npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cephes

v3.3.3

Published

Implementation of special functions and distributions mathematical functions from the cephes library.

Readme

node-cephes

This is a WebAssembly packaging of the cephes library. The cephes library contains C implementations of most special functions, distributions, and other hard-to-implement mathematical functions.

Install

npm install cephes

If you are looking on GitHub, you will notice some files are missing. These are statically built from the cephes library. See the CONTRIBUTING.md file, for how to build them.

Usage

Cephes is a WebAssembly module but is very small and fast to compile, as it doesn't depend on any runtime libraries. In Node.js it is therefore compiled synchronously and all you need to do is require the module.

const cephes = require('cephes'); // Node.js

In the browser, it is, for good practice, compiled asynchronously. You must therefore wait for the .compiled promise to be resolved.

const cephes = require('cephes'); // Browser
await cephes.compiled;

Note that the .compiled promise is also available in Node.js, but it is simply a dummy promise that resolves immediately.

The JavaScript interface

There are three variations of functions to be aware of:

1. Plain numeric function

These don't require anything special.

const value = cephes.zeta(2, 1);

2. Functions that return more than one value

In C, these functions return a primary value and then return extra value using pointer arguments. In JavaScript this is implemented as a function that returns an array of length 2. The first element is the primary returned value, the second is an object of the extra returned values.

const [value, {ai, aip, bi, bip}] = cephes.airy(-1);

3. Functions that consumes an array

Some functions consumes an array of values, these must be TypedArrays of the appropriate type. These functions will typically also require a variation of .length value as a parameter, like you would do in C. Be aware, that in some cases it may not be exactly the .length of the TypedArray, but may be one less or one more. Check the specific function documentation to be sure.

const arrayInput = new Float64Array([2.2, 3.3, 4.4]);
const value = cephes.polevl(1.1, arrayInput, arrayInput.length - 1);

4. Functions that use Complex numbers

Some functions use complex numbers. We have a convenience method in cephes (createComplex), which takes a real and imaginary part. Note most of the complex functions store the value in one of the arguments. For convenience, the last argument is returned by the function.

Here is an example with csin.

// Create the resulting complex
const w = cephes.createComplex();
// Run the function
cephes.csin(cephes.createComplex(0.5, 0.5), w);

// Output update of value to console
console.log(w.toString()); // Expect 0.5406126857131534 + 0.4573041531842493i

Table of Content

Documentation

Arithmetic and Algebraic

int = cephes.signbit(x: double)

signbit is the "Returns the sign bit". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#signbit.

const ret = cephes.signbit(x);

cephes.csinh(z: Complex, w: Complex)

csinh is the "Complex hyperbolic sine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#csinh.

cephes.csinh(z, w);

cephes.casinh(z: Complex, w: Complex)

casinh is the "Complex inverse hyperbolic sine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#casinh.

cephes.casinh(z, w);

cephes.ccosh(z: Complex, w: Complex)

ccosh is the "Complex hyperbolic cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ccosh.

cephes.ccosh(z, w);

cephes.cacosh(z: Complex, w: Complex)

cacosh is the "Complex inverse hyperbolic cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cacosh.

cephes.cacosh(z, w);

cephes.ctanh(z: Complex, w: Complex)

ctanh is the "Complex hyperbolic tangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ctanh.

cephes.ctanh(z, w);

cephes.catanh(z: Complex, w: Complex)

catanh is the "Complex inverse hyperbolic tangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#catanh.

cephes.catanh(z, w);

cephes.cpow(a: Complex, z: Complex, w: Complex)

cpow is the "Complex power function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cpow.

cephes.cpow(a, z, w);

cephes.cneg(a: Complex)

cneg is the "Complex negative". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cneg.

cephes.cneg(a);

int = cephes.isnan(x: double)

isnan is the "Check if Not-A-Number". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#isnan.

const ret = cephes.isnan(x);

int = cephes.isfinite(x: double)

isfinite is the "Check if finite". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#isfinite.

const ret = cephes.isfinite(x);

double = cephes.sqrt(x: double)

sqrt is the "Square root". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sqrt.

const ret = cephes.sqrt(x);

double = cephes.cbrt(x: double)

cbrt is the "Cube root". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cbrt.

const ret = cephes.cbrt(x);

double = cephes.polevl(x: double, coef: Float64Array, N: int)

polevl is the "Evaluate polynomial". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#polevl.

const ret = cephes.polevl(x, new Float64Array(coef), N);

