Skip to content
Symi Docs
WASM / JavaScript

Signatures in the WASM / JavaScript view are TypeScript. Where the JavaScript facade wraps an operation its form is listed first; the other calling forms are the raw wasm-bindgen exports.

On this page

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): Expression
Calling forms

Explicit context: Context.sin

sin(value: ExpressionLike): Expression

Raw WebAssembly: Explicit context: Context.sin

sin(x: Expression): Expression

SymiFacade method: SymiFacade.sin

sin(value: ExpressionLike): Expression

Expression method: Expression.sin

sin(): Expression

cos#

Raw WebAssembly: Default context

cos(x: Expression): Expression
Calling forms

Explicit context: Context.cos

cos(value: ExpressionLike): Expression

Raw WebAssembly: Explicit context: Context.cos

cos(x: Expression): Expression

SymiFacade method: SymiFacade.cos

cos(value: ExpressionLike): Expression

Expression method: Expression.cos

cos(): Expression

tan#

Raw WebAssembly: Default context

tan(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.tan

tan(x: Expression): Expression

sec#

Raw WebAssembly: Default context

sec(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.sec

sec(x: Expression): Expression

csc#

Raw WebAssembly: Default context

csc(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.csc

csc(x: Expression): Expression

cot#

Raw WebAssembly: Default context

cot(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.cot

cot(x: Expression): Expression

arcsin#

Raw WebAssembly: Default context

arcsin(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arcsin

arcsin(x: Expression): Expression

arccos#

Raw WebAssembly: Default context

arccos(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccos

arccos(x: Expression): Expression

arctan#

Raw WebAssembly: Default context

arctan(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arctan

arctan(x: Expression): Expression

arcsec#

Raw WebAssembly: Default context

arcsec(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arcsec

arcsec(x: Expression): Expression

arccsc#

Raw WebAssembly: Default context

arccsc(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccsc

arccsc(x: Expression): Expression

arccot#

Raw WebAssembly: Default context

arccot(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccot

arccot(x: Expression): Expression

The 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): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.sinh

sinh(x: Expression): Expression

cosh#

Raw WebAssembly: Default context

cosh(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.cosh

cosh(x: Expression): Expression

tanh#

Raw WebAssembly: Default context

tanh(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.tanh

tanh(x: Expression): Expression

sech#

Raw WebAssembly: Default context

sech(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.sech

sech(x: Expression): Expression

csch#

Raw WebAssembly: Default context

csch(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.csch

csch(x: Expression): Expression

coth#

Raw WebAssembly: Default context

coth(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.coth

coth(x: Expression): Expression

arcsinh#

Raw WebAssembly: Default context

arcsinh(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arcsinh

arcsinh(x: Expression): Expression

arccosh#

Raw WebAssembly: Default context

arccosh(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccosh

arccosh(x: Expression): Expression

arctanh#

Raw WebAssembly: Default context

arctanh(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arctanh

arctanh(x: Expression): Expression

arcsech#

Raw WebAssembly: Default context

arcsech(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arcsech

arcsech(x: Expression): Expression

arccsch#

Raw WebAssembly: Default context

arccsch(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccsch

arccsch(x: Expression): Expression

arccoth#

Raw WebAssembly: Default context

arccoth(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.arccoth

arccoth(x: Expression): Expression

exp#

Raw WebAssembly: Default context

exp(x: Expression): Expression
Calling forms

Explicit context: Context.exp

exp(value: ExpressionLike): Expression

Raw WebAssembly: Explicit context: Context.exp

exp(x: Expression): Expression

SymiFacade method: SymiFacade.exp

exp(value: ExpressionLike): Expression

Expression method: Expression.exp

exp(): Expression

The natural exponential.

log#

Raw WebAssembly: Default context

log(x: Expression, base?: Expression | null): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.log

log(x: Expression, base?: Expression | null): Expression

Natural logarithm; with base given, log(x)/log(base).

sqrt#

Raw WebAssembly: Default context

sqrt(x: Expression): Expression
Calling forms

Explicit context: Context.sqrt

sqrt(value: ExpressionLike): Expression

Raw WebAssembly: Explicit context: Context.sqrt

sqrt(x: Expression): Expression

SymiFacade method: SymiFacade.sqrt

sqrt(value: ExpressionLike): Expression

Expression method: Expression.sqrt

sqrt(): Expression

Principal square root, stored as x^(1/2).

root#

Raw WebAssembly: Default context

root(x: Expression, n: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.root

root(x: Expression, n: Expression): Expression

Principal n-th root, stored as x^(1/n).

abs#

Raw WebAssembly: Default context

abs(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.abs

abs(x: Expression): Expression

The 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): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.floor

floor(x: Expression): Expression

ceiling#

Raw WebAssembly: Default context

ceiling(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.ceiling

ceiling(x: Expression): Expression

conjugate#

Raw WebAssembly: Default context

conjugate(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.conjugate

conjugate(x: Expression): Expression

Complex conjugate.

factorial#

Raw WebAssembly: Default context

factorial(x: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.factorial

factorial(x: Expression): Expression

binomial#

Raw WebAssembly: Default context

binomial(n: Expression, k: Expression): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.binomial

binomial(n: Expression, k: Expression): Expression

Binomial coefficient C(n, k).

min#

Raw WebAssembly: Default context

min(arguments: Expression[]): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.min

min(arguments: Expression[]): Expression

Minimum of the arguments (variadic in Python; a JS array in WASM).

max#

Raw WebAssembly: Default context

max(arguments: Expression[]): Expression
Calling forms

Raw WebAssembly: Explicit context: Context.max

max(arguments: Expression[]): Expression

Maximum of the arguments (variadic in Python; a JS array in WASM).

Example#

Elementary functions evaluate exactly at recognised arguments and stay symbolic elsewhere.

JavaScript
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): Expression
Calling forms

SymiFacade method: SymiFacade.absoluteValue

absoluteValue(value: ExpressionLike): Expression

Expression method: Expression.absoluteValue

absoluteValue(): Expression

The absolute value ∣x∣|x|, 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.

Symi documentation · WASM / JavaScript