@stdlib/math-base-special
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published
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

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

Trigonometric Functions

  • acos( x ): compute the arccosine of a double-precision floating-point number.
  • acosh( x ): compute the hyperbolic arccosine of a double-precision floating-point number.
  • acovercos( x ): compute the inverse coversed cosine.
  • acoversin( x ): compute the inverse coversed sine.
  • ahavercos( x ): compute the inverse half-value versed cosine.
  • ahaversin( x ): compute the inverse half-value versed sine.
  • asin( x ): compute the arcsine of a double-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).
  • atanh( x ): compute the hyperbolic arctangent of a double-precision floating-point number.
  • avercos( x ): compute the inverse versed cosine.
  • aversin( x ): compute the inverse versed sine.
  • cos( x ): compute the cosine of a number.
  • cosh( x ): compute the hyperbolic cosine of a double-precision floating-point number.
  • cosm1( x ): compute cos(x) - 1.
  • cospi( x ): compute the cosine of a number times π.
  • covercos( x ): compute the coversed cosine.
  • coversin( x ): compute the coversed sine.
  • hacovercos( x ): compute the half-value coversed cosine.
  • hacoversin( x ): compute the half-value coversed sine.
  • havercos( x ): compute the half-value versed cosine.
  • haversin( x ): compute the half-value versed sine.
  • risingFactorial( x, n ): compute the rising factorial.
  • sin( x ): compute the sine of a number.
  • sinc( x ): compute the cardinal sine of a number.
  • sincos( x ): simultaneously compute the sine and cosine of a number.
  • sincospi(): simultaneously compute the sine and cosine of a number times π.
  • sinh( x ): compute the hyperbolic sine of a double-precision floating-point number.
  • sinpi( x ): compute the sine of a number times π.
  • tan( x ): evaluate the tangent of a number.
  • tanh( x ): compute the hyperbolic tangent of a double-precision floating-point number.
  • vercos( x ): compute the versed cosine.
  • versin( x ): compute the versed sine.

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.
  • 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 a double-precision complex floating-point number toward positive infinity.
  • cceilf( z ): round 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.
  • 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.
  • 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.
  • 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.
  • maxabsn( [x[, y[, ...args]]] ): return the maximum absolute value.
  • minabs( x, y ): return the minimum absolute value.
  • minabsn( [x[, y[, ...args]]] ): return the minimum absolute value.
  • minmaxabs( x, y ): return the minimum and maximum absolute values.
  • minmaxabsn( [x[, y[, ...args]]] ): return the minimum and maximum absolute values.
  • 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.
  • roundn( x, n ): round a double-precision floating-point number to the nearest multiple of 10^n.
  • roundsd( x, n[, b] ): round a numeric value to the nearest number 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

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-2024. The Stdlib Authors.

Package Sidebar

Install

npm i @stdlib/math-base-special

Homepage

stdlib.io

Weekly Downloads

4

Version

0.2.1

License

Apache-2.0

Unpacked Size

384 kB

Total Files

10

Last publish

Collaborators

  • stdlib-bot
  • kgryte
  • planeshifter
  • rreusser