Skip to content

stdlib-js/math-base-special

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Special Functions

NPM version Build Status Coverage Status

Base (i.e., lower-level) special math functions.

Installation

npm install @stdlib/math-base-special

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var special = require( '@stdlib/math-base-special' );

special

Namespace for "base" (i.e., lower-level) special math functions.

var fcns = special;
// returns {...}

Exponential & Logarithmic Functions

  • exp( x ): natural exponential function.
  • exp10( x ): base 10 exponential function.
  • exp2( x ): base 2 exponential function.
  • expit( x ): compute the standard logistic function.
  • expm1( x ): compute exp(x) - 1.
  • expm1rel( x ): compute the relative error exponential.
  • kernelLog1p( f ): evaluate a correction term for double-precision base-2 and base-10 logarithms when 1+f is in [√2/2, √2].
  • kernelLog1pf( f ): evaluate a correction term for single-precision base-2 and base-10 logarithms when 1 + f is in [√2/2, √2].
  • ln( x ): evaluate the natural logarithm of a double-precision floating-point number.
  • log( x, b ): compute the base b logarithm of a double-precision floating-point number.
  • log10( x ): evaluate the common logarithm.
  • log1mexp( x ): evaluates the natural logarithm of 1-exp(-|x|).
  • log1p( x ): evaluate the natural logarithm of 1+x.
  • log1pexp( x ): evaluates the natural logarithm of 1+exp(x).
  • log1pmx( x ): evaluate ln(1+x) - x.
  • log2( x ): evaluate the binary logarithm.
  • logaddexp( x, y ): evaluates the natural logarithm of exp(x) + exp(y).
  • logf( x, b ): compute the base b logarithm of a single-precision floating-point number.
  • logitf( p ): compute the logit function for a single-precision floating-point number.
  • pow( base, exponent ): exponential function.
  • powm1( b, x ): evaluate bˣ - 1.
  • xlog1py( x, y ): compute x * ln(y+1) so that the result is 0 if x = 0.
  • xlogy( x, y ): compute x * ln(y) so that the result is 0 if x = 0.
  • xlogyf( x, y ): compute x * ln(y) so that the result is 0 if x = 0 for single-precision floating-point numbers x and y.

