• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    C
  • License
    Other
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

Note that there are a few cephes functions that are not exposed here, as some of them are quite hard to make consumable in JavaScript using WebAssembly. Feel free to send a pull request if you need one of them.

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 = ephes.polevl(1.1, arrayInput, arrayInput.length - 1);

Table of Content

Function Description Documentation
Arithmetic and Algebraic
signbit(x) Returns the sign bit c-doc  •  js-doc
isnan(x) Check if Not-A-Number c-doc  •  js-doc
isfinite(x) Check if finite c-doc  •  js-doc
cbrt(x) Cube root c-doc  •  js-doc
polevl(x, coef, N) Evaluate polynomial c-doc  •  js-doc
chbevl(x, array, n) Evaluate Chebyshev series c-doc  •  js-doc
round(x) Round to nearest integer value c-doc  •  js-doc
frexp(x) Extract exponent c-doc  •  js-doc
ldexp(x, pw2) Add integer to exponent c-doc  •  js-doc
Exponential and Trigonometric
expx2(x, sign) Exponential of squared argument c-doc  •  js-doc
radian(d, m, s) Degrees, minutes, seconds to radians c-doc  •  js-doc
sincos(x, flg) Circular sine and cosine of argument in degrees c-doc  •  js-doc
cot(x) Circular cotangent c-doc  •  js-doc
cotdg(x) Circular cotangent of argument in degrees c-doc  •  js-doc
log1p(x) Relative error approximations for log(1 + x) c-doc  •  js-doc
expm1(x) Relative error approximations for exp(x) - 1 c-doc  •  js-doc
cosm1(x) Relative error approximations for cos(x) - 1 c-doc  •  js-doc
acos(x) Arc cosine c-doc  •  js-doc
acosh(x) Arc hyperbolic cosine c-doc  •  js-doc
asinh(xx) Arc hyperbolic sine c-doc  •  js-doc
atanh(x) Arc hyperbolic tangent c-doc  •  js-doc
asin(x) Arcsine c-doc  •  js-doc
atan(x) Arctangent c-doc  •  js-doc
atan2(y, x) Quadrant correct arctangent c-doc  •  js-doc
cos(x) Cosine c-doc  •  js-doc
cosdg(x) Cosine of arg in degrees c-doc  •  js-doc
exp(x) Exponential, base e c-doc  •  js-doc
exp2(x) Exponential, base 2 c-doc  •  js-doc
exp10(x) Exponential, base 10 c-doc  •  js-doc
cosh(x) Hyperbolic cosine c-doc  •  js-doc
sinh(x) Hyperbolic sine c-doc  •  js-doc
tanh(x) Hyperbolic tangent c-doc  •  js-doc
log(x) Logarithm, base e c-doc  •  js-doc
log2(x) Logarithm, base 2 c-doc  •  js-doc
log10(x) Logarithm, base 10 c-doc  •  js-doc
pow(x, y) Power c-doc  •  js-doc
powi(x, nn) Integer Power c-doc  •  js-doc
sin(x) Sine c-doc  •  js-doc
sindg(x) Sine of arg in degrees c-doc  •  js-doc
tan(x) Tangent c-doc  •  js-doc
tandg(x) Tangent of arg in degrees c-doc  •  js-doc
Exponential integral
ei(x) Exponential integral c-doc  •  js-doc
expn(n, x) Exponential integral c-doc  •  js-doc
shichi(x) Hyperbolic cosine integral c-doc  •  js-doc
sici(x) Cosine integral c-doc  •  js-doc
Gamma
lbeta(a, b) Natural log of |beta|. c-doc  •  js-doc
beta(a, b) Beta c-doc  •  js-doc
fac(i) Factorial c-doc  •  js-doc
gamma(x) Gamma c-doc  •  js-doc
lgam(x) Logarithm of gamma function c-doc  •  js-doc
incbet(aa, bb, xx) Incomplete beta integral c-doc  •  js-doc
incbi(aa, bb, yy0) Inverse beta integral c-doc  •  js-doc
igam(a, x) Incomplete gamma integral c-doc  •  js-doc
igamc(a, x) Complemented gamma integral c-doc  •  js-doc
igami(a, y0) Inverse gamma integral c-doc  •  js-doc
psi(x) Psi (digamma) function c-doc  •  js-doc
rgamma(x) Reciprocal Gamma c-doc  •  js-doc
Error function
erf(x) Error function c-doc  •  js-doc
erfc(a) Complemented error function c-doc  •  js-doc
dawsn(xx) Dawson's integral c-doc  •  js-doc
fresnl(xxa) Fresnel integral c-doc  •  js-doc
Bessel
airy(x) Airy c-doc  •  js-doc
j0(x) Bessel, order 0 c-doc  •  js-doc
j1(x) Bessel, order 1 c-doc  •  js-doc
jn(n, x) Bessel, order n c-doc  •  js-doc
jv(n, x) Bessel, noninteger order c-doc  •  js-doc
y0(x) Bessel, second kind, order 0 c-doc  •  js-doc
y1(x) Bessel, second kind, order 1 c-doc  •  js-doc
yn(n, x) Bessel, second kind, order n c-doc  •  js-doc
yv(v, x) Bessel, noninteger order c-doc  •  js-doc
i0(x) Modified Bessel, order 0 c-doc  •  js-doc
i0e(x) Exponentially scaled i0 c-doc  •  js-doc
i1(x) Modified Bessel, order 1 c-doc  •  js-doc
i1e(x) Exponentially scaled i1 c-doc  •  js-doc
iv(v, x) Modified Bessel, nonint. order c-doc  •  js-doc
k0(x) Mod. Bessel, 3rd kind, order 0 c-doc  •  js-doc
k0e(x) Exponentially scaled k0 c-doc  •  js-doc
k1(x) Mod. Bessel, 3rd kind, order 1 c-doc  •  js-doc
k1e(x) Exponentially scaled k1 c-doc  •  js-doc
kn(nn, x) Mod. Bessel, 3rd kind, order n c-doc  •  js-doc
Hypergeometric
hyperg(a, b, x) Confluent hypergeometric c-doc  •  js-doc
hyp2f1(a, b, c, x) Gauss hypergeometric function c-doc  •  js-doc
Elliptic
ellpe(x) Complete elliptic integral c-doc  •  js-doc
ellie(phi, m) Incomplete elliptic integral c-doc  •  js-doc
ellpk(x) Complete elliptic integral c-doc  •  js-doc
ellik(phi, m) Incomplete elliptic integral c-doc  •  js-doc
ellpj(u, m) Jacobian elliptic function c-doc  •  js-doc
Probability
btdtr(a, b, x) Beta distribution c-doc  •  js-doc
smirnov(n, e) Exact Smirnov statistic, for one-sided test. c-doc  •  js-doc
kolmogorov(y) Kolmogorov's limiting distribution of two-sided test. c-doc  •  js-doc
smirnovi(n, p) Functional inverse of Smirnov distribution. c-doc  •  js-doc
kolmogi(p) Functional inverse of Kolmogorov statistic for two-sided test. c-doc  •  js-doc
nbdtri(k, n, p) Inverse Negative binomial distribution c-doc  •  js-doc
stdtri(k, p) Functional inverse of Student's t distribution c-doc  •  js-doc
bdtr(k, n, p) Binomial distribution c-doc  •  js-doc
bdtrc(k, n, p) Complemented binomial c-doc  •  js-doc
bdtri(k, n, y) Inverse binomial c-doc  •  js-doc
chdtr(df, x) Chi square distribution c-doc  •  js-doc
chdtrc(df, x) Complemented Chi square c-doc  •  js-doc
chdtri(df, y) Inverse Chi square c-doc  •  js-doc
fdtr(ia, ib, x) F distribution c-doc  •  js-doc
fdtrc(ia, ib, x) Complemented F c-doc  •  js-doc
fdtri(ia, ib, y) Inverse F distribution c-doc  •  js-doc
gdtr(a, b, x) Gamma distribution c-doc  •  js-doc
gdtrc(a, b, x) Complemented gamma c-doc  •  js-doc
nbdtr(k, n, p) Negative binomial distribution c-doc  •  js-doc
nbdtrc(k, n, p) Complemented negative binomial c-doc  •  js-doc
ndtr(a) Normal distribution c-doc  •  js-doc
ndtri(y0) Inverse normal distribution c-doc  •  js-doc
pdtr(k, m) Poisson distribution c-doc  •  js-doc
pdtrc(k, m) Complemented Poisson c-doc  •  js-doc
pdtri(k, y) Inverse Poisson distribution c-doc  •  js-doc
stdtr(k, t) Student's t distribution c-doc  •  js-doc
Miscellaneous
plancki(w, T) Integral of Planck's black body radiation formula c-doc  •  js-doc
planckc(w, T) Complemented Planck radiation integral c-doc  •  js-doc
planckd(w, T) Planck's black body radiation formula c-doc  •  js-doc
planckw(T) Wavelength, w, of maximum radiation at given temperature T. c-doc  •  js-doc
spence(x) Dilogarithm c-doc  •  js-doc
zetac(x) Riemann Zeta function c-doc  •  js-doc
zeta(x, q) Two argument zeta function c-doc  •  js-doc
struve(v, x) Struve function c-doc  •  js-doc
Polynomials and Power Series
p1evl(x, coef, N) Evaluate polynomial when coefficient of x is 1.0. c-doc  •  js-doc
polylog(n, x) The polylogarithm of order n c-doc  •  js-doc

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);

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.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, 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);

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.

