Skip to main content

Epsil Standard Library

The 705 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).
arcArc(any+) -> numberArc / wide-hat accent measure (\widehat{ABC}) — opaque typed head; not evaluated.
—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(T, (number | string)?) -> T where T: numberBaseForm(expr, base=10)
—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, symbol*) -> anyReturn the canonical form of an expression
caseFoldCaseFold(string) -> stringCaseFold(s): a case-folded form of s, for case-insensitive comparison — CaseFold(a) == CaseFold(b) tests equality ignoring case.
characterFromCharacterFrom(string) -> characterCharacterFrom(s): the character s denotes.
charactersCharacters(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, Undefined or NaN), evaluated left-to-right.
—Colon(any, any) -> expressionType annotation (a : b) — opaque typed head.
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>?) 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(string, (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(function, lower: expression, upper: expression) -> unknownEvaluate a function at one point or between two bounds.
findRootFindRoot(any, any) -> dictionaryFindRoot(equations, params): numerically find parameter values that
—Function(expression, (function | symbol)*) -> functionA function literal
geometricVectorGeometricVector(any, any) -> expressionGeometric vector (directed segment between two points) — opaque typed head.
graphemeClustersGraphemeClusters(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
—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(integer, integer?) -> stringIntegerString(n, base=10) 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 if the value is ABSENT — the Missing or Undefined symbol, or a NaN number (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.
—N(any, (integer | list<number>)?) -> unknownN(expr): numerically evaluate an expression
—NamedArgument(string, any) -> nothingNamedArgument(name, value): one named argument of a call (Epsil
nothingNothingvariable nothingThe absence of a value; the sole member of the unit type.
numberFromNumberFrom(string, base: (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'"].
—OverParen(any+) -> expressionOver-paren accent (\overparen{BC}) — opaque typed head; not evaluated.
padEndPadEnd(string, n: integer, pad: 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(string, n: integer, pad: 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) -> 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).
polygonPolygon(any+) -> expressionPolygon primitive — opaque typed head.
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.
—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, number) random -> T where T: string) & ((collection<any> | set<real>, 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,
—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.
segmentSegment(any+) -> expressionSegment primitive — opaque typed head.
—SequencefunctionOrdered sequence of expressions.
—Signature(symbol) -> nothing | stringReturn the signature string of an operator.
simplifySimplify(any, any?) -> expressionSimplify(expr): simplify an expression.
solveSolve(any, any*) -> listSolve(equation, unknown): the list of solutions of an equation for the
sphereSphere(any+) -> expressionSphere primitive — opaque typed head.
—Spread(any) -> unknownSpread(t): splice the elements of the tuple t into the enclosing
—String(any*) -> stringA string created by joining its arguments.
stringCompareStringCompare(string, 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: string?) -> stringStringJoin(xs): join the elements of the finite collection xs (strings or characters) into a string.
stringRepeatStringRepeat(string, n: integer) -> stringStringRepeat(s, n): n copies of the string s, concatenated.
stringReplaceStringReplace((string, string, string, count: integer?) -> string) & ((string, regexp, string, count: integer?) -> string) & ((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((string, string?) -> list<string>) & ((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(string) -> stringToLowerCase(s): the string s mapped to lower case using the Unicode default (locale-independent) mappings.
toUpperCaseToUpperCase(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(string, chars: (character | collection<character | string> | string)?) -> stringTrim(s): remove leading and trailing whitespace (the Unicode White_Space characters).
trimEndTrimEnd(string, chars: (character | collection<character | string> | string)?) -> stringTrimEnd(s): remove trailing whitespace (the Unicode White_Space characters).
trimStartTrimStart(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(3) is TypeFrom("integer").
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(string) -> list<integer>A collection of Unicode scalars from a string, same as UTF-32
utf16Utf16(string) -> list<integer>A collection of UTF-16 code units from a string.
utf8Utf8(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(real | string, any) -> expressionWithRandomSeed(seed, body): evaluate body with a random seed frame

Control structures​

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

EpsilMathJSONSignatureSummary
—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(any) -> unknownIterate a function until a fixed point is reached.
—If(expression, expression, expression?) -> anyConditional branch: evaluate one of two expressions.
—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).
—Pin(expression) -> nothingInside a Match pattern, Pin(expr) matches the value of expr (evaluated at match time) rather than its structure.
whenWhen(expression, boolean) -> anyConditional/restriction value.
—Which(expression+) -> unknownReturn the value for the first condition that is true.

Logic​

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

EpsilMathJSONSignatureSummary
—And(boolean+) -> booleanLogical conjunction (AND): true when all operands are true.
booleBoole(boolean) -> integerReturn 1 if the argument is true, 0 otherwise.
equivalentEquivalent(boolean, 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(boolean, boolean) -> booleanLogical implication: false only when the antecedent is true and the consequent is false.
isSatisfiableIsSatisfiable(boolean) -> booleanCheck satisfiability using brute-force enumeration.
isTautologyIsTautology(boolean) -> booleanCheck if expression is a tautology using brute-force enumeration.
kroneckerDeltaKroneckerDelta(value+) -> integerReturn 1 if the arguments are equal, 0 otherwise.
minimalCNFMinimalCNF(boolean) -> booleanConvert to minimal CNF using Quine-McCluskey.
minimalDNFMinimalDNF(boolean) -> booleanConvert to minimal DNF using Quine-McCluskey.
nandNand(boolean+) -> booleanLogical NAND: the negation of AND (n-ary).
norNor(boolean+) -> booleanLogical NOR: the negation of OR (n-ary).
—Not(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(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) -> listFind all prime implicants using Quine-McCluskey.
primeImplicatesPrimeImplicates(boolean) -> listFind all prime implicates using Quine-McCluskey.
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) -> listGenerate truth table for expression.
xorXor(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(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(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>, (missing | value)+) -> collectionAdd one or more elements to the end of a collection.
argMaxArgMax(indexed_collection<T>, key: ((T) any -> unknown)?) -> integer where TReturn the 1-based index of the element that maximizes the given key function (or the element itself when no key is given).
argMinArgMin(indexed_collection<T>, key: ((T) any -> unknown)?) -> integer where TReturn the 1-based index of the element that minimizes the given key function (or the element itself when no key is given).
—At(value: any, index: (boolean | indexed_collection<any> | number | string)+) -> unknownAccess an element of an indexed collection.
chunkChunk((S, integer) -> list<string> where S: string) & ((collection, integer) -> list<list>)Split the collection into k nearly equal-sized groups.
chunkByChunkBy((S, key: (character) any -> unknown) -> list<string> where S: string) & ((collection<T>, key: (T) any -> unknown) -> list<list<T>> where T)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(collection<any>, element: any) -> booleanReturn True if the collection contains the given element (structural identity, like ===), False otherwise.
containsSequenceContainsSequence(indexed_collection<T>, indexed_collection<T>) -> boolean where TReturn True when needle occurs as a contiguous subsequence of the indexed collection.
countCount(collection<any>, any?) -> infinity | integerCount(xs): the number of elements in the collection.
countIfCountIf(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((T, integer) -> T where T: string) & ((indexed_collection<T>, integer) -> list<T> where T)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(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)Return the indexed collection without its first n elements.
dropWhileDropWhile(collection<T>, predicate: (T) any -> boolean) -> 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(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) -> unknownAccess a named field of a value: p.x in Epsil.
fillFill(function, tuple) -> listProduce a 2D list (matrix) by applying a function to each pair of row and column indexes.
filterFilter(collection<T>, predicate: (T) any -> boolean) -> collection where TReturn the elements of the collection for which the predicate function returns True.
findFind(collection<T>, predicate: (T) any -> boolean) -> any where TReturn the first element of the collection satisfying the predicate, or Nothing if none found.
firstFirst(xs: indexed_collection<any>) -> anyThe first element of a collection.
flatMapFlatMap(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, 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(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(indexed_collection<any>, any) -> integerReturn the 1-based index of the first occurrence of value in collection, or 0 if not found.
indexWhereIndexWhere(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(indexed_collection<T>, integer, T) -> list<T> where TReturn a copy of the indexed collection with value 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(number, number) -> set<real>A set of real numbers between two endpoints.
isEmptyIsEmpty(collection<any>) -> booleanReturn True if the collection is empty, False otherwise.
iterateIterate(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>) -> 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(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(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)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(indexed_collection<T>, order: (((T) any -> unknown) | ((any, any) any -> boolean | number))?) -> list<integer> where TReturn the indexes that would sort the collection.
—Pair(first: T, second: U) -> tuple<T, U> where T, UA tuple of two elements
partitionPartition(collection<T>, ((T) any -> boolean) | integer, integer?) -> list<list<T>> where TPartition a collection into consecutive chunks each of size n; the trailing chunk may be shorter when n 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(collection<T>, predicate: (T) any -> boolean) -> list<integer> where TReturn 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)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(indexed_collection<T>, indexed_collection<T>, from: integer?) -> nothing | range where TReturn the 1-based inclusive index span of the first occurrence of needle as a contiguous subsequence of the indexed collection, or Nothing 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(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(indexed_collection<T>, integer, T) -> list<T> where TReturn a copy of the indexed collection with the element at the 1-based index replaced by value.
residueClassResidueClass(any, any) -> valueAn element of ℤ/nℤ: the class of the integer k modulo n.
restRest((T) -> T where T: string) & ((indexed_collection<T>) -> list<T> where T)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)Reverse the order of the elements of an indexed collection.
rotateLeftRotateLeft((T, integer?) -> T where T: string) & ((T, integer?) -> T where T: list) & ((indexed_collection<T>, integer?) -> list<T> where T)Rotate the elements of the collection to the left by n positions.
rotateRightRotateRight((T, integer?) -> T where T: string) & ((T, integer?) -> T where T: list) & ((indexed_collection<T>, integer?) -> list<T> where T)Rotate the elements of the collection to the right by n positions.
scanScan(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.
—Set(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, span: nothing | range) -> T | nothing where T: string) & ((value: T, start: number, end: number) -> T where T: string) & ((value: indexed_collection<T>, span: range) -> list<T> where T) & ((value: indexed_collection<T>, span: nothing | range) -> list<T> | nothing where T) & ((value: indexed_collection<T>, start: number, end: number) -> list<T> where T)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)Return the elements of the collection sorted according to the given comparison function.
startsWithStartsWith(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.
symmetricDifferenceSymmetricDifference(set<any>, set<any>) -> setReturn the symmetric difference of two sets (elements in either set but not both).
tableTable(function, integer, integer?) -> collectionAn alias for Tabulate (the preferred name) that additionally accepts
tabulateTabulate(generator: function, integer, 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)Return the first n elements of an indexed collection.
takeWhileTakeWhile(collection<T>, predicate: (T) any -> boolean) -> 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((T) -> T where T: string) & ((collection<T>) -> list<T> where T)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(color | string | tuple) -> colorConvert any color to HSL (hue degrees, s/l 0-1)
asHsvAsHsv(color | string | tuple) -> colorConvert any color to HSV (hue degrees, s/v 0-1)
asOklabAsOklab(color | string | tuple) -> colorConvert any color to OKLab
asOklchAsOklch(color | string | tuple) -> colorConvert any color to OKLCh
asRgbAsRgb(color | string | tuple) -> colorConvert any color to sRGB (channels 0-1)
colorColor(string) -> colorParse a CSS-style color string to an Oklch color
colorContrastColorContrast(color | string | tuple, 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(color | tuple, string) -> colorBuild a color from channel values in a named color space.
colorMixColorMix(color | string | tuple, color | string | tuple, number?) -> colorMix two colors in OKLCh space
colorToColorspaceColorToColorspace(color | string | tuple, string) -> tupleConvert a color to components in a target color space
colorToStringColorToString(color | string | tuple, 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)).
colormapColormap(string, number?) -> color | list<color>Sample colors from a named palette
contrastingColorContrastingColor(color | string | tuple, (color | string | tuple)?, (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 | string | tuple, 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(number, number, number, number?) -> colorHSL color (hue degrees, saturation/lightness 0-1, optional alpha)
hsvHsv(number, number, number, number?) -> colorHSV color (hue degrees, saturation/value 0-1, optional alpha)
oklabOklab(number, number, number, number?) -> colorOKLab color (L 0-1, a/b ~ -0.4..0.4, optional alpha)
oklchOklch(number, number, number, number?) -> colorOKLCh color (L 0-1, C 0-~0.4, hue degrees, optional alpha)
rgbRgb(number, number, number, number?) -> colorsRGB color (channels 0-1, optional alpha 0-1)

Regular expressions​

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

EpsilMathJSONSignatureSummary
isMatchIsMatch(subject: 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: string, pattern: regexp) -> nothing | recordThe first match of a regular expression in a string, as a record.
stringMatchAllStringMatchAll(subject: 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(complex | infinity) -> numberAbsolute value (magnitude) of a number.
absArgAbsArg(complex | infinity) -> tuple<+oo | real, real>Tuple of magnitude and argument of a complex number.
—Add(value+) -> valueSum of two or more values.
airyAiAiryAi(complex | infinity) -> numberAiry function of the first kind
airyAiPrimeAiryAiPrime(complex | infinity) -> numberDerivative of the Airy function of the first kind
airyBiAiryBi(complex | infinity) -> numberAiry function of the second kind
airyBiPrimeAiryBiPrime(complex | infinity) -> numberDerivative of the Airy function of the second kind
argArg(complex | infinity) -> numberArg is an alias for Argument, which is the preferred name.
argumentArgument(complex | infinity) -> numberComplex argument (phase angle) of a number, in the engine's angular unit.
besselIBesselI(order: complex, complex | infinity) -> numberModified Bessel function of the first kind
besselJBesselJ(order: complex, complex | infinity) -> numberBessel function of the first kind
besselKBesselK(order: complex, complex | infinity) -> numberModified Bessel function of the second kind (Macdonald function)
besselYBesselY(order: complex, complex | infinity) -> numberBessel function of the second kind (Neumann function)
betaBeta(complex | infinity, complex | infinity) -> numberEuler beta function
catalanConstantCatalanConstantconstant real<0.915965594177219..0.9159655941772191> = 0.915965594177219015055Catalan's constant G ≈ 0.9160.
ceilCeil(real | signed_infinity) -> integer | signed_infinityRounds a number up to the next largest integer
chopChop(T) -> T where T: numberReplace tiny numeric values with zero.
clampClamp(real | signed_infinity, real | signed_infinity, 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(complex, 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(number) -> nothing | numberDenominator of an expression
digammaDigamma(complex | infinity) -> numberDigamma function, the logarithmic derivative of the gamma function
dirichletBetaDirichletBeta(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(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(complex | infinity, (complex | infinity)+) -> numberQuotient of a numerator and one or more denominators.
elementMaxElementMax(real | signed_infinity, (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(real | signed_infinity, (real | signed_infinity)+) -> real | signed_infinityElement-wise minimum: broadcasts scalars over collections (and zips collections), returning a collection; all-scalar arguments give a scalar.
eulerGammaEulerGammaconstant real<0.5772156649015328..0.5772156649015329> = 0.577215664901532860607The Euler–Mascheroni constant γ ≈ 0.5772.
expExp(number) -> numberNatural exponential function: e^x.
exp2Exp2(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(complex | infinity) -> numberFactorial function: the product of all positive integers less than or equal to n
factorial2Factorial2(complex | infinity) -> numberDouble Factorial Function
floorFloor(real | signed_infinity) -> integer | signed_infinityRounds a number down to the nearest integer.
fractFract(real | signed_infinity) -> real<0..1>Fractional part of a number: x - floor(x)
gcdGCD(any*) -> numberGreatest Common Divisor
gammaGamma(complex | infinity, (complex | infinity)?) -> numberGamma function Γ(z); with two arguments, the upper incomplete gamma Γ(s, z) = ∫_z^∞ tˢ⁻¹ e⁻ᵗ dt.
gammaLnGammaLn(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).
heavisideHeaviside(real | signed_infinity) -> rational<0..1>Heaviside step function.
hurwitzZetaHurwitzZeta(complex | infinity, complex | infinity, integer?) -> numberHurwitz zeta function ζ(s,a) = Σ_{n=0}^∞ (n+a)^{-s}
imIm(complex | infinity) -> numberIm is an alias for Imaginary, which is the preferred name.
imaginaryImaginary(complex | infinity) -> numberImaginary part of a complex number.
imaginaryUnitImaginaryUnitconstant imaginary = iThe imaginary unit, whose square is −1.
—Indeterminateconstant number = IndeterminateIndeterminate, the exact answer to an indeterminate form such as 0/0: a number with no value.
infimumInfimum(value*) -> numberLike Min, but defined for open sets
interpretInterpret(any) -> anyInterpret a notational expression as its mathematical meaning.
isCompositeIsComposite(number) -> booleanIsComposite(n) returns True if n is a composite number
isEvenIsEven(number) -> booleanIsEven(n) returns True if n is an even number
isOddIsOdd(number) -> booleanIsOdd(n) returns True if n is an odd number
isPrimeIsPrime(number) -> booleanIsPrime(n) returns True if n is a prime number
lcmLCM(any*) -> numberLeast Common Multiple
lambertWLambertW(z: complex | infinity, branch: integer?) -> numberLambert W function (product logarithm)
lbLb(number) -> numberBase-2 Logarithm
lerchPhiLerchPhi(complex, complex, complex) -> numberLerch transcendent Φ(z,s,a) = Σ_{k=0}^∞ zᵏ(k+a)^{-s}
lgLg(number) -> numberBase-10 Logarithm
lnLn(complex | infinity, base: (complex | infinity)?) -> complex | infinityNatural Logarithm
logLog(complex | infinity, base: (complex | infinity)?) -> numberLog(z, b = 10) = Logarithm of base b
log10Log10(number) -> numberBase-10 Logarithm
log2Log2(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) -> valueA nominal value carrying a 1σ absolute uncertainty.
minMin(value+) -> numberMinimum of two or more numbers
—Mod(real, real) -> realModulo: the remainder of the floored division of x by y.
—Multiply(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.
—Negate(complex | infinity) -> numberAdditive Inverse
negativeInfinityNegativeInfinityconstant -oo = -ooNegative infinity (−∞).
numeratorNumerator(number) -> nothing | numberNumerator of an expression
numeratorDenominatorNumeratorDenominator(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: integer, complex | infinity) -> numberPolygamma function, the n-th derivative of the digamma function
positiveInfinityPositiveInfinityconstant +oo = +ooPositive infinity (+∞).
—Power(complex | infinity, complex | signed_infinity) -> numberExponentiation: raise a base to a power.
—PreDecrement(number) -> numberDecrement a number by one.
—PreIncrement(number) -> numberIncrement a number by one.
productProduct(any, tuple*) -> numberProduct(f, a, b) computes the product of f from a to b
rationalRational((integer, integer) -> rational) | ((real) -> rational)Construct a rational number from a numerator and denominator.
rationalizeRationalize(real, real<0..>?) -> rationalApproximate a real number by a rational.
reRe(complex | infinity) -> numberRe is an alias for Real, which is the preferred name.
realReal(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(complex | infinity, complex | infinity) -> numbern-th root of a value.
roundRound(real | signed_infinity, integer?) -> real | signed_infinityRounds a number to the nearest integer, or (with a precision argument) to n decimal places.
signSign(complex | signed_infinity) -> 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.
sqrtSqrt(complex | infinity) -> complex | infinitySquare Root
—Square(number) -> numberSquare of a number: x^2.
—Subtract(number+) -> numberDifference between two or more values.
sumSum(any, tuple*) -> numberSum(f, [a, b]) computes the sum of f from a to b; Sum(L) sums the elements of a collection L
supremumSupremum(value*) -> numberLike Max, but defined for open sets
trigammaTrigamma(complex | infinity) -> numberTrigamma function, the derivative of the digamma function
truncateTruncate(real | signed_infinity) -> integer | signed_infinityRounds a number towards zero (removes the fractional part)
zetaZeta(complex | infinity, (complex | infinity)?) -> numberRiemann zeta function; with two arguments, the Hurwitz zeta function ζ(s,a) = Σ_{n=0}^∞ (n+a)^{-s}.
—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(complex, complex, integer) -> realSmooth escape-time value for a Julia set with parameter c.
mandelbrotMandelbrot(complex, 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(complex) -> numberArccosine, the inverse cosine function.
arccotArccot(complex | signed_infinity) -> numberArccotangent, the inverse cotangent function.
arccscArccsc(complex | infinity) -> numberArccosecant, the inverse cosecant function.
arcoshArcosh(complex | signed_infinity) -> numberInverse hyperbolic cosine (area hyperbolic cosine).
arcothArcoth(complex | infinity) -> numberInverse hyperbolic cotangent (area hyperbolic cotangent).
arcschArcsch(complex | infinity) -> numberInverse hyperbolic cosecant (area hyperbolic cosecant).
arcsecArcsec(complex | infinity) -> numberArcsecant, the inverse secant function.
arcsinArcsin(complex) -> numberArcsine, the inverse sine function.
arctanArctan(complex | signed_infinity) -> numberInverse tangent.
arctan2Arctan2(y: real | signed_infinity, x: real | signed_infinity) -> realTwo-argument arctangent giving the angle of a vector.
arsechArsech(complex | signed_infinity) -> numberInverse hyperbolic secant (area hyperbolic secant).
arsinhArsinh(complex | signed_infinity) -> numberInverse hyperbolic sine (area hyperbolic sine).
artanhArtanh(complex | signed_infinity) -> numberInverse hyperbolic tangent (area hyperbolic tangent).
cosCos(complex) -> numberCosine of an angle.
cosIntegralCosIntegral(complex | infinity) -> numberCosine integral: γ + ln(x) + ∫₀ˣ (cos(t)−1)/t dt.
coshCosh(complex | signed_infinity) -> numberHyperbolic cosine.
coshIntegralCoshIntegral(complex | infinity) -> numberHyperbolic cosine integral: γ + ln|x| + ∫₀ˣ (cosh(t)−1)/t dt.
cotCot(complex) -> numberCotangent, the reciprocal of tangent.
cothCoth(complex | signed_infinity) -> numberHyperbolic cotangent, the reciprocal of hyperbolic tangent.
cscCsc(complex) -> numberCosecant, the reciprocal of sine.
cschCsch(complex | signed_infinity) -> numberHyperbolic cosecant, the reciprocal of hyperbolic sine.
dmsDMS(number, number?, number?) -> numberConstruct an angle from degrees, minutes, and seconds.
degreesDegrees(real) -> realConvert an angle in degrees.
fresnelCFresnelC(complex | signed_infinity) -> complexFresnel cosine integral.
fresnelSFresnelS(complex | signed_infinity) -> complexFresnel sine integral.
haversineHaversine(real) -> numberHaversine function.
hypotHypot(infinity | real, infinity | real) -> +oo | nan | realHypotenuse length: sqrt(x^2 + y^2).
inverseFunctionInverseFunction(function) -> functionInverse of a function.
inverseHaversineInverseHaversine(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(complex) -> numberSecant, the reciprocal of cosine.
sechSech(complex | signed_infinity) -> numberHyperbolic secant, the reciprocal of hyperbolic cosine.
sinSin(complex) -> numberSine of an angle.
sinIntegralSinIntegral(complex | infinity) -> numberSine integral: ∫₀ˣ sin(t)/t dt.
sincSinc(complex | signed_infinity) -> complexUnnormalized sinc function: sin(x)/x with sinc(0)=1.
sinhSinh(complex | signed_infinity) -> numberHyperbolic sine.
sinhIntegralSinhIntegral(complex | infinity) -> numberHyperbolic sine integral: ∫₀ˣ sinh(t)/t dt.
tanTan(complex) -> numberTangent of an angle.
tanhTanh(complex | 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, using the residue theorem.
—D(expression, variables: symbol*) -> expressionSymbolic partial derivative with respect to one or more variables.
dSolveDSolve(expression, symbol, symbol) -> expressionSymbolic differential equation solver.
derivativeDerivative(function, order: number*) -> functionDerivative operator that returns a derivative function.
integrateIntegrate(function, limits+) -> list<number> | list<tuple> | number | tupleSymbolic integral with optional bounds.
interpolatingFunctionInterpolatingFunction(list<any>, number?) -> numberPiecewise-quartic dense-output interpolant of a numeric ODE solution (produced by NDSolveFunction).
jacobianMatrixJacobianMatrix(any, any?) -> valueJacobianMatrix(fs, vars): the matrix of partial derivatives
limitLimit(function, point: number, direction: number?) -> numberLimit of a function
—Limits(index: symbol, lower: value, upper: value) -> tupleLimits of a function
ndND(function, at: number) -> list<number> | number | tupleNumerical derivative evaluated at a point.
ndSolveNDSolve(expression, symbol, limits: symbol | tuple, number, number?) -> listNumerical differential equation solver.
ndSolveFunctionNDSolveFunction(expression, symbol, limits: symbol | tuple, 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(expression, symbol, 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
apartApart(value, symbol?) -> valueAlias for PartialFraction.
cancelCancel(value, symbol?) -> valueCancel common polynomial factors in the numerator and denominator of a rational expression.
coefficientListCoefficientList(value, symbol?) -> list<value>Return the list of coefficients of a polynomial, from highest to lowest degree.
discriminantDiscriminant(value, symbol?) -> valueReturn the discriminant of a polynomial.
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
factorFactor(value, symbol?) -> valueFactor a polynomial expression into a product of irreducible factors.
partialFractionPartialFraction(value, symbol?) -> valueDecompose a rational expression into partial fractions.
polynomialPolynomial(list<value>, symbol) -> valueConstruct a polynomial from a list of coefficients (highest to lowest degree) and a variable.
polynomialDegreePolynomialDegree(value, 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.
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(value, symbol?) -> set<value>Return 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

Combinatorics​

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

EpsilMathJSONSignatureSummary
bellNumberBellNumber(integer) -> integerCompute the Bell number B(n), the number of partitions of a set of n elements.
binomialBinomial(complex | infinity, complex | infinity) -> numberCompute the binomial coefficient C(n, k) = n! / (k!
cartesianProductCartesianProduct(set<any>+) -> setReturn the Cartesian product of input sets.
chooseChoose(n: complex | infinity, m: complex | infinity) -> numberBinomial coefficient: number of ways to choose k items from n.
combinationsCombinations((S, integer) -> list<string> where S: string) & ((collection, integer) -> list<list>)Return all k-element combinations of a collection.
fibonacciFibonacci(integer) -> integerCompute the nth Fibonacci number.
multinomialMultinomial(integer+) -> integerCompute the multinomial coefficient for multiple integers.
permutationsPermutations((S, integer?) -> list<string> where S: string) & ((collection, integer?) -> list<list>)Return all permutations of length k (default full length) of a collection.
pochhammerPochhammer(complex | infinity, complex | infinity) -> numberRising factorial (Pochhammer symbol) (a)_k = a(a+1)…(a+k-1).
powerSetPowerSet(set<any>) -> setReturn the power set of a set (set of all subsets).
subfactorialSubfactorial(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
bernoulliBBernoulliB(integer) -> rationalReturn the nth Bernoulli number Bₙ as an exact rational, using the convention B₁ = -1/2.
carmichaelLambdaCarmichaelLambda(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(integer) -> integerReturn the nth Catalan number C(n) = (2n)! / ((n+1)! · n!): 1, 1, 2, 5, 14, 42, … Defined for n ≥ 0.
chineseRemainderChineseRemainder(collection<any>, collection<any>) -> 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(real, integer?) -> list<integer>Return the continued-fraction expansion of x as a list of integer terms [a0, a1, …].
digitCountDigitCount(integer, integer?, integer?) -> integer | list<integer>Count digits of n in the given base (default 10); the sign of n is ignored.
digitSumDigitSum(integer, integer?) -> integerReturn the sum of the digits of n in the given base (default 10).
dirichletCharacterDirichletCharacter(integer, integer, integer) -> numberThe Dirichlet character χ_j(n) modulo k, the j-th of the φ(k) characters (Wolfram's indexing, j = 1 the principal character).
dirichletLDirichletL(integer, integer, 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(integer, integer) -> booleanDivides(a, b) returns True if a divides b (i.e.
divisorSigmaDivisorSigma(integer, integer) -> integerThe divisor function σ_k(n) = Σ_{d | n} dᵏ over the positive divisors of n. σ₀ counts divisors, σ₁ sums them.
divisorsDivisors(integer) -> list<integer>Return the sorted list of positive divisors of an integer n.
eulerPhiEulerPhi(integer) -> integerEulerPhi is an alias for Totient, which is the preferred name.
eulerianEulerian(integer, integer) -> integerEulerian number A(n, m): number of permutations of {1..n} with exactly m ascents.
extendedGCDExtendedGCD(integer, integer) -> tuple<integer, integer, integer>Return 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(integer) -> 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 (rational) value of a continued fraction given its list of integer terms [a0, a1, …].
fromDigitsFromDigits(collection<any>, integer?) -> integerReconstruct an integer from its list of digits (most-significant first) in the given base (default 10).
integerDigitsIntegerDigits(integer, integer?, integer?) -> list<integer>Return the digits of n in the given base (default 10), most-significant first.
integerSqrtIntegerSqrt(integer) -> integerReturn the integer square root of n, i.e. the largest integer m such that m² ≤ n.
isAbundantIsAbundant(integer) -> booleanTrue if n is an abundant number (sum of divisors > 2n).
isCenteredSquareIsCenteredSquare(integer) -> booleanTrue if n is a centered square number.
isHappyIsHappy(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(integer) -> booleanTrue if n is an octahedral number.
isPerfectIsPerfect(integer) -> booleanReturns "True" if n is a perfect number, a positive integer which equals the sum of all its divisors.
isPerfectPowerIsPerfectPower(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(integer) -> booleanTrue if n is a perfect square.
isSquareFreeIsSquareFree(integer) -> booleanReturn "True" if n is square-free (not divisible by any perfect square > 1).
isTriangularIsTriangular(integer) -> booleanTrue if n is a triangular number.
jacobiSymbolJacobiSymbol(integer, integer) -> integerThe Jacobi symbol (a/n) for an odd n > 0.
legendreSymbolLegendreSymbol(integer, integer) -> integerThe Legendre symbol (a/p) for an odd prime p.
lucasLucas(integer) -> integerLucas is an alias for LucasL, which is the preferred name.
lucasLLucasL(integer) -> integerReturn the nth Lucas number: LucasL(0) is 2, LucasL(1) is 1, and LucasL(n) = LucasL(n-1) + LucasL(n-2).
modularInverseModularInverse(integer, integer) -> integerReturn the modular multiplicative inverse of a modulo m: the integer x with a·x ≡ 1 (mod m).
moebiusMuMoebiusMu(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(integer, integer, list<integer>?) -> integerThe multiplicative order of a modulo n: the smallest k > 0 such that a^k ≡ 1 (mod n).
nPartitionNPartition(integer) -> integerNumber of integer partitions of n, for n ≥ 0; it is 0 for n < 0.
nextPrimeNextPrime(integer, integer?) -> integerReturn the smallest prime greater than n.
notDividesNotDivides(integer, integer) -> booleanNotDivides(a, b) returns True if a does not divide b, corresponding to the notation a ∤ b.
nthPrimeNthPrime(integer) -> integerReturn the nth prime number (1-based): NthPrime(1) is 2, NthPrime(2) is 3, …
partitionsPPartitionsP(integer) -> integerPartitionsP is an alias for NPartition, which is the preferred name.
powerModPowerMod(integer, rational, integer) -> integerReturn a^b mod m (modular exponentiation).
powerModListPowerModList(integer, rational, integer) -> 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(integer) -> list<integer>Return the sorted list of distinct prime factors of an integer n.
primeNuPrimeNu(integer) -> integerReturn ω(n), the number of distinct prime factors of n.
primeNumberPrimeNumber(integer) -> integerThe nth prime number.
primeOmegaPrimeOmega(integer) -> integerReturn Ω(n), the number of prime factors of n counted with multiplicity.
primePiPrimePi(real) -> integerReturn π(n), the prime-counting function: the number of primes less than or equal to n.
primitiveRootPrimitiveRoot(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(integer) -> list<integer>The sorted list of all primitive roots modulo n: the generators of the multiplicative group of integers mod n.
radicalRadical(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(integer, 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(integer) -> integerNumber of positive divisors of n.
sigma1Sigma1(integer) -> integerSum of positive divisors of n.
sigmaMinus1SigmaMinus1(integer) -> rationalSum of reciprocals of positive divisors of n.
stirlingStirling(integer, integer) -> integerStirling number of the second kind S(n, m): ways to partition n elements into m non-empty subsets.
stirlingS1StirlingS1(integer, 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(integer, integer) -> integerStirlingS2 is an alias for Stirling, which is the preferred name.
totientTotient(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(complex | infinity, (complex | infinity)?) -> numberArithmetic-geometric mean.
appellF1AppellF1(complex | infinity, complex | infinity, complex | infinity, complex | infinity, complex | infinity, complex | infinity) -> numberAppell hypergeometric function F₁(a; b₁, b₂; c; x, y), double series for |x|, |y| < 1.
barnesGBarnesG(complex | infinity) -> numberThe Barnes G-function, the double gamma function G(z+1) = Γ(z)·G(z), G(1) = 1.
clausenClClausenCl(integer, 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(complex | infinity) -> numberDedekind eta function η(τ), Im(τ) > 0.
eisensteinEEisensteinE(number, complex | infinity) -> numberNormalized Eisenstein series Eₛ(τ) of even weight s ≥ 2, Im(τ) > 0.
ellipticEEllipticE(complex | infinity, (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(complex | infinity, complex | infinity) -> numberIncomplete elliptic integral of the first kind F(φ|m) (amplitude first, parameter convention m = k², as in Mathematica).
ellipticKEllipticK(complex | infinity) -> numberComplete elliptic integral of the first kind K(m), parameter convention m = k².
ellipticPiEllipticPi(complex | infinity, complex | infinity, (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(complex | infinity) -> numberExponential integral Ei(x) = PV ∫_{−∞}^x eᵗ/t dt.
hypergeometric1F1Hypergeometric1F1(complex | infinity, complex | infinity, complex | infinity) -> numberKummer confluent hypergeometric function ₁F₁(a; b; z) = M(a, b, z).
hypergeometric2F1Hypergeometric2F1(complex | infinity, complex | infinity, complex | infinity, complex | infinity) -> numberGauss hypergeometric function ₂F₁(a, b; c; z).
jacobiThetaJacobiTheta(number, complex | infinity, complex | infinity, number?) -> numberJacobi theta function θⱼ(z, τ), j ∈ {1,2,3,4}, nome q = e^{iπτ} (Fungrim convention).
logBarnesGLogBarnesG(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(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(complex | infinity) -> numberLogarithmic integral li(x) = PV ∫₀ˣ dt/ln t = Ei(ln x).
polyLogPolyLog(complex | infinity, complex | infinity) -> numberPolylogarithm Liₛ(z) = Σ_{k≥1} zᵏ/kˢ, at any real or complex order s.
stieltjesGammaStieltjesGamma(integer, 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, 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) -> integerDimension of an object
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.
flattenFlatten(value, 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(T) -> T where T: 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) -> listKernel (null space) of a linear map
luDecompositionLUDecomposition(matrix) -> tupleLU decomposition of a square matrix.
linearSolveLinearSolve(matrix, matrix | vector) -> valueSolve the linear system A·x = b for x.
matrixMatrix(matrix, string?, string?) -> matrixMatrix constructor and canonicalizer.
matrixMultiplyMatrixMultiply(matrix | vector, matrix | vector) -> matrix | vectorMatrix and vector multiplication.
matrixPowerMatrixPower(matrix, real) -> matrixSquare matrix raised to a power.
matrixRankMatrixRank(value) -> integerRank of a matrix (number of linearly independent rows/columns).
normNorm(list<number> | list<tuple> | number | tuple, (+oo | real | string)?) -> +oo | nan | realVector or matrix norm.
onesMatrixOnesMatrix(integer, integer?) -> matrixMatrix filled with ones.
pseudoInversePseudoInverse(matrix) -> matrixMoore-Penrose pseudoinverse of a matrix.
qrDecompositionQRDecomposition(matrix) -> tupleQR decomposition of a matrix.
rankRank(value) -> integerThe length of the shape of the expression.
reshapeReshape(value, tuple) -> valueReshape a tensor or collection to a target shape.
rowReduceRowReduce(matrix) -> matrixReduced row echelon form (RREF) of a matrix.
svdSVD(matrix) -> tupleSingular value decomposition of a matrix.
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(list<number> | number, axis1: integer?, axis2: integer?) -> list<number> | numberTrace of a matrix or pair of tensor axes.
transposeTranspose(value, axis1: integer?, axis2: integer?) -> valueTranspose a matrix or swap two tensor axes.
vectorVector(any+) -> vectorConstruct a column vector.
zeroMatrixZeroMatrix(integer, integer?) -> matrixMatrix filled with zeros.

Statistics​

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

EpsilMathJSONSignatureSummary
betaRegularizedBetaRegularized(complex | infinity, complex | infinity, complex | infinity) -> numberRegularized incomplete beta function I_x(a, b)
binCountsBinCounts(collection<any>, list<number> | number) -> list<number>Count the number of elements falling into each bin.
binomialDistributionBinomialDistribution(integer<0..>, 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.
correlationCorrelation(collection<any>, collection<any>?) -> 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(collection<any>, collection<any>?) -> nan | realSample covariance (n − 1 denominator) of paired data, given as two equal-length collections or one collection of (x, y) pairs.
erfErf(complex | signed_infinity) -> complexGauss error function
erfInvErfInv(complex | infinity) -> numberInverse of the error function
erfcErfc(complex | signed_infinity) -> complexComplementary error function: 1 - Erf(x)
erfiErfi(complex | signed_infinity) -> complex | signed_infinityImaginary error function: -i·Erf(i·x)
exponentialDistributionExponentialDistribution(real<0<..>) -> expression<ExponentialDistribution>Exponential distribution with rate parameter λ.
findFitFindFit(any, any, any, any) -> dictionaryNonlinear least-squares fit of a model to data.
gammaRegularizedGammaRegularized(complex | infinity, complex | infinity) -> numberRegularized upper incomplete gamma function Q(a, z) = Γ(a, z)/Γ(a)
histogramHistogram(collection<any>, list<number> | number) -> list<tuple<number, integer>>Compute a histogram of the values in a collection.
interquartileRangeInterquartileRange((collection<any> | number)+) -> +oo | nan | real<0..>Interquartile range (Q3 - Q1) of a collection.
kurtosisKurtosis((collection<any> | number)+) -> nan | realKurtosis of a collection of numbers.
linearRegressionLinearRegression(any+) -> tuple<number, number>Least-squares linear fit b0 + b1·x.
meanMean((collection<any> | distribution | number)+) -> numberArithmetic mean (average) of a collection of numbers.
medianMedian((collection<any> | number)+) -> nan | real | signed_infinityMedian of a collection of numbers.
modeMode((collection<any> | number)+) -> nan | real | signed_infinityMost frequently occurring value in a collection.
normalDistributionNormalDistribution(real, 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(collection<any>, collection<any>?) -> nan | realPopulation covariance (n denominator) of paired data, given as two equal-length collections or one collection of (x, y) pairs.
populationStandardDeviationPopulationStandardDeviation((collection<any> | number)+) -> nan | real<0..>Population Standard Deviation of a collection of numbers.
populationVariancePopulationVariance((collection<any> | 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<any> | 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((T, number) random -> T where T: string) & ((indexed_collection, number) random -> list)RandomSample(xs, k): a list of k 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 [1, 1].
skewnessSkewness((collection<any> | number)+) -> nan | realSkewness of a collection of numbers.
slidingWindowSlidingWindow((S, integer, integer?) -> list<string> where S: string) & ((collection, integer, integer?) -> list<list>)Return overlapping sliding windows of fixed size over the collection.
standardDeviationStandardDeviation((collection<any> | distribution | number)+) -> nan | real<0..>Sample Standard Deviation of a collection of numbers.
uniformDistributionUniformDistribution(real, real) -> expression<UniformDistribution>Continuous uniform distribution on the interval [a, b].
varianceVariance((collection<any> | 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
quantityQuantity(value, value) -> valueA value paired with a physical unit
quantityMagnitudeQuantityMagnitude(value) -> valueExtract the numeric value from a quantity
quantityUnitQuantityUnit(value) -> valueExtract the unit from a quantity
unitConvertUnitConvert(value, 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 value = 6.02214076e+23 mol^-1Avogadro constant
boltzmannConstantBoltzmannConstantconstant value = 1.380649e-23 J/KBoltzmann constant
elementaryChargeElementaryChargeconstant value = 1.602176634e-19 CElementary electric charge
gasConstantGasConstantconstant value = 8.314462618 J/mol⋅KMolar gas constant
gravitationalConstantGravitationalConstantconstant value = 6.6743e-11 m^3/kg⋅s^2Newtonian constant of gravitation
mu0Mu0constant value = 0.00000125663706212 N/A^2Vacuum permeability
planckConstantPlanckConstantconstant value = 6.62607015e-34 J⋅sPlanck constant
speedOfLightSpeedOfLightconstant value = 299792458 m/sSpeed of light in vacuum
standardGravityStandardGravityconstant value = 9.80665 m/s^2Standard acceleration due to gravity
stefanBoltzmannConstantStefanBoltzmannConstantconstant value = 5.670374419e-8 W/m^2⋅K^4Stefan-Boltzmann constant
vacuumPermittivityVacuumPermittivityconstant value = 8.8541878128e-12 F/mVacuum permittivity (electric constant)