Trigonometric Functions

  • acos( x ): compute the arccosine of a double-precision floating-point number.
  • acosd( x ): compute the arccosine in degrees of a double-precision floating-point number.
  • acosdf( x ): compute the arccosine (in degrees) of a single-precision floating-point number.
  • acosf( x ): compute the arccosine of a single-precision floating-point number.
  • acosh( x ): compute the hyperbolic arccosine of a double-precision floating-point number.
  • acovercos( x ): compute the inverse coversed cosine.
  • acovercosf( x ): compute the inverse coversed cosine of a single-precision floating-point number (in radians).
  • acoversin( x ): compute the inverse coversed sine.
  • acoversinf( x ): compute the inverse coversed sine of a single-precision floating-point number (in radians).
  • ahavercos( x ): compute the inverse half-value versed cosine.
  • ahavercosf( x ): compute the inverse half-value versed cosine of a single-precision floating point number.
  • ahaversin( x ): compute the inverse half-value versed sine.
  • ahaversinf( x ): compute the inverse half-value versed sine of a single-precision floating-point number.
  • asin( x ): compute the arcsine of a double-precision floating-point number.
  • asind( x ): compute the arcsine (in degrees) of a double-precision floating-point number.
  • asindf( x ): compute the arcsine (in degrees) of a single-precision floating-point number.
  • asinf( x ): compute the arcsine of a single-precision floating-point number.
  • asinh( x ): compute the hyperbolic arcsine of a double-precision floating-point number.
  • atan( x ): compute the arctangent of a double-precision floating-point number.
  • atan2( y, x ): compute the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y).
  • atan2d( y, x ): compute the angle in the plane (in degrees) between the positive x-axis and the ray from (0,0) to the point (x,y).
  • atan2f( y, x ): compute the angle in the plane (in radians) between the positive x-axis and the ray from (0,0) to the point (x,y) as a single-precision floating-point number.
  • atand( x ): compute the arctangent in degrees of a double-precision floating-point number.
  • atandf( x ): compute the arctangent (in degrees) of a single-precision floating-point number.
  • atanf( x ): compute the arctangent of a single-precision floating-point number.
  • atanh( x ): compute the hyperbolic arctangent of a double-precision floating-point number.
  • avercos( x ): compute the inverse versed cosine.
  • avercosf( x ): compute the inverse versed cosine of a single-precision floating-point number (in radians).
  • aversin( x ): compute the inverse versed sine.
  • aversinf( x ): compute the inverse versed sine of a single-precision floating-point number (in radians).
  • cos( x ): compute the cosine of a number.
  • cosd( x ): computes the cosine of an angle measured in degrees.
  • cosdf( x ): computes the cosine of a single-precision floating-point number (in degrees).
  • cosf( x ): compute the cosine of a single-precision floating-point number (in radians).
  • cosh( x ): compute the hyperbolic cosine of a double-precision floating-point number.
  • cosm1( x ): compute cos(x) - 1.
  • cosm1f( x ): compute cos(x) - 1.
  • cospi( x ): compute the cosine of a number times π.
  • cospif( x ): compute the cosine of a number times π.
  • covercos( x ): compute the coversed cosine.
  • covercosf( x ): compute the coversed cosine of a single-precision floating-point number (in radians).
  • coversin( x ): compute the coversed sine.
  • coversinf( x ): compute the coversed sine of a single-precision floating-point number (in radians).
  • hacovercos( x ): compute the half-value coversed cosine.
  • hacovercosf( x ): compute the half-value coversed cosine of a single-precision floating-point number (in radians).
  • hacoversin( x ): compute the half-value coversed sine.
  • hacoversinf( x ): compute the half-value coversed sine of a single-precision floating-point number (in radians).
  • havercos( x ): compute the half-value versed cosine.
  • havercosf( x ): compute the half-value versed cosine of a single-precision floating-point number (in radians).
  • haversin( x ): compute the half-value versed sine.
  • haversinf( x ): compute the half-value versed sine of a single-precision floating-point number (in radians).
  • kernelCosf( x ): compute the cosine of a number on [-π/4, π/4] in single-precision floating-point format.
  • kernelSincos( x, y, out, stride, offset ): simultaneously compute the sine and cosine of an angle measured in radians on the interval [-π/4, π/4].
  • kernelSincosf( x ): simultaneously compute the sine and cosine of an angle measured in radians on [-π/4, π/4] in single-precision floating-point format.
  • kernelSinf( x ): compute the sine of a number on [-π/4, π/4] in single-precision floating-point format.
  • kernelTanf( x, iy ): compute the tangent of a number on [-π/4, π/4] in single-precision floating-point format.
  • risingFactorial( x, n ): compute the rising factorial.
  • sin( x ): compute the sine of a number.
  • sinc( x ): compute the cardinal sine of a number.
  • sincf( x ): compute the cardinal sine of a single-precision floating-point number (in radians).
  • sincos( x ): simultaneously compute the sine and cosine of an angle measured in radians.
  • sincosd( x ): simultaneously compute the sine and cosine of an angle measured in degrees.
  • sincosf( x ): simultaneously compute the sine and cosine of a single-precision floating-point number (in radians).
  • sincospi(): simultaneously compute the sine and cosine of a number times π.
  • sind( x ): compute the sine of an angle measured in degrees.
  • sindf( x ): compute the sine of a single-precision floating-point number (in degrees).
  • sinf( x ): compute the sine of a single-precision floating-point number (in radians).
  • sinh( x ): compute the hyperbolic sine of a double-precision floating-point number.
  • sinpi( x ): compute the sine of a number times π.
  • sinpif( x ): compute the sine of a number times π.
  • tan( x ): evaluate the tangent of a number.
  • tand( x ): compute the tangent of an angle measured in degrees.
  • tandf( x ): compute the tangent of a single-precision floating-point number (in degrees).
  • tanf( x ): evaluate the tangent of a single-precision floating-point number (in radians).
  • tanh( x ): compute the hyperbolic tangent of a double-precision floating-point number.
  • vercos( x ): compute the versed cosine.
  • vercosf( x ): compute the versed cosine of a single-precision floating-point number (in radians).
  • versin( x ): compute the versed sine.
  • versinf( x ): compute the versed sine of a single-precision floating-point number (in radians).