const ret = cephes.smirnovi(n, p);

double = cephes.kolmogi(p: double)

kolmogi is the "Functional inverse of Kolmogorov statistic for two-sided test.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#kolmogi.

const ret = cephes.kolmogi(p);

double = cephes.nbdtri(k: int, n: int, p: double)

nbdtri is the "Inverse Negative binomial distribution". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#nbdtri.

const ret = cephes.nbdtri(k, n, p);

double = cephes.stdtri(k: int, p: double)

stdtri is the "Functional inverse of Student's t distribution". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#stdtri.

const ret = cephes.stdtri(k, p);

double = cephes.bdtr(k: int, n: int, p: double)

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

const ret = cephes.bdtr(k, n, p);

double = cephes.bdtrc(k: int, n: int, p: double)

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

const ret = cephes.bdtrc(k, n, p);

double = cephes.bdtri(k: int, n: int, y: double)

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

const ret = cephes.bdtri(k, n, y);

double = cephes.chdtr(df: double, x: double)

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

const ret = cephes.chdtr(df, x);

double = cephes.chdtrc(df: double, x: double)

chdtrc is the "Complemented Chi square". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#chdtrc.

const ret = cephes.chdtrc(df, x);

double = cephes.chdtri(df: double, y: double)

chdtri is the "Inverse Chi square". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#chdtri.