double = cephes.chbevl(x: double, array: Float64Array, n: int)

chbevl is the "Evaluate Chebyshev series". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#chbevl.

const ret = cephes.chbevl(x, new Float64Array(array), n);

double = cephes.round(x: double)

round is the "Round to nearest integer value". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#round.

const ret = cephes.round(x);

double = cephes.ceil(x: double)

ceil is the "Truncate upward to integer". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ceil.

const ret = cephes.ceil(x);

double = cephes.floor(x: double)

floor is the "Truncate downward to integer". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#floor.

const ret = cephes.floor(x);

[double, extra] = cephes.frexp(x: double)

frexp is the "Extract exponent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#frexp.

const [ret, extra] = cephes.frexp(x);

The extra object contains the following values:

const {
  pw2: int
} = extra;

double = cephes.ldexp(x: double, pw2: int)

ldexp is the "Add integer to exponent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ldexp.

const ret = cephes.ldexp(x, pw2);

double = cephes.fabs(x: double)

fabs is the "Absolute value". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#fabs.

const ret = cephes.fabs(x);

Exponential and Trigonometric

double = cephes.expx2(x: double, sign: int)

expx2 is the "Exponential of squared argument". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#expx2.

const ret = cephes.expx2(x, sign);

double = cephes.radian(d: double, m: double, s: double)

radian is the "Degrees, minutes, seconds to radians". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#radian.

const ret = cephes.radian(d, m, s);

[int, extra] = cephes.sincos(x: double, flg: int)

sincos is the "Circular sine and cosine of argument in degrees". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sincos.

const [ret, extra] = cephes.sincos(x, flg);

The extra object contains the following values:

const {
  s: double,
  c: double
} = extra;

double = cephes.cot(x: double)

cot is the "Circular cotangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cot.

const ret = cephes.cot(x);

double = cephes.cotdg(x: double)

cotdg is the "Circular cotangent of argument in degrees". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cotdg.

const ret = cephes.cotdg(x);

double = cephes.log1p(x: double)

log1p is the "Relative error approximations for log(1 + x)". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#log1p.

const ret = cephes.log1p(x);

double = cephes.expm1(x: double)

expm1 is the "Relative error approximations for exp(x) - 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#expm1.

const ret = cephes.expm1(x);

double = cephes.cosm1(x: double)

cosm1 is the "Relative error approximations for cos(x) - 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cosm1.

const ret = cephes.cosm1(x);

double = cephes.acos(x: double)

acos is the "Arc cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#acos.

const ret = cephes.acos(x);

double = cephes.acosh(x: double)

acosh is the "Arc hyperbolic cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#acosh.

const ret = cephes.acosh(x);

double = cephes.asinh(xx: double)

asinh is the "Arc hyperbolic sine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#asinh.

const ret = cephes.asinh(xx);

double = cephes.atanh(x: double)

atanh is the "Arc hyperbolic tangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#atanh.

const ret = cephes.atanh(x);

double = cephes.asin(x: double)

asin is the "Arcsine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#asin.

const ret = cephes.asin(x);

double = cephes.atan(x: double)

atan is the "Arctangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#atan.

const ret = cephes.atan(x);

double = cephes.atan2(y: double, x: double)

atan2 is the "Quadrant correct arctangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#atan2.

const ret = cephes.atan2(y, x);

double = cephes.cos(x: double)

cos is the "Cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cos.

const ret = cephes.cos(x);

double = cephes.cosdg(x: double)

cosdg is the "Cosine of arg in degrees". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cosdg.

const ret = cephes.cosdg(x);

double = cephes.exp(x: double)

exp is the "Exponential, base e". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#exp.

const ret = cephes.exp(x);

double = cephes.exp2(x: double)

exp2 is the "Exponential, base 2". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#exp2.

const ret = cephes.exp2(x);

double = cephes.exp10(x: double)

exp10 is the "Exponential, base 10". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#exp10.

const ret = cephes.exp10(x);

double = cephes.cosh(x: double)

cosh is the "Hyperbolic cosine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#cosh.

const ret = cephes.cosh(x);

double = cephes.sinh(x: double)

sinh is the "Hyperbolic sine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sinh.

const ret = cephes.sinh(x);

double = cephes.tanh(x: double)

tanh is the "Hyperbolic tangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#tanh.

const ret = cephes.tanh(x);

double = cephes.log(x: double)