Bessel Functions

  • besselj0( x ): compute the Bessel function of the first kind of order zero.
  • besselj1( x ): compute the Bessel function of the first kind of order one.
  • bessely0( x ): compute the Bessel function of the second kind of order zero.
  • bessely1( x ): compute the Bessel function of the second kind of order one.

Absolute Value and Rounding Functions

  • abs( x ): compute the absolute value of a double-precision floating-point number.
  • abs2( x ): compute the squared absolute value of a double-precision floating-point number.
  • abs2f( x ): compute the squared absolute value of a single-precision floating-point number.
  • absf( x ): compute the absolute value of a single-precision floating-point number.
  • absgammalnf( x ): natural logarithm of the absolute value of the gamma function.
  • cabs( z ): compute the absolute value of a double-precision complex floating-point number.
  • cabs2( z ): compute the squared absolute value of a double-precision complex floating-point number.
  • cabs2f( z ): compute the squared absolute value of a single-precision complex floating-point number.
  • cabsf( z ): compute the absolute value of a single-precision complex floating-point number.
  • cceil( z ): round each component of a double-precision complex floating-point number toward positive infinity.
  • cceilf( z ): round each component of a single-precision complex floating-point number toward positive infinity.
  • cceiln( z, n ): round each component of a double-precision complex floating-point number to the nearest multiple of 10^n toward positive infinity.
  • ceil( x ): round a double-precision floating-point number toward positive infinity.
  • ceil10( x ): round a numeric value to the nearest power of 10 toward positive infinity.
  • ceil2( x ): round a numeric value to the nearest power of two toward positive infinity.
  • ceilb( x, n, b ): round a numeric value to the nearest multiple of b^n toward positive infinity.
  • ceilf( x ): round a single-precision floating-point number toward positive infinity.
  • ceiln( x, n ): round a numeric value to the nearest multiple of 10^n toward positive infinity.
  • ceilsd( x, n, b ): round a numeric value to the nearest number toward positive infinity with N significant figures.
  • cfloor( z ): round a double-precision complex floating-point number toward negative infinity.
  • cfloorf( z ): round each component of a single-precision complex floating-point number toward negative infinity.
  • cfloorn( z, n ): round each component of a double-precision complex floating-point number to the nearest multiple of 10^n toward negative infinity.
  • clamp( v, min, max ): restrict a double-precision floating-point number to a specified range.
  • clampf( v, min, max ): restrict a single-precision floating-point number to a specified range.
  • cround( z ): round each component of a double-precision complex floating-point number to the nearest integer.
  • croundf( z ): round each component of a single-precision complex floating-point number to the nearest integer.
  • croundn( z, n ): round each component of a double-precision complex floating-point number to the nearest multiple of 10^n.
  • csignum( z ): evaluate the signum function of a double-precision complex floating-point number.
  • csignumf( z ): evaluate the signum function of a single-precision complex floating-point number.
  • floor( x ): round a double-precision floating-point number toward negative infinity.
  • floor10( x ): round a numeric value to the nearest power of 10 toward negative infinity.
  • floor2( x ): round a numeric value to the nearest power of two toward negative infinity.
  • floorb( x, n, b ): round a numeric value to the nearest multiple of b^n toward negative infinity.
  • floorf( x ): round a single-precision floating-point numeric value toward negative infinity.
  • floorn( x, n ): round a double-precision floating-point number to the nearest multiple of 10^n toward negative infinity.
  • floorsd( x, n, b ): round a numeric value to the nearest number toward negative infinity with N significant figures.
  • labs( x ): compute an absolute value of a signed 32-bit integer.
  • maxabs( x, y ): return the maximum absolute value.
  • maxabsf( x, y ): return the maximum absolute single-precision floating-point number.
  • maxabsn( [x[, y[, ...args]]] ): return the maximum absolute value.
  • minabs( x, y ): return the minimum absolute value.
  • minabsf( x, y ): return the minimum absolute single-precision floating-point number.
  • minabsn( [x[, y[, ...args]]] ): return the minimum absolute value.
  • minmaxabs( x, y ): return the minimum and maximum absolute values.
  • minmaxabsf( x, y ): return the minimum and maximum absolute values of two single-precision floating-point numbers.
  • minmaxabsn( [x[, y[, ...args]]] ): return the minimum and maximum absolute values.
  • roundNearestEven( x ): round a double-precision floating-point number to the nearest integer value with ties rounding to the nearest even integer.
  • round( x ): round a numeric value to the nearest integer.
  • round10( x ): round a numeric value to the nearest power of 10 on a linear scale.
  • round2( x ): round a numeric value to the nearest power of two on a linear scale.
  • roundb( x, n, b ): round a numeric value to the nearest multiple of b^n on a linear scale.
  • roundf( x ): round a single-precision floating-point number to the nearest integer.
  • roundn( x, n ): round a double-precision floating-point number to the nearest multiple of 10^n.
  • roundsd( x, n[, b] ): round a double-precision floating-point number to the nearest value with n significant figures.
  • signum( x ): signum function.
  • signumf( x ): signum function.
  • trunc( x ): round a double-precision floating-point number toward zero.
  • trunc10( x ): round a numeric value to the nearest power of 10 toward zero.
  • trunc2( x ): round a numeric value to the nearest power of two toward zero.
  • truncb( x, n, b ): round a numeric value to the nearest multiple of b^n toward zero.
  • truncf( x ): round a single-precision floating-point number toward zero.
  • truncn( x, n ): round a numeric value to the nearest multiple of 10^n toward zero.
  • truncsd( x, n, b ): round a numeric value to the nearest number toward zero with n significant figures.

