A lot of the mathematical implementations we do at NearForm depends on so-called mathematical special functions . There is no clearly defined criteria for what a special function is, but suffice to say they are functions that often turn up in mathematics and most of them are notoriously hard to compute. Often they are defined as the solution to a well-posed problem. However the solution itself is not easy to compute.
In R these functions are often built-in, and in Python, SciPy implements these functions.
Deep within the SciPy source code , we find the Cephes library which is what implements many of these functions.
We have released the WebAssembly version of Cephes on npm, see https://www.npmjs.com/package/cephes .
So all you need to do is to install it with
npm install cephes .
Below are just a few examples of the 125 available functions. You can see all of them in our README file .
All of the values that make up the graph are calculated dynamically in your browser. This gives you an idea of just how fast Cephes in WebAssembly is.
The Bessel function is the solution to the equation The Bessel function is typically used in partial differential equations, where will often be a fixed integer.
The Gamma function is used in many probability distributions. As its value increases very quickly, it is often the function that is used in practice. Cephes has dedicated implementations for both. The DiGamma function , is its derivative and also appear frequently in probability theory.
The beta distribution is central in a lot of Bayesian statistics. The cumulative distribution function is notoriously hard to compute, but this function is also implemented by Cephes.
The Airy function is the solution to the differential equation It is often used in physics such as quantum mechanics. Cephes also defines it compimentary function and their derivatives and .
1 2 3 4
Mathematical special functions:
shows various mathematical special functions. Try clicking the page numbers 1, 2, 3, or 4 to change the function.
The mathematical special functions have so many use cases. If you think your business could benefit from math, such as statistics, logistics, or something else. Then please feel free to contact us .