log is the "Logarithm, base e". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#log.

const ret = cephes.log(x);

double = cephes.log2(x: double)

log2 is the "Logarithm, base 2". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#log2.

const ret = cephes.log2(x);

double = cephes.log10(x: double)

log10 is the "Logarithm, base 10". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#log10.

const ret = cephes.log10(x);

double = cephes.pow(x: double, y: double)

pow is the "Power". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#pow.

const ret = cephes.pow(x, y);

double = cephes.powi(x: double, nn: int)

powi is the "Integer Power". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#powi.

const ret = cephes.powi(x, nn);

double = cephes.sin(x: double)

sin is the "Sine". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sin.

const ret = cephes.sin(x);

double = cephes.sindg(x: double)

sindg is the "Sine of arg in degrees". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sindg.

const ret = cephes.sindg(x);

double = cephes.tan(x: double)

tan is the "Tangent". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#tan.

const ret = cephes.tan(x);

double = cephes.tandg(x: double)

tandg is the "Tangent of arg in degrees". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#tandg.

const ret = cephes.tandg(x);

Exponential integral

double = cephes.ei(x: double)

ei is the "Exponential integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ei.

const ret = cephes.ei(x);

double = cephes.expn(n: int, x: double)

expn is the "Exponential integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#expn.

const ret = cephes.expn(n, x);

[int, extra] = cephes.shichi(x: double)

shichi is the "Hyperbolic cosine integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#shichi.

const [ret, extra] = cephes.shichi(x);

The extra object contains the following values:

const {
  si: double,
  ci: double
} = extra;

[int, extra] = cephes.sici(x: double)

sici is the "Cosine integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#sici.

const [ret, extra] = cephes.sici(x);

The extra object contains the following values:

const {
  si: double,
  ci: double
} = extra;

Gamma

double = cephes.lbeta(a: double, b: double)

lbeta is the "Natural log of |beta|.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#lbeta.

const ret = cephes.lbeta(a, b);

double = cephes.beta(a: double, b: double)

beta is the "Beta". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#beta.

const ret = cephes.beta(a, b);

double = cephes.fac(i: int)

fac is the "Factorial". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#fac.

const ret = cephes.fac(i);

double = cephes.gamma(x: double)

gamma is the "Gamma". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#gamma.

const ret = cephes.gamma(x);

double = cephes.lgam(x: double)

lgam is the "Logarithm of gamma function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#lgam.

const ret = cephes.lgam(x);

double = cephes.incbet(aa: double, bb: double, xx: double)

incbet is the "Incomplete beta integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#incbet.

const ret = cephes.incbet(aa, bb, xx);

double = cephes.incbi(aa: double, bb: double, yy0: double)

incbi is the "Inverse beta integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#incbi.

const ret = cephes.incbi(aa, bb, yy0);

double = cephes.igam(a: double, x: double)

igam is the "Incomplete gamma integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#igam.

const ret = cephes.igam(a, x);

double = cephes.igamc(a: double, x: double)

igamc is the "Complemented gamma integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#igamc.

const ret = cephes.igamc(a, x);

double = cephes.igami(a: double, y0: double)

igami is the "Inverse gamma integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#igami.

const ret = cephes.igami(a, y0);

double = cephes.psi(x: double)

psi is the "Psi (digamma) function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#psi.

const ret = cephes.psi(x);

double = cephes.rgamma(x: double)

rgamma is the "Reciprocal Gamma". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#rgamma.

const ret = cephes.rgamma(x);

Error function

double = cephes.erf(x: double)

erf is the "Error function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#erf.

const ret = cephes.erf(x);

double = cephes.erfc(a: double)

erfc is the "Complemented error function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#erfc.

const ret = cephes.erfc(a);

double = cephes.dawsn(xx: double)

dawsn is the "Dawson's integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#dawsn.

const ret = cephes.dawsn(xx);

[int, extra] = cephes.fresnl(xxa: double)

fresnl is the "Fresnel integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#fresnl.

const [ret, extra] = cephes.fresnl(xxa);

The extra object contains the following values:

const {
  ssa: double,
  cca: double
} = extra;

Bessel

[int, extra] = cephes.airy(x: double)

airy is the "Airy". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#airy.

const [ret, extra] = cephes.airy(x);

The extra object contains the following values:

const {
  ai: double,
  aip: double,
  bi: double,
  bip: double
} = extra;

double = cephes.j0(x: double)

j0 is the "Bessel, order 0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#j0.

const ret = cephes.j0(x);

double = cephes.j1(x: double)

j1 is the "Bessel, order 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#j1.

const ret = cephes.j1(x);

double = cephes.jn(n: int, x: double)

jn is the "Bessel, order n". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#jn.

const ret = cephes.jn(n, x);

double = cephes.jv(n: double, x: double)

jv is the "Bessel, noninteger order". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#jv.

const ret = cephes.jv(n, x);

double = cephes.y0(x: double)

y0 is the "Bessel, second kind, order 0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#y0.

const ret = cephes.y0(x);

double = cephes.y1(x: double)

y1 is the "Bessel, second kind, order 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#y1.

const ret = cephes.y1(x);

double = cephes.yn(n: int, x: double)

yn is the "Bessel, second kind, order n". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#yn.

const ret = cephes.yn(n, x);

double = cephes.yv(v: double, x: double)

yv is the "Bessel, noninteger order". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#yv.

const ret = cephes.yv(v, x);

double = cephes.i0(x: double)

i0 is the "Modified Bessel, order 0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#i0.

const ret = cephes.i0(x);

double = cephes.i0e(x: double)

i0e is the "Exponentially scaled i0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#i0e.

const ret = cephes.i0e(x);

double = cephes.i1(x: double)

i1 is the "Modified Bessel, order 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#i1.

const ret = cephes.i1(x);

double = cephes.i1e(x: double)

i1e is the "Exponentially scaled i1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#i1e.

const ret = cephes.i1e(x);

double = cephes.iv(v: double, x: double)

iv is the "Modified Bessel, nonint. order". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#iv.

const ret = cephes.iv(v, x);

double = cephes.k0(x: double)

k0 is the "Mod. Bessel, 3rd kind, order 0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#k0.

const ret = cephes.k0(x);

double = cephes.k0e(x: double)

k0e is the "Exponentially scaled k0". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#k0e.

const ret = cephes.k0e(x);

double = cephes.k1(x: double)

k1 is the "Mod. Bessel, 3rd kind, order 1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#k1.

const ret = cephes.k1(x);

double = cephes.k1e(x: double)

k1e is the "Exponentially scaled k1". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#k1e.

const ret = cephes.k1e(x);

double = cephes.kn(nn: int, x: double)

kn is the "Mod. Bessel, 3rd kind, order n". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#kn.

const ret = cephes.kn(nn, x);

Hypergeometric

double = cephes.hyperg(a: double, b: double, x: double)

hyperg is the "Confluent hypergeometric". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#hyperg.

const ret = cephes.hyperg(a, b, x);

double = cephes.hyp2f1(a: double, b: double, c: double, x: double)

hyp2f1 is the "Gauss hypergeometric function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#hyp2f1.

const ret = cephes.hyp2f1(a, b, c, x);

Elliptic

double = cephes.ellpe(x: double)

ellpe is the "Complete elliptic integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ellpe.

const ret = cephes.ellpe(x);

double = cephes.ellie(phi: double, m: double)

ellie is the "Incomplete elliptic integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ellie.

const ret = cephes.ellie(phi, m);

double = cephes.ellpk(x: double)

ellpk is the "Complete elliptic integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ellpk.

const ret = cephes.ellpk(x);

double = cephes.ellik(phi: double, m: double)

ellik is the "Incomplete elliptic integral". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ellik.

const ret = cephes.ellik(phi, m);

[int, extra] = cephes.ellpj(u: double, m: double)

ellpj is the "Jacobian elliptic function". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#ellpj.

const [ret, extra] = cephes.ellpj(u, m);

The extra object contains the following values:

const {
  sn: double,
  cn: double,
  dn: double,
  ph: double
} = extra;

Probability

double = cephes.btdtr(a: double, b: double, x: double)

btdtr is the "Beta distribution". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#btdtr.

const ret = cephes.btdtr(a, b, x);

double = cephes.smirnov(n: int, e: double)

smirnov is the "Exact Smirnov statistic, for one-sided test.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#smirnov.

const ret = cephes.smirnov(n, e);

double = cephes.kolmogorov(y: double)

kolmogorov is the "Kolmogorov's limiting distribution of two-sided test.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#kolmogorov.

const ret = cephes.kolmogorov(y);

double = cephes.smirnovi(n: int, p: double)

smirnovi is the "Functional inverse of Smirnov distribution.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#smirnovi.