All built-in functions and constants start with a capital and cannot be re-defined.
In the tables below, a (*) indicates functions that support arbitrary precision integer output, and
arguments are indicated as follows:
| Base | n k | Return a string representation of n in base k (from 2 to 16) |
| Int | x|$ | Convert to integer (truncates) |
| Dec | x|$ | Convert to decimal |
| Frac | x | Convert to rational (best approximation with configured max denominator) |
| Complex | x | Convert to complex |
| Str | * | Convert to string |
| ToDeg | x | Convert x from radians to degrees |
| ToRad | x | Convert x from degrees to radians |
| Split | x|$ | Return an array of digits for an integer, the numerator and denominator for a fraction, or characters for a string |
| Combine | [n|$] | Combine the given array of digits into a number or characters into a string |
| NaN | * | Return true ($1) if NaN |
| Arg | z | Argument of a complex number |
| Conj | z | Complex conjugate |
| Re | z | Real part of a complex number |
| Im | z | Imaginary part of a complex number |
| Chop | z n | Truncate small deviations from integer values (tolerance 10^-n) |
| AGM | z w | Return the arithmetic geometric mean of the two arguments |
| GCD | z w | Return the greatest common divisor of two arguments (integer or gaussian integer) (*) |
| LCM | z w | Return the least common multiple of two arguments (integer or gaussian integer) (*) |
| Factors | z | Return (probable) prime factors of the argument (over gaussian integers if input is complex) (*) |
| Divisors | z | Return all divisors of the argument |
| CF | x | Calculate a continued fraction representation of x to machine precision |
| FromCF | [d] | Evaluate the given continued fraction representation |
| Sort | [z|$] | Sort array argument (in place) |
| KeySort | [*] [y] | Sort the first array (in place) using the second array y as the key |
| Rev | [*]|$ | Reverse array or string argument (in place) |
| Unique | [x] | Return the unique elements of [x] |
| Freq | [x] [y] | Return the number of occurrences in [x] of each element of [y] |
| ArrayCmp | [*] *|[*] | When the second argument is an array, return true if the two arrays are element by element equal, else return true if every element of the array is equal to the second argument |
| Diffs | [z] | Return an array of the differences between adjacent elements of [z] |
| Fill | [*] z|[z] | Fill the given array with the value z or cycle through entries [z] |
| FillIf | [*] [b] z|[z] | Fill the entries of the given array selected by the boolean array [b] with the value z or cycle through entries [z] |
| FnFill | [*] @f | Fill the given array by repeated calls to the function f (handy for random arrays). The function must take either no arguments, or a single integer argument in which case the current index is passed in. |
| Extract | i [[*]] | Return the ith column of an array of arrays (useful especially for file data) |
| Assign | [[*]] | Auto assign each column of the array to the variable name given by the header (i.e. the values in the first row) |
| Apply | @f [x] | Returns vector [ f(x[1]) f(x[2]) ... f(x[n]) ] |
| Apply2D | @f [x] [y] | Returns matrix [ [ f(x[1],y[1]) f(x[2],y[1]) ... f(x[n],y[1]) ] [ f(x[1],y[2]) ... ] [ ... f(x[n],y[m]) ] ] |
| Shuffle | [*] | Shuffle the array argument (in place) |
| Sample | [*] n b | Take n samples from a, with replacement if b nonzero |
| NextPerm | [i] n | Given a k-permutation of [1:n] (i.e. a k element order important subset of [1:n]) return the next k-permutation, or NaN if last. Results are undefined if the input array has duplicates. |
| NextComb | [i] n | Given a k-combination of [1:n] (i.e. a k element order unimportant subset of [1:n]) return the next k-combination, or NaN if last. Results are undefined if the input array is unsorted or has duplicates. |
| NextSubset | [i] n | Given a subset of [1:n] return the next subset, or NaN if last. Results are undefined if the input array is unsorted or has duplicates. |
| NextPart | [[i]] | Given a partition of [1:n] return the next partition, or NaN if last. Results are undefined if the input parition is invalid. |
| SeedRand | | Reset random sequences |
| UIRand | n | Return a random integer between 1 and n |
| UDRand | x y | Return a random decimal between x and y |
| GRand | x y | Return a random decimal from a gaussian distribution with mean x and stdev y |
| ERand | x | Return a random decimal from an exponential distribution with mean x |
| PRand | x | Return a random integer from a poisson distribution with mean x |
| BRand | n x | Return a random integer from a binomial distribution for n trials and probability x |
| GammaRand | a b | Return a random decimal from an gamma distribution with shape a and rate b |
| WRand | a b | Return a random decimal from a Weibull distribution with shape a and scale b |
| CRand | a b | Return a random decimal from a Cauchy distribution with location a and scale b |
| GeoRand | p | Return a random integer from a geometric distribution with probability p |
| NegBRand | n x | Return a random integer from a negative binomial distribution for n successes and probability of success p |
| Sobol | | Return the next value in a Sobol quasi-random sequence in the range [0,1] |
| Mean | [z] | Return the arithmetic mean of the array values |
| GeoMean | [z] | Return the geometric mean of the array values |
| HarMean | [z] | Return the harmonic mean of the array values |
| Median | [x] | Return the median of the array values |
| Stdev | [x] | Return the sample standard deviation of the array values |
| StdevP | [x] | Return the population standard deviation of the array values |
| MAD | [x] | Return the median absolute deviation from the median of the array values |
| Moments | [x] | Return the first four sample moments of the array values as a 4-array |
| MomentsP | [x] | Return the first four population moments of the array values as a 4-array |
| Hist | [x] n|[y] | Return frequency counts for the data in x binned according to [y] - either a constant number of bins, or an array holding the number of bins and the minimum and maximum values [n min max] |
| Range | [x] | Return the range of the array values as a 2-array |
| FivePoint | [x] b1 b2 | Return the minimum, 1st quartile, median, 3rd quartile and maximum array values as an array. Identify and return outliers if b1 is non-zero, correcting for skew if b2 is non-zero. |
| Robust | [x] | Return the trimean, half interquartile range, and robust estimators of the skew and kurtosis of the array values |
| Winsorize | [x] f | Find points that deviate from the median by more than f * MAD, and adjust their values to f * MAD (in place) |
| Z | [x] | Convert the array values to Z scores |
| Ranks | [x] | Return an array containing the ranks for the elements of the input array |
| Correlation | [x] [y] | Return the Pearson correlation, covariance and significance for equal size array arguments |
| LMFit | $ | Do a multiple linear regression using the model described by the string argument, e.g. "f : 1 x y z", "f : a b" |
| Logit | $ | Do a multiple logistic regression using the model described by the string argument. (Binary dependent data and must include constant) |
| StdDist | x | Return pdf(x) for a standard gaussian distribution (mean 0 and stdev 1) |
| StdCDF | x | Return cdf(x) for a standard gaussian distribution (mean 0 and stdev 1) |
| StdCDF2 | x y | Return cumulative probability for a value between x and y for a standard gaussian distribution (mean 0 and stdev 1) |
| StdCDFInv | p | Return x such that cdf(x) = p for a standard gaussian distribution (mean 0 and stdev 1) |
| GDist | a b x | Return pdf(x) for a gaussian distribution with mean a and stdev b |
| GCDF | a b x | Return cdf(x) for a gaussian distribution with mean a and stdev b |
| GCDF2 | a b x y | Return cumulative probability for a value between x and y for a gaussian distribution with mean a and stdev b |
| GCDFInv | a b p | Return x such that cdf(x) = p for a gaussian distribution with mean a and stdev b |
| EDist | y x | Return pdf(x) for an exponential distribution with parameter y |
| ECDF | y x | Return cdf(x) for an exponential distribution with parameter y |
| ECDFInv | y p | Return x such that cdf(x) = p for an exponential distribution with parameter y |
| GammaDist | a b x | Return pdf(x) for a gamma distribution with shape a and rate b |
| GammaCDF | a b x | Return cdf(x) for a gamma distribution with shape a and rate b |
| GammaCDFInv | a b p | Return x such that cdf(x) = p for a gamma distribution with shape a and rate b |
| WDist | a b x | Return pdf(x) for a Weibull distribution with shape a and scale b |
| WCDF | a b x | Return cdf(x) for a Weibull distribution with shape a and scale b |
| WCDFInv | a b p | Return x such that cdf(x) = p for a Weibull distribution with shape a and scale b |
| CDist | a b x | Return pdf(x) for a Cauchy distribution with location a and scale b |
| CCDF | a b x | Return cdf(x) for a Cauchy distribution with location a and scale b |
| CCDFInv | a b p | Return x such that cdf(x) = p for a Cauchy distribution with location a and scale b |
| TDist | x n | Return pdf(x) for a Students t distribution with degrees of freedom n |
| FDist | x n k | Return pdf(x) for an F distribution with degrees of freedom n and k |
| Chi2 | x n | Return pdf(x) for a Chi-squared distribution with n degrees of freedom |
| PDist | k x | Return pdf(k) for a Poisson distribution with parameter x (probability to get k if expect x) |
| PCDF | k x | Return cdf(k) for a Poisson distribution with parameter x (probability to get 0 to k if expect x) |
| PCDFInv | k p | Return x such that cdf(x) = p for a Poisson distribution (to get from 0 to k with probability p means parameter x) |
| GeoDist | k p | Return pdf(k) for a Geometric distribution with probability of success p (probability of k failures before first success) |
| GeoCDF | k p | Return cdf(k) for a Geometric distribution with probability of success p (probability to get 0 to k failures before first success) |
| GeoCDFInv | k x | Return probability of success p such that cdf(k) = x for a Geometric distribution |
| BDist | k n p | Return pdf(k) for a binomial distribution with n trials and probability of success p |
| BCDF | k n p | Return cdf(k) for a binomial distribution with n trials and probability of success p |
| BCDFInvP | k n x | Return probability of success p such that cdf(k) = x for a binomial distribution with n trials |
| BCDFInvK | p n x | Return number of successes given probability of success p for a binomial distribution with n trials and cdf = x |
| NegBDist | n k p | Return pdf(k) for a negative binomial distribution with probability of n - 1 successes and k failures in k + n - 1 trials, and success on the (k + n)th trial |
| NegBCDF | n k p | Return cdf(k) for a negative binomial distribution with n successes and n + k trials |
| NegBCDFInvP | n k x | Return probability of success p such that cdf(k) = x for a negative binomial distribution with n successes and k failures |
| NegBCDFInvK | p n x | Return number of failures given probability of success p for a negative binomial distribution with n successes and cdf = x |
| ZTest | [x] y s | Perform a Z test using the array data, mean y and standard deviation s |
| T1Test | [x] y | Perform a one sample t-test using the array data and mean y |
| T2Test | [x] [y] | Perform an two sample t-test on the two arrays |
| Chi2Test | [x] [y] | Perform a Chi-squared test on the two arrays (observed and expected frequencies respectively) |
| GTest | [x] [y] | Perform a G-test on the two arrays (observed and expected frequencies respectively) |
| Chi2TestMR | [x] [y] n | Apply a Rao-Scott multiple response correction to the Chi-squared test on the two arrays for sample size n |
| GTestMR | [x] [y] n | Apply a Rao-Scott multiple response correction to the G-test on the two arrays for sample size n |
| FTest | [x] [y] | Perform an F test on the two arrays |
| ANOVA | [[x]] | Perform an ANOVA on the array of arrays |
| MWTest | [x] [y] | Perform a Mann-Whitney test on the two arrays |
| TestU | [x] | Perform an Anderson-Darling test on the array for goodness of fit to a uniform distribution. |
| TestG | [x] | Perform an Anderson-Darling test on the array for goodness of fit to a gaussian distribution. |
| TestDist | @f [x] | Perform an Anderson-Darling test on the array for goodness of fit to a distribution with CDF f(x). |
| FFT | [z] | Return the Discrete Fourier Transform of the input data (no need for length a power of 2) |
| IFFT | [z] | Return the Inverse Discrete Fourier Transform of the input data |
| Spectrum | [z] | Return the Power Spectrum of the input data |
| Peaks | [x] k h | Identify peaks in the input data, using a neighbourhood of k values and a threshold of h sigma for outlier detection |
| LinCorr | [x] [y] b | Return the list correlation of the input vectors (auto pad with zeros - b = $1 => trim) |
| CycCorr | [x] [y] b | Return the cyclic list correlation of the input vectors (auto pad with zeros - b = $1 => trim) |
| LinConv | [x] [y] b | Return the list convolution of the input vectors (auto pad with zeros - b = $1 => trim) |
| CycConv | [x] [y] b | Return the cyclic list convolution of the input vectors (auto pad with zeros - b = $1 => trim) |
| Fisher | [x] | Normalise x to (-1,1) and apply a Fisher transform |
| Mat | m n | Create an m by n matrix of zeros (can access matrix elements directly using m'[r c] and rows using m'[r]) |
| Part | [*] n | Partition the given array/matrix into n columns |
| Flatten | [*] | Remove any partitioning from the given matrix |
| Id | n | Create an n by n identity matrix |
| Inv | [z] | Invert the given matrix |
| Trans | [*] | Return the transpose of the given matrix |
| Det | [z] | Calculate the determinant of the given matrix |
| MSolve | [z] [w] | Solve Z.X=W for each column in [w] |
| Row | i [*] | Return the ith row of the matrix |
| Col | j [*] | Return the jth column of the matrix |
| RowSum | [*] | Return a column array containing the sum of each row of the matrix |
| ColSum | [*] | Return an array containing the sum of each column of the matrix |
| Diag | [*] | Return an array of the diagonal elements of the matrix |
| Trace | [z] | Return sum of the diagonal elements of the matrix |
| LU | [z] | Return the LU decomposition of the given matrix (implied unit values for the L diagonals) |
| RRE | [z] | Return the Reduced Row Echelon form of the given matrix |
| Rank | [z] | Return the rank of the given matrix |
| Dim | [*] | Return a 2-vector containing the dimensions of the matrix |
| Inner | [z] [z] | Return the inner product of the two vectors |
| Cross | [z] [z] | Return the cross product of two 3-vectors |
| Outer | [z] [z] | Return the outer product of the two vectors |
| RowEx | [*] i j | Exchange rows i and j |
| ColEx | [*] i j | Exchange columns i and j |
| RowOp | [*] i j z | Elementary row operation: Row i += z * Row j |
| ColOp | [*] i j z | Elementary col operation: Col i += z * Col j |
| CharP | [z] | Characteristic polynomial of a given square matrix |
| Eigenvalues | [z] | Eigenvalues of a given square matrix |
| LinePlot | [x] d1 d2 | Plot the data in x vs their index with plot options d1 and line options d2 |
| LinePlot2 | [x] [y] d1 d2 | Plot the data (x,y) with plot options d1 and line options d2 |
| LinePlot3 | [x] [y] [z] d1 d2 | Plot the data (x,y,z) with plot options d1 and line options d2 |
| FLinePlot | @f [x] d1 d2 | Plot f x vs x for the points [x] with plot options d1 and line options d2 |
| PlotDefs | | Return a dictionary with the default box plot options preset. Available options are: title, xlabel, ylabel, zlabel, bkcolour, justify azimuth, elevation, xmin, xmax, ymin, ymax, zmin, zmax, fill, box, axis |
| AxesPlotDefs | | Return a dictionary with the default axes plot options preset. Available options are: title, xlabel, ylabel, zlabel, bkcolour, justify azimuth, elevation, xmin, xmax, ymin, ymax, zmin, zmax, fill, box, axis |
| LogPlotDefs | | Return a dictionary with the default box plot options and LOGX axis type |
| AxesLogDefs | | Return a dictionary with the default axes plot options and LOGX axis type |
| LineDefs | | Return a dictionary with the default line plot options preset. Available options are: label, colour, thickness, symbol, linestyle |
| SurfaceDefs | | Return a dictionary with the default surface plot options preset. Available options are: label, mesh, colour, contours |
| Histogram | [x] d1 d2 | Plot the counts in x as a histogram with plot options d1 and line options d2 |
| SurfacePlot | [x] [y] [z] d1 d2 | Plot the data z(x,y) with plot options d1 and line options d2, for x and y ordered grid points and z stored by row |
| FSurfacePlot | @f [x] [y] d1 d2 | Does an Apply2D @f [x] [y] to get the [z], then as for SurfacePlot |
| ContourPlot | [x] [y] [z] d1 d2 | Plot the data z(x,y) with plot options d1 and line options d2, for x and y ordered grid points and z stored by row |
| FContourPlot | @f [x] [y] d1 d2 | Does an Apply2D @f [x] [y] to get the [z], then as for ContourPlot |
| CombineLines | [a] | Combine the line plots in the array into a single plot |
| LayoutPlots | [a] i | Layout the plots in the array in rows of i columns (max of 5 columns, and subplots must not already be grids) |
| Animate | @f [a] n | Animate the function f by calling it at a rate of n times per second, using each element of a in turn as the only argument. |
| linestyle: | JOIN, DASH, NOLINE |
| mesh: | MESHXY, MESHX, MESHY |
| character: | Escape sequences for character strings: SANS = "#fn", ROMAN = "#fr", ITALIC = "#fi", SCRIPT = "#fs", GREEK = "#g" UNDER = "#-", OVER = "#+", SUB = "#d", SUPER = "#u", HASH = "##" |
| symbol: | NOSYM, DOT, PLUS, ASTERISK, CIRCLE, CROSS, SQUARE, TRIANGLE, CIRCLEPLUS, CIRCLEDOT, CURVEDBOX, DIAMOND, STAR, SOLIDSQ, SOLIDCIRC |
| colour: | BLACK, RED, YELLOW, GREEN, AQUAMARINE, PINK, WHEAT, GREY, BROWN, BLUE, BLUEVIOLET, CYAN, TURQUOISE, MAGENTA, SALMON, WHITE |
| fill | SOLID, SHADED, HATCHED, NOFILL |
| box: | NOBOX, BOX, LABELLED, AXES, GRID, AXESONLY |
| axis: | LINEAR, LOGX, LOGY, LOGXY |