stats/mathx
src/stats/mathx.tur
defn
mathx-erf
(mathx-erf [x :float] :float)
error function erf(x).
Parameters
| x | argument |
Returns
erf(x) in [-1, 1].
Example
(mathx-erf 0.0) ; => 0.0 (mathx-erf 1.0) ; => ~0.8427
Since: ST0
defn
mathx-erfc
(mathx-erfc [x :float] :float)
complementary error function erfc(x) = 1 - erf(x).
Parameters
| x | argument |
Returns
erfc(x) in [0, 2].
Example
(mathx-erfc 0.0) ; => 1.0
Since: ST0
defn
mathx-lgamma
(mathx-lgamma [x :float] :float)
natural log of the absolute value of gamma(x).
Parameters
| x | argument (must not be a non-positive integer) |
Returns
ln|gamma(x)|
Example
(mathx-lgamma 5.0) ; => ~3.1781 (= ln(24))
Since: ST0
defn
mathx-tgamma
(mathx-tgamma [x :float] :float)
true gamma function gamma(x).
Parameters
| x | argument |
Returns
gamma(x)
Example
(mathx-tgamma 5.0) ; => 24.0
Since: ST0
defn
mathx-expm1
(mathx-expm1 [x :float] :float)
exp(x) - 1, accurate near zero.
Parameters
| x | argument |
Returns
exp(x) - 1
Example
(mathx-expm1 0.0) ; => 0.0 (mathx-expm1 1e-10) ; => ~1e-10 (much more accurate than (- (exp 1e-10) 1))
Since: ST0
defn
mathx-log1p
(mathx-log1p [x :float] :float)
ln(1 + x), accurate near zero.
Parameters
| x | argument (x > -1) |
Returns
ln(1 + x)
Example
(mathx-log1p 0.0) ; => 0.0 (mathx-log1p 1e-10) ; => ~1e-10
Since: ST0