Import
import { kMath } from "./js/kmath";
Instantiate
var K = new kMath();
Do some math
var y = K.digamma12(1); // -0.5772156649015329
R̶e̶t̶u̶r̶n̶s̶ ̶a̶ ̶n̶u̶m̶e̶r̶i̶c̶ ̶v̶a̶l̶u̶e̶ ̶b̶e̶t̶w̶e̶e̶n̶ ̶̶̶-̶1̶ ̶a̶n̶d̶ ̶̶̶1̶,̶ ̶r̶e̶p̶r̶e̶s̶e̶n̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶s̶i̶n̶e̶ ̶o̶f̶ ̶t̶h̶e̶ ̶a̶n̶g̶l̶e̶ ̶g̶i̶v̶e̶n̶ ̶i̶n̶ ̶r̶a̶d̶i̶a̶n̶s̶.̶ ̶T̶h̶e̶ ̶s̶c̶a̶l̶i̶n̶g̶ ̶f̶a̶c̶t̶o̶r̶s̶ ̶(̶5̶2̶1̶4̶,̶ ̶2̶.̶4̶4̶E̶-̶4̶)̶ ̶w̶e̶r̶e̶ ̶c̶h̶o̶s̶e̶n̶ ̶a̶r̶b̶i̶t̶r̶a̶r̶i̶l̶y̶ ̶a̶n̶d̶ ̶i̶n̶ ̶h̶a̶s̶t̶e̶,̶ ̶t̶h̶e̶n̶ ̶t̶r̶u̶n̶c̶a̶t̶e̶d̶ ̶t̶o̶ ̶s̶q̶u̶e̶e̶z̶e̶ ̶a̶ ̶f̶e̶w̶ ̶m̶o̶r̶e̶ ̶c̶l̶o̶c̶k̶ ̶c̶y̶c̶l̶e̶s̶ ̶o̶u̶t̶ ̶o̶f̶ ̶t̶h̶e̶ ̶f̶u̶n̶c̶t̶i̶o̶n̶,̶ ̶s̶o̶ ̶t̶h̶e̶ ̶p̶r̶e̶c̶i̶s̶i̶o̶n̶ ̶i̶s̶ ̶o̶n̶l̶y̶ ̶a̶c̶c̶u̶r̶a̶t̶e̶ ̶t̶o̶ ̶~̶5̶ ̶d̶e̶c̶i̶m̶a̶l̶ ̶p̶l̶a̶c̶e̶s̶ ̶o̶n̶ ̶t̶h̶e̶ ̶a̶r̶c̶.̶ ̶̶ ̶:̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶}̶;̶ ̶ ̶B̶a̶s̶e̶d̶ ̶o̶n̶ ̶t̶h̶e̶ ̶m̶e̶t̶h̶o̶d̶s̶ ̶d̶i̶s̶c̶u̶s̶s̶e̶d̶ ̶h̶e̶r̶e̶:̶ ̶h̶t̶t̶p̶:̶/̶/̶w̶w̶w̶.̶c̶o̶r̶a̶n̶a̶c̶.̶c̶o̶m̶/̶2̶0̶0̶9̶/̶0̶7̶/̶s̶i̶n̶e̶s̶ ̶ ̶P̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶ ̶t̶e̶s̶t̶s̶:̶ ̶h̶t̶t̶p̶:̶/̶/̶j̶s̶p̶e̶r̶f̶.̶c̶o̶m̶/̶b̶i̶t̶w̶i̶s̶e̶-̶s̶i̶n̶e̶/̶3̶̶
B̶a̶s̶e̶d̶ ̶o̶n̶ ̶t̶h̶e̶ ̶m̶e̶t̶h̶o̶d̶s̶ ̶d̶i̶s̶c̶u̶s̶s̶e̶d̶ ̶h̶e̶r̶e̶:̶ ̶h̶t̶t̶p̶:̶/̶/̶w̶w̶w̶.̶c̶o̶r̶a̶n̶a̶c̶.̶c̶o̶m̶/̶2̶0̶0̶9̶/̶0̶7̶/̶s̶i̶n̶e̶s̶
Browsers have become significantly more optimized and this method is no longer fastest.
Performance tests: http://jsperf.com/bitwise-sine/3
Bitwise cosine approximation, see fsin(x)
Represents the unit step function, equal to 0 for x < 0 and 1 for x >= 0
The Dirac delta function, or δ function, is a generalized function, or distribution, on the real number line that is zero everywhere except at zero, with an integral of one over the entire real line.
http://en.wikipedia.org/wiki/Dirac_delta_function
The discrete analog of the diracdelta(x) function.
http://en.wikipedia.org/wiki/Kronecker_delta
The sign function or signum function (from signum, Latin for "sign") is an odd mathematical function that extracts the sign of a real number.
http://en.wikipedia.org/wiki/Sign_function
Normalized sinc function.
http://en.wikipedia.org/wiki/Sinc_function
The remainder of division of one number by another.
http://en.wikipedia.org/wiki/Modulo_operation
Square wave approximation.
The factorial function (integers)
http://en.wikipedia.org/wiki/Factorial
Gamma function.
http://en.wikipedia.org/wiki/Gamma
The logarithm of the gamma function.
The logarithmic derivative of the gamma function:
http://en.wikipedia.org/wiki/Digamma_function
The nth-Harmonic number.
http://en.wikipedia.org/wiki/Harmonic_number
Phi distribution.
The Fresnel C integral C(x)
http://en.wikipedia.org/wiki/Fresnel_integral
The Riemann zeta function.
http://en.wikipedia.org/wiki/Riemann_zeta_function
The "error function" (also called the Gauss error function) is a special function (non-elementary) of sigmoid shape which occurs in probability, statistics and partial differential equations.
http://en.wikipedia.org/wiki/Error_function
Returns machine epsilon.
The Cantor function, named after Georg Cantor, is an example of a function that is continuous, but not absolutely continuous. It is also referred to as the Devil's staircase, the Cantor staircase function, and the Cantor-Lebesgue function.
http://en.wikipedia.org/wiki/Cantor_function
The length of the hypotenuse divided by the length of the opposite side.
Hyperbolic cosine.
Hyperbolic sine.
Hyperbolic tangent.
Hyperbolic cosecant.
Hyperbolic cotangent
Inverse Hyperbolic Cosine.
Inverse Hyperbolic Sine.
Inverse Hyperbolic Tangent.
Cast float to integer.
Fast floor function.