Other Special Functions

  • acot( x ): compute the inverse cotangent of a double-precision floating-point number.
  • acotd( x ): compute the arccotangent in degrees of a double-precision floating-point number.
  • acotdf( x ): compute the arccotangent in degrees of a single-precision floating-point number.
  • acotf( x ): compute the inverse cotangent of a single-precision floating-point number.
  • acoth( x ): compute the inverse hyperbolic cotangent of a double-precision floating-point number.
  • acsc( x ): compute the arccosecant of a number.
  • acscd( x ): compute the arccosecant in degrees of a double-precision floating-point number.
  • acscdf( x ): compute the arccosecant (in degrees) of a single-precision floating-point number.
  • acscf( x ): compute the arccosecant of a single-precision floating-point number.
  • acsch( x ): compute the hyperbolic arccosecant of a number.
  • asec( x ): compute the inverse (arc) secant of a number.
  • asecd( x ): compute the arcsecant (in degrees) of a double-precision floating-point number.
  • asecdf( x ): compute the arcsecant (in degrees) of a single-precision floating-point number.
  • asecf( x ): compute the inverse (arc) secant of a single-precision floating-point number.
  • asech( x ): compute the hyperbolic arcsecant of a number.
  • bernoulli( n ): compute the nth Bernoulli number.
  • bernoullif( n ): compute the nth Bernoulli number as a single-precision floating-point number.
  • beta( x, y ): beta function.
  • betainc( x, a, b[, regularized[, upper]] ): incomplete beta function.
  • betaincinv( p, a, b[, upper] ): inverse of the incomplete beta function.
  • betaln( x, y ): natural logarithm of the beta function.
  • binet( x ): evaluate Binet's formula extended to real numbers.
  • binomcoef( n, k ): compute the binomial coefficient.
  • binomcoeff( n, k ): compute the binomial coefficient as a single-precision floating-point number.
  • binomcoefln( n, k ): compute the natural logarithm of the binomial coefficient.
  • boxcox( x, lambda ): compute a one-parameter Box-Cox transformation.
  • boxcox1p( x, lambda ): compute a one-parameter Box-Cox transformation of 1+x.
  • boxcox1pinv( y, lambda ): compute the inverse of a one-parameter Box-Cox transformation for 1+x.
  • boxcoxinv( y, lambda ): compute the inverse of a one-parameter Box-Cox transformation.
  • cbrt( x ): compute the cube root of a double-precision floating-point number.
  • cbrtf( x ): compute the cube root of a single-precision floating-point number.
  • ccis( z ): evaluate the cis function for a double-precision complex floating-point number.
  • cexp( z ): evaluate the exponential function for a double-precision complex floating-point number.
  • cflipsign( z, y ): return a double-precision complex floating-point number with the same magnitude as z and the sign of y*z.
  • cflipsignf( z, y ): return a single-precision complex floating-point number with the same magnitude as z and the sign of y*z.
  • cinv( z ): compute the inverse of a double-precision complex floating-point number.
  • cinvf( z ): compute the inverse of a single-precision complex floating-point number.
  • copysign( x, y ): return a double-precision floating-point number with the magnitude of x and the sign of y.
  • copysignf( x, y ): return a single-precision floating-point number with the magnitude of x and the sign of y.
  • cot( x ): evaluate the cotangent of a number.
  • cotd( x ): compute the cotangent of an angle measured in degrees.
  • cotdf( x ): compute the cotangent of a single-precision floating-point number (in degrees).
  • cotf( x ): evaluate the cotangent of a single-precision floating-point number (in radians).
  • coth( x ): compute the hyperbolic cotangent of a number.
  • cphase( z ): compute the argument of a double-precision complex floating-point number in radians.
  • cphasef( z ): compute the argument of a single-precision complex floating-point number in radians.
  • cpolar( z ): compute the absolute value and phase of a double-precision complex floating-point number.
  • cpolarf( z ): compute the absolute value and phase of a single-precision complex floating-point number.
  • csc( x ): evaluate the cosecant of a number.
  • cscd( x ): compute the cosecant of a degree.
  • cscdf( x ): compute the cosecant of a single-precision floating-point number (in degrees).
  • cscf( x ): evaluate the cosecant of a single-precision floating-point number (in radians).
  • csch( x ): compute the hyperbolic cosecant of a number.
  • deg2rad( x ): convert an angle from degrees to radians.
  • deg2radf( x ): convert an angle from degrees to radians (single-precision).
  • digamma( x ): digamma function.
  • diracDelta( x ): evaluate the Dirac delta function.
  • diracDeltaf( x ): evaluate the Dirac delta function for a single-precision floating-point number.
  • eta( s ): dirichlet eta function.
  • ellipe( m ): compute the complete elliptic integral of the second kind.
  • ellipj( u, m ): compute the Jacobi elliptic functions sn, cn, and dn.
  • ellipk( m ): compute the complete elliptic integral of the first kind.
  • erf( x ): error function.
  • erfc( x ): complementary error function.
  • erfcinv( x ): inverse complementary error function.
  • erfcx( x ): scaled complementary error function.
  • erfinv( x ): inverse error function.
  • factorial( x ): factorial function.
  • factorial2( n ): double factorial function.
  • factorial2f( n ): evaluate the double factorial function as a single-precision floating-point number.
  • factorialln( x ): natural logarithm of the factorial function.
  • factoriallnf( x ): natural logarithm of the factorial of a single-precision floating-point number.
  • fallingFactorial( x, n ): compute the falling factorial.
  • fibonacciIndex( F ): compute the Fibonacci number index.
  • fibonacciIndexf( F ): compute the Fibonacci number index of a single-precision floating-point number.
  • fibonacci( n ): compute the nth Fibonacci number.
  • fibonaccif( n ): compute the nth Fibonacci number as a single-precision floating-point number.
  • flipsign( x, y ): return a double-precision floating-point number with the magnitude of x and the sign of x*y.
  • flipsignf( x, y ): return a single-precision floating-point number with the magnitude of x and the sign of x*y.
  • fmod( x, y ): modulus function.
  • fmodf( x, y ): evaluate the Modulus function for single-precision floating-point numbers.
  • fresnel( x ): compute the Fresnel integrals S(x) and C(x).
  • fresnelc( x ): compute the Fresnel integral C(x).
  • fresnels( x ): compute the Fresnel integral S(x).
  • frexp( x ): split a double-precision floating-point number into a normalized fraction and an integer power of two.
  • frexpf( x ): split a single-precision floating-point number into a normalized fraction and an integer power of two.
  • gamma( x ): gamma function.
  • gamma1pm1( x ): compute gamma(x+1) - 1.
  • gammainc( x, s[, regularized[, upper ]] ): incomplete gamma function.
  • gammaincinv( p, s[, upper ] ): inverse of incomplete gamma function.
  • gammaln( x ): natural logarithm of the gamma function.
  • gammasgn( x ): sign of the gamma function.
  • gammasgnf( x ): sign of the gamma function for a single-precision floating-point number.
  • gcd( a, b ): compute the greatest common divisor (gcd).
  • gcdf( a, b ): compute the greatest common divisor (gcd) of two single-precision floating-point numbers.
  • heaviside( x[, continuity] ): evaluate the Heaviside function.
  • heavisidef( x[, continuity] ): evaluate the Heaviside function for a single-precision floating-point number.
  • hyp2f1( a, b, c, x ): evaluates the Gaussian hypergeometric function.
  • hypot( x, y ): compute the hypotenuse avoiding overflow and underflow.
  • hypotf( x, y ): compute the hypotenuse avoiding overflow and underflow (single-precision).
  • inv( x ): compute the multiplicative inverse of a double-precision floating-point number.
  • invf( x ): compute the multiplicative inverse of a single-precision floating-point number.
  • kroneckerDelta( i, j ): evaluate the Kronecker delta.
  • kroneckerDeltaf( i, j ): evaluate the Kronecker delta (single-precision).
  • lcm( a, b ): compute the least common multiple (lcm).
  • lcmf( a, b ): compute the least common multiple (lcm) of two single-precision floating-point numbers.
  • ldexp( frac, exp ): multiply a double-precision floating-point number by an integer power of two.
  • ldexpf( frac, exp ): multiply a single-precision floating-point number by an integer power of two.
  • lnf( x ): evaluate the natural logarithm of a single-precision floating-point number.
  • lucas( n ): compute the nth Lucas number.
  • lucasf( n ): compute the nth Lucas number as a single-precision floating-point number.
  • max( x, y ): return the maximum value.
  • maxf( x, y ): return the maximum single-precision floating-point number.
  • maxn( [x[, y[, ...args]]] ): return the maximum value.
  • min( x, y ): return the minimum value.
  • minf( x, y ): return the minimum single-precision floating-point number.
  • minmax( x, y ): return the minimum and maximum values.
  • minmaxf( x, y ): return the minimum and maximum of two single-precision floating-point numbers.
  • minmaxn( [x[, y[, ...args]]] ): return the minimum and maximum values.
  • minn( [x[, y[, ...args]]] ): return the minimum value.
  • modf( x ): decompose a double-precision floating-point number into integral and fractional parts.
  • modff( x ): decompose a single-precision floating-point number into integral and fractional parts.
  • nanmax( x, y ): return the maximum value, ignoring NaN.
  • nanmaxf( x, y ): return the maximum value of two single-precision floating-point numbers, ignoring NaN.
  • nanmin( x, y ): return the minimum value, ignoring NaN.
  • nanminf( x, y ): return the minimum value of two single-precision floating-point numbers, ignoring NaN.
  • negafibonacci( n ): compute the nth negaFibonacci number.
  • negafibonaccif( n ): compute the nth negaFibonacci number as a single-precision floating-point number.
  • negalucas( n ): compute the nth negaLucas number.
  • negalucasf( n ): compute the nth negaLucas number in single-precision floating-point format.
  • nonfibonacci( n ): compute the nth non-Fibonacci number.
  • nonfibonaccif( n ): compute the nth non-Fibonacci single-precision floating-point number.
  • pdiff( x, y ): return the positive difference between x and y.
  • pdifff( x, y ): return the positive difference between x and y.
  • polygamma( n, x ): polygamma function.
  • rad2deg( x ): convert an angle from radians to degrees.
  • rad2degf( x ): convert an angle from radians to degrees (single-precision).
  • ramp( x ): evaluate the ramp function.
  • rampf( x ): evaluate the ramp function.
  • rcbrt( x ): compute the reciprocal of the principal cube root of a double-precision floating-point number.
  • rcbrtf( x ): compute the reciprocal of the principal cube root of a single-precision floating-point number.
  • rempio2f( x, y ): compute x - nπ/2 = r (single-precision).
  • zeta( s ): riemann zeta function.
  • rsqrt( x ): compute the reciprocal of the principal square root of a double-precision floating-point number.
  • rsqrtf( x ): compute the reciprocal of the principal square root of a single-precision floating-point number.
  • sec( x ): evaluate the secant of a number.
  • secd( x ): compute the secant of an angle measured in degrees.
  • secdf( x ): compute the secant of a single-precision floating-point number (in degrees).
  • secf( x ): evaluate the secant of a single-precision floating-point number (in radians).
  • sech( x ): compute the hyperbolic secant of a double-precision floating-point number.
  • sici( x ): compute the sine and cosine integrals.
  • spence( x ): spence's function, also known as the dilogarithm.
  • spencef( x ): spence's function (the dilogarithm) for a single-precision floating-point number.
  • sqrt( x ): compute the principal square root of a double-precision floating-point number.
  • sqrt1pm1( x ): compute sqrt( 1 + x ) - 1.
  • sqrtf( x ): compute the principal square root of a single-precision floating-point number.
  • sqrtpi( x ): compute the principal square root of the product of π and a positive number.
  • sqrtpif( x ): compute the principal square root of the product of π and a positive single-precision floating-point number.
  • tribonacci( n ): compute the nth Tribonacci number.
  • tribonaccif( n ): compute the nth Tribonacci number as a single-precision floating-point number.
  • trigamma( x ): trigamma function.
  • trigammaf( x ): trigamma function for a single-precision floating-point number.
  • wrap( v, min, max ): wrap a value to the half-open interval [min,max).
  • wrapf( v, min, max ): wrap a single-precision floating-point value to the half-open interval [min,max).

Fast algorithms of various special functions, which trade accuracy for increased speed, are available in the following sub-namespace:

  • fast: fast math special functions.

Finally, the namespace exports the following kernel functions, which are mainly used internally. Beware that they may only be applicable for input values inside a certain number range and/or may not work as expected if not all arguments satisfy the parameter requirements.

Examples

var objectKeys = require( '@stdlib/utils-keys' );
var special = require( '@stdlib/math-base-special' );

console.log( objectKeys( special ) );

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2025. The Stdlib Authors.

Packages

No packages published

Contributors 2

  •  
  •