Symbolic evaluation
Ending a line with an arrow evaluates it in a mode where a name with no value stays symbolic instead of becoming an error.
1+2+b+3+b => // 2b+6An unknown survives arithmetic, exponentiation, negation and function calls, so an expression keeps its shape rather than losing the terms that involve it.
x^2+3x+2 => // x^2+3x+2-x => // -xsqrt(x) => // sqrt(x)Exact arithmetic
Section titled “Exact arithmetic”Coefficients are exact rationals rather than floating-point numbers, so a value reads back as it was written and a fraction stays a fraction.
x/3 => // x/32^10 + x => // x+1024This matters most where rounding would be indistinguishable from a real result:
a matrix entry that is structurally zero can arrive as a value like
0.0000000000000000555 in floating point, which is enough to make a singular
matrix look invertible.
A function only folds when its answer is exact. sqrt(4) becomes 2, while
sqrt(2) is left alone rather than replaced with an approximation.
The bounded simplifier
Section titled “The bounded simplifier”Simplification is deliberately limited. It folds constants, applies additive and
multiplicative identities, and collects like terms in a top-level sum. It does
not apply trigonometric identities, and it never expands or factors on its own,
which is what keeps x^2 from turning back into x*x.
A function with no symbolic reading, such as random, reports that rather than
computing a result from a placeholder value.
Solving a linear system
Section titled “Solving a linear system”Writing a product chain equal to a value stores an equation. Asking for the unknown solves it.
a = [1, 2; 3, 4]a*x = [60; 70]x => // [-50.00; 55.00]This also works when the coefficients are themselves unknown, which is what makes it useful for deriving a formula rather than only a number.