Skip to main content

Epsil Standard Library

The 749 functions and constants of the standard library, by category. Each row gives a name, its signature (for a function) or its kind and type (for a constant or variable), and the first sentence of its description — the same description epsil doc <name> prints in full and the editor shows as a hover. The full description and the executed examples of every definition are on the category's reference page, linked from each heading.

To search the library by concept rather than by name, use epsil doc <keywords> (see the CLI); the guide for agents lists the names most often needed.

Core​

The Core reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
aboutAbout(any) -> dictionary<any>Return information about an expression as a dictionary: its kind (symbol, constant, function, number, string, expression), its static type and, when applicable, its name, value, signature, clause listing, attributes (the algebraic flags…
angleAngle(any+) -> numberAngle mark / measure (\angle ABC, \varangle XYZ, ∠ABC) — opaque typed head; not evaluated.
—Annotated(expression, dictionary<any>) -> expressionAttach metadata or style annotations to an expression.
applyApply(name: any, arguments: any*) -> unknownApply a function to a list of arguments
applyWholeApplyWhole(name: any, arguments: any*) -> unknownApply a function to arguments, each bound whole (engine-internal).
arbitraryConstantArbitraryConstant(integer) -> numberArbitraryConstant(k): an arbitrary number, the k-th of a result: a constant of integration, the free parameter of an identity.
arbitraryIntegerArbitraryInteger(integer) -> integerArbitraryInteger(k): an arbitrary integer, the k-th of a result: the parameter of a family of roots, of a diophantine or a congruence solution.
arcArc(any+) -> numberArc / wide-hat accent measure (\widehat{ABC}) — opaque typed head; not evaluated.
—AssertPresent(any) -> unknownAssert that a value is present: return it unchanged, or an expected-present error when it is ABSENT (missing, NaN, or a point whose coordinates are all NaN).
—Assign(expression | symbol, any) scope -> anyAssign a value to a symbol or define a sequence.
assumeAssume(any) scope -> stringRecord an assumption about a symbol.
baseFormBaseForm(x: T, base: (number | string)?) -> T where T: numberBaseForm(x, base): the number x unchanged, marked to be written in base (10 by default).
—Block(unknown*) -> unknownEvaluate a sequence of expressions in a local scope, sequentially.
—BuiltinFunction(string | symbol) -> symbolReturn a built-in function symbol by name.
canonicalFormCanonicalForm(any, (string | symbol)*) -> anyReturn the canonical form of an expression.
caseFoldCaseFold(character | string) -> stringCaseFold(s): a case-folded form of s, for case-insensitive comparison — caseFold(a) == caseFold(b) tests equality ignoring case.
characterFromCharacterFrom(character | string) -> characterCharacterFrom(s): the character s denotes.
charactersCharacters(character | string) -> list<character>Characters(s): split a string into a list of user-perceived characters (grapheme clusters).
—Coalesce(any+) -> unknownReturn the first operand that is not ABSENT (missing, NaN, or a point whose coordinates are all NaN), evaluated left-to-right.
—Colon(any, any) -> expressionType annotation (a : b) — opaque typed head.
compositionComposition(function*) -> functionThe composition of functions, applied right to left: composition(f, g, h)(x) is f(g(h(x)))
conformsConforms(subject: any, protocols: string+) -> booleanTrue iff the subject conforms to EVERY named protocol.
—Declare(symbol, type: (string | symbol)?, value: any?, attributes: dictionary<any>?) scope -> anyDeclare a symbol in the current scope, optionally assigning a type and an initial value.
—DeclareConformance(target: string | symbol, protocols: any, whereClauseOrImplementation: any?, implementation: dictionary<any>?) scope -> nothingDeclare that a type CONFORMS to one or more protocols — the lowering of the Epsil type string is Hashable & Comparable statement.
—DeclareProtocol(string | symbol, members: dictionary<any>?, parents: any?, attributes: dictionary<any>?) scope -> nothingDeclare a PROTOCOL: a set of function and property requirements a type may declare itself to satisfy.
—DeclareSumType(string | symbol, any*) scope -> nothingDeclare a SUM TYPE: N nominal variants plus the transparent union that names them, in one statement — the lowering of the Epsil sugar type node = lit(num: number) | plus(op1: node, op2: node).
—DeclareType(string | symbol, type: string | symbol | type, attributes: dictionary<any>?) scope -> nothingDeclare a type.
—DefineFunction(symbol, function, dictionary<any>?) scope -> nothingDefine one clause of a (possibly multi-clause) function: DefineFunction(f, Function(body, params…)).
—Delimiter(any, string?) -> anyGroup expressions with explicit delimiters.
digitsFromDigitsFrom(s: character | string, base: (character | integer | string)?) -> integerReturn an integer representation of the string s in base base.
errorError(expression<ErrorCode> | string, expression?) -> nothingRepresent an error expression.
—ErrorCode(string, any*) -> errorStructured error code with optional arguments.
evaluateEvaluate(any) -> unknownEvaluate an expression.
evaluateAtEvaluateAt(f: function, lower: expression, upper: expression?) -> unknownEvaluate a function at one point or between two bounds.
findRootFindRoot(equations: any, params: any, options: dictionary?) -> dictionaryFindRoot(equations, params): numerically find parameter values that zero the residuals.
—Function(expression, (function | symbol)*) -> functionFunction(body, param1, param2, …): a function literal.
graphemeClustersGraphemeClusters(character | string) -> list<character>A collection of grapheme clusters from a string.
headHead(any) -> symbolReturn the head of an expression, the name of the operator
—Hold(any) -> unknownHold an expression, preventing it from being canonicalized or evaluated until ReleaseHold is applied to it
—HoldValues(any, any?) -> expressionHoldValues(body): evaluate body with its assigned free symbols shielded — each such symbol becomes a pure symbol (its declared type and in-scope assumptions apply, its assigned value does NOT) for the duration.
—HorizontalSpacing(number) -> nothingHorizontal spacing annotation.
identityIdentity(T) -> T where TReturn the argument unchanged
—IndexedSequence(any, symbol, any, any?) -> expressionIndexed sequence \{a_n\}_{n=1}^{\infty} — inert head IndexedSequence(term, index, lower, upper?); not evaluated.
inputInput(prompt: string?) console -> nothing | stringRead one line of text from the host: the terminal in a command-line host, the prompt() dialog in a browser.
integerStringIntegerString(n: broadcastable<integer>, base: broadcastable<integer>?, length: broadcastable<integer>?) -> stringintegerString(n, base=10, length) return a string representation of the integer n in base base.
—InvisibleOperatorfunctionImplicit operator used for juxtapositions such as function application or multiplication.
isErrorIsError(any) -> booleanTrue if the expression is an error value, or a frozen expression embedding one ("a" + 1).
isMissingIsMissing(any) -> booleanTrue for missing, NaN, or a point whose coordinates are all NaN, regardless of provenance.
—Latex(any+) -> stringSerialize an expression to LaTeX
—LatexString(string) -> stringValue preserving type conversion/tag indicating the string is a LaTeX string
—MatchesType(subject: any, type: string | type) -> booleanTrue iff the first operand, EVALUATED, is a value of the given type — the engine form of the Epsil x is T test and of match type patterns, which both lower here.
missingMissingvariable missingA value that is absent but whose position is preserved (Julia missing, R NA); the sole member of the missing type.
—Module(symbol) -> unknownThe definition of a name in the standard library, also where a local definition shadows the name
—N(any, (integer | list<number>)?) -> unknownN(expr): numerically evaluate an expression.
nSolveNSolve(any, any*) -> listNSolve(equation, unknown): the solutions of an equation as floats.
—NamedArgument(string, any) -> nothingNamedArgument(name, value): one named argument of a call (Epsil surface syntax: f(rate: 0.05)).
nothingNothingvariable nothingThe value of an empty block or of a statement with no value; the sole member of the unit type.
numberFromNumberFrom(s: character | string, base: (character | integer | string)?) -> numberNumberFrom(s): the number the string s denotes — optional surrounding whitespace, an optional sign, then ASCII digits with an optional "." fraction and an optional e/E exponent, or one of "oo", "+oo", "-oo", "NaN", "Indeterminate".
numericApproximationNumericApproximation(any) -> unknownNumerically evaluate an expression, as the .N() method does (engine-internal).
—Object(any, string?) -> unknownProvenance head for the snapshot of a mutable object: ["Object", <record>, "'TypeName'"].
—Optional(any, any) -> nothingOptional(param, default): a parameter of a function literal with a default value (Epsil surface syntax: (x, k = 2) => x * k).
—OverParen(any+) -> expressionOver-paren accent (\overparen{BC}) — opaque typed head; not evaluated.
padEndPadEnd(s: character | string, n: integer, pad: (character | string)?) -> stringPadEnd(s, n, pad=" "): s padded at the END to n characters by repeating pad (its final copy truncated on a character boundary).
padStartPadStart(s: character | string, n: integer, pad: (character | string)?) -> stringPadStart(s, n, pad=" "): s padded at the START to n characters by repeating pad (its final copy truncated on a character boundary).
parallelParallel(any, any) -> expressionParallelism relation (AB \parallel CD) — opaque typed head; not evaluated.
parseParse(string) any -> anyParse a LaTeX string and evaluate to a corresponding expression
perpendicularPerpendicular(any, any) -> expressionPerpendicularity relation (AB \perp CD) — opaque typed head; not evaluated.
—Pipe(value, function) -> unknownApply a function to a value: Pipe(x, f) evaluates to f(x).
primePrime(T, integer?) -> T where TDerivative or prime notation (f', f^{(n)}) — opaque typed head until a derivative library handler runs.
printPrint(any*) console -> nothingPrint the operands to the host console, separated by spaces and followed by a newline.
programProgram(unknown*) -> unknownEvaluate a program in the caller scope, continuing after statement errors, and return the value of its last statement.
—ProtocolDefaultconstant unknownStands for the default value of a parameter in a call of a protocol member: the call receives the default that the selected requirement declares for that parameter.
—ProtocolMember(protocol: string, member: string, arguments: any*) -> unknownInvoke a protocol member on a value — the lowering of a QUALIFIED protocol call (Comparable.compare(x, y) in Epsil, whose parse, a MemberCall on the protocol name, canonicalizes to apply(field(Comparable, "compare"), x, y)).
—ProtocolProperty(protocol: string, property: string, receiver: any, value: any?) -> unknownRead (or write) a protocol PROPERTY through a NAMED protocol — the lowering of the qualified field form person.(Nameable.name) (protocols design P6, amending the D16 field grammar).
quadrilateralQuadrilateral(any+) -> expressionQuadrilateral mark (\square ABCD) — opaque typed head; not evaluated.
randomRandom((collection<any> | set<real>)?) random -> anyRandom(): non-deterministic real in [0, 1)
randomChoiceRandomChoice((T, k: number) random -> T where T: string) & ((collection<any> | set<real>, k: number) random -> list<any>)RandomChoice(domain, k): a list of k independent draws from domain, with replacement.
randomExpressionRandomExpression() entropy -> expressionGenerate a random expression.
—ReleaseHold(any) -> unknownRelease an expression held by Hold
replaceAllReplaceAll(any, any+) -> anyReplaceAll(expr, rules): apply one or more replacement rules to expr, then evaluate the result (Mathematica expr /. rules).
—Rule(match: expression, replace: expression, predicate: function?) -> expressionPattern replacement rule.
—RuntimeError(expression<ErrorCode> | string) -> neverConstruct an error value when evaluated: the runtime counterpart of a written Error(…), which is a static diagnostic node.
—SequencefunctionOrdered sequence of expressions.
—Signature(symbol) -> nothing | stringReturn the signature string of an operator.
simplifySimplify(any, assumptions: any?) -> expressionSimplify(expr): simplify an expression.
solveSolve(any, any*) -> listSolve(equation, unknown): the list of solutions of an equation for the unknown.
—Spread(any) -> unknownSpread(t): splice the elements of the tuple t into the enclosing argument list (Epsil surface syntax: f(...t)).
—String(any*) -> stringA string created by joining its arguments.
stringCompareStringCompare(character | string, character | string) -> integerStringCompare(a, b): -1 when a sorts before b, 0 when they are equal, 1 when a sorts after b.
stringFromStringFrom(any, format: string?) -> stringStringFrom(value, format?): create a string from value.
stringJoinStringJoin(collection<character | string>, separator: (character | string)?) -> stringStringJoin(xs): join the elements of the finite collection xs (strings or characters) into a string.
stringRepeatStringRepeat(character | string, n: integer) -> stringStringRepeat(s, n): n copies of the string s, concatenated.
stringReplaceStringReplace((character | string, character | string, character | string, count: integer?) -> string) & ((character | string, regexp, character | string, count: integer?) -> string) & ((character | string, regexp, function, count: integer?) -> string)StringReplace(s, target, replacement): replace every non-overlapping occurrence of target in s, scanning left to right over whole characters.
stringSplitStringSplit((character | string, (character | string)?) -> list<string>) & ((character | string, regexp) -> list<string>)StringSplit(s): split a string on runs of whitespace (the Unicode White_Space code points), dropping empty parts.
—Subscript(collection<any>, any) -> anySubscript notation for indexing or compound symbols.
—Subtype(subtype: string | type, supertype: string | type) -> booleanTrue iff the FIRST operand is a subtype of the second — Subtype("integer", "number") is True, Subtype("number", "integer") is False.
symbolSymbolfunctionConstruct a new symbol with a name formed by concatenating the arguments
tailTail(any) -> collectionReturn the tail of an expression, the operands of the expression
—Text(any*) -> stringA sequence of strings, annotated expressions and other Text expressions
timingTiming(value, repeat: integer?) -> tuple<number, value>timing(expr) evaluates expr and returns a pair: the time the evaluation took, in microseconds, then the value; read them as timing(expr)[1] and timing(expr)[2].
toTo(any, any) -> nothingAction arrow / mapping (a \to b) — opaque typed head.
toLowerCaseToLowerCase(character | string) -> stringToLowerCase(s): the string s mapped to lower case using the Unicode default (locale-independent) mappings.
toUpperCaseToUpperCase(character | string) -> stringToUpperCase(s): the string s mapped to upper case using the Unicode default (locale-independent) mappings.
triangleTriangle(any+) -> expressionTriangle primitive — opaque typed head.
trimTrim(character | string, chars: (character | collection<character | string> | string)?) -> stringTrim(s): remove leading and trailing whitespace (the Unicode White_Space characters).
trimEndTrimEnd(character | string, chars: (character | collection<character | string> | string)?) -> stringTrimEnd(s): remove trailing whitespace (the Unicode White_Space characters).
trimStartTrimStart(character | string, chars: (character | collection<character | string> | string)?) -> stringTrimStart(s): remove leading whitespace (the Unicode White_Space characters).
typeType(any) -> typeThe STATIC type of an expression, as a type value: type("hi") is TypeFrom("string").
typeFromTypeFrom(text: string) -> typeA type expression as a first-class value, constructed from its text: TypeFrom("list<integer>").
—Typed(any, string | symbol) -> unknownAscribe a type to an expression.
—Unevaluated(any) -> unknownPrevent an expression from being evaluated
unicodeScalarsUnicodeScalars(character | string) -> list<integer>A collection of Unicode scalars from a string, same as UTF-32
utf16Utf16(character | string) -> list<integer>A collection of UTF-16 code units from a string.
utf8Utf8(character | string) -> list<integer>A collection of UTF-8 code units from a string.
—Wildcard(symbol) -> symbolSingle-expression pattern wildcard.
—WildcardOptionalSequence(symbol) -> symbolPattern wildcard matching zero or more expressions.
—WildcardSequence(symbol) -> symbolPattern wildcard matching one or more expressions.
withRandomSeedWithRandomSeed(seed: real | string, body: any) -> expressionWithRandomSeed(seed, body): evaluate body with a random seed frame seeded by seed (a finite real or a string).

Control structures​

The Control structures reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
—AddTo(expression, any) scope -> anyCompound assignment: AddTo(s, e) is Assign(s, Add(s, e)), and AddTo(At(L, i, …), e) is Assign(L, ReplaceAt(L, i, …, Add(At(L, i, …), e))), with each position evaluated once, before e.
—Alternatives(expression+) -> nothingInside a Match pattern, Alternatives(p1, p2, …) matches if any alternative matches.
—Break(value: any?) -> nothingExit the enclosing loop immediately, optionally with a value (Break(v)) that becomes the loop value.
—Comprehension(body: expression, iterators: expression+) -> listValue-producing comprehension: evaluate body in nested iteration over one or more Element clauses and collect the results into a list.
—Condition(expression, symbol?) -> booleanTest whether a value satisfies one or more conditions.
—Continue() -> nothingSkip to the next iteration of the enclosing loop.
fixedPointFixedPoint(f: function, initial: any, maxIterations: integer?) -> unknownApply a function repeatedly, starting from an initial value, until two successive values are the same: fixedPoint(f, x) is the first of f(x), f(f(x)), … that f maps to itself.
—If(expression, expression, expression?) -> anyIf(c, e1, e2) evaluates to e1 when c is True and to e2 otherwise; without e2 it is the absent value of the domain of e1 when c is False: NaN for a number, missing otherwise, as for a restriction e1\{c\}, which…
—Loop(body: expression, iterators: expression*) -> anyImperative loop, evaluated for effect.
—Match(expression, expression+) -> unknownStructural pattern match.
—MatchCase(expression, expression, expression?) -> nothingA case of a Match: MatchCase(pattern, body) or MatchCase(pattern, guard, body).
—ParallelComprehension(body: expression, iterators: expression+) random -> listParallel comprehension: ParallelComprehension(body, Element(x, xs), …) is the list that Comprehension with the same operands gives, but the passes of the first clause can run in any order.
parallelDomainParallelDomain(collection: any) random -> anyThe domain of the passes of a parallel loop (engine-internal).
—ParallelLoop(body: expression, iterators: expression+) random -> anyParallel loop, evaluated for effect: ParallelLoop(body, Element(x, coll)) evaluates body once for each element of coll (a pass), and the passes can run in any order.
—Pin(expression) -> nothingInside a Match pattern, Pin(expr) matches the value of expr (evaluated at match time) rather than its structure.
—Which(expression+) -> unknownWhich(c1, e1, c2, e2, …) evaluates to the value of the first e whose condition c is True, and to missing when no condition is True.

Logic​

The Logic reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
—And(broadcastable<boolean>+) -> booleanLogical conjunction (AND): true when all operands are true.
booleBoole(broadcastable<boolean>) -> integerReturn 1 if the argument is true, 0 otherwise.
equivalentEquivalent(broadcastable<boolean>, broadcastable<boolean>) -> booleanLogical equivalence (if and only if): true when both operands have the same truth value.
existsExists(value, boolean) -> booleanExistential quantifier (there exists): true when the predicate holds for at least one value.
existsUniqueExistsUnique(value, boolean) -> booleanUnique existential quantifier (there exists exactly one value satisfying the predicate).
—Falseconstant booleanThe boolean truth value false.
forAllForAll(value, boolean) -> booleanUniversal quantifier (for all): true when the predicate holds for every value.
impliesImplies(antecedent: broadcastable<boolean>, consequent: broadcastable<boolean>) -> booleanLogical implication: false only when the antecedent is true and the consequent is false.
isSatisfiableIsSatisfiable(boolean) -> booleanReturn True when some assignment of truth values to the variables of a boolean expression makes it true, False otherwise.
isTautologyIsTautology(boolean) -> booleanReturn True when a boolean expression is true for every assignment of truth values to its variables, False otherwise.
kroneckerDeltaKroneckerDelta(value+) -> integerReturn 1 if the arguments are equal, 0 otherwise.
minimalCNFMinimalCNF(boolean) -> booleanReturn a minimal conjunctive normal form (CNF) of a boolean expression: an AND of ORs of its prime implicates with the fewest clauses (for a large expression, the search for the fewest can stop at a budget and give a few more).
minimalDNFMinimalDNF(boolean) -> booleanReturn a minimal disjunctive normal form (DNF) of a boolean expression: an OR of ANDs of its prime implicants with the fewest terms (for a large expression, the search for the fewest can stop at a budget and give a few more).
nandNand(broadcastable<boolean>+) -> booleanLogical NAND: the negation of AND (n-ary).
norNor(broadcastable<boolean>+) -> booleanLogical NOR: the negation of OR (n-ary).
—Not(broadcastable<boolean>) -> booleanLogical negation (NOT).
notExistsNotExists(value, boolean) -> booleanNegated existential quantifier (there does not exist): true when the predicate holds for no value.
notForAllNotForAll(value, boolean) -> booleanNegated universal quantifier (not for all): true when the predicate fails for at least one value.
—Or(broadcastable<boolean>+) -> booleanLogical disjunction (OR): true when at least one operand is true.
—Predicate(symbol, value+) -> booleanApply a predicate to arguments, returning a boolean
primeImplicantsPrimeImplicants(boolean) -> listReturn the list of the prime implicants of a boolean expression: the minimal conjunctions of literals that imply it.
primeImplicatesPrimeImplicates(boolean) -> listReturn the list of the prime implicates of a boolean expression: the minimal disjunctions of literals that it implies.
toCNFToCNF(boolean) -> booleanConvert a boolean expression to conjunctive normal form (CNF), an AND of ORs.
toDNFToDNF(boolean) -> booleanConvert a boolean expression to disjunctive normal form (DNF), an OR of ANDs.
—Trueconstant booleanThe boolean truth value true.
truthTableTruthTable(boolean) -> listReturn the truth table of a boolean expression, as a list of rows.
xorXor(broadcastable<boolean>+) -> booleanExclusive or: true when an odd number of operands are true

Collections​

The Collections reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
adjoinAdjoin(set<any>, any+) -> setThe ring obtained by adjoining one or more elements to a base ring.
allAll(xs: collection<T>, predicate: ((T) any -> boolean)?) -> boolean where TReturn True if the predicate holds for every element of the collection (or if every element is True when no predicate is given).
anyAny(xs: collection<T>, predicate: ((T) any -> boolean)?) -> boolean where TReturn True if the predicate holds for at least one element of the collection (or if any element is True when no predicate is given).
appendAppend(collection<any>, any+) -> collectionReturn the collection with one or more elements added at its end.
argMaxArgMax(xs: indexed_collection<T>, key: ((T) any -> unknown)?) -> integer where TReturn the 1-based index of the element that maximizes the given key function (or of the largest element when no key is given); of several such elements, the first.
argMinArgMin(xs: indexed_collection<T>, key: ((T) any -> unknown)?) -> integer where TReturn the 1-based index of the element that minimizes the given key function (or of the smallest element when no key is given); of several such elements, the first.
arrayFromArrayFrom(value, string?) state -> arrayMake a new mutable array from the elements of a finite collection, or from the cells of an array, in order.
—At(value: any, index: (boolean | character | indexed_collection<any> | number | string)+) -> unknownAccess an element of an indexed collection.
chunkChunk((xs: S, count: integer) -> list<string> where S: string) & ((xs: indexed_collection, count: integer) -> list<list>)Return the collection split into count groups of consecutive elements.
chunkByChunkBy((xs: S, key: (character) any -> unknown) -> list<string> where S: string) & ((xs: indexed_collection<T>, key: (T) any -> unknown) -> list<list<T>> where T: any)Split the collection into maximal runs of consecutive elements over which the key function yields the same value.
closedClosed(number) -> numberClosed(x): the endpoint x of an Interval, marked as included.
complementComplement(set<any>+) -> setReturn the elements of the first set that are not in any of the subsequent sets.
complexNumbersComplexNumbersconstant set<complex>The set of all finite complex numbers.
containsContains(xs: collection<any>, element: any) -> booleanReturn True if the collection contains the given element (structural identity, like ===), False otherwise.
containsSequenceContainsSequence(xs: indexed_collection<T>, needle: indexed_collection<T>) -> boolean where TReturn True when needle occurs as a contiguous subsequence of the indexed collection.
countCount(xs: collection<any>, element: any?, levels: any?) -> infinity | integercount(xs): the number of elements in the collection.
countIfCountIf(xs: collection<T>, predicate: (T) any -> boolean) -> integer where TReturn the number of elements in the collection satisfying the predicate.
cycleCycle(list<any>) -> listProduce an infinite sequence by cycling through the elements of a finite collection.
dedupDedup(collection<any>) -> collectionReturn the collection with consecutive duplicate elements collapsed to a single element.
deleteAtDeleteAt((xs: T, index: integer) -> T where T: string) & ((xs: indexed_collection<T>, index: integer) -> list<T> where T: any) & ((xs: dictionary<V>, key: string) -> dictionary<V> where V: any)Return a copy of the indexed collection with the element at the 1-based index removed.
—Dictionary(tuple<string, unknown>*) -> dictionaryA collection of key -> value entries with string keys ({x -> 1, y -> 2} in Epsil).
dictionaryFromDictionaryFrom(collection<any>) -> dictionaryCreate a dictionary from the elements of a collection of (key, value) pairs.
differencesDifferences(indexed_collection<any>) -> indexed_collectionReturn the successive differences of a collection: a collection whose k-th element is x(k+1) − xk, of length one less than the input.
dropDrop((xs: T, count: number) -> T where T: string) & ((xs: indexed_collection<T>, count: number) -> list<T> where T: any)Return the indexed collection without its first count elements.
dropWhileDropWhile(xs: indexed_collection<T>, predicate: (T) any -> boolean) -> indexed_collection where TReturn the collection with its leading elements for which the predicate returns True removed; the remaining elements are returned unfiltered.
—Element(any, any, boolean?) -> booleanTest whether a value is an element of a collection.
emptySetEmptySetconstant setThe empty set, a set containing no elements.
endsWithEndsWith(xs: indexed_collection<T>, suffix: indexed_collection<T>) -> boolean where TReturn True when the indexed collection ends with suffix as a contiguous subsequence.
extendedComplexNumbersExtendedComplexNumbersconstant set<complex | infinity>The set of all complex numbers, including infinities.
extendedIntegersExtendedIntegersconstant set<integer | signed_infinity>The set of all integers, including infinities.
extendedRationalNumbersExtendedRationalNumbersconstant set<rational | signed_infinity>The set of all rational numbers, including infinities.
extendedRealNumbersExtendedRealNumbersconstant set<real | signed_infinity>The set of all real numbers, including infinities.
fieldField(value: any, field: string) -> unknownReturn the named field of a value: p.x in Epsil.
filterFilter(xs: collection<T>, predicate: (T) any -> boolean) -> collection where TReturn the elements of the collection for which the predicate function returns True.
findFind(xs: indexed_collection<T>, predicate: (T) any -> boolean) -> any where T: anyReturn the first element of the collection satisfying the predicate.
firstFirst(xs: indexed_collection<any>, default: any?) -> anyThe first element of a collection.
flatMapFlatMap(xs: collection<T>, mapping: (T) any -> U) -> list where T, UMap a function over a collection and concatenate the results into a single list, splicing collection-valued results and keeping scalar results as single elements.
foldFold(reducer: (unknown, T) any -> unknown, initial: value, xs: collection<T>) -> value where TFold a collection to a single value, applying a binary function f(accumulator, element) left to right from an initial value.
groupByGroupBy(xs: collection<T>, key: (T) any -> unknown) -> dictionary<list> where TPartition the collection into a dictionary of lists based on the key returned by the function.
imaginaryNumbersImaginaryNumbersconstant set<imaginary>The set of all imaginary numbers.
indexOfIndexOf(xs: indexed_collection<any>, element: any) -> integerReturn the 1-based index of the first occurrence of value in collection, or 0 if not found.
indexWhereIndexWhere(xs: indexed_collection<T>, predicate: (T) any -> boolean) -> integer where TReturn the 1-based index of the first element satisfying the predicate, or 0 if not found.
insertInsert(xs: indexed_collection<T>, index: integer, element: T) -> list<T> where T: anyReturn a copy of the indexed collection with element inserted before the 1-based index.
integersIntegersconstant set<integer>The set of all finite integers.
intersectionIntersection(any+) -> setReturn the intersection of one or more collections as a set.
intervalInterval(start: number, end: number) -> set<real>A set of real numbers between two endpoints.
isEmptyIsEmpty(collection<any>) -> booleanReturn True if the collection is empty, False otherwise.
iterateIterate(f: function, initial: any?) -> listProduce an infinite sequence by repeatedly applying a function to the previous value, starting with an initial value.
joinJoin((T+) -> T where T: string) & ((collection<any>*) -> collection)Join the elements of some collections into a flat collection.
—KeyValuePair(key: string, value: T) -> tuple<string, T> where TA key/value pair
keysKeys(dictionary<any>) -> list<string>Return a list of the keys of a dictionary.
lastLast(xs: indexed_collection<any>, default: any?) -> anyThe last element of a collection.
lengthLength(any) -> infinity | integerNumber of elements in a collection.
linspaceLinspace(start: number, end: number?, count: number?) -> list<number>A sequence of evenly spaced numbers between a start and end value, both endpoints included.
—List(any*) -> listAn ordered collection of elements (a list).
listFromListFrom(value*) -> listCreate a list from the elements of a collection.
—ListJoin(collection<any>*) -> listJoin the elements of some collections into a list.
mapMap(mapping: (T) any -> U, collection<T>+) -> indexed_collection where T, UReturn the collection where each element has been transformed by the mapping function.
maxByMaxBy(xs: collection<T>, key: (T) any -> unknown) -> value where TReturn the element of the collection that maximizes the given key function.
—MemberCall(receiver: any, member: string, arguments: any*) -> unknownCall the member name of a value with the value as its first argument: c.area(2) in Epsil.
minByMinBy(xs: collection<T>, key: (T) any -> unknown) -> value where TReturn the element of the collection that minimizes the given key function.
mostMost((T) -> T where T: string) & ((indexed_collection<T>) -> list<T> where T: any)Return the collection without the last element.
negativeIntegersNegativeIntegersconstant set<integer>The set of all negative integers.
negativeNumbersNegativeNumbersconstant set<real>The set of all negative real numbers.
nonNegativeIntegersNonNegativeIntegersconstant set<integer>The set of all non-negative integers.
nonNegativeNumbersNonNegativeNumbersconstant set<real>The set of all non-negative real numbers.
nonPositiveIntegersNonPositiveIntegersconstant set<integer>The set of all non-positive integers.
nonPositiveNumbersNonPositiveNumbersconstant set<real>The set of all non-positive real numbers.
—NotElement(any, any) -> booleanTest whether a value is not an element of a collection.
—NotSubset(lhs: any, rhs: any) -> booleanTest whether the first collection is not a strict subset of the second.
—NotSuperset(lhs: any, rhs: any) -> booleanTest whether the first collection is not a strict superset of the second.
—NotSupersetEqual(lhs: any, rhs: any) -> booleanTest whether the first collection is not a superset (possibly equal) of the second.
numbersNumbersconstant set<number>The set of all numbers.
openOpen(number) -> numberOpen(x): the endpoint x of an Interval, marked as excluded.
orderingOrdering(xs: indexed_collection<T>, order: (((T) any -> unknown) | ((any, any) any -> boolean | number))?) -> list<integer> where T: anyReturn the indexes that would sort the collection.
—Pair(first: T, second: U) -> tuple<T, U> where T, UA tuple of two elements
partitionPartition(xs: indexed_collection<T>, count: ((T) any -> boolean) | integer, step: integer?) -> list<list<T>> where T: anyPartition a collection into consecutive chunks each of size count; the trailing chunk may be shorter when count does not divide the length.
pointListPointList(any+) -> anyA list of points: zips collection components into a List of point-tuples (Desmos point-list idiom); a plain point when no component is a collection.
pointXPointX(xs: collection<any> | tuple) -> anyThe x-coordinate of a point, broadcasting over a list of points.
pointYPointY(xs: collection<any> | tuple) -> anyThe y-coordinate of a point, broadcasting over a list of points.
pointZPointZ(xs: collection<any> | tuple) -> anyThe z-coordinate of a point, broadcasting over a list of points.
positionPosition(xs: indexed_collection<T>, predicate: (T) any -> boolean) -> list<integer> where T: anyReturn a list of indexes of elements in the collection satisfying the predicate.
positiveIntegersPositiveIntegersconstant set<integer>The set of all positive integers.
positiveNumbersPositiveNumbersconstant set<real>The set of all positive real numbers.
primesPrimesconstant set<integer>The set of all prime numbers.
quotientRingQuotientRing(set<any>, any) -> setThe quotient of a ring by the ideal generated by the second argument.
randomShuffleRandomShuffle((T) random -> T where T: string) & ((indexed_collection<T>) random -> list<T> where T: any)Randomize the order of the elements in the collection.
—Range(number, number?, step: number?) -> list<number>A sequence of numbers from a start to an end value with an optional step.
rangeOfRangeOf(xs: indexed_collection<T>, needle: indexed_collection<T>, from: integer?) -> missing | range where TReturn the 1-based inclusive index span of the first occurrence of needle as a contiguous subsequence of the indexed collection, or missing when it does not occur.
rationalNumbersRationalNumbersconstant set<rational>The set of all finite rational numbers.
realNumbersRealNumbersconstant set<real>The set of all finite real numbers.
reduceReduce(xs: collection<T>, reducer: (unknown, T) any -> unknown, initial: value?) -> value where TReduce (fold) a collection to a single value by repeatedly applying a binary function, with an optional initial value.
repeatRepeat(value: any, count: integer?) -> listProduce a sequence by repeating a single value.
replaceAtReplaceAt((xs: indexed_collection<T>, index: integer, element: T) -> list<T> where T: any) & ((xs: indexed_collection<any>, index: integer, integer, any+) -> list<any>)Return a copy of the indexed collection with the element at the 1-based index replaced by element.
residueClassResidueClass(k: any, n: any) -> residueAn element of ℤ/nℤ: the class of the integer k modulo n.
restRest((T) -> T where T: string) & ((indexed_collection<T>) -> list<T> where T: any)Return the collection without the first element.
reverseReverse((T) -> T where T: string) & ((T) -> T where T: list) & ((indexed_collection<T>) -> list<T> where T: any)Reverse the order of the elements of an indexed collection.
rotateLeftRotateLeft((xs: T, n: integer?) -> T where T: string) & ((xs: T, n: integer?) -> T where T: list) & ((xs: indexed_collection<T>, n: integer?) -> list<T> where T: any)Rotate the elements of the collection to the left by n positions.
rotateRightRotateRight((xs: T, n: integer?) -> T where T: string) & ((xs: T, n: integer?) -> T where T: list) & ((xs: indexed_collection<T>, n: integer?) -> list<T> where T: any)Rotate the elements of the collection to the right by n positions.
scanScan(xs: indexed_collection<T>, reducer: (unknown, T) any -> unknown, initial: value?) -> indexed_collection where TReturn the cumulative fold of a collection: a same-length collection whose k-th element is the running result of applying a binary function left to right (optionally seeded by an initial value).
secondSecond(xs: indexed_collection<any>) -> anyThe second element of a collection.
setSet(any*) -> setAn unordered collection of distinct elements (a set).
setFromSetFrom(value*) -> setCreate a set from the elements of a collection.
setMinusSetMinus(set<any>, value*) -> setReturn the set difference between the first set and subsequent values.
—Single(value: T) -> tuple<T> where TA tuple with a single element
sliceSlice((value: T, span: range) -> T where T: string) & ((value: T, start: number, end: number) -> T where T: string) & ((value: indexed_collection<T>, span: range) -> list<T> where T: any) & ((value: indexed_collection<T>, start: number, end: number) -> list<T> where T: any)Return a contiguous run of elements from an indexed collection.
sortSort((T, order: (((character) any -> unknown) | ((character, character) any -> boolean | number))?) -> T where T: string) & ((indexed_collection<T>, order: (((T) any -> unknown) | ((any, any) any -> boolean | number))?) -> list<T> where T: any)Return the elements of the collection sorted according to the given comparison function.
startsWithStartsWith(xs: indexed_collection<T>, prefix: indexed_collection<T>) -> boolean where TReturn True when the indexed collection begins with prefix as a contiguous subsequence.
subsetSubset(any, any*) -> booleanTest whether the first collection is a strict subset of the second.
subsetEqualSubsetEqual(any, any*) -> booleanTest whether the first collection is a subset (possibly equal) of the second.
supersetSuperset(any, any*) -> booleanTest whether the first collection is a strict superset of the second.
supersetEqualSupersetEqual(any, any*) -> booleanTest whether the first collection is a superset (possibly equal) of the second.
swapSwap(array, array) state -> nothingExchange the cells and the counts of two arrays of one cell type, in constant time, with no cell copied.
symmetricDifferenceSymmetricDifference(set<any>, set<any>) -> setReturn the symmetric difference of two sets (elements in either set but not both).
tableTable(function, integer+) -> collectionReturn the list of the values of a function at each index of the given dimensions, as tabulate (the preferred name) does.
tabulateTabulate(generator: function, integer+) -> listCreate a collection by applying a function to each index in the specified dimensions.
takeTake((xs: T, count: number) -> T where T: string) & ((xs: indexed_collection<T>, count: number) -> list<T> where T: any)Return the first n elements of an indexed collection.
takeWhileTakeWhile(xs: indexed_collection<T>, predicate: (T) any -> boolean) -> indexed_collection where TReturn the leading elements of the collection for which the predicate returns True, stopping at the first element that does not.
tallyTally(collection<T>) -> tuple<list<T>, list<integer>> where TReturn a tuple with the unique elements of the collection and their respective counts.
thirdThird(xs: indexed_collection<any>) -> anyThe third element of a collection.
—Triple(first: T, second: U, third: V) -> tuple<T, U, V> where T, U, VA tuple of three elements
—Tuple(any*) -> tupleA fixed number of heterogeneous elements.
tupleFromTupleFrom(value*) -> tupleCreate a tuple from the elements of a collection.
unionUnion(any+) -> setReturn the union of two or more collections as a set.
uniqueUnique((xs: T) -> T where T: string) & ((xs: T, test: (character, character) any -> boolean) -> T where T: string) & ((xs: collection<T>) -> list<T> where T: any) & ((xs: collection<T>, test: (T, T) any -> boolean) -> list<T> where T: any)Return a list of the unique elements of the collection.
valuesValues(dictionary<any>) -> listReturn a list of the values of a dictionary.
zipZip(indexed_collection<any>+) -> listCombine multiple collections element-wise into a list of tuples.

Colors​

The Colors reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
asHslAsHsl(broadcastable<color | string | tuple>) -> colorConvert any color to HSL (hue degrees, s/l 0-1)
asHsvAsHsv(broadcastable<color | string | tuple>) -> colorConvert any color to HSV (hue degrees, s/v 0-1)
asOklabAsOklab(broadcastable<color | string | tuple>) -> colorConvert any color to OKLab
asOklchAsOklch(broadcastable<color | string | tuple>) -> colorConvert any color to OKLCh
asRgbAsRgb(broadcastable<color | string | tuple>) -> colorConvert any color to sRGB (channels 0-1)
colorColor(string) -> colorParse a CSS-style color string to a color in the color space of the string: an Rgb color for a hex code, an rgb() spelling or a color name, an Hsl color for an hsl() spelling, and an Oklch or Oklab color for an oklch() or oklab()…
colorContrastColorContrast(background: color | string | tuple, foreground: color | string | tuple) -> numberAPCA contrast ratio between two colors
colorDeltaColorDelta(color | string | tuple, color | string | tuple) -> numberPerceptual color difference (ΔE_OK) between two colors
colorFromColorspaceColorFromColorspace(channels: color | tuple, space: string) -> colorBuild a color from channel values in a named color space.
colorMatchesColorMatches(color: color, other: color, tolerance: number) -> booleanWhether two colors are the same within a tolerance: True when each sRGB channel and the alpha of the two colors differ by at most the tolerance, whatever color space each color is written in.
colorMixColorMix(a: color | string | tuple, b: color | string | tuple, ratio: number?) -> colorMix two colors in OKLCh space
colorToColorspaceColorToColorspace(color: color | string | tuple, space: string) -> tupleConvert a color to components in a target color space
colorToStringColorToString(color: color | string | tuple, format: string?) -> stringConvert a color to a string in the specified format: "hex" (the default), "rgb", "hsl", "oklch", "srgb" (the same as "hex") or "display-p3" (the CSS spelling color(display-p3 r g b)).
colorUpdateColorUpdate(color: color, channels: dictionary) -> colorA copy of a color with some channels replaced.
colormapColormap(string, number?) -> color | list<color>Sample colors from a named palette.
contrastingColorContrastingColor(background: color | string | tuple, a: (color | string | tuple)?, b: (color | string | tuple)?) -> colorChoose the foreground color with better APCA contrast against a background, answered as given: the interpreter keeps the color head the candidate was written with, and a compiled target answers the same color in its canonical form
gamutMapGamutMap(color: color | string | tuple, gamut: string?) -> colorMap a color into a target gamut, "srgb" (the default) or "display-p3", with the CSS Color 4 gamut-mapping algorithm: the OKLCh chroma is reduced, at constant lightness and hue, until the color is inside the gamut or until clipping each…
hslHsl(h: broadcastable<number>, s: broadcastable<number>, l: broadcastable<number>, alpha: broadcastable<number>?) -> colorHSL color (hue degrees, saturation/lightness 0-1, optional alpha)
hsvHsv(h: broadcastable<number>, s: broadcastable<number>, v: broadcastable<number>, alpha: broadcastable<number>?) -> colorHSV color (hue degrees, saturation/value 0-1, optional alpha)
oklabOklab(l: broadcastable<number>, a: broadcastable<number>, b: broadcastable<number>, alpha: broadcastable<number>?) -> colorOKLab color (L 0-1, a/b ~ -0.4..0.4, optional alpha)
oklchOklch(l: broadcastable<number>, c: broadcastable<number>, h: broadcastable<number>, alpha: broadcastable<number>?) -> colorOKLCh color (L 0-1, C 0-~0.4, hue degrees, optional alpha)
rgbRgb(r: broadcastable<number>, g: broadcastable<number>, b: broadcastable<number>, alpha: broadcastable<number>?) -> colorsRGB color (channels 0-1, optional alpha 0-1)
rgb255Rgb255(r: broadcastable<number>, g: broadcastable<number>, b: broadcastable<number>, alpha: broadcastable<number>?) -> colorsRGB color with channels on the scale of 0 to 255 (optional alpha 0-1): rgb255(r, g, b, alpha) is rgb(r/255, g/255, b/255, alpha)

Regular expressions​

The Regular expressions reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
isMatchIsMatch(subject: character | string, pattern: regexp) -> booleanWhether a string contains a match for a regular expression.
regExpRegExp(pattern: string, flags: string?) -> regexpA compiled regular expression, using the host JavaScript dialect.
stringMatchStringMatch(subject: character | string, pattern: regexp) -> nothing | recordThe first match of a regular expression in a string, as a record.
stringMatchAllStringMatchAll(subject: character | string, pattern: regexp) -> list<record>Every non-overlapping match of a regular expression in a string, as a list of records.

Relations​

The Relations reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
—Approx(any, any*) -> booleanApproximate-equality relation (approximately equal).
—ApproxEqual(any, any*) -> booleanApproximately-equal relation.
—ApproxNotEqual(any, any*) -> booleanApproximately-not-equal relation.
congruentCongruent(number, number, modulo: number) -> booleanIndicate that two expressions are congruent modulo a number
—Equal(any, any) -> booleanEquality comparison (equal to).
—Greater(any, any*) -> booleanGreater-than comparison (strictly greater than).
—GreaterEqual(any, any*) -> booleanGreater-than-or-equal comparison (greater than or equal to).
identicallyEqualIdenticallyEqual(any, any) -> booleanIdentity comparison (\equiv).
isSameIsSame(any, any) -> booleanCompare two expressions for structural equality
—Less(any, any*) -> booleanLess-than comparison (strictly less than).
—LessEqual(any, any*) -> booleanLess-than-or-equal comparison (less than or equal to).
—NotApprox(any, any*) -> booleanNegated approximate-equality relation (not approximately equal).
—NotApproxEqual(any*) -> unknownNegated approximately-equal relation.
—NotApproxNotEqual(any, any*) -> booleanNegated approximately-not-equal relation.
—NotEqual(any, any*) -> booleanInequality comparison (not equal to).
—NotGreater(any, any*) -> booleanNegated greater-than relation (not greater than).
—NotGreaterNotEqual(any, any*) -> booleanNeither greater than nor equal to.
—NotLess(any, any*) -> booleanNegated less-than relation (not less than).
—NotLessNotEqual(any, any*) -> booleanNeither less than nor equal to.
—NotPrecedes(any, any*) -> booleanNegated precedes relation (does not precede).
—NotSucceeds(any, any*) -> booleanNegated succeeds relation (does not succeed).
—NotTilde(any, any*) -> booleanNegated similarity relation (not similar).
—NotTildeEqual(any, any*) -> booleanNegated approximately/asymptotically-equal relation (not approximately equal).
—NotTildeFullEqual(any, any*) -> booleanNegated isomorphism/congruence relation (not isomorphic or congruent).
—Precedes(any, any*) -> booleanPrecedes relation in an ordering (comes before).
—Same(any, any*) -> booleanStructural identity comparison (Epsil ===).
—Succeeds(any, any*) -> booleanSucceeds relation in an ordering (comes after).
—Tilde(any, any*) -> booleanGeneric similarity relation (\sim): similar geometric figures, asymptotic equivalence, or "is distributed as".
—TildeEqual(any, any*) -> booleanApproximately or asymptotically equal
—TildeFullEqual(any, any*) -> booleanIndicate isomorphism, congruence and homotopic equivalence

Arithmetic​

The Arithmetic reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
absAbs(broadcastable<complex | infinity | quantity>) -> numberAbsolute value (magnitude) of a number.
absArgAbsArg(broadcastable<complex | infinity>) -> tuple<+oo | real, real>Tuple of magnitude and argument of a complex number.
—Add(value+) -> valueSum of two or more values.
airyAiAiryAi(broadcastable<complex | infinity>) -> numberAiry function of the first kind
airyAiPrimeAiryAiPrime(broadcastable<complex | infinity>) -> numberDerivative of the Airy function of the first kind
airyBiAiryBi(broadcastable<complex | infinity>) -> numberAiry function of the second kind
airyBiPrimeAiryBiPrime(broadcastable<complex | infinity>) -> numberDerivative of the Airy function of the second kind
argArg(broadcastable<complex | infinity>) -> numberarg is an alias for argument, which is the preferred name.
argumentArgument(broadcastable<complex | infinity>) -> numberComplex argument (phase angle) of a number, in the engine's angular unit.
besselIBesselI(order: broadcastable<complex>, z: broadcastable<complex | infinity>) -> numberModified Bessel function of the first kind
besselJBesselJ(order: broadcastable<complex>, z: broadcastable<complex | infinity>) -> numberBessel function of the first kind
besselKBesselK(order: broadcastable<complex>, z: broadcastable<complex | infinity>) -> numberModified Bessel function of the second kind (Macdonald function)
besselYBesselY(order: broadcastable<complex>, z: broadcastable<complex | infinity>) -> numberBessel function of the second kind (Neumann function)
betaBeta(broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>?, broadcastable<complex | infinity>?) -> numberEuler beta function
catalanConstantCatalanConstantconstant real<0.915965594177219..0.9159655941772191> = 0.915965594177219015055Catalan's constant G ≈ 0.9160.
ceilCeil(x: broadcastable<real | signed_infinity | ~oo>, step: broadcastable<real>?) -> real | signed_infinity | ~ooRounds a number up to the next largest integer, or with a step to the least multiple of the step that is at least the number.
chopChop(x: T, tolerance: real<0..>?) -> T where T: numberReplace tiny numeric values with zero.
clampClamp(x: broadcastable<real | signed_infinity>, lower: broadcastable<real | signed_infinity>, upper: broadcastable<real | signed_infinity>) -> real | signed_infinityClamp a value to the range [lo, hi] = min(max(x, lo), hi).
complexComplex(real: number, imaginary: number) -> complexConstruct a complex number from real and imaginary parts.
complexInfinityComplexInfinityconstant number = ~ooComplex infinity, a single unsigned infinity in the complex plane.
complexRootsComplexRoots(broadcastable<complex>, broadcastable<integer>) -> list<number>All n-th complex roots of a number.
conjugateConjugate(T) -> T where T: numberComplex conjugate of a number, or the pointwise conjugate of a function.
—ContinuationPlaceholderconstant unknownThis symbol indicates that some elements in a collection have been omitted, for example in a long list of numbers, or in an infinite set
denominatorDenominator(broadcastable<number>) -> nothing | numberDenominator of an expression
digammaDigamma(broadcastable<complex | infinity>) -> numberDigamma function, the logarithmic derivative of the gamma function
dirichletBetaDirichletBeta(broadcastable<complex | infinity>) -> numberDirichlet beta function β(s) = Σ_{n≥0} (−1)^n/(2n+1)^s = 4^(−s) (ζ(s, 1/4) − ζ(s, 3/4)), entire; β(1) = π/4, β(2) = G, β(+∞) = 1.
dirichletEtaDirichletEta(broadcastable<complex | infinity>) -> numberDirichlet eta function η(s) = Σ_{n≥1} (−1)^(n−1)/n^s = (1 − 2^(1−s)) ζ(s), entire; η(1) = ln 2, η(+∞) = 1.
distanceDistance(list<list<number>> | list<number> | list<tuple> | tuple, list<list<number>> | list<number> | list<tuple> | tuple) -> numberEuclidean distance between two points, broadcasting over a list of points.
—Divide(broadcastable<complex | infinity>, broadcastable<complex | infinity>+) -> numberQuotient of a numerator and one or more denominators.
elementMaxElementMax(broadcastable<real | signed_infinity>, broadcastable<real | signed_infinity>+) -> real | signed_infinityElement-wise maximum: broadcasts scalars over collections (and zips collections), returning a collection; all-scalar arguments give a scalar.
elementMinElementMin(broadcastable<real | signed_infinity>, broadcastable<real | signed_infinity>+) -> real | signed_infinityElement-wise minimum: broadcasts scalars over collections (and zips collections), returning a collection; all-scalar arguments give a scalar.
enclosureEnclosure(nan | real | set<real> | signed_infinity, (nan | real | signed_infinity)?) -> enclosure | nanA closed interval [lo, hi] that encloses one real number, with interval arithmetic.
eulerGammaEulerGammaconstant real<0.5772156649015328..0.5772156649015329> = 0.577215664901532860607The Euler–Mascheroni constant γ ≈ 0.5772.
expExp(broadcastable<number>) -> numberNatural exponential function: e^x.
exp2Exp2(broadcastable<number>) -> numberBase-2 exponential: 2^x
exponentialEExponentialEconstant real<2.718281828459045..2.718281828459046> = 2.71828182845904523536Euler's number e ≈ 2.71828, the base of the natural logarithm.
—Factorial(broadcastable<complex | infinity>) -> numberFactorial function: the product of all positive integers less than or equal to n
factorial2Factorial2(broadcastable<complex | infinity>) -> numberDouble Factorial Function
floorFloor(x: broadcastable<real | signed_infinity | ~oo>, step: broadcastable<real>?) -> real | signed_infinity | ~ooRounds a number down to the nearest integer, or with a step to the greatest multiple of the step that is at most the number.
fractFract(broadcastable<real | signed_infinity | ~oo>) -> real<0..1>Fractional part of a number: x - floor(x)
gcdGCD(any*) -> numberGreatest Common Divisor
gammaGamma(broadcastable<complex | infinity>, broadcastable<complex | infinity>?, broadcastable<complex | infinity>?) -> numberGamma function Γ(z); with two arguments, the upper incomplete gamma Γ(s, z) = ∫_z^∞ tˢ⁻¹ e⁻ᵗ dt; with three, Γ(s, z0) − Γ(s, z1).
gammaLnGammaLn(broadcastable<complex | infinity>) -> numberNatural logarithm of the gamma function.
goldenRatioGoldenRatioconstant real<1.618033988749894..1.618033988749895> = 1/2 * (1 + sqrt(5))The golden ratio φ = (1+√5)/2 ≈ 1.618.
halfHalfconstant rational = 1/2The rational number one half (1/2).
harmonicNumberHarmonicNumber(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberHarmonic number H_n = Σ_{k=1}^n 1/k, exact at a non-negative integer and continued by ψ(n+1) + γ; with a second argument r, the generalized H_n^(r) = Σ_{k=1}^n 1/k^r = ζ(r) − ζ(r, n+1).
heavisideHeaviside(broadcastable<real | signed_infinity>) -> rational<0..1>Heaviside step function.
hurwitzZetaHurwitzZeta(broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<integer>?) -> numberHurwitz zeta function ζ(s,a) = Σ_{n=0}^∞ (n+a)^{-s}
imIm(broadcastable<complex | infinity>) -> numberim is an alias for imaginary, which is the preferred name.
imaginaryImaginary(broadcastable<complex | infinity>) -> numberImaginary part of a complex number.
imaginaryUnitImaginaryUnitconstant imaginary = iThe imaginary unit, whose square is −1.
—Indeterminateconstant number = NaNAn input spelling of NaN.
infimumInfimum(value*) -> numberThe greatest lower bound of numbers, collections and intervals: like min, but the open end of an interval is a bound too.
interpretInterpret(any) -> anyInterpret a notational expression as its mathematical meaning.
isCompositeIsComposite(broadcastable<number>) -> booleanisComposite(n) returns True if n is a composite number
isEvenIsEven(broadcastable<number>) -> booleanisEven(n) returns True if n is an even number
isOddIsOdd(broadcastable<number>) -> booleanisOdd(n) returns True if n is an odd number
isPrimeIsPrime(broadcastable<number>) -> booleanisPrime(n) returns True if n is a prime number
lcmLCM(any*) -> numberLeast Common Multiple
lambertWLambertW(z: broadcastable<complex | infinity>, branch: broadcastable<integer>?) -> numberLambert W function (product logarithm)
lbLb(broadcastable<number>) -> numberBase-2 Logarithm
lerchPhiLerchPhi(z: broadcastable<complex>, s: broadcastable<complex>, a: broadcastable<complex>) -> numberLerch transcendent Φ(z,s,a) = Σ_{k=0}^∞ zᵏ(k+a)^{-s}
lgLg(broadcastable<number>) -> numberBase-10 Logarithm
lnLn(broadcastable<complex | infinity>, base: broadcastable<complex | infinity>?) -> complex | infinityNatural Logarithm
logLog(broadcastable<complex | infinity>, base: broadcastable<complex | infinity>?) -> numberLog(z, b = 10) = Logarithm of base b
log10Log10(broadcastable<number>) -> numberBase-10 Logarithm
log2Log2(broadcastable<number>) -> numberBase-2 Logarithm
machineEpsilonMachineEpsilonconstant real = 2.220446049250313e-16The difference between 1 and the next larger floating point number (machine epsilon).
maxMax(value*) -> numberMaximum of two or more numbers.
measurementMeasurement(value: value, uncertainty: value) -> measurementA nominal value carrying a 1σ absolute uncertainty.
minMin(value+) -> numberMinimum of two or more numbers.
—Mod(broadcastable<real>, broadcastable<real>, broadcastable<real>?) -> realModulo: the remainder of the floored division of x by y.
—Multiply(broadcastable<number>*) -> numberProduct of two or more values.
—NaNconstant number = NaNNot a Number, the result of a floating-point operation that is undefined or unrepresentable, such as 0.0/0.0, or of an exact form with no value, such as 0/0.
—Negate(broadcastable<complex | infinity>) -> numberAdditive Inverse
negativeInfinityNegativeInfinityconstant -oo = -ooNegative infinity (−∞).
numeratorNumerator(broadcastable<number>) -> nothing | numberNumerator of an expression
numeratorDenominatorNumeratorDenominator(broadcastable<number>) -> nothing | tuple<number, number>Sequence of Numerator and Denominator of an expression
—PlusMinus(T, U) -> tuple<T, U> where T: value, U: valuePlus or Minus
polyGammaPolyGamma(order: broadcastable<integer>, broadcastable<complex | infinity>) -> numberPolygamma function, the n-th derivative of the digamma function
positiveInfinityPositiveInfinityconstant +oo = +ooPositive infinity (+∞).
—Power(broadcastable<complex | infinity>, broadcastable<complex | signed_infinity>) -> numberExponentiation: raise a base to a power.
—PreDecrement(broadcastable<number>) -> numberDecrement a number by one.
—PreIncrement(broadcastable<number>) -> numberIncrement a number by one.
productProduct(any, tuple*) -> numberproduct(f, (k, a, b)) computes the product of f for k from a to b; product(L) multiplies the elements of a collection L.
rationalRational((integer, integer) -> rational) | ((real) -> rational)Construct a rational number from a numerator and denominator.
rationalizeRationalize(x: broadcastable<real>, tolerance: broadcastable<real<0..>>?) -> rationalApproximate a real number by a rational.
reRe(broadcastable<complex | infinity>) -> numberre is an alias for real, which is the preferred name.
realReal(broadcastable<complex | infinity>) -> numberReal part of a complex number.
remainderRemainder(T, T) -> T where T: numberIEEE remainder: the signed remainder after dividing x by y, with the quotient rounded to the nearest integer (ties round toward +Infinity, matching JavaScript Math.round)
rootRoot(broadcastable<complex | infinity>, broadcastable<complex | infinity>) -> numbern-th root of a value.
roundRound(x: broadcastable<real | signed_infinity | ~oo>, step: broadcastable<real>?) -> real | signed_infinity | ~ooRounds a number to the nearest integer, or with a step to the nearest multiple of the step.
signSign(broadcastable<complex | signed_infinity | ~oo>) -> complexSign of a number: -1, 0, or 1 for a real; z/|z|, the point of the unit circle in its direction, for a complex z.
smoothstepSmoothstep(edge0: broadcastable<real | signed_infinity>, edge1: broadcastable<real | signed_infinity>, x: broadcastable<real | signed_infinity>) -> nan | realSmooth Hermite interpolation between 0 and 1 as x goes from edge0 to edge1: t²(3 − 2t) with t = Clamp((x − edge0)/(edge1 − edge0), 0, 1).
sqrtSqrt(broadcastable<complex | infinity>) -> complex | infinitySquare Root
—Square(broadcastable<number>) -> numberSquare of a number: x^2.
—Subtract(broadcastable<number>+) -> numberDifference between two or more values.
sumSum(any, tuple*) -> numbersum(f, (k, a, b)) computes the sum of f for k from a to b; sum(L) sums the elements of a collection L.
supremumSupremum(value*) -> numberThe least upper bound of numbers, collections and intervals: like max, but the open end of an interval is a bound too.
trigammaTrigamma(broadcastable<complex | infinity>) -> numberTrigamma function, the derivative of the digamma function
truncateTruncate(x: broadcastable<real | signed_infinity | ~oo>, step: broadcastable<real>?) -> real | signed_infinity | ~ooRounds a number towards zero (removes the fractional part), or with a step to the multiple of the step nearest to the number in the direction of zero.
zetaZeta(s: broadcastable<complex | infinity>, a: broadcastable<complex | infinity>?) -> numberRiemann zeta function; with two arguments, Wolfram's generalized zeta: for a real a, ζ(s,a) = Σ_{n=0}^∞ |n+a|^{-s} (a term with n+a = 0 omitted, except at s = 0, where ζ(0,a) = 1/2 - a), which is HurwitzZeta(s,a) for a > 0; for a complex…
—econstant real<2.718281828459045..2.718281828459046> = eEuler's number e ≈ 2.71828, the base of the natural logarithm.
—iconstant imaginary = iThe imaginary unit, whose square is −1.

Fractals​

The Fractals reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
juliaJulia(z: broadcastable<complex>, c: broadcastable<complex>, maxIterations: broadcastable<integer>) -> realSmooth escape-time value for a Julia set with parameter c.
mandelbrotMandelbrot(c: broadcastable<complex>, maxIterations: broadcastable<integer>) -> realSmooth escape-time value for the Mandelbrot set.

Trigonometry​

The Trigonometry reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
arccosArccos(broadcastable<complex | quantity>) -> numberArccosine, the inverse cosine function.
arccotArccot(broadcastable<complex | quantity | signed_infinity>) -> numberArccotangent, the inverse cotangent function.
arccscArccsc(broadcastable<complex | infinity | quantity>) -> numberArccosecant, the inverse cosecant function.
arcoshArcosh(broadcastable<complex | quantity | signed_infinity>) -> numberInverse hyperbolic cosine (area hyperbolic cosine).
arcothArcoth(broadcastable<complex | infinity | quantity>) -> numberInverse hyperbolic cotangent (area hyperbolic cotangent).
arcschArcsch(broadcastable<complex | infinity | quantity>) -> numberInverse hyperbolic cosecant (area hyperbolic cosecant).
arcsecArcsec(broadcastable<complex | infinity | quantity>) -> numberArcsecant, the inverse secant function.
arcsinArcsin(broadcastable<complex | quantity>) -> numberArcsine, the inverse sine function.
arctanArctan(broadcastable<complex | quantity | signed_infinity>) -> numberInverse tangent.
arctan2Arctan2(y: broadcastable<real | signed_infinity>, x: broadcastable<real | signed_infinity>) -> realTwo-argument arctangent giving the angle of a vector.
arsechArsech(broadcastable<complex | quantity | signed_infinity>) -> numberInverse hyperbolic secant (area hyperbolic secant).
arsinhArsinh(broadcastable<complex | quantity | signed_infinity>) -> numberInverse hyperbolic sine (area hyperbolic sine).
artanhArtanh(broadcastable<complex | quantity | signed_infinity>) -> numberInverse hyperbolic tangent (area hyperbolic tangent).
cosCos(broadcastable<complex | quantity>) -> numberCosine of an angle.
cosIntegralCosIntegral(broadcastable<complex | infinity>) -> numberCosine integral: γ + ln(x) + ∫₀ˣ (cos(t)−1)/t dt.
coshCosh(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic cosine.
coshIntegralCoshIntegral(broadcastable<complex | infinity>) -> numberHyperbolic cosine integral: γ + ln|x| + ∫₀ˣ (cosh(t)−1)/t dt.
cotCot(broadcastable<complex | quantity>) -> numberCotangent, the reciprocal of tangent.
cothCoth(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic cotangent, the reciprocal of hyperbolic tangent.
cscCsc(broadcastable<complex | quantity>) -> numberCosecant, the reciprocal of sine.
cschCsch(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic cosecant, the reciprocal of hyperbolic sine.
dmsDMS(degrees: broadcastable<number>, minutes: broadcastable<number>?, seconds: broadcastable<number>?) -> numberConstruct an angle from degrees, minutes, and seconds.
degreesDegrees(broadcastable<real>) -> realConvert an angle in degrees.
fresnelCFresnelC(broadcastable<complex | signed_infinity>) -> complexFresnel cosine integral.
fresnelSFresnelS(broadcastable<complex | signed_infinity>) -> complexFresnel sine integral.
haversineHaversine(broadcastable<real>) -> numberHaversine function.
hypotHypot(broadcastable<infinity | real>, broadcastable<infinity | real>) -> +oo | nan | realHypotenuse length: sqrt(x^2 + y^2).
inverseFunctionInverseFunction(function) -> functionInverse of a function.
inverseHaversineInverseHaversine(broadcastable<real>) -> numberInverse haversine function.
piPiconstant real<3.141592653589793..3.141592653589794> = 3.14159265358979323846The constant π ≈ 3.14159, the ratio of a circle's circumference to its diameter.
secSec(broadcastable<complex | quantity>) -> numberSecant, the reciprocal of cosine.
sechSech(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic secant, the reciprocal of hyperbolic cosine.
sinSin(broadcastable<complex | quantity>) -> numberSine of an angle.
sinIntegralSinIntegral(broadcastable<complex | infinity>) -> numberSine integral: ∫₀ˣ sin(t)/t dt.
sincSinc(broadcastable<complex | signed_infinity>) -> complexUnnormalized sinc function: sin(x)/x with sinc(0)=1.
sinhSinh(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic sine.
sinhIntegralSinhIntegral(broadcastable<complex | infinity>) -> numberHyperbolic sine integral: ∫₀ˣ sinh(t)/t dt.
tanTan(broadcastable<complex | quantity>) -> numberTangent of an angle.
tanhTanh(broadcastable<complex | quantity | signed_infinity>) -> numberHyperbolic tangent.
trigExpandTrigExpand(value) -> valueExpand trigonometric and hyperbolic functions of sums and integer multiples of angles.
trigReduceTrigReduce(value) -> valueRewrite products and integer powers of trigonometric and hyperbolic functions as a linear combination of functions of multiple angles (the inverse of TrigExpand).
trigToExpTrigToExp(value) -> valueRewrite trigonometric and hyperbolic functions in terms of the complex exponential, exactly.

Calculus​

The Calculus reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
bigOBigO(value) -> numberLandau big-O remainder term.
circleContourCircleContour(center: complex, radius: real, orientation: integer?) -> expressionClosed circle: center, positive radius, optional orientation (+1 or -1).
circularIntegrateCircularIntegrate(function, limits+) -> numberClosed-path integral.
contourIntegrateContourIntegrate(expression, variable: symbol, contour: expression) -> numberSymbolic integral over an explicit closed contour or the real line (realLineContour), using the residue theorem.
—D(expression, variables: symbol*) -> expressionSymbolic partial derivative with respect to one or more variables.
dSolveDSolve(equation: expression, dependent: symbol, variable: symbol) -> expressionSymbolic differential equation solver.
derivativeDerivative(function, order: number*) -> functionDerivative operator that returns a derivative function.
integrateIntegrate(function, limits+) -> list<tuple> | number | tensor | tupleSymbolic integral with optional bounds.
interpolatingFunctionInterpolatingFunction(list<any>, number?) -> numberPiecewise-quartic dense-output interpolant of a numeric ODE solution (produced by ndSolveFunction).
jacobianMatrixJacobianMatrix(fs: any, variables: any?) -> valueJacobianMatrix(fs, variables): the matrix of partial derivatives ∂fᵢ/∂xⱼ, one row per function and one column per variable.
limitLimit(function, point: number, direction: number?) -> numberLimit of a function.
—Limits(index: symbol, lower: value, upper: value, step: value?) -> tupleLimits of a function
ndND(function, at: number) -> list<number> | number | tupleNumerical derivative evaluated at a point.
ndSolveNDSolve(equation: expression, dependent: symbol, limits: symbol | tuple, initial: number, steps: number?) -> listNumerical differential equation solver.
ndSolveFunctionNDSolveFunction(equation: expression, dependent: symbol, limits: symbol | tuple, initial: number) -> functionNumerically solve an ordinary differential equation and return the solution as an applicable function (a Function literal wrapping an interpolatingFunction), usable at any point of the integration interval.
nIntegrateNIntegrate(function, lower: number, upper: number) -> numberNumerical approximation of a definite integral.
nLimitNLimit(function, point: number, direction: number?) -> numberNumerical approximation of the limit of a function.
normalNormal(value) -> valueStrip Big-O remainder terms from a series, yielding the truncated polynomial.
polygonContourPolygonContour(vertices: list<complex>, orientation: integer?) -> expressionSimple closed polygon: a list of complex vertices in traversal order, with optional orientation override (+1 or -1).
rSolveRSolve(equation: expression, dependent: symbol, index: symbol) -> expressionSymbolic recurrence equation solver.
realLineContourRealLineContour(principalValue: boolean?) -> expressionThe real axis from minus infinity to infinity.
rectangleContourRectangleContour(lowerLeft: complex, upperRight: complex, orientation: integer?) -> expressionClosed rectangle: lower-left and upper-right complex corners, optional orientation (+1 or -1).
residueResidue(expression, variable: symbol, point: value) -> numberResidue of a function at a point (the coefficient of (x-a)⁻¹ in its Laurent expansion)
seriesSeries(expression, variable: symbol?, point: value?, order: number?) -> numberTaylor series expansion of an expression about a point (or an asymptotic expansion at ±∞), including Laurent, Puiseux (fractional-power), and log-aware expansions at poles and branch points.

Polynomials​

The Polynomials reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
algebraicGeneratorAlgebraicGenerator(list<number>) -> numberDeprecated: AlgebraicGenerator(List(c₀, …, cₙ)) is PolynomialRoot(c₀ + c₁t + … + cₙtⁿ, t), the abstract root of an irreducible polynomial with no complex embedding selected.
apartApart(expr: value, variable: symbol?) -> valueAlias for PartialFraction.
cancelCancel(expr: value, variable: symbol?) -> valueCancel common polynomial factors in the numerator and denominator of a rational expression.
coefficientListCoefficientList(polynomial: value, variable: symbol?) -> list<value>Return the list of coefficients of a polynomial, from highest to lowest degree.
discriminantDiscriminant(polynomial: value, variable: symbol?) -> valueReturn the discriminant of a polynomial of degree 2, 3 or 4; another degree stays unevaluated.
distributeDistribute(value) -> valueDistribute multiplication over addition.
expandExpand(value) -> valueExpand out products and positive integer powers.
expandAllExpandAll(value) -> valueRecursively expand out products and positive integer powers, including those in the arguments of other functions.
factorFactor(expr: value, variable: symbol?, generator: value?) -> valueFactor a polynomial expression into a product of irreducible factors.
partialFractionPartialFraction(expr: value, variable: symbol?) -> valueDecompose a rational expression into partial fractions.
piecewiseExpandPiecewiseExpand(value) -> valuepiecewiseExpand(expr) rewrites abs, sign, min, max and heaviside, wherever they occur in expr, into a conditional value Which(c1, v1, …, True, vd).
polynomialPolynomial(coefficients: list<value>, variable: symbol) -> valueConstruct a polynomial from a list of coefficients (highest to lowest degree) and a variable.
polynomialDegreePolynomialDegree(polynomial: value, variable: symbol?) -> integerReturn the degree of a polynomial with respect to a variable.
polynomialGCDPolynomialGCD(a: value, b: value, variable: symbol?) -> valueReturn the greatest common divisor of two polynomials, with leading coefficient 1.
polynomialQuotientPolynomialQuotient(dividend: value, divisor: value, variable: symbol?) -> valueReturn the quotient of polynomial division of dividend by divisor.
polynomialRemainderPolynomialRemainder(dividend: value, divisor: value, variable: symbol?) -> valueReturn the remainder of polynomial division of dividend by divisor.
polynomialRootsPolynomialRoots(polynomial: value, variable: symbol?) -> set<value>Return the set of the roots of a polynomial expression.
resultantResultant(a: value, b: value, variable: symbol?) -> valueReturn the resultant of two polynomials with respect to a variable.
togetherTogether(value) -> valueCombine rational expressions into a single fraction over a common denominator.

Combinatorics​

The Combinatorics reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
bellNumberBellNumber(n: broadcastable<integer>, x: broadcastable<number>?) -> numberCompute the Bell number B(n), the number of partitions of a set of n elements.
binomialBinomial(n: broadcastable<complex | infinity>, k: broadcastable<complex | infinity>) -> numberCompute the binomial coefficient C(n, k) = n! / (k!
cartesianProductCartesianProduct(set<any>+) -> setReturn the Cartesian product of input sets.
chooseChoose(n: broadcastable<complex | infinity>, m: broadcastable<complex | infinity>) -> numberBinomial coefficient: number of ways to choose k items from n.
combinationsCombinations((xs: S, k: integer) -> list<string> where S: string) & ((xs: collection, k: integer) -> list<list>)Return all k-element combinations of a collection.
fibonacciFibonacci(n: broadcastable<integer>, x: broadcastable<number>?) -> numberCompute the nth Fibonacci number.
integerPartitionsIntegerPartitions(n: integer, k: any?, parts: list<integer>?, count: integer?) -> list<list<integer>>Return the partitions of n, each a list of its positive parts in non-increasing order, in reverse lexicographic order.
multinomialMultinomial(integer+) -> integerCompute the multinomial coefficient for multiple integers.
permutationsPermutations((xs: S, k: integer?) -> list<string> where S: string) & ((n: integer<0..>, k: integer?) -> list<list<integer>>) & ((xs: collection, k: integer?) -> list<list>)Return all permutations of length k (default full length) of a collection.
pochhammerPochhammer(x: broadcastable<complex | infinity>, n: broadcastable<complex | infinity>) -> numberRising factorial (Pochhammer symbol) (x)_n = x(x+1)…(x+n-1).
powerSetPowerSet(set<any>) -> setReturn the power set of a set (set of all subsets).
subfactorialSubfactorial(broadcastable<integer>) -> integerCompute the number of derangements (subfactorial) of n items.

Number theory​

The Number theory reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
algebraicNumberNormAlgebraicNumberNorm(number) -> numberThe norm of a over ℚ in the field ℚ(a): (−1)ᵈ times its minimal polynomial’s constant term over its leading one.
algebraicNumberTraceAlgebraicNumberTrace(number) -> numberThe trace of a over ℚ in the field ℚ(a): minus its minimal polynomial’s second coefficient over its leading one.
bernoulliBBernoulliB(broadcastable<integer>) -> rationalReturn the nth Bernoulli number Bₙ as an exact rational, using the convention B₁ = -1/2.
carmichaelLambdaCarmichaelLambda(broadcastable<integer>) -> integerReturn the Carmichael function λ(n) (the reduced totient): the smallest positive integer m such that a^m ≡ 1 (mod n) for every a coprime to n.
catalanNumberCatalanNumber(broadcastable<real>) -> numberReturn the nth Catalan number C(n) = (2n)! / ((n+1)! · n!): 1, 1, 2, 5, 14, 42, … Defined for n ≥ 0.
chineseRemainderChineseRemainder(residues: collection<any>, moduli: collection<any>, lower: integer?) -> integerSolve a system of simultaneous congruences: return the smallest non-negative integer x such that x ≡ residues[i] (mod moduli[i]) for every i.
continuedFractionContinuedFraction(x: broadcastable<real>, count: broadcastable<integer>?) -> list<integer | list<integer>>Return the continued-fraction expansion of x as a list of integer terms [a0, a1, …].
digitCountDigitCount(n: broadcastable<integer>, base: broadcastable<integer>?, digit: broadcastable<integer>?, length: broadcastable<integer>?) -> integer | list<integer>Count digits of n in the given base (default 10); the sign of n is ignored.
digitSumDigitSum(n: broadcastable<integer>, base: broadcastable<integer>?, count: broadcastable<integer>?) -> integerReturn the sum of the digits of n in the given base (default 10).
dirichletCharacterDirichletCharacter(k: broadcastable<integer>, j: broadcastable<integer>, n: broadcastable<integer>) -> numberThe Dirichlet character χ_j(n) modulo k, the j-th of the φ(k) characters (Wolfram's indexing, j = 1 the principal character).
dirichletLDirichletL(k: broadcastable<integer>, j: broadcastable<integer>, s: broadcastable<number>) -> numberThe Dirichlet L-function L(s, χ) = Σ χ(n)/nˢ (n ≥ 1) of the character χ_j modulo k (dirichletCharacter(k, j, ·)): k^(−s) Σ_{r=1}^{k} χ(r) ζ(s, r/k).
dividesDivides(broadcastable<integer>, broadcastable<integer>) -> booleandivides(a, b) returns True if a divides b (i.e.
divisorSigmaDivisorSigma(k: broadcastable<integer>, n: broadcastable<integer>) -> rationalThe divisor function σ_k(n) = Σ_{d | n} dᵏ over the positive divisors of n. σ₀ counts divisors, σ₁ sums them.
divisorsDivisors(broadcastable<integer>) -> list<integer>Return the sorted list of positive divisors of an integer n.
eulerEEulerE(n: broadcastable<integer>, x: broadcastable<number>?) -> numberReturn the nth Euler number Eₙ (1, 0, -1, 0, 5, 0, -61, …) for eulerE(n), or the Euler polynomial Eₙ(x) for eulerE(n, x).
eulerPhiEulerPhi(broadcastable<integer>) -> integereulerPhi is an alias for totient, which is the preferred name.
eulerianEulerian(n: broadcastable<integer>, m: broadcastable<integer>) -> integerEulerian number A(n, m): number of permutations of {1..n} with exactly m ascents.
extendedGCDExtendedGCD(broadcastable<integer>, broadcastable<integer>, broadcastable<integer>*) -> tupleReturn the extended GCD of a and b as a tuple (g, x, y) where g = gcd(a, b) is non-negative and a·x + b·y = g (Bézout coefficients).
factorIntegerFactorInteger(broadcastable<rational>) -> list<tuple<integer, integer>>Return the prime factorization of an integer n as a list of [prime, exponent] tuples, ordered by ascending prime.
fromContinuedFractionFromContinuedFraction(collection<any>) -> numberReconstruct the value of a continued fraction given its list of integer terms [a0, a1, …].
fromDigitsFromDigits(digits: collection<any>, base: number?) -> numberReconstruct a number from its digits (most-significant first) in the given base (default 10).
integerDigitsIntegerDigits(n: broadcastable<integer>, base: broadcastable<integer>?, length: broadcastable<integer>?) -> list<integer>Return the digits of n in the given base (default 10), most-significant first.
integerSqrtIntegerSqrt(broadcastable<integer>) -> integerReturn the integer square root of n, i.e. the largest integer m such that m² ≤ n.
isAbundantIsAbundant(broadcastable<integer>) -> booleanTrue if n is an abundant number (sum of divisors > 2n).
isAlgebraicIntegerIsAlgebraicInteger(number) -> booleanWhether a is an algebraic integer: a root of a monic polynomial over ℤ.
isCenteredSquareIsCenteredSquare(broadcastable<integer>) -> booleanTrue if n is a centered square number, n = t² + (t + 1)² for an integer t ≥ 0: 1, 5, 13, 25, 41, ...
isHappyIsHappy(broadcastable<integer>) -> booleanTrue if n is a happy number, a number which eventually reaches 1 when the number is replaced by the sum of the square of each digit
isOctahedralIsOctahedral(broadcastable<integer>) -> booleanTrue if n is an octahedral number.
isPerfectIsPerfect(broadcastable<integer>) -> booleanReturns "True" if n is a perfect number, a positive integer which equals the sum of all its divisors.
isPerfectPowerIsPerfectPower(broadcastable<integer>) -> booleanReturn "True" if n is a perfect power a^b for integers a and b ≥ 2 (a negative n requires an odd exponent).
isSquareIsSquare(broadcastable<integer>) -> booleanTrue if n is a perfect square.
isSquareFreeIsSquareFree(broadcastable<rational>) -> booleanReturn "True" if n is square-free (not divisible by any perfect square > 1).
isTriangularIsTriangular(broadcastable<integer>) -> booleanTrue if n is a triangular number.
jacobiSymbolJacobiSymbol(a: broadcastable<integer>, n: broadcastable<integer>) -> integerThe Jacobi symbol (a/n) for an odd n > 0.
legendreSymbolLegendreSymbol(a: broadcastable<integer>, p: broadcastable<integer>) -> integerThe Legendre symbol (a/p) for an odd prime p.
lucasLucas(broadcastable<integer>) -> integerlucas is an alias for lucasL, which is the preferred name.
lucasLLucasL(broadcastable<integer>) -> integerReturn the nth Lucas number: lucasL(0) is 2, lucasL(1) is 1, and LucasL(n) = LucasL(n-1) + LucasL(n-2).
minimalPolynomialMinimalPolynomial(a: number, variable: any) -> expressionThe minimal polynomial of the algebraic number a in x: primitive over ℤ, positive leading coefficient.
modularInverseModularInverse(a: broadcastable<integer>, modulus: broadcastable<integer>) -> integerReturn the modular multiplicative inverse of a modulo m: the integer x with a·x ≡ 1 (mod m).
moebiusMuMoebiusMu(broadcastable<integer>) -> integerReturn the Möbius function μ(n): 0 if n is divisible by a perfect square > 1, otherwise (-1) raised to the number of distinct prime factors.
multiplicativeOrderMultiplicativeOrder(a: integer, modulus: integer, residues: list<integer>?) -> integerThe multiplicative order of a modulo n: the smallest k > 0 such that a^k ≡ 1 (mod n).
nPartitionNPartition(broadcastable<integer>) -> integerNumber of integer partitions of n, for n ≥ 0; it is 0 for n < 0.
nextPrimeNextPrime(n: broadcastable<real>, k: broadcastable<integer>?) -> integerReturn the smallest prime greater than n.
notDividesNotDivides(broadcastable<integer>, broadcastable<integer>) -> booleannotDivides(a, b) returns True if a does not divide b, corresponding to the notation a ∤ b.
nthPrimeNthPrime(broadcastable<integer>) -> integerReturn the nth prime number (1-based): nthPrime(1) is 2, nthPrime(2) is 3, …
numberFieldDiscriminantNumberFieldDiscriminant(number) -> integerThe discriminant of the field ℚ(a): of its ring of integers.
numberFieldIntegralBasisNumberFieldIntegralBasis(number) -> list<number>A ℤ-basis of the ring of integers of ℚ(a), written on the powers of the generator read (the radical or root a is written in), as Wolfram writes it.
numberFieldSignatureNumberFieldSignature(number) -> list<integer>The signature (r₁, r₂) of ℚ(a): its real embeddings and its pairs of complex ones.
partitionsPPartitionsP(broadcastable<integer>) -> integerpartitionsP is an alias for nPartition, which is the preferred name.
partitionsQPartitionsQ(broadcastable<integer>) -> integerNumber of partitions of n into distinct parts (equivalently, into odd parts), q(n); it is 0 for n < 0.
polynomialRootPolynomialRoot(polynomial: any, variable: any, index: integer?) -> numberThe root of the polynomial p in the variable x (bound, as in Wolfram's Root[Function[x, p], k]).
powerModPowerMod(base: list<rational> | rational, exponent: list<rational> | rational, modulus: integer | list<integer>) -> integer | list<integer>Return a^b mod m (modular exponentiation).
powerModListPowerModList(base: list<rational> | rational, exponent: list<rational> | rational, modulus: integer | list<integer>) -> list<integer> | list<list<integer>>Return the sorted list of every x in [0, m) with x^r ≡ a^s (mod m), for the exponent s/r.
primeFactorsPrimeFactors(broadcastable<integer>) -> list<integer>Return the sorted list of distinct prime factors of an integer n.
primeNuPrimeNu(broadcastable<integer>) -> integerReturn ω(n), the number of distinct prime factors of n.
primeNumberPrimeNumber(broadcastable<integer>) -> integerThe nth prime number.
primeOmegaPrimeOmega(broadcastable<integer>) -> integerReturn Ω(n), the number of prime factors of n counted with multiplicity.
primePiPrimePi(broadcastable<real>) -> integerReturn π(n), the prime-counting function: the number of primes less than or equal to n.
primitiveRootPrimitiveRoot(broadcastable<integer>) -> integerThe smallest primitive root modulo n (a generator of the multiplicative group of integers mod n), or undefined if none exists (which happens unless n is 1, 2, 4, pᵏ, or 2pᵏ for an odd prime p).
primitiveRootListPrimitiveRootList(broadcastable<integer>) -> list<integer>The sorted list of all primitive roots modulo n: the generators of the multiplicative group of integers mod n.
radicalRadical(broadcastable<integer>) -> integerReturn the radical of n (its square-free kernel): the product of its distinct prime factors.
randomPrimeRandomPrime(integer, integer?) random -> integerReturn a random prime.
rationalReconstructionRationalReconstruction(a: broadcastable<integer>, modulus: broadcastable<integer>) -> rationalThe rational p/q with p ≡ a·q (mod m) and |p|, q ≤ ⌊√((m − 1)/2)⌋, the unique such fraction in lowest terms when it exists (Wang's algorithm).
sigma0Sigma0(broadcastable<integer>) -> integerNumber of positive divisors of n.
sigma1Sigma1(broadcastable<integer>) -> integerSum of positive divisors of n.
sigmaMinus1SigmaMinus1(broadcastable<integer>) -> rationalSum of reciprocals of positive divisors of n.
stirlingStirling(n: broadcastable<integer>, m: broadcastable<integer>) -> integerStirling number of the second kind S(n, m): ways to partition n elements into m non-empty subsets.
stirlingS1StirlingS1(n: broadcastable<integer>, m: broadcastable<integer>) -> integerSigned Stirling number of the first kind s(n, m): the coefficient of x^m in the falling factorial x(x−1)…(x−n+1).
stirlingS2StirlingS2(n: broadcastable<integer>, m: broadcastable<integer>) -> integerstirlingS2 is an alias for stirling, which is the preferred name.
totientTotient(broadcastable<integer>) -> integerEuler's totient function φ(n): count of positive integers ≤ n that are coprime to n, for n ≥ 1; φ(0) = 0 and φ(−n) = φ(n).

Special functions​

The Special functions reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
agmAGM(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberArithmetic-geometric mean.
appellF1AppellF1(a: broadcastable<complex | infinity>, b1: broadcastable<complex | infinity>, b2: broadcastable<complex | infinity>, c: broadcastable<complex | infinity>, x: broadcastable<complex | infinity>, y: broadcastable<complex | infinity>) -> numberAppell hypergeometric function F₁(a; b₁, b₂; c; x, y), double series for |x|, |y| < 1.
barnesGBarnesG(broadcastable<complex | infinity>) -> numberThe Barnes G-function, the double gamma function G(z+1) = Γ(z)·G(z), G(1) = 1.
chebyshevTChebyshevT(degree: broadcastable<real>, x: broadcastable<complex>) -> numberChebyshev polynomial of the first kind Tₙ(x), with Tₙ(cos θ) = cos(nθ).
chebyshevUChebyshevU(degree: broadcastable<real>, x: broadcastable<complex>) -> numberChebyshev polynomial of the second kind Uₙ(x), with Uₙ(cos θ) = sin((n+1)θ)/sin θ.
clausenClClausenCl(n: broadcastable<integer>, theta: broadcastable<real>) -> numberClausen function Clₙ(θ) of integer order n ≥ 1 and real θ: Im Liₙ(e^{iθ}) = Σ sin(kθ)/kⁿ for even n, Re Liₙ(e^{iθ}) = Σ cos(kθ)/kⁿ for odd n.
dedekindEtaDedekindEta(broadcastable<complex | infinity>) -> numberDedekind eta function η(τ), Im(τ) > 0.
eisensteinEEisensteinE(s: broadcastable<number>, tau: broadcastable<complex | infinity>) -> numberNormalized Eisenstein series Eₛ(τ) of even weight s ≥ 2, Im(τ) > 0.
ellipticEEllipticE(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberElliptic integral of the second kind: complete E(m) with one argument, incomplete E(φ|m) with two (amplitude first, parameter convention m = k², as in Mathematica).
ellipticFEllipticF(phi: broadcastable<complex | infinity>, m: broadcastable<complex | infinity>) -> numberIncomplete elliptic integral of the first kind F(φ|m) (amplitude first, parameter convention m = k², as in Mathematica).
ellipticKEllipticK(broadcastable<complex | infinity>) -> numberComplete elliptic integral of the first kind K(m), parameter convention m = k².
ellipticPiEllipticPi(broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberElliptic integral of the third kind: complete Π(n|m) with two arguments, incomplete Π(n; φ|m) with three (characteristic first, amplitude second, parameter convention m = k², as in Mathematica).
expIntegralEiExpIntegralEi(broadcastable<complex | infinity>) -> numberExponential integral Ei(x) = PV ∫_{−∞}^x eᵗ/t dt.
hermiteHHermiteH(degree: broadcastable<real>, x: broadcastable<complex>) -> numberHermite polynomial Hₙ(x) of the physicists' convention, with H₀ = 1, H₁ = 2x and Hₙ₊₁ = 2x Hₙ − 2n Hₙ₋₁.
hypergeometric1F1Hypergeometric1F1(a: broadcastable<complex | infinity>, b: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> numberKummer confluent hypergeometric function ₁F₁(a; b; z) = M(a, b, z).
hypergeometric2F1Hypergeometric2F1(a: broadcastable<complex | infinity>, b: broadcastable<complex | infinity>, c: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> numberGauss hypergeometric function ₂F₁(a, b; c; z).
jacobiThetaJacobiTheta(j: broadcastable<number>, z: broadcastable<complex | infinity>, tau: broadcastable<complex | infinity>, r: broadcastable<number>?) -> numberJacobi theta function θⱼ(z, τ), j ∈ {1,2,3,4}, nome q = e^{iπτ} (Fungrim convention).
laguerreLLaguerreL(degree: broadcastable<real>, broadcastable<complex>, broadcastable<complex>?) -> numberLaguerre polynomial Lₙ(x) = Σₖ (−1)ᵏ C(n, k) xᵏ/k!; with three arguments, the generalized Laguerre polynomial Lₙ⁽ᵃ⁾(x) = Σₖ (−1)ᵏ C(n+a, n−k) xᵏ/k!, with LaguerreL(n, 0, x) = LaguerreL(n, x).
legendrePLegendreP(degree: broadcastable<real>, x: broadcastable<complex>) -> numberLegendre polynomial Pₙ(x), with P₀ = 1, P₁ = x and (n+1)Pₙ₊₁ = (2n+1)x Pₙ − n Pₙ₋₁.
logBarnesGLogBarnesG(broadcastable<complex | infinity>) -> numberThe logarithm of the Barnes G-function, continued analytically with logGamma: its imaginary part is not principal on the negative axis. −∞ at the zeros of G, the non-positive integers.
logGammaLogGamma(broadcastable<complex | infinity>) -> numberThe analytic continuation of ln Γ(z), with its branch cut on (−∞, 0]; not gammaLn, the principal logarithm of Γ(z), which jumps by 2πi across the zeros of Im Γ.
logIntegralLogIntegral(broadcastable<complex | infinity>) -> numberLogarithmic integral li(x) = PV ∫₀ˣ dt/ln t = Ei(ln x).
polyLogPolyLog(s: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> numberPolylogarithm Liₛ(z) = Σ_{k≥1} zᵏ/kˢ, at any real or complex order s.
stieltjesGammaStieltjesGamma(n: broadcastable<integer>, a: broadcastable<number>?) -> numberGeneralized Stieltjes constants γₙ(a), the Laurent coefficients of ζ(s, a) at s = 1: ζ(s, a) = 1/(s−1) + Σₙ (−1)ⁿ γₙ(a)(s−1)ⁿ/n!.

Linear algebra​

The Linear algebra reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
adjugateMatrixAdjugateMatrix(matrix) -> matrixAdjugate (classical adjoint) of a square matrix.
characteristicPolynomialCharacteristicPolynomial(matrix, variable: any?) -> expressionCharacteristic polynomial det(x·I − A) of a square matrix (monic).
choleskyDecompositionCholeskyDecomposition(matrix) -> matrixCholesky decomposition of a positive-definite matrix.
conjugateTransposeConjugateTranspose(value, axis1: integer?, axis2: integer?) -> valueConjugate transpose (Hermitian adjoint) of a matrix or tensor.
crossCross(tuple | vector, tuple | vector) -> tuple | vectorCross product of two 3-vectors.
degreeDegree(value) -> integerDegree of an object
detDet(matrix) -> numberdet is an alias for determinant, which is the preferred name.
determinantDeterminant(matrix) -> numberDeterminant of a square matrix.
diagonalDiagonal(value) -> valueExtract a matrix diagonal or build a diagonal matrix.
dimensionDimension(value) -> integerReturn the dimension of a vector space: the number of elements of a vector, matrix or tensor, the product of the dimensions of the two objects of a hom, or the number of basis vectors of a kernel written as the argument.
dotDot(list<tuple> | matrix | tuple | vector, list<tuple> | matrix | tuple | vector) -> valueDot product (vector inner product) or matrix product.
eigenEigen(matrix) -> tupleEigenvalue-eigenvector decomposition of a square matrix.
eigenvaluesEigenvalues(matrix) -> listEigenvalues of a square matrix.
eigenvectorsEigenvectors(matrix) -> listEigenvectors of a square matrix.
fillFill(value: any, integer+) -> listList or tensor with each element equal to a value.
flattenFlatten(value, depth: (+oo | integer)?) -> listFlatten a tensor or collection into a list.
hadamardProductHadamardProduct(matrix | vector, matrix | vector) -> matrix | vectorHadamard (element-wise) product of two vectors or matrices of the same shape.
homHom(value*) -> valueHom-set of morphisms between objects
identityMatrixIdentityMatrix(integer) -> matrixn-by-n identity matrix.
inverseInverse(matrix) -> matrixMultiplicative inverse of a square matrix.
isDiagonalIsDiagonal(value) -> booleanWhether the matrix is diagonal (all off-diagonal entries are zero).
isSquareMatrixIsSquareMatrix(value) -> booleanWhether the value is a square matrix.
isSymmetricIsSymmetric(value) -> booleanWhether the matrix is symmetric (A equals its transpose).
kernelKernel(value) -> listReturn a basis of the kernel (null space) of a matrix, as a list of vectors; the list is empty when the columns are independent.
luDecompositionLUDecomposition(matrix) -> tupleReturn the LU decomposition of a square matrix A: the tuple (P, L, U) with P·A = L·U, where P is a permutation matrix, L is lower triangular with ones on its diagonal and U is upper triangular.
linearSolveLinearSolve(matrix, matrix | vector) -> valueReturn the solution x of the linear system A·x = b, of the shape of b.
matrixMatrix(matrix, delimiters: string?, format: string?) -> matrixReturn the matrix whose rows are the elements of a list of lists.
matrixMultiplyMatrixMultiply(matrix | vector, matrix | vector) -> matrix | number | vectorReturn the matrix product of two matrices, of a matrix and a vector, or of two vectors (their inner product).
matrixPowerMatrixPower(matrix, real) -> matrixSquare matrix raised to a power.
matrixRankMatrixRank(value) -> integerRank of a matrix (number of linearly independent rows/columns).
normNorm(list<tuple> | number | tensor | tuple, (+oo | real | string)?) -> +oo | nan | realReturn the norm of a vector, a matrix or a point, or the absolute value of a number.
onesOnes(integer+) -> listReturn a list, or a tensor of any rank, whose every element is 1.
onesMatrixOnesMatrix(rows: integer, columns: integer?) -> matrixReturn a matrix of the given size whose every element is 1.
pseudoInversePseudoInverse(matrix) -> matrixReturn the Moore-Penrose pseudoinverse of a matrix: an n×m matrix for an m×n matrix.
qrDecompositionQRDecomposition(matrix) -> tupleReturn the QR decomposition of an m×n matrix A: the tuple (Q, R) with A = Q·R, where Q is an m×m orthogonal matrix and R is an m×n upper triangular matrix.
rankRank(value) -> integerThe length of the shape of the expression.
reshapeReshape(value, tuple) -> valueReturn the elements of a tensor or collection, in row-major order, arranged in a target shape.
rowReduceRowReduce(matrix) -> matrixReturn the reduced row echelon form (RREF) of a matrix.
svdSVD(matrix) -> tupleReturn the singular value decomposition of an m×n matrix A, computed in machine precision: the tuple (U, S, V) with A = U·S·Vᵀ, where U and V are orthogonal and S is diagonal.
shapeShape(value) -> tupleReturn the shape tuple of an expression.
singularValuesSingularValues(matrix) -> listThe singular values of a matrix, sorted in descending order (including any zero values).
traceTrace(number | tensor, axis1: integer?, axis2: integer?) -> number | tensorReturn the sum of the diagonal elements of a square matrix, or the tensor of the traces over two axes of a tensor.
transposeTranspose(value, axis1: integer?, axis2: integer?) -> valueTranspose a matrix or swap two tensor axes.
vectorVector(any+) -> vectorReturn the column vector of the arguments: an n×1 matrix with one argument in each row.
zeroMatrixZeroMatrix(rows: integer, columns: integer?) -> matrixReturn a matrix of the given size whose every element is 0.
zerosZeros(integer+) -> listReturn a list, or a tensor of any rank, whose every element is 0.

Statistics​

The Statistics reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
betaDistributionBetaDistribution(real<0<..>, real<0<..>) -> expression<BetaDistribution>Beta distribution with shape parameters α and β, on the interval [0, 1].
betaRegularizedBetaRegularized(broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberRegularized incomplete beta function I_x(a, b); with four arguments, I_z1(a, b) − I_z0(a, b)
binCountsBinCounts(xs: collection<number>, bins: list<number> | number) -> list<number>Count the number of elements falling into each bin.
binomialDistributionBinomialDistribution(n: integer<0..>, p: real<0..1>) -> expression<BinomialDistribution>Binomial distribution: number of successes in n independent trials, each with success probability p.
cdfCDF(distribution, real | signed_infinity) -> nan | real<0..1>Cumulative distribution function P(X ≤ x) of a distribution.
chiSquareDistributionChiSquareDistribution(real<0<..>) -> expression<ChiSquareDistribution>Chi-square distribution with k degrees of freedom (k > 0, not necessarily an integer).
correlationCorrelation(xs: collection<number | tuple>, ys: collection<number>?) -> nan | real<-1..1>Pearson's correlation coefficient of paired data, given as two equal-length collections or one collection of (x, y) pairs.
covarianceCovariance(xs: collection<number | tuple>, ys: collection<number>?) -> nan | realSample covariance (n − 1 denominator) of paired data, given as two equal-length collections or one collection of (x, y) pairs.
erfErf(broadcastable<complex | signed_infinity>, broadcastable<complex | signed_infinity>?) -> complexGauss error function; with two arguments, Erf(z1) − Erf(z0)
erfInvErfInv(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberInverse of the error function; with two arguments, the x with Erf(z0, x) = z, that is ErfInv(z + Erf(z0))
erfcErfc(broadcastable<complex | signed_infinity>) -> complexComplementary error function: 1 - Erf(x)
erfiErfi(broadcastable<complex | signed_infinity>) -> complex | signed_infinityImaginary error function: -i·Erf(i·x)
exponentialDistributionExponentialDistribution(real<0<..>) -> expression<ExponentialDistribution>Exponential distribution with rate parameter λ.
fRatioDistributionFRatioDistribution(real<0<..>, real<0<..>) -> expression<FRatioDistribution>Snedecor's F distribution with d₁ degrees of freedom in the numerator and d₂ in the denominator.
findFitFindFit(data: any, model: any, params: any, vars: any, options: dictionary?) -> dictionaryNonlinear least-squares fit of a model to data.
gammaDistributionGammaDistribution(shape: real<0<..>, scale: real<0<..>) -> expression<GammaDistribution>Gamma distribution with shape α and scale θ: the density is x^(α−1)·e^(−x/θ)/(Γ(α)·θ^α) for x > 0.
gammaRegularizedGammaRegularized(broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> numberRegularized upper incomplete gamma function Q(a, z) = Γ(a, z)/Γ(a); with three arguments, Q(a, z0) − Q(a, z1)
geometricDistributionGeometricDistribution(real<0..1>) -> expression<GeometricDistribution>Geometric distribution: the number of failures before the first success, each trial a success with probability p (0 < p ≤ 1).
histogramHistogram(xs: collection<number>, bins: list<number> | number) -> list<tuple<number, integer>>Compute a histogram of the values in a collection.
hypergeometricDistributionHypergeometricDistribution(draws: integer<0..>, successes: integer<0..>, population: integer<0..>) -> expression<HypergeometricDistribution>Hypergeometric distribution: the number of successes in n draws without replacement from a population of N items of which K are successes (0 ≤ n ≤ N, 0 ≤ K ≤ N).
interquartileRangeInterquartileRange((collection<number> | number)+) -> +oo | nan | real<0..>Interquartile range (Q3 - Q1) of a collection.
kurtosisKurtosis((collection<number> | number)+) -> nan | realKurtosis of a collection of numbers.
linearRegressionLinearRegression(any+) -> tuple<number, number>Least-squares linear fit b0 + b1·x.
meanMean((collection<number> | distribution | number)+) -> numberArithmetic mean (average) of a collection of numbers.
medianMedian((collection<number> | number)+) -> nan | real | signed_infinityMedian of a collection of numbers.
modeMode((collection<number> | number)+) -> nan | real | signed_infinityMost frequently occurring value in a collection.
negativeBinomialDistributionNegativeBinomialDistribution(n: integer<1..>, p: real<0..1>) -> expression<NegativeBinomialDistribution>Negative binomial distribution: the number of failures before the n-th success (n a positive integer), each trial a success with probability p (0 < p ≤ 1).
normalDistributionNormalDistribution(mu: real, sigma: real<0<..>) -> expression<NormalDistribution>Normal (Gaussian) distribution with mean μ and standard deviation σ.
pdfPDF(distribution, real | signed_infinity) -> nan | real<0..>Probability density (continuous) or mass (discrete) function of a distribution, evaluated at x.
poissonDistributionPoissonDistribution(real<0<..>) -> expression<PoissonDistribution>Poisson distribution with rate parameter λ.
polynomialFitPolynomialFit(any+) -> list<number>Least-squares polynomial fit of the given degree.
populationCovariancePopulationCovariance(xs: collection<number | tuple>, ys: collection<number>?) -> nan | realPopulation covariance (n denominator) of paired data, given as two equal-length collections or one collection of (x, y) pairs.
populationStandardDeviationPopulationStandardDeviation((collection<number> | number)+) -> nan | real<0..>Population Standard Deviation of a collection of numbers.
populationVariancePopulationVariance((collection<number> | number)+) -> nan | real<0..>Population variance of a collection of numbers.
quantileQuantile(collection<any> | distribution, real<0..1>) -> nan | real | signed_infinityQuantile (inverse CDF): the least x with CDF(x) ≥ p, for p in [0, 1].
quartilesQuartiles((collection<number> | number)+) -> tuple<lower: nan | real | signed_infinity, mid: nan | real | signed_infinity, upper: nan | real | signed_infinity>Lower quartile, median, and upper quartile of a collection.
randomSampleRandomSample((xs: T, count: number) random -> T where T: string) & ((xs: indexed_collection, count: number) random -> list)RandomSample(xs, count): a list of count elements drawn from the indexed collection xs, without replacement. "Without replacement" is over POSITIONS, not values: on a multiset, repeats are expected — RandomSample([1, 1, 2], 2) can return…
skewnessSkewness((collection<number> | number)+) -> nan | realSkewness of a collection of numbers.
slidingWindowSlidingWindow((xs: S, count: integer, step: integer?) -> list<string> where S: string) & ((xs: collection, count: integer, step: integer?) -> list<list>)Return overlapping sliding windows of fixed size over the collection.
standardDeviationStandardDeviation((collection<number> | distribution | number)+) -> nan | real<0..>Sample Standard Deviation of a collection of numbers.
studentTDistributionStudentTDistribution(real<0<..>) -> expression<StudentTDistribution>Student's t distribution with ν degrees of freedom (ν > 0, not necessarily an integer).
uniformDistributionUniformDistribution(lower: real, upper: real) -> expression<UniformDistribution>Continuous uniform distribution on the interval [a, b].
varianceVariance((collection<number> | distribution | number)+) -> nan | real<0..>Sample variance of a collection of numbers.

Units​

The Units reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
isCompatibleUnitIsCompatibleUnit(value, value) -> valueCheck if two units have the same dimension and convert into each other (dB and Np do, dB and percent do not)
quantityQuantity(magnitude: value, unit: value) -> quantityA value paired with a physical unit
quantityMagnitudeQuantityMagnitude(value) -> valueExtract the numeric value from a quantity
quantityUnitQuantityUnit(value) -> valueExtract the unit from a quantity
unitConvertUnitConvert(quantity: value, unit: value) -> valueConvert a quantity to a different compatible unit
unitDimensionUnitDimension(value) -> valueReturn the dimension vector of a unit
unitSimplifyUnitSimplify(value) -> valueSimplify a quantity unit to a named derived unit if possible

Physics​

The Physics reference has the full description and the examples of each definition.

EpsilMathJSONSignatureSummary
avogadroConstantAvogadroConstantconstant quantity = 6.02214076e+23 mol^-1Avogadro constant
boltzmannConstantBoltzmannConstantconstant quantity = 1.380649e-23 J/KBoltzmann constant
elementaryChargeElementaryChargeconstant quantity = 1.602176634e-19 CElementary electric charge
gasConstantGasConstantconstant quantity = 8.314462618 J/(K⋅mol)Molar gas constant
gravitationalConstantGravitationalConstantconstant quantity = 6.6743e-11 m^3/(kg⋅s^2)Newtonian constant of gravitation
mu0Mu0constant quantity = 0.00000125663706212 N/A^2Vacuum permeability
planckConstantPlanckConstantconstant quantity = 6.62607015e-34 J⋅sPlanck constant
speedOfLightSpeedOfLightconstant quantity = 299792458 m/sSpeed of light in vacuum
standardGravityStandardGravityconstant quantity = 9.80665 m/s^2Standard acceleration due to gravity
stefanBoltzmannConstantStefanBoltzmannConstantconstant quantity = 5.670374419e-8 W/(K^4⋅m^2)Stefan-Boltzmann constant
vacuumPermittivityVacuumPermittivityconstant quantity = 8.8541878128e-12 F/mVacuum permittivity (electric constant)