Builtin Functions

Help > Functions… has a browsable reference.

Expression Syntax

The precise rules are below but the short version is this: Parantheses are optional unless a function has more than one argument (sin(x) and sinx are the same). Multiplication is implicit, so x*y and xy are the same. Whitespace is for grouping, so (x+y)*(z+w) can be written as x+y * z+w and sin(x+y) as sin x+y. Numbers are not localized, the decimal separator is always a dot, never a comma because the comma separates multiple arguments.

Reserved Names

This applies to parameters and functions. Reserved are x, y, z, r, u, v, since those are the predefined plotting variables. Some other names cannot be used because they are already defined, like e, i, pi, sin, cos, …

Names cannot contain spaces, commas, control characters, parantheses or start with a digit. But other than that, the full unicode range is valid and there is no limit on the length.

Defining Functions

To create: Use the + button in the Definitions box.

To delete: Select Delete from the context menu (click & wait or right mouse button on a definition entry).

To edit: Doubleclick or context menu.

Functions can not be recursive and can not use the plotting variables without declaring them as parameters. For example f = x*y is an error because x and y are unknown when the function is parsed. This must be written as f(x,y) = x*y. Parameters and other functions can be used though.

Expression Syntax II

The parser does backtracking, so functions can be overloaded (different functions with the same name for different numbers of arguments). When an expression is split into separate tokens, longer matches are always tried first if there are several possibilities. For example even if there are parameters a and c, arcsin is never read as a*r*c*sin.

Numbers

Can be decimal like 0.1234 or -12.34e-5, or (probably not too useful here) binary 0b110.001101e1101 (the exponent is binary too), or hexadecimal: 0xA8B.CD53q-7F (since e is already a digit, we use q as exponent marker).

The imaginary unit is called i.

Unicode superscripts are read as power operators. For example x⁻⁴⁺⁵ⁱ is equal to x^(-4+5i).

Operators and precedence

Operators
ordered by
precedence
MeaningAssociativityExamples
Function call-sinx^2 = (sinx)^2
-• ~•Prefix operators-~x^2 = (~x)^2
•! •²…•⁹Postfix operators-x^3! = x^(3!) = x^6
Implicit Multiplicationleftab^cd = (ab)^(cd), abc = (ab)c, sinxy = (sinx)*y
^ **Exponentiationrighta^b^c = a^(b^c)
* / %Multiplication, Division, Modulolefta/b/c = (a/b)/c = a/(bc), a*b^c*d = a*(b^c)*d
+ -Addition, Subtractionlefta-b-c = (a-b)-c = a-(b+c)
< >Comparison-The value is 1 for true or 0 for false.
(a < b) * (b < c) is a < b < c
Ice cube tray-style plots for sets can be done like this:
sin xx - sin yy > 0.
Whitespace-see below

Parantheses and whitespace

Whitespace works like this: Any block of tokens (without mismatched parantheses) that is surrounded by whitespace (beginning and end of the expression count as whitespace) and can be put inside parantheses without creating syntax errors will be put in parantheses and then whitespace is removed.

For example:
x*y⌴^⌴x*y becomes (x*y)^(x*y),
x+y⌴sin⌴x becomes (x+y)sin(x),
x*⌴x+y⌴*⌴x becomes (x*(x+y))*(x), which is x*(x+y)*x,
x⌴*x+y⌴x becomes ((x)*x+y)(x), which is (x*x+y)*x.

Parantheses work as usual for grouping subexpressions.