const ret = cephes.chdtri(df, y);

double = cephes.fdtr(ia: int, ib: int, x: double)

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

const ret = cephes.fdtr(ia, ib, x);

double = cephes.fdtrc(ia: int, ib: int, x: double)

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

const ret = cephes.fdtrc(ia, ib, x);

double = cephes.fdtri(ia: int, ib: int, y: double)

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

const ret = cephes.fdtri(ia, ib, y);

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

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

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

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

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

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

double = cephes.nbdtr(k: int, n: int, p: double)

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

const ret = cephes.nbdtr(k, n, p);

double = cephes.nbdtrc(k: int, n: int, p: double)

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

const ret = cephes.nbdtrc(k, n, p);

double = cephes.ndtr(a: double)

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

const ret = cephes.ndtr(a);

double = cephes.ndtri(y0: double)

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

const ret = cephes.ndtri(y0);

double = cephes.pdtr(k: int, m: double)

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

const ret = cephes.pdtr(k, m);

double = cephes.pdtrc(k: int, m: double)

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

const ret = cephes.pdtrc(k, m);

double = cephes.pdtri(k: int, y: double)

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

const ret = cephes.pdtri(k, y);

double = cephes.stdtr(k: int, t: double)

stdtr is the "Student's t distribution". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#stdtr.

const ret = cephes.stdtr(k, t);

Miscellaneous

double = cephes.plancki(w: double, T: double)

plancki is the "Integral of Planck's black body radiation formula". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#plancki.

const ret = cephes.plancki(w, T);

double = cephes.planckc(w: double, T: double)

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

const ret = cephes.planckc(w, T);

double = cephes.planckd(w: double, T: double)

planckd is the "Planck's black body radiation formula". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#planckd.

const ret = cephes.planckd(w, T);

double = cephes.planckw(T: double)

planckw is the "Wavelength, w, of maximum radiation at given temperature T.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#planckw.

const ret = cephes.planckw(T);

double = cephes.spence(x: double)

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

const ret = cephes.spence(x);

double = cephes.zetac(x: double)

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

const ret = cephes.zetac(x);

double = cephes.zeta(x: double, q: double)

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

const ret = cephes.zeta(x, q);

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

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

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

Polynomials and Power Series

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

p1evl is the "Evaluate polynomial when coefficient of x is 1.0.". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#p1evl.

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

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

polylog is the "The polylogarithm of order n". You can read the full documentation at http://www.netlib.org/cephes/doubldoc.html#polylog.

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

LICENSE

The cephes library, that this module wraps, can be found at http://www.netlib.org/cephes/. The cephes library from the NetLib website, doesn't have any license. However, the author Stephen Moshier, has kindly given permission for it to be included in a BSD-licensed package.

Please see the LICENSE file, for all the details.

More Repositories

1

graphql-hooks

🎣 Minimal hooks-first GraphQL client
TypeScript
1,878
star
2

temporal_tables

Postgresql temporal_tables extension in PL/pgSQL, without the need for external c extension.
PLpgSQL
429
star
3

fast-jwt

Fast JSON Web Token implementation
JavaScript
330
star
4

nscale

Deployment just got easy
JavaScript
325
star
5

react-animation

Animation components and styles for React projects
JavaScript
285
star
6

sql

SQL injection protection module
JavaScript
201
star
7

react-browser-hooks

React Browser Hooks
JavaScript
128
star
8

udaru

Open source Access Manager for node.js
JavaScript
125
star
9

the-fastify-workshop

A workshop about Fastify
JavaScript
113
star
10

gammaray

Node.js vulnerability scanner
Go
104
star
11

autopsy

dissect your dead node services with mdb via a smart os vm
JavaScript
89
star
12

fastify-auth0-verify

Auth0 verification plugin for Fastify
JavaScript
87
star
13

titus

Deploy useful features in sprint one
JavaScript
61
star
14

micro-services-tutorial-iot

An instructor led microservices workshop
JavaScript
54
star
15

developing-microservices

A workshop on microservices in nodejs
JavaScript
54
star
16

heap-profiler

Heap dump and sample profiler generator for Node.
JavaScript
52
star
17

docker-cloudwatch

Docker Cloudwatch
JavaScript
46
star
18

promises-workshop

Broken Promises Exercises
HTML
45
star
19

polaris

NearForm multi-platform application accelerator
JavaScript
35
star
20

nscale-workshop

Nodeconf.eu nscale workshop
35
star
21

well

well
JavaScript
35
star
22

nceubadge

The NodeConf EU 2017 Badge
HTML
34
star
23

owasp-top-ten-workshop

NearForm OWASP Top Ten Security Vulnerabilities Workshop
JavaScript
34
star
24

graphql-auto-federate

Automatically federate a Mercurius GraphQL service
JavaScript
32
star
25

trail

Audit trail log service
JavaScript
32
star
26

slow-rest-api

A REST API that is slow
HTML
31
star
27

stats

📊 Collect stats about your node.js process 📊
JavaScript
29
star
28

node-hidden-markov-model-tf

A trainable Hidden Markov Model with Gaussian emissions using TensorFlow.js
JavaScript
28
star
29

autocannon-ui

A graphical user interface for autocannon providing the same user experience
JavaScript
28
star
30

react-pwa

Hackernews Progressive Web Application built with React
JavaScript
28
star
31

open-banking-reference-app

NearForm reference application for open banking - https://community.nearform.com/api-banking
TypeScript
27
star
32

react-redux-typescript-saga-immutable

Sample React boilerplate written in TypeScript, including React Router, Redux, Redux Saga, ImmutableJS and Styled Components.
TypeScript
27
star
33

fastify-overview-ui

UI for fastify-overview
JavaScript
26
star
34

minishift-demo

Demo for local development using minishift
Shell
25
star
35

reviewbot

A bot to assist with code reviews via AI
JavaScript
25
star
36

get-jwks

Fetch utils for JWKS keys
JavaScript
23
star
37

sharing-components

JavaScript
23
star
38

tf-modules-example

Code example for the reusable, configurable Terraform modules blog post
HCL
22
star
39

aws-proxy-pattern

Terraform module to create a transparent proxy within AWS
HCL
20
star
40

openapi-transformer-toolkit

Automate design-first API workflows by generating schemas and types from OpenAPI specs.
TypeScript
20
star
41

fastify-casbin

A plugin for Fastify that adds support for Casbin
JavaScript
19
star
42

the-graphql-workshop

A workshop about GraphQL with mercurius
JavaScript
18
star
43

choo-pwa

PWA with Choo
JavaScript
17
star
44

no-gres

A small module to mock pg for testing purposes.
JavaScript
17
star
45

nscale-docs

Documentation for nscale
17
star
46

optic

App for generating OTP tokens for 2FA protected accounts
JavaScript
17
star
47

initium-platform

A set of Kubernetes add-ons with optimal configuration and test coverage to create a day zero platform for your code
Go
16
star
48

optic-release-automation-action

Automate the release process of your npm modules, apps and actions
JavaScript
15
star
49

brokeneck

Admin UI for Auth0, Azure AD and AWS Cognito
JavaScript
15
star
50

node-test-runner-workshop

The Node.js Test Runner Workshop
JavaScript
14
star
51

graphql-hooks-workshop

HTML
14
star
52

react-patterns-workshop

A workshop which covers intermediate and advanced React usage patterns
JavaScript
14
star
53

node-test-github-reporter

A GitHub test reporter for the Node.js test runner
JavaScript
14
star
54

mira

The Mira Accelerator fast-tracks the setup of common Amazon Web Services (AWS) Serverless infrastructure
TypeScript
13
star
55

react-native-apple-wallet-demo

Create Custom Apple Wallet Passes with React Native and Fastify
JavaScript
13
star
56

langchain-google-calendar

A spike project: allows natural language to create actions in Google Calendar
TypeScript
12
star
57

fastify-casbin-rest

A plugin for Fastify that adds support for Casbin's REST model
JavaScript
12
star
58

cloudwatchlogs-stream

Stream interfacet to CloudWatch Logs
JavaScript
11
star
59

mercurius-apollo-registry

A Mercurius plugin for schema reporting to Apollo Studio
JavaScript
11
star
60

leaistic

An ElasticSearch manager
JavaScript
11
star
61

stats-to-elasticsearch

Collect and send stats about your node.js process to elasticsearch. 📊🔌📈
JavaScript
10
star
62

nceubadge2018

NodeConf EU 2018 Badge code and hardware design files
JavaScript
10
star
63

openshift-kafka

Run Apache Kafka in Openshift Origin
Smarty
10
star
64

create-stats-dashboard

📈 A wrapper to create and initialise a stats dashboard on kibana using import-kibana-dashboard, for easy manipulation of stats sent via stats-to-elasticsearch 📉
JavaScript
10
star
65

fastify-mssql

MSSQL Plugin for Fastify
JavaScript
10
star
66

mercurius-explain

A Mercurius plugin that shows the execution time of each resolver in a query
JavaScript
10
star
67

the-micro-frontends-workshop

The Micro Frontends Workshop with Module Federation
JavaScript
9
star
68

commentami

A 'google docs' like commenting system
JavaScript
9
star
69

zoom-shuffle-bot

Zoom Chatbot used to retrieve a randomized list of your current meeting's participants
JavaScript
9
star
70

jsnation-node-workshop

Our workshop at JSNation 2019
JavaScript
9
star
71

optic-expo

Secure 2FA OTP via Mobile Push Notifications
TypeScript
8
star
72

choo-data

Simple data fetching plugin for Choo with server-side rendering support
JavaScript
8
star
73

nodeconfeu-gesture-models

Ongoing attempts at gesture models
C++
8
star
74

slack-knowledgebase-chatgpt-responder

ChatGPT powered slack responder to the questions that are about NearForm knowledge base
JavaScript
8
star
75

initium

Deploy your code on day zero, avoiding vendor lock-in.
7
star
76

playwright-firebase

A plugin to handle Firebase authentication in Playwright tests
TypeScript
7
star
77

docker-container

JavaScript
7
star
78

otlp-blueprint

Open Telemetry + Jaeger + 3-tier application Blueprint
HCL
7
star
79

pwa-poc

PWA for proof of concept for sharing images, qrcode scanning and geolocation from a PWA
JavaScript
7
star
80

slidev-theme-nearform

NearForm theme for sli.dev presentations
CSS
6
star
81

saluki

Utility based CSS-in-JS theming
JavaScript
6
star
82

fastify-secrets-aws

Fastify secrets plugin for AWS Secrets Manager
JavaScript
6
star
83

fastify-cloud-run

Fastify on Google Cloud Run
JavaScript
6
star
84

iot-system

A fuge config for a demo iot system
JavaScript
6
star
85

fastify-slow-down

A slow down plugin for fastify
JavaScript
6
star
86

github-action-check-linked-issues

GitHub action to check if pull requests have their corresponding issues.
JavaScript
6
star
87

github-board-slack-notifications

Send notifications to a Slack channel for any changes that are performed in a GitHub board (Projects v2 / beta)
JavaScript
6
star
88

openshift-ansible

Ansible code for openshift
Python
5
star
89

fastify-jwt-jwks

JSON Web Key Set (JWKS) verification plugin for Fastify
JavaScript
5
star
90

memleak-exercise

JavaScript
5
star
91

github-action-notify-release

GitHub Action that automatically creates an issue with an overview of the commits that are waiting to be released
JavaScript
5
star
92

fastify-ravendb

Fastify RavenDB connection plugin
JavaScript
5
star
93

fastify-secrets-azure

Fastify secrets plugin for Azure Key Vault
JavaScript
5
star
94

anger

pub-sub tester for Nes
JavaScript
5
star
95

choo-bundles

Bundle splitting with HTTP2 push support for Choo with choo-ssr
JavaScript
5
star
96

sentinel

Sentinel - a testing & monitoring application
JavaScript
5
star
97

mercurius-explain-graphiql-plugin

A Graphiql plugin to show the results from mercurius-explain
JavaScript
5
star
98

azure-workshop

Azure Workshop on Kubernetes
JavaScript
5
star
99

webinar-streams

Examples for the streams Webinar
JavaScript
4
star
100

initium-cli

CLI tool for the Initium project
Go
4
star