Skip to content
Symi Docs
Kotlin
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#

Explicit context

fun sin(argument: UniffiExpression): UniffiExpression
Calling forms

Expression method: UniffiExpression.sin

fun sin(): UniffiExpression

cos#

Explicit context

fun cos(argument: UniffiExpression): UniffiExpression
Calling forms

Expression method: UniffiExpression.cos

fun cos(): UniffiExpression

tan#

Explicit context

fun tan(argument: UniffiExpression): UniffiExpression

sec#

Explicit context

fun sec(argument: UniffiExpression): UniffiExpression

csc#

Explicit context

fun csc(argument: UniffiExpression): UniffiExpression

cot#

Explicit context

fun cot(argument: UniffiExpression): UniffiExpression

arcsin#

Explicit context

fun arcsin(argument: UniffiExpression): UniffiExpression

arccos#

Explicit context

fun arccos(argument: UniffiExpression): UniffiExpression

arctan#

Explicit context

fun arctan(argument: UniffiExpression): UniffiExpression

arcsec#

Explicit context

fun arcsec(argument: UniffiExpression): UniffiExpression

arccsc#

Explicit context

fun arccsc(argument: UniffiExpression): UniffiExpression

arccot#

Explicit context

fun arccot(argument: UniffiExpression): UniffiExpression

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#

Explicit context

fun sinh(argument: UniffiExpression): UniffiExpression

cosh#

Explicit context

fun cosh(argument: UniffiExpression): UniffiExpression

tanh#

Explicit context

fun tanh(argument: UniffiExpression): UniffiExpression

sech#

Explicit context

fun sech(argument: UniffiExpression): UniffiExpression

csch#

Explicit context

fun csch(argument: UniffiExpression): UniffiExpression

coth#

Explicit context

fun coth(argument: UniffiExpression): UniffiExpression

arcsinh#

Explicit context

fun arcsinh(argument: UniffiExpression): UniffiExpression

arccosh#

Explicit context

fun arccosh(argument: UniffiExpression): UniffiExpression

arctanh#

Explicit context

fun arctanh(argument: UniffiExpression): UniffiExpression

arcsech#

Explicit context

fun arcsech(argument: UniffiExpression): UniffiExpression

arccsch#

Explicit context

fun arccsch(argument: UniffiExpression): UniffiExpression

arccoth#

Explicit context

fun arccoth(argument: UniffiExpression): UniffiExpression

exp#

Explicit context

fun exp(argument: UniffiExpression): UniffiExpression
Calling forms

Expression method: UniffiExpression.exp

fun exp(): UniffiExpression

The natural exponential.

log#

Explicit context

fun log(
    argument: UniffiExpression,
    base: UniffiExpression?,
): UniffiExpression

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

sqrt#

Explicit context

fun sqrt(argument: UniffiExpression): UniffiExpression
Calling forms

Expression method: UniffiExpression.sqrt

fun sqrt(): UniffiExpression

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

root#

Explicit context

fun root(
    radicand: UniffiExpression,
    index: UniffiExpression,
): UniffiExpression

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

abs#

Explicit context

fun abs(argument: UniffiExpression): UniffiExpression

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#

Explicit context

fun floor(argument: UniffiExpression): UniffiExpression

ceiling#

Explicit context

fun ceiling(argument: UniffiExpression): UniffiExpression

conjugate#

Explicit context

fun conjugate(argument: UniffiExpression): UniffiExpression

Complex conjugate.

factorial#

Explicit context

fun factorial(argument: UniffiExpression): UniffiExpression

binomial#

Explicit context

fun binomial(
    upper: UniffiExpression,
    lower: UniffiExpression,
): UniffiExpression

Binomial coefficient C(n, k).

min#

Explicit context

fun min(arguments: List<UniffiExpression>): UniffiExpression

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

max#

Explicit context

fun max(arguments: List<UniffiExpression>): UniffiExpression

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

Example#

absolute_value#

Explicit context

fun absoluteValue(argument: UniffiExpression): UniffiExpression
Calling forms

Expression method: UniffiExpression.absoluteValue

fun absoluteValue(): UniffiExpression

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 · Kotlin