Elementary functions
Elementary functions simplify when their arguments provide enough exact information.
All routed through the auto-simplifying builders, so the result is in
canonical ASAE form (e.g. sqrt(x) is stored as x^(1/2), known special
values collapse).
sin#
Raw WebAssembly: Default context
sin(x: Expression): ExpressionCalling forms
Explicit context: Context.sin
sin(value: ExpressionLike): ExpressionRaw WebAssembly: Explicit context: Context.sin
sin(x: Expression): ExpressionSymiFacade method: SymiFacade.sin
sin(value: ExpressionLike): ExpressionExpression method: Expression.sin
sin(): Expressioncos#
Raw WebAssembly: Default context
cos(x: Expression): ExpressionCalling forms
Explicit context: Context.cos
cos(value: ExpressionLike): ExpressionRaw WebAssembly: Explicit context: Context.cos
cos(x: Expression): ExpressionSymiFacade method: SymiFacade.cos
cos(value: ExpressionLike): ExpressionExpression method: Expression.cos
cos(): Expressiontan#
Raw WebAssembly: Default context
tan(x: Expression): Expressionsec#
Raw WebAssembly: Default context
sec(x: Expression): Expressioncsc#
Raw WebAssembly: Default context
csc(x: Expression): Expressioncot#
Raw WebAssembly: Default context
cot(x: Expression): Expressionarcsin#
Raw WebAssembly: Default context
arcsin(x: Expression): Expressionarccos#
Raw WebAssembly: Default context
arccos(x: Expression): Expressionarctan#
Raw WebAssembly: Default context
arctan(x: Expression): Expressionarcsec#
Raw WebAssembly: Default context
arcsec(x: Expression): Expressionarccsc#
Raw WebAssembly: Default context
arccsc(x: Expression): Expressionarccot#
Raw WebAssembly: Default context
arccot(x: Expression): ExpressionThe principal value is arctan(1/x), with arccot(0) = pi/2. Over the reals it lies in
(-pi/2, 0) for negative x and in (0, pi/2] otherwise, so it jumps at zero; in the complex
plane its branch cut is the closed segment of the imaginary axis from -i to i.
sinh#
Raw WebAssembly: Default context
sinh(x: Expression): Expressioncosh#
Raw WebAssembly: Default context
cosh(x: Expression): Expressiontanh#
Raw WebAssembly: Default context
tanh(x: Expression): Expressionsech#
Raw WebAssembly: Default context
sech(x: Expression): Expressioncsch#
Raw WebAssembly: Default context
csch(x: Expression): Expressioncoth#
Raw WebAssembly: Default context
coth(x: Expression): Expressionarcsinh#
Raw WebAssembly: Default context
arcsinh(x: Expression): Expressionarccosh#
Raw WebAssembly: Default context
arccosh(x: Expression): Expressionarctanh#
Raw WebAssembly: Default context
arctanh(x: Expression): Expressionarcsech#
Raw WebAssembly: Default context
arcsech(x: Expression): Expressionarccsch#
Raw WebAssembly: Default context
arccsch(x: Expression): Expressionarccoth#
Raw WebAssembly: Default context
arccoth(x: Expression): Expressionexp#
Raw WebAssembly: Default context
exp(x: Expression): ExpressionCalling forms
Explicit context: Context.exp
exp(value: ExpressionLike): ExpressionRaw WebAssembly: Explicit context: Context.exp
exp(x: Expression): ExpressionSymiFacade method: SymiFacade.exp
exp(value: ExpressionLike): ExpressionExpression method: Expression.exp
exp(): ExpressionThe natural exponential.
log#
Raw WebAssembly: Default context
log(x: Expression, base?: Expression | null): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.log
log(x: Expression, base?: Expression | null): ExpressionNatural logarithm; with base given, log(x)/log(base).
sqrt#
Raw WebAssembly: Default context
sqrt(x: Expression): ExpressionCalling forms
Explicit context: Context.sqrt
sqrt(value: ExpressionLike): ExpressionRaw WebAssembly: Explicit context: Context.sqrt
sqrt(x: Expression): ExpressionSymiFacade method: SymiFacade.sqrt
sqrt(value: ExpressionLike): ExpressionExpression method: Expression.sqrt
sqrt(): ExpressionPrincipal square root, stored as x^(1/2).
root#
Raw WebAssembly: Default context
root(x: Expression, n: Expression): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.root
root(x: Expression, n: Expression): ExpressionPrincipal n-th root, stored as x^(1/n).
abs#
Raw WebAssembly: Default context
abs(x: Expression): ExpressionThe absolute value. It folds to x or -x whenever the sign of x is decided by the exact real
order procedure — the same decided class evaluate_truth reports on — so abs(sqrt(5) - 2)
becomes sqrt(5) - 2 rather than staying wrapped. A sign the procedure cannot prove leaves the
call symbolic; signum folds on exactly the same reach.
floor#
Raw WebAssembly: Default context
floor(x: Expression): Expressionceiling#
Raw WebAssembly: Default context
ceiling(x: Expression): Expressionconjugate#
Raw WebAssembly: Default context
conjugate(x: Expression): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.conjugate
conjugate(x: Expression): ExpressionComplex conjugate.
factorial#
Raw WebAssembly: Default context
factorial(x: Expression): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.factorial
factorial(x: Expression): Expressionbinomial#
Raw WebAssembly: Default context
binomial(n: Expression, k: Expression): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.binomial
binomial(n: Expression, k: Expression): ExpressionBinomial coefficient C(n, k).
min#
Raw WebAssembly: Default context
min(arguments: Expression[]): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.min
min(arguments: Expression[]): ExpressionMinimum of the arguments (variadic in Python; a JS array in WASM).
max#
Raw WebAssembly: Default context
max(arguments: Expression[]): ExpressionCalling forms
Raw WebAssembly: Explicit context: Context.max
max(arguments: Expression[]): ExpressionMaximum of the arguments (variadic in Python; a JS array in WASM).
Example#
Elementary functions evaluate exactly at recognised arguments and stay symbolic elsewhere.
const x = symi.symbol("x");
console.log(symi.sin(symi.pi.divide(6)).toString());
console.log(symi.exp(symi.integer(0n)).toString());
console.log(symi.sqrt(symi.integer(18n)).toString());
console.log(x.cos().power(2).add(x.sin().power(2)).toString());absolute_value#
Explicit context
absoluteValue(value: ExpressionLike): ExpressionCalling forms
SymiFacade method: SymiFacade.absoluteValue
absoluteValue(value: ExpressionLike): ExpressionExpression method: Expression.absoluteValue
absoluteValue(): ExpressionThe absolute value , spelled in full. It is the same operation as
abs; the two names exist because abs is the spelling the Python and
JavaScript hosts use for their own built-in, and the full name is the spelling
the mobile hosts generate.