Liking cljdoc? Tell your friends :D
Clojure only.

fastmath.core

Collection of basic math functions and constants.

Contains:

  • Basic math functions
  • Predicates
  • Bitwise operations
  • Trigonometry
  • Log/power
  • Floating point format operations
  • Factorial, combinations, gcd/lcd
  • Additional functions: sampling, rank, lerp

Almost all math functions are backed by FastMath library. Almost all operates on primitive double and returns double or long and are inlined.

Primitive math operators

Inlined function operating on double/longs as a replacement of Clojure numerical tower: * + - / > < >= <= == rem quot mod bit-or bit-and bit-xor bit-and-not bit-set bit-clear bit-test bit-flip bit-not bit-shift-left bit-shift-right unsigned-bit-shift-right inc dec zero? neg? pos? min max even? odd? abs

And additionally:

  • << - bit shift left
  • >> - signed bit shift right
  • >>> - unsigned bit shift right
  • not== - not equal

To turn on primitive math on your namespace call use-primitive-operators. To turn off and revert original versions call unuse-primitive-operators which is recomended when Clojure 1.12+ is used.

Collection of basic math functions and constants.

Contains:

* Basic math functions
* Predicates
* Bitwise operations
* Trigonometry
* Log/power
* Floating point format operations
* Factorial, combinations, gcd/lcd
* Additional functions: sampling, rank, lerp

Almost all math functions are backed by [FastMath](https://github.com/jeffhain/jafama) library. Almost all operates on primitive `double` and returns `double` or `long` and are inlined.

#### Primitive math operators

Inlined function operating on double/longs as a replacement of Clojure numerical tower: `*` `+` `-` `/` `>` `<` `>=` `<=` `==` `rem` `quot` `mod` `bit-or` `bit-and` `bit-xor` `bit-and-not` `bit-set` `bit-clear` `bit-test` `bit-flip` `bit-not` `bit-shift-left` `bit-shift-right` `unsigned-bit-shift-right` `inc` `dec` `zero?` `neg?` `pos?` `min` `max` `even?` `odd?` `abs`

And additionally:

* `<<` - bit shift left
* `>>` - signed bit shift right
* `>>>` - unsigned bit shift right
* `not==` - not equal

To turn on primitive math on your namespace call [[use-primitive-operators]].
To turn off and revert original versions call [[unuse-primitive-operators]] which is recomended when Clojure 1.12+ is used.
raw docstring

*clj

(*)
(* a)
(* a b)
(* a b c)
(* a b c d)
(* a b c d & r)

Primitive and inlined *.

Primitive and inlined `*`.
sourceraw docstring

+clj

(+)
(+ a)
(+ a b)
(+ a b c)
(+ a b c d)
(+ a b c d & r)

Primitive and inlined +.

Primitive and inlined `+`.
sourceraw docstring

-clj

(- a)
(- a b)
(- a b c)
(- a b c d)
(- a b c d & r)

Primitive and inlined -.

Primitive and inlined `-`.
sourceraw docstring

-Eclj

Value of \(-e\)

Value of \\(-e\\)
sourceraw docstring

-HALF_PIclj

Value of \(-\frac{\pi}{2}\)

Value of \\(-\frac{\pi}{2}\\)
sourceraw docstring

-PIclj

Value of \(-\pi\)

Value of \\(-\pi\\)
sourceraw docstring

-QUARTER_PIclj

Value of \(-\frac{\pi}{4}\)

Value of \\(-\frac{\pi}{4}\\)
sourceraw docstring

-TAUclj

Alias for [[TWO_PI-]]

Alias for [[TWO_PI-]]
sourceraw docstring

-THIRD_PIclj

Value of \(-\frac{\pi}{3}\)

Value of \\(-\frac{\pi}{3}\\)
sourceraw docstring

-TWO_PIclj

Value of \(-2 {\pi}\)

Value of \\(-2 {\pi}\\)
sourceraw docstring

/clj

(/ a)
(/ a b)
(/ a b c)
(/ a b c d)
(/ a b c d & r)

Primitive and inlined /.

Primitive and inlined `/`.
sourceraw docstring

<clj

(< _)
(< a b)
(< a b & r)

Primitive math less-then function.

Primitive math less-then function.
sourceraw docstring

<<clj

(<< x shift)

Shift bits left

Shift bits left
sourceraw docstring

<=clj

(<= _)
(<= a b)
(<= a b & r)

Primitive math less-and-equal function.

Primitive math less-and-equal function.
sourceraw docstring

==clj

(== _)
(== a b)
(== a b & r)

Primitive math equality function.

Primitive math equality function.
sourceraw docstring

>clj

(> _)
(> a b)
(> a b & r)

Primitive math greater-than function.

Primitive math greater-than function.
sourceraw docstring

>=clj

(>= _)
(>= a b)
(>= a b & r)

Primitive math greater-and-equal function.

Primitive math greater-and-equal function.
sourceraw docstring

>>clj

(>> x shift)

Shift bits right and keep most significant bit unchanged

Shift bits right and keep most significant bit unchanged
sourceraw docstring

>>>clj

(>>> x shift)

Shift bits right and set most significant bit to 0

Shift bits right and set most significant bit to `0`
sourceraw docstring

absclj

(abs x)

Primitive and inlined version of abs.

Primitive and inlined version of abs.
sourceraw docstring

acosclj

(acos x)

acos(x)

acos(x)
sourceraw docstring

acoshclj

(acosh x)

acosh(x)

acosh(x)
sourceraw docstring

acotclj

(acot x)

acot(x)

acot(x)
sourceraw docstring

acothclj

(acoth x)

Area hyperbolic cotangent

Area hyperbolic cotangent
sourceraw docstring

acovercosclj

(acovercos x)

Arc covercosine

Arc covercosine
sourceraw docstring

acoversinclj

(acoversin x)

Arc coversine

Arc coversine
sourceraw docstring

acrdclj

(acrd x)

Inverse chord

Inverse chord
sourceraw docstring

acscclj

(acsc x)

acsc(x)

acsc(x)
sourceraw docstring

acschclj

(acsch v)

Area hyperbolic cosecant

Area hyperbolic cosecant
sourceraw docstring

aexcscclj

(aexcsc x)

Arc excosecant

Arc excosecant
sourceraw docstring

aexsecclj

(aexsec x)

Arc exsecant

Arc exsecant
sourceraw docstring

ahacovercosclj

(ahacovercos x)

Arc hacovercosine

Arc hacovercosine
sourceraw docstring

ahacoversinclj

(ahacoversin x)

Arc hacoversine

Arc hacoversine
sourceraw docstring

ahavercosclj

(ahavercos x)

Arc havecosine

Arc havecosine
sourceraw docstring

ahaversinclj

(ahaversin x)

Arc haversine

Arc haversine
sourceraw docstring

approxclj

(approx v)
(approx v digits)

Round v to specified (default: 2) decimal places. Be aware of floating point number accuracy.

Round `v` to specified (default: 2) decimal places. Be aware of floating point number accuracy.
sourceraw docstring

approx-eqclj

(approx-eq a b)
(approx-eq a b digits)

Checks equality approximately. See approx.

Checks equality approximately. See [[approx]].
sourceraw docstring

approx=clj

Alias for approx-eq

Alias for [[approx-eq]]
sourceraw docstring

asecclj

(asec x)

asec(x)

asec(x)
sourceraw docstring

asechclj

(asech x)

Area hyperbolic secant

Area hyperbolic secant
sourceraw docstring

asinclj

(asin x)

asin(x)

asin(x)
sourceraw docstring

asinhclj

(asinh x)

asinh(x)

asinh(x)
sourceraw docstring

atanclj

(atan x)

atan(x)

atan(x)
sourceraw docstring

atan2clj

(atan2 x y)

atan2(x,y)

atan2(x,y)
sourceraw docstring

atanhclj

(atanh x)

atanh(x)

atanh(x)
sourceraw docstring

avercosclj

(avercos x)

Arc vecosine

Arc vecosine
sourceraw docstring

aversinclj

(aversin x)

Arc versine

Arc versine
sourceraw docstring

between-?clj

(between-? [x y] v)
(between-? x y v)

Check if given number is within the range (x,y].

Check if given number is within the range (x,y].
sourceraw docstring

between?clj

(between? [x y] v)
(between? x y v)

Check if given number is within the range [x,y].

Check if given number is within the range [x,y].
sourceraw docstring

bit-andclj

(bit-and x)
(bit-and x y)
(bit-and x y & r)

x ∧ y - bitwise AND

x ∧ y - bitwise AND
sourceraw docstring

bit-and-notclj

(bit-and-not x)
(bit-and-not x y)
(bit-and-not x y & r)

x ∧ ~y - bitwise AND (with complement second argument)

x ∧ ~y - bitwise AND (with complement second argument)
sourceraw docstring

bit-clearclj

(bit-clear x bit)

Clear bit (set to 0).

Clear bit (set to `0`).
sourceraw docstring

bit-flipclj

(bit-flip x bit)

Flip bit (set to 0 when 1 or to 1 when 0).

Flip bit (set to `0` when `1` or to `1` when `0`).
sourceraw docstring

bit-nandclj

(bit-nand x)
(bit-nand x y)
(bit-nand x y & r)

~(x ∧ y) - bitwise NAND

~(x ∧ y) - bitwise NAND
sourceraw docstring

bit-norclj

(bit-nor x)
(bit-nor x y)
(bit-nor x y & r)

~(x ∨ y) - bitwise NOR

~(x ∨ y) - bitwise NOR
sourceraw docstring

bit-notclj

(bit-not x)

~x - bitwise NOT

~x - bitwise NOT
sourceraw docstring

bit-orclj

(bit-or x)
(bit-or x y)
(bit-or x y & r)

x ∨ y - bitwise OR

x ∨ y - bitwise OR
sourceraw docstring

bit-setclj

(bit-set x bit)

Set bit (set to 1).

Set bit (set to `1`).
sourceraw docstring

bit-shift-leftclj

(bit-shift-left x shift)

Shift bits left

Shift bits left
sourceraw docstring

bit-shift-rightclj

(bit-shift-right x shift)

Shift bits right and keep most significant bit unchanged

Shift bits right and keep most significant bit unchanged
sourceraw docstring

bit-testclj

(bit-test x bit)

Test bit (return to true when 1 or false when 0).

Test bit (return to `true` when `1` or `false` when `0`).
sourceraw docstring

bit-xnorclj

(bit-xnor x)
(bit-xnor x y)
(bit-xnor x y & r)

~(x⊕y) - bitwise XNOR

~(x⊕y) - bitwise XNOR
sourceraw docstring

bit-xorclj

(bit-xor x)
(bit-xor x y)
(bit-xor x y & r)

x⊕y - bitwise XOR

x⊕y - bitwise XOR
sourceraw docstring

bits->doubleclj

(bits->double v)

Convert 64 bits to double

Convert 64 bits to double
sourceraw docstring

bool-notclj

(bool-not x)

Primitive boolean not

Primitive boolean not
sourceraw docstring

bool-xorclj

(bool-xor x y)
(bool-xor x y & r)

Primitive boolean xor

Primitive boolean xor
sourceraw docstring

CATALAN_Gclj

Catalan G

Catalan G
sourceraw docstring

cbclj

(cb x)

\(x^3\)

\\(x^3\\)
sourceraw docstring

cbrtclj

(cbrt x)

\(\sqrt[3]{x}\)

\\(\sqrt[3]{x}\\)
sourceraw docstring

ceilclj

(ceil x)
(ceil x scale)

\(\lceil x \rceil\). See: qceil.

Rounding is done to a multiply of scale value (when provided).

\\(\lceil x \rceil\\). See: [[qceil]].

Rounding is done to a multiply of scale value (when provided).
sourceraw docstring

cexpexpclj

(cexpexp x)

1-exp(-exp(x))

1-exp(-exp(x))
sourceraw docstring

cloglogclj

(cloglog x)

log(-log(1-x))

log(-log(1-x))
sourceraw docstring

cnormclj

(cnorm v start stop)
(cnorm v start1 stop1 start2 stop2)

Constrained version of norm. Result of norm is applied to constrain to [0,1] or [start2,stop2] ranges.

Constrained version of norm. Result of [[norm]] is applied to [[constrain]] to `[0,1]` or `[start2,stop2]` ranges.
sourceraw docstring

co-intervalsclj

(co-intervals data)
(co-intervals data number)
(co-intervals data number overlap)

Divide sequence to overlaping intervals containing similar number of values. Same as R's co.intervals()

Divide sequence to overlaping intervals containing similar number of values. Same as R's `co.intervals()`
sourceraw docstring

combinationsclj

(combinations n k)

Binomial coefficient (n choose k)

Binomial coefficient (n choose k)
sourceraw docstring

constraincljmacro

(constrain value mn mx)

Clamp value to the range [mn,mx].

Clamp `value` to the range `[mn,mx]`.
sourceraw docstring

copy-signclj

(copy-sign magnitude sign)

Returns a value with a magnitude of first argument and sign of second.

Returns a value with a magnitude of first argument and sign of second.
sourceraw docstring

cosclj

(cos x)

cos(x)

cos(x)
sourceraw docstring

cos-interpolationclj

(cos-interpolation start stop t)

oF interpolateCosine interpolation. See also lerp/mlerp, quad-interpolation or smooth-interpolation.

oF interpolateCosine interpolation. See also [[lerp]]/[[mlerp]], [[quad-interpolation]] or [[smooth-interpolation]].
sourceraw docstring

coshclj

(cosh x)

cosh(x)

cosh(x)
sourceraw docstring

cospiclj

(cospi x)

cos(pi*x)

cos(pi*x)
sourceraw docstring

cotclj

(cot x)

cot(x)

cot(x)
sourceraw docstring

cothclj

(coth x)

Hyperbolic cotangent

Hyperbolic cotangent
sourceraw docstring

cotpiclj

(cotpi x)

cot(pi*x)

cot(pi*x)
sourceraw docstring

covercosclj

(covercos x)

Covercosine

Covercosine
sourceraw docstring

coversinclj

(coversin x)

Coversine

Coversine
sourceraw docstring

crdclj

(crd x)

Chord

Chord
sourceraw docstring

cscclj

(csc x)

csc(x)

csc(x)
sourceraw docstring

cschclj

(csch x)

Hyperbolic cosecant

Hyperbolic cosecant
sourceraw docstring

cscpiclj

(cscpi x)

csc(pi*x)

csc(pi*x)
sourceraw docstring

cutclj

(cut data breaks)
(cut x1 x2 breaks)

Cut range or sequence into intervals

Cut range or sequence into intervals
sourceraw docstring

decclj

(dec x)

Primitive and inlined dec

Primitive and inlined `dec`
sourceraw docstring

deg-in-radclj

\(\frac{\pi}{180}\)

\\(\frac{\pi}{180}\\)
sourceraw docstring

degreesclj

(degrees rad)

Convert radians into degrees.

Convert radians into degrees.
sourceraw docstring

delta-eqclj

(delta-eq a b)
(delta-eq a b accuracy)
(delta-eq a b abs-tol rel-tol)

Checks equality for given absolute accuracy (default 1.0e-6).

Version with 4-arity accepts absolute and relative accuracy.

Checks equality for given absolute accuracy (default `1.0e-6`).

Version with 4-arity accepts absolute and relative accuracy.
sourceraw docstring

delta=clj

Alias for delta-eq

Alias for [[delta-eq]]
sourceraw docstring

difference-of-productsclj

(difference-of-products a b c d)

Kahan's algorithm for (ab)-(cd) to avoid catastrophic cancellation.

Kahan's algorithm for (a*b)-(c*d) to avoid catastrophic cancellation.
sourceraw docstring

distclj

(dist [x1 y1] [x2 y2])
(dist x1 y1 x2 y2)

Euclidean distance between points (x1,y1) and (x2,y2). See fastmath.vector namespace to see other metrics which work on vectors.

Euclidean distance between points `(x1,y1)` and `(x2,y2)`. See [[fastmath.vector]] namespace to see other metrics which work on vectors.
sourceraw docstring

double-array->seqclj

Convert double array into sequence.

Alias for seq.

Convert double array into sequence.

Alias for `seq`.
sourceraw docstring

double-array-typeclj

source

double-bitsclj

(double-bits v)

Returns double as 64-bits (long)

Returns double as 64-bits (long)
sourceraw docstring

double-double-array->seqclj

(double-double-array->seq res)

Convert double array of double arrays into sequence of sequences.

Convert double array of double arrays into sequence of sequences. 
sourceraw docstring

double-double-array-typeclj

source

double-exponentclj

(double-exponent v)

Extract exponent information from double

Extract exponent information from double
sourceraw docstring

double-high-bitsclj

(double-high-bits v)

Returns high word from double as bits

Returns high word from double as bits
sourceraw docstring

double-low-bitsclj

(double-low-bits v)

Returns low word from double as bits

Returns low word from double as bits
sourceraw docstring

double-one-minus-epsilonclj

Value of 0x1.fffffffffffffp-1d = 0.(9)

Value of 0x1.fffffffffffffp-1d = 0.(9)
sourceraw docstring

double-significandclj

(double-significand v)

Extract significand from double

Extract significand from double
sourceraw docstring

Eclj

Value of \(e\)

Value of \\(e\\)
sourceraw docstring

EPSILONclj

Very small number \(\varepsilon\)

Very small number \\(\varepsilon\\)
sourceraw docstring

eqclj

(eq _)
(eq a b)
(eq a b & r)

Primitive math equality function.

Primitive math equality function.
sourceraw docstring

even?clj

(even? x)

Primitive and inlined even?

Primitive and inlined `even?`
sourceraw docstring

excscclj

(excsc x)

Excosecant

Excosecant
sourceraw docstring

expclj

(exp x)

exp(x) = e^x

exp(x) = e^x
sourceraw docstring

expexpclj

(expexp x)

exp(-exp(-x))

exp(-exp(-x))
sourceraw docstring

expm1clj

(expm1 x)

exp(x)-1 for small x

exp(x)-1 for small x
sourceraw docstring

exsecclj

(exsec x)

Exsecant

Exsecant
sourceraw docstring

factorialclj

(factorial n)

Factorial

Factorial
sourceraw docstring

factorial20clj

(factorial20 n)

Factorial table up to 20!

Factorial table up to 20!
sourceraw docstring

falling-factorialclj

(falling-factorial n x)

Falling (descending) factorial.

Falling (descending) factorial.
sourceraw docstring

falling-factorial-intclj

(falling-factorial-int n x)

Falling (descending) factorial for integer n.

Falling (descending) factorial for integer n.
sourceraw docstring

fast*cljdeprecated

(fast*)
(fast* a)
(fast* a b)
(fast* a b & r)

Primitive and inlined * as a function

Primitive and inlined `*` as a function
sourceraw docstring

fast+cljdeprecated

(fast+)
(fast+ a)
(fast+ a b)
(fast+ a b & r)

Primitive and inlined + as a function

Primitive and inlined `+` as a function
sourceraw docstring

fast-cljdeprecated

(fast-)
(fast- a)
(fast- a b)
(fast- a b & r)

Primitive and inlined - as a function

Primitive and inlined `-` as a function
sourceraw docstring

fast-divcljdeprecated

(fast-div)
(fast-div a)
(fast-div a b)
(fast-div a b & r)

Primitive and inlined / as a function

Primitive and inlined `/` as a function
sourceraw docstring

fast-identitycljdeprecated

(fast-identity a)

Identity on double.

Identity on double.
sourceraw docstring

fast-maxcljdeprecated

(fast-max a)
(fast-max a b)
(fast-max a b & r)

Primitive and inlined max as a function

Primitive and inlined `max` as a function
sourceraw docstring

fast-mincljdeprecated

(fast-min a)
(fast-min a b)
(fast-min a b & r)

Primitive and inlined min as a function

Primitive and inlined `min` as a function
sourceraw docstring

floorclj

(floor x)
(floor x scale)

\(\lfloor x \rfloor\). See: qfloor.

Rounding is done to a multiply of scale value (when provided).

\\(\lfloor x \rfloor\\). See: [[qfloor]].

Rounding is done to a multiply of scale value (when provided).
sourceraw docstring

fmaclj

(fma x y z)

(x y z) -> (+ z (* x y)) or Math/fma for java 9+

`(x y z)` -> `(+ z (* x y))` or `Math/fma` for java 9+
sourceraw docstring

FOUR_INV_PIclj

Value of \(\frac{4}{\pi}\)

Value of \\(\frac{4}{\pi}\\)
sourceraw docstring

fpowclj

(fpow x exponent)

Fast version of pow where exponent is integer.

Fast version of pow where exponent is integer.
sourceraw docstring

fracclj

(frac v)

Fractional part, always returns values from 0.0 to 1.0 (exclusive). See sfrac for signed version.

Fractional part, always returns values from 0.0 to 1.0 (exclusive). See [[sfrac]] for signed version.
sourceraw docstring

GAMMAclj

Euler-Mascheroni constant

Euler-Mascheroni constant
sourceraw docstring

gcdclj

(gcd a b)

Fast binary greatest common divisor (Stein's algorithm)

Fast binary greatest common divisor (Stein's algorithm)
sourceraw docstring

group-by-intervalsclj

(group-by-intervals coll)
(group-by-intervals intervals coll)

Group sequence of values into given intervals.

If intervals are missing, use co-intervals to find some.

Group sequence of values into given intervals.

If `intervals` are missing, use [[co-intervals]] to find some.
sourceraw docstring

hacovercosclj

(hacovercos x)

Hacovercosine

Hacovercosine
sourceraw docstring

hacoversinclj

(hacoversin x)

Hacoversine

Hacoversine
sourceraw docstring

HALF_PIclj

Value of \(\frac{\pi}{2}\)

Value of \\(\frac{\pi}{2}\\)
sourceraw docstring

havercosclj

(havercos x)

Havercosine

Havercosine
sourceraw docstring

haversinclj

(haversin x)
(haversin [lat1 lon1] [lat2 lon2])
(haversin lat1 lon1 lat2 lon2)

Haversine formula for value or lattitude and longitude pairs.

Haversine formula for value or lattitude and longitude pairs.
sourceraw docstring

haversineclj

Haversine (haversin alias)

Haversine ([[haversin]] alias)
sourceraw docstring

haversine-distclj

(haversine-dist [lat1 lon1] [lat2 lon2])
(haversine-dist lat1 lon1 lat2 lon2)

Haversine distance d for r=1

Haversine distance `d` for `r=1`
sourceraw docstring

high-2-expclj

(high-2-exp x)

Find lowest exponent (power of 2) which is greater or equal x. See low-2-exp.

Find lowest exponent (power of 2) which is greater or equal `x`. See [[low-2-exp]].
sourceraw docstring

high-expclj

(high-exp b x)

Find lowest exponent for base b which is higher or equalx. See also low-exp.

Find lowest exponent for base `b` which is higher or equal`x`. See also [[low-exp]].
sourceraw docstring

hypotclj

(hypot x y)
(hypot x y z)

Hypot. See also hypot-sqrt.

Hypot.
See also [[hypot-sqrt]].
sourceraw docstring

hypot-sqrtclj

(hypot-sqrt x y)
(hypot-sqrt x y z)

Hypot, sqrt version: \(\sqrt{x^2+y^2}\) or \(\sqrt{x^2+y^2+z^2}\).

Hypot, sqrt version: \\(\sqrt{x^2+y^2}\\) or \\(\sqrt{x^2+y^2+z^2}\\).
sourceraw docstring

iabscljdeprecated

(iabs x)

\(|x|\) - long version. See abs.

\\(|x|\\) - `long` version. See [[abs]].
sourceraw docstring

identity-doubleclj

(identity-double a)

Identity on double.

Identity on double.
sourceraw docstring

identity-longclj

(identity-long a)

Identity on double.

Identity on double.
sourceraw docstring

incclj

(inc x)

Primitive and inlined inc

Primitive and inlined `inc`
sourceraw docstring

inf?clj

(inf? v)

Check if a number is an infinite (positive or negative).

Check if a number is an infinite (positive or negative).
sourceraw docstring

integer?clj

(integer? v)

Check if given real number is an integer.

Check if given real number is an integer.
sourceraw docstring

inv-factorialclj

(inv-factorial n)

Inverse of factorial, 1/n!

Inverse of factorial, 1/n!
sourceraw docstring

INV_FOUR_PIclj

Value of \(\frac{1}{4 \pi}\)

Value of \\(\frac{1}{4 \pi}\\)
sourceraw docstring

INV_LN2clj

\(\frac{1}{\ln{2}}\)

\\(\frac{1}{\ln{2}}\\)
sourceraw docstring

INV_LOG_HALFclj

\(\frac{1}{\ln{0.5}}\)

\\(\frac{1}{\ln{0.5}}\\)
sourceraw docstring

INV_PIclj

Value of \(\frac{1}{\pi}\)

Value of \\(\frac{1}{\pi}\\)
sourceraw docstring

INV_SQRT2PIclj

\(\frac{1}{\sqrt{2\pi}}\)

\\(\frac{1}{\sqrt{2\pi}}\\)
sourceraw docstring

INV_SQRT_2clj

\(\frac{1}{\sqrt{2}}\)

\\(\frac{1}{\sqrt{2}}\\)
sourceraw docstring

INV_SQRTPIclj

\(\frac{1}{\sqrt\pi}\)

\\(\frac{1}{\sqrt\pi}\\)
sourceraw docstring

INV_TWO_PIclj

Value of \(\frac{1}{2 \pi}\)

Value of \\(\frac{1}{2 \pi}\\)
sourceraw docstring

invalid-double?clj

(invalid-double? v)

Check if a number is not finite double (NaN or ±Inf).

Check if a number is not finite double (NaN or ±Inf).
sourceraw docstring

itruncclj

(itrunc v)

Truncate fractional part, keep sign. Returns long.

Truncate fractional part, keep sign. Returns `long`.
sourceraw docstring

jvm-versionclj

source

LANCZOS_Gclj

Lanchos approximation g constant

Lanchos approximation `g` constant
sourceraw docstring

lcmclj

(lcm a b)

Fast binary least common multiplier.

Fast binary least common multiplier.
sourceraw docstring

lerpclj

(lerp start stop t)

Linear interpolation between start and stop for amount t. See also mlerp, cos-interpolation, quad-interpolation or smooth-interpolation.

Linear interpolation between `start` and `stop` for amount `t`. See also [[mlerp]], [[cos-interpolation]], [[quad-interpolation]] or [[smooth-interpolation]].
sourceraw docstring

lnclj

(ln x)

log(x)=ln(x)

log(x)=ln(x)
sourceraw docstring

LN10clj

\(\ln{10}\)

\\(\ln{10}\\)
sourceraw docstring

LN2clj

\(\ln{2}\)

\\(\ln{2}\\)
sourceraw docstring

LN2_2clj

\(\frac{\ln{2}}{2}\)

\\(\frac{\ln{2}}{2}\\)
sourceraw docstring

logclj

(log x)
(log base x)

log(x)=ln(x) or logarithm with given base.

log(x)=ln(x) or logarithm with given `base`.
sourceraw docstring

log-combinationsclj

(log-combinations n k)

Log of binomial coefficient (n choose k)

Log of binomial coefficient (n choose k)
sourceraw docstring

log-factorialclj

(log-factorial x)

Log factorial, alias to log-gamma

Log factorial, alias to log-gamma
sourceraw docstring

log10clj

(log10 x)

log_10(x)

log_10(x)
sourceraw docstring

LOG10Eclj

\(\log_{10}{e}\)

\\(\log_{10}{e}\\)
sourceraw docstring

log1mexpclj

(log1mexp x)

log(1-exp(x)), x<0

log(1-exp(x)), x<0
sourceraw docstring

log1pclj

(log1p x)

log(1+x) for small x

log(1+x) for small x
sourceraw docstring

log1pexpclj

(log1pexp x)

log(1+exp(x))

log(1+exp(x))
sourceraw docstring

log1pmxclj

(log1pmx x)

log(1+x)-x

log(1+x)-x
sourceraw docstring

log1psqclj

(log1psq x)

log(1+x^2))

log(1+x^2))
sourceraw docstring

log2clj

(log2 x)

Logarithm with base 2.

\(\ln_2{x}\)

Logarithm with base 2.

\\(\ln_2{x}\\)
sourceraw docstring

LOG2Eclj

\(\log_{2}{e}\)

\\(\log_{2}{e}\\)
sourceraw docstring

log2intclj

(log2int v)

Fast and integer version of log2, returns long

Fast and integer version of log2, returns long
sourceraw docstring

log2mexpclj

(log2mexp x)

log(2-exp(x))

log(2-exp(x))
sourceraw docstring

LOG_HALFclj

\(\ln{0.5}\)

\\(\ln{0.5}\\)
sourceraw docstring

LOG_PIclj

\(\ln{\pi}\)

\\(\ln{\pi}\\)
sourceraw docstring

LOG_TWO_PIclj

\(\ln{2 \pi}\)

\\(\ln{2 \pi}\\)
sourceraw docstring

logaddexpclj

(logaddexp x y)

log(exp(x)+exp(y))

log(exp(x)+exp(y))
sourceraw docstring

logbclj

(logb b x)

Logarithm with base b.

\(\ln_b{x}\)

Logarithm with base `b`.

\\(\ln_b{x}\\)
sourceraw docstring

logcoshclj

(logcosh x)

log(cosh(x))

log(cosh(x))
sourceraw docstring

logexpm1clj

(logexpm1 x)

log(exp(x)-1))

log(exp(x)-1))
sourceraw docstring

logisticclj

Alias for sigmoid

Alias for [[sigmoid]]
sourceraw docstring

logitclj

(logit x)

Logit function

Logit function
sourceraw docstring

loglogclj

(loglog x)

-log(-log(x))

-log(-log(x))
sourceraw docstring

logmxp1clj

(logmxp1 x)

log(x)-x+1

log(x)-x+1
sourceraw docstring

logsubexpclj

(logsubexp x y)

log(abs(exp(x)-exp(y)))

log(abs(exp(x)-exp(y)))
sourceraw docstring

logsumexpclj

(logsumexp xs)

log(exp(x1)+...+exp(xn))

log(exp(x1)+...+exp(xn))
sourceraw docstring

long-absclj

(long-abs x)

\(|x|\) - long version. See abs.

\\(|x|\\) - `long` version. See [[abs]].
sourceraw docstring

long-addclj

(long-add)
(long-add a)
(long-add a b)
(long-add a b c)
(long-add a b c d)
(long-add a b c d & r)

Primitive and inlined +. Coerces arguments and returned value to a long.

Primitive and inlined `+`. Coerces arguments and returned value to a long.
sourceraw docstring

long-decclj

(long-dec x)

Primitive and inlined dec coerced to a long

Primitive and inlined `dec` coerced to a long
sourceraw docstring

long-divclj

(long-div a)
(long-div a b)
(long-div a b c)
(long-div a b c d)
(long-div a b c d & r)

Primitive and inlined /. Coerces to arguments and returned value to a long.

Primitive and inlined `/`. Coerces to arguments and returned value to a long.
sourceraw docstring

long-incclj

(long-inc x)

Primitive and inlined inc coerced to a long

Primitive and inlined `inc` coerced to a long
sourceraw docstring

long-maxclj

(long-max a)
(long-max a b)
(long-max a b c)
(long-max a b c d)
(long-max a b c d & r)

Primitive and inlined max. Coerces arguments and returned values to longs.

Primitive and inlined `max`. Coerces arguments and returned values to longs.
sourceraw docstring

long-minclj

(long-min a)
(long-min a b)
(long-min a b c)
(long-min a b c d)
(long-min a b c d & r)

Primitive and inlined min. Coerces arguments and returned values to longs.

Primitive and inlined `min`. Coerces arguments and returned values to longs.
sourceraw docstring

long-modclj

(long-mod x y)

Primitive and inlined mod coerced to longs

Primitive and inlined `mod` coerced to longs
sourceraw docstring

long-multclj

(long-mult)
(long-mult a)
(long-mult a b)
(long-mult a b c)
(long-mult a b c d)
(long-mult a b c d & r)

Primitive and inlined *. Coerces arguments and returned value to a long.

Primitive and inlined `*`. Coerces arguments and returned value to a long.
sourceraw docstring

long-quotclj

(long-quot x y)

Primitive and inlined quot coerced to longs

Primitive and inlined `quot` coerced to longs
sourceraw docstring

long-remclj

(long-rem x y)

Primitive and inlined rem coerced to longs

Primitive and inlined `rem` coerced to longs
sourceraw docstring

long-subclj

(long-sub a)
(long-sub a b)
(long-sub a b c)
(long-sub a b c d)
(long-sub a b c d & r)

Primitive and inlined -. Coerces arguments and returned value to a long.

Primitive and inlined `-`. Coerces arguments and returned value to a long.
sourceraw docstring

low-2-expclj

(low-2-exp x)

Find greatest exponent (power of 2) which is lower or equal x. See high-2-exp.

Find greatest exponent (power of 2) which is lower or equal `x`. See [[high-2-exp]].
sourceraw docstring

low-expclj

(low-exp b x)

Find greatest exponent for base b which is lower or equal x. See also high-exp.

Find greatest exponent for base `b` which is lower or equal `x`. See also [[high-exp]].
sourceraw docstring

M_1_PIclj

\(\frac{1}{\pi}\)

\\(\frac{1}{\pi}\\)
sourceraw docstring

M_2_PIclj

\(\frac{2}{\pi}\)

\\(\frac{2}{\pi}\\)
sourceraw docstring

M_2_SQRTPIclj

\(\frac{2}{\sqrt\pi}\)

\\(\frac{2}{\sqrt\pi}\\)
sourceraw docstring

M_3PI_4clj

\(\frac{3\pi}{4}\)

\\(\frac{3\pi}{4}\\)
sourceraw docstring

M_Eclj

\(e\)

\\(e\\)
sourceraw docstring

M_INVLN2clj

\(\frac{1}{\ln{2}}\)

\\(\frac{1}{\ln{2}}\\)
sourceraw docstring

M_IVLN10clj

\(\frac{1}{\ln{10}}\)

\\(\frac{1}{\ln{10}}\\)
sourceraw docstring

M_LN10clj

\(\ln{10}\)

\\(\ln{10}\\)
sourceraw docstring

M_LN2clj

\(\ln{2}\)

\\(\ln{2}\\)
sourceraw docstring

M_LOG10Eclj

\(\log_{10}{e}\)

\\(\log_{10}{e}\\)
sourceraw docstring

M_LOG2_Eclj

\(\ln{2}\)

\\(\ln{2}\\)
sourceraw docstring

M_LOG2Eclj

\(\log_{2}{e}\)

\\(\log_{2}{e}\\)
sourceraw docstring

M_PIclj

\(\pi\)

\\(\pi\\)
sourceraw docstring

M_PI_2clj

\(\frac{\pi}{2}\)

\\(\frac{\pi}{2}\\)
sourceraw docstring

M_PI_4clj

\(\frac{\pi}{4}\)

\\(\frac{\pi}{4}\\)
sourceraw docstring

M_SQRT1_2clj

\(\frac{1}{\sqrt{2}}\)

\\(\frac{1}{\sqrt{2}}\\)
sourceraw docstring

M_SQRT2clj

\(\sqrt{2}\)

\\(\sqrt{2}\\)
sourceraw docstring

M_SQRT3clj

\(\sqrt{3}\)

\\(\sqrt{3}\\)
sourceraw docstring

M_SQRT_PIclj

\(\sqrt\pi\)

\\(\sqrt\pi\\)
sourceraw docstring

M_TWOPIclj

\(2\pi\)

\\(2\pi\\)
sourceraw docstring

MACHINE-EPSILONclj

ULP(1)/2. Half of the smallest difference between 1.0 and next possible double floating point number.

ULP(1)/2. Half of the smallest difference between 1.0 and next possible double floating point number.
sourceraw docstring

MACHINE-EPSILON10clj

5*ULP(1)

5*ULP(1)
sourceraw docstring

make-normclj

(make-norm start stop)
(make-norm start stop dstart dstop)

Make norm function for given range. Resulting function accepts double value (with optional target [dstart,dstop] range) and returns double.

Make [[norm]] function for given range. Resulting function accepts `double` value (with optional target `[dstart,dstop]` range) and returns `double`.
sourceraw docstring

maxclj

(max a)
(max a b)
(max a b c)
(max a b c d)
(max a b c d & r)

Primitive and inlined max.

Primitive and inlined `max`.
sourceraw docstring

minclj

(min a)
(min a b)
(min a b c)
(min a b c d)
(min a b c d & r)

Primitive and inlined min.

Primitive and inlined `min`.
sourceraw docstring

mlerpcljmacro

(mlerp start stop t)

lerp as macro. For inline code. See also lerp, cos-interpolation, quad-interpolation or smooth-interpolation.

[[lerp]] as macro. For inline code. See also [[lerp]], [[cos-interpolation]], [[quad-interpolation]] or [[smooth-interpolation]].
sourceraw docstring

mnormcljmacro

(mnorm v start stop)
(mnorm v start1 stop1 start2 stop2)

Macro version of norm.

Macro version of [[norm]].
sourceraw docstring

modclj

(mod x y)

Primitive and inlined mod

Primitive and inlined `mod`
sourceraw docstring

muladdclj

(muladd x y z)

(x y z) -> (+ z (* x y)) or Math/fma for java 9+

`(x y z)` -> `(+ z (* x y))` or `Math/fma` for java 9+
sourceraw docstring

nan?clj

(nan? v)

Check if a number is a NaN

Check if a number is a NaN
sourceraw docstring

near-zero?clj

(near-zero? x)
(near-zero? x abs-tol)
(near-zero? x abs-tol rel-tol)

Checks if given value is near zero with absolute (default: 1.0e-6) and/or relative (default 0.0) tolerance.

Checks if given value is near zero with absolute (default: `1.0e-6`) and/or relative (default `0.0`) tolerance.
sourceraw docstring

neg-inf?clj

(neg-inf? v)

Check if a number is negatively infinite.

Check if a number is negatively infinite.
sourceraw docstring

neg?clj

(neg? x)

Primitive and inlined neg?

Primitive and inlined `neg?`
sourceraw docstring

negative-zero?clj

(negative-zero? x)

Check if zero is negative, ie. -0.0

Check if zero is negative, ie. -0.0
sourceraw docstring

negmuladdclj

(negmuladd x y z)

(x y z) -> (+ z (* -x y)) or Math/fma for java 9+

`(x y z)` -> `(+ z (* -x y))` or `Math/fma` for java 9+
sourceraw docstring

next-doubleclj

(next-double v)
(next-double v delta)

Next double value. Optional value delta sets step amount.

Next double value. Optional value `delta` sets step amount.
sourceraw docstring

normclj

(norm v start stop)
(norm v start1 stop1 start2 stop2)

Normalize v from the range [start,stop] to the range [0,1] or map v from the range [start1,stop1] to the range [start2,stop2]. See also make-norm.

Normalize `v` from the range `[start,stop]` to the range `[0,1]` or map `v` from the range `[start1,stop1]` to the range `[start2,stop2]`. See also [[make-norm]].
sourceraw docstring

not-neg?clj

(not-neg? x)

Primitive and inlined not-neg? (x>=0.0)

Primitive and inlined `not-neg?` (x>=0.0)
sourceraw docstring

not-pos?clj

(not-pos? x)

Primitive and inlined not-pos? (x<=0.0)

Primitive and inlined `not-pos?` (x<=0.0)
sourceraw docstring

not==clj

(not== _)
(not== a b)
(not== a b & r)

Not equality. For more than two arguments, pairwise not equality is checked.

(not== 1 2 1) === (and (not= 1 2) (not= 2 1))

Not equality. For more than two arguments, pairwise not equality is checked.

`(not== 1 2 1)` === `(and (not= 1 2) (not= 2 1))`
sourceraw docstring

odd?clj

(odd? x)

Primitive and inlined odd?

Primitive and inlined `odd?`
sourceraw docstring

one?clj

(one? x)

Primitive and inlined one? (x==1.0)

Primitive and inlined `one?` (x==1.0)
sourceraw docstring

ONE_SIXTHclj

Value of \(\frac{1}{6}\)

Value of \\(\frac{1}{6}\\)
sourceraw docstring

ONE_THIRDclj

Value of \(\frac{1}{3}\)

Value of \\(\frac{1}{3}\\)
sourceraw docstring

orderclj

(order vs)
(order vs decreasing?)

Ordering permutation. See R docs

Order uses 0 based indexing.

Ordering permutation. See [R docs](https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/order)

Order uses 0 based indexing.
sourceraw docstring

PHIclj

Golden ratio \(\phi\)

Golden ratio \\(\phi\\)
sourceraw docstring

PIclj

Value of \(\pi\)

Value of \\(\pi\\)
sourceraw docstring

pos-inf?clj

(pos-inf? v)

Check if a number is positively infinite.

Check if a number is positively infinite.
sourceraw docstring

pos?clj

(pos? x)

Primitive and inlined pos?

Primitive and inlined `pos?`
sourceraw docstring

powclj

(pow x exponent)

Power of a number

Power of a number
sourceraw docstring

pow2clj

(pow2 x)

Same as sq. \(x^2\)

Same as [[sq]]. \\(x^2\\)
sourceraw docstring

pow3clj

(pow3 x)

\(x^3\)

\\(x^3\\)
sourceraw docstring

prev-doubleclj

(prev-double v)
(prev-double v delta)

Next double value. Optional value delta sets step amount.

Next double value. Optional value `delta` sets step amount.
sourceraw docstring

qceilclj

(qceil x)

Fast version of ceil. Returns long.

Fast version of [[ceil]]. Returns `long`.
sourceraw docstring

qcosclj

(qcos x)

Fast and less accurate cos(x)

Fast and less accurate cos(x)
sourceraw docstring

qdistclj

(qdist [x1 y1] [x2 y2])
(qdist x1 y1 x2 y2)

Quick version of Euclidean distance between points. qsqrt is used instead of sqrt.

Quick version of Euclidean distance between points. [[qsqrt]] is used instead of [[sqrt]].
sourceraw docstring

qexpclj

(qexp x)

Quick and less accurate version of exp.

Quick and less accurate version of [[exp]].
sourceraw docstring

qfloorclj

(qfloor x)

Fast version of floor. Returns long.

Fast version of [[floor]]. Returns `long`.
sourceraw docstring

qlogclj

(qlog x)

Fast and less accurate version of log.

Fast and less accurate version of [[log]].
sourceraw docstring

qpowclj

(qpow x exponent)

Fast and less accurate version of pow.

Fast and less accurate version of [[pow]].
sourceraw docstring

qroundclj

(qround x)

Fast version of round. Returns long

Fast version of [[round]]. Returns `long`
sourceraw docstring

qsinclj

(qsin x)

Fast and less accurate sin(x)

Fast and less accurate sin(x)
sourceraw docstring

qsqrtclj

(qsqrt x)

Approximated sqrt using binary operations with error 1.0E-2.

Approximated [[sqrt]] using binary operations with error `1.0E-2`.
sourceraw docstring

quad-interpolationclj

(quad-interpolation start stop t)

Quad interpolation. See also lerp/mlerp, cos-interpolation or smooth-interpolation.

Quad interpolation. See also [[lerp]]/[[mlerp]], [[cos-interpolation]] or [[smooth-interpolation]].
sourceraw docstring

QUARTER_PIclj

Value of \(\frac{\pi}{4}\)

Value of \\(\frac{\pi}{4}\\)
sourceraw docstring

quotclj

(quot x y)

Primitive and inlined quot

Primitive and inlined `quot`
sourceraw docstring

rad-in-degclj

\(\frac{180}{\pi}\)

\\(\frac{180}{\pi}\\)
sourceraw docstring

radiansclj

(radians deg)

Convert degrees into radians.

Convert degrees into radians.
sourceraw docstring

rankclj

(rank vs)
(rank vs ties)
(rank vs ties desc?)

Sample ranks. See R docs.

Rank uses 0 based indexing.

Possible tie strategies: :average, :first, :last, :random, :min, :max, :dense.

:dense is the same as in data.table::frank from R

Sample ranks. See [R docs](https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/rank).

Rank uses 0 based indexing.

Possible tie strategies: `:average`, `:first`, `:last`, `:random`, `:min`, `:max`, `:dense`.

`:dense` is the same as in `data.table::frank` from R
sourceraw docstring

rank1clj

source

remclj

(rem x y)

Primitive and inlined rem

Primitive and inlined `rem`
sourceraw docstring

remainderclj

(remainder dividend divisor)

From FastMath doc: returns dividend - divisor * n, where n is the mathematical integer closest to dividend/divisor. Returned value in [-|divisor|/2,|divisor|/2]

From `FastMath` doc: returns dividend - divisor * n,
where n is the mathematical integer closest to dividend/divisor. Returned value in `[-|divisor|/2,|divisor|/2]`
sourceraw docstring

rintclj

(rint x)
(rint x scale)

Round to double. See round, qround.

Rounding is done to a multiply of scale value (when provided).

Round to `double`. See [[round]], [[qround]].

Rounding is done to a multiply of scale value (when provided).
sourceraw docstring

rising-factorialclj

(rising-factorial n x)

Rising (Pochhammer) factorial.

Rising (Pochhammer) factorial.
sourceraw docstring

rising-factorial-intclj

(rising-factorial-int n x)

Rising (Pochhammer) factorial for integer n.

Rising (Pochhammer) factorial for integer n.
sourceraw docstring

roundclj

(round x)

Round to long. See: rint, qround.

Round to `long`. See: [[rint]], [[qround]].
sourceraw docstring

round-evenclj

(round-even x)

Round evenly (like in round in R), IEEE / IEC rounding

Round evenly (like in round in R), IEEE / IEC rounding
sourceraw docstring

round-up-pow2clj

(round-up-pow2 v)

Round long to the next power of 2

Round long to the next power of 2
sourceraw docstring

rqsqrtclj

(rqsqrt x)

Reciprocal of qsqrt. Quick and less accurate.

Reciprocal of [[qsqrt]]. Quick and less accurate.
sourceraw docstring

safe-sqrtclj

(safe-sqrt value)

Safe sqrt, for value <= 0 result is 0.

\( \left\{ \begin{array}{lr} 0 & : x \leq 0\\ \sqrt{x} & : x > 0 \end{array} \right. \)

Safe sqrt, for value <= 0 result is 0.

\\(
\left\\{
\begin{array}{lr}
0 & : x \leq 0\\\\
\sqrt{x} & : x > 0
\end{array}
\\right.
\\)
sourceraw docstring

sampleclj

(sample f number-of-values)
(sample f number-of-values domain?)
(sample f domain-min domain-max number-of-values)
(sample f domain-min domain-max number-of-values domain?)

Sample function f and return sequence of values.

range-min defaults to 0.0, range-max to 1.0.

Range is inclusive.

When optional domain? is set to true (default: false) function returns pairs [x,(f x)].

Sample function `f` and return sequence of values.

`range-min` defaults to 0.0, `range-max` to 1.0.

Range is inclusive.

When optional `domain?` is set to true (default: false) function returns pairs `[x,(f x)]`.
sourceraw docstring

secclj

(sec x)

sec(x)

sec(x)
sourceraw docstring

sechclj

(sech x)

Hyperbolic secant

Hyperbolic secant
sourceraw docstring

secpiclj

(secpi x)

sec(pi*x)

sec(pi*x)
sourceraw docstring

seq->double-arrayclj

(seq->double-array vs)

Convert sequence to double array. Returns input if vs is double array already.

Convert sequence to double array. Returns input if `vs` is double array already.
sourceraw docstring

seq->double-double-arrayclj

(seq->double-double-array vss)

Convert sequence to double-array of double-arrays.

If sequence is double-array of double-arrays returns vss

Convert sequence to double-array of double-arrays.

If sequence is double-array of double-arrays returns `vss`
sourceraw docstring

sfracclj

(sfrac v)

Fractional part, always returns values from -1.0 to 1.0 (exclusive). See frac for unsigned version.

Fractional part, always returns values from -1.0 to 1.0 (exclusive). See [[frac]] for unsigned version.
sourceraw docstring

sgnclj

(sgn value)

Return -1 when value is negative, 1 otherwise. See also signum.

Return -1 when `value` is negative, 1 otherwise. See also [[signum]].
sourceraw docstring

sigmoidclj

(sigmoid x)

Sigmoid function

Sigmoid function
sourceraw docstring

signumclj

(signum value)

Return 1 if value is > 0, 0 if it is 0, -1 otherwise. See also sgn.

Return 1 if `value` is > 0, 0 if it is 0, -1 otherwise. See also [[sgn]].
sourceraw docstring

SILVERclj

Silver ratio \(\delta_S\)

Silver ratio \\(\delta_S\\)
sourceraw docstring

sinclj

(sin x)

sin(x)

sin(x)
sourceraw docstring

sincclj

(sinc v)

Sinc function.

Sinc function.
sourceraw docstring

sinhclj

(sinh x)

sinh(x)

sinh(x)
sourceraw docstring

sinpiclj

(sinpi x)

sin(pi*x)

sin(pi*x)
sourceraw docstring

SIXTHclj

Value of \(\frac{1}{6}\)

Value of \\(\frac{1}{6}\\)
sourceraw docstring

slice-rangeclj

(slice-range cnt)
(slice-range start end cnt)

Slice range to get cnt number of points evenly distanced.

Slice range to get `cnt` number of points evenly distanced.
sourceraw docstring

smooth-interpolationclj

(smooth-interpolation start stop t)

Smoothstep based interpolation. See also lerp/mlerp, quad-interpolation or cos-interpolation.

Smoothstep based interpolation. See also [[lerp]]/[[mlerp]], [[quad-interpolation]] or [[cos-interpolation]].
sourceraw docstring

smooth-maxclj

(smooth-max xs)
(smooth-max xs alpha)
(smooth-max xs alpha family)

Smooth maximum function.

A smooth function with alpha argument. When alpha goes to infinity, function returns maximum value of xs.

Family:

  • :lse - LogSumExp (default)
  • :boltzmann - Boltzmann operator, works for small alpha values
  • :mellowmax
  • :p-norm
  • :smu - smooth maximum unit, epsilon = 1/alpha > 0
Smooth maximum function.

A smooth function with `alpha` argument. When `alpha` goes to infinity, function returns maximum value of `xs`.

Family:

* `:lse` - LogSumExp (default)
* `:boltzmann` - Boltzmann operator, works for small alpha values
* `:mellowmax`
* `:p-norm`
* `:smu` - smooth maximum unit, epsilon = 1/alpha > 0
sourceraw docstring

smoothstepclj

(smoothstep edge0 edge1 x)
GL [smoothstep](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/smoothstep.xhtml).
sourceraw docstring

spowclj

(spow x exponent)

Symmetric power of a number (keeping a sign of the argument.

Symmetric power of a number (keeping a sign of the argument.
sourceraw docstring

sqclj

(sq x)

Same as pow2. \(x^2\)

Same as [[pow2]]. \\(x^2\\)
sourceraw docstring

sqrtclj

(sqrt x)

\(\sqrt{x}\)

\\(\sqrt{x}\\)
sourceraw docstring

SQRT2clj

\(\sqrt{2}\)

\\(\sqrt{2}\\)
sourceraw docstring

SQRT2_2clj

\(\frac{\sqrt{2}}{2}\)

\\(\frac{\sqrt{2}}{2}\\)
sourceraw docstring

SQRT2PIclj

\(\sqrt{2\pi}\)

\\(\sqrt{2\pi}\\)
sourceraw docstring

SQRT3clj

\(\sqrt{3}\)

\\(\sqrt{3}\\)
sourceraw docstring

SQRT3_2clj

\(\frac{\sqrt{3}}{2}\)

\\(\frac{\sqrt{3}}{2}\\)
sourceraw docstring

SQRT3_3clj

\(\frac{\sqrt{3}}{3}\)

\\(\frac{\sqrt{3}}{3}\\)
sourceraw docstring

SQRT3_4clj

\(\frac{\sqrt{3}}{4}\)

\\(\frac{\sqrt{3}}{4}\\)
sourceraw docstring

SQRT5clj

\(\sqrt{5}\)

\\(\sqrt{5}\\)
sourceraw docstring

SQRT_2_PIclj

\(\sqrt{\frac{2}{\pi}}\)

\\(\sqrt{\frac{2}{\pi}}\\)
sourceraw docstring

SQRT_HALFPIclj

\(\sqrt{\frac{1}{2}\pi}\)

\\(\sqrt{\frac{1}{2}\pi}\\)
sourceraw docstring

SQRTPIclj

\(\sqrt{\pi}\)

\\(\sqrt{\pi}\\)
sourceraw docstring

sum-of-productsclj

(sum-of-products a b c d)

Kahan's algorithm for (ab)+(cd) to avoid catastrophic cancellation.

Kahan's algorithm for (a*b)+(c*d) to avoid catastrophic cancellation.
sourceraw docstring

tanclj

(tan x)

tan(x)

tan(x)
sourceraw docstring

tanhclj

(tanh x)

tanh(x)

tanh(x)
sourceraw docstring

tanpiclj

(tanpi x)

tan(pi*x)

tan(pi*x)
sourceraw docstring

TAUclj

Alias for TWO_PI

Alias for [[TWO_PI]]
sourceraw docstring

THIRDclj

Value of \(\frac{1}{3}\)

Value of \\(\frac{1}{3}\\)
sourceraw docstring

THIRD_PIclj

Value of \(\frac{\pi}{3}\)

Value of \\(\frac{\pi}{3}\\)
sourceraw docstring

truncclj

(trunc v)

Truncate fractional part, keep sign. Returns double.

Truncate fractional part, keep sign. Returns `double`.
sourceraw docstring

TWO_INV_PIclj

Value of \(\frac{2}{\pi}\)

Value of \\(\frac{2}{\pi}\\)
sourceraw docstring

TWO_PIclj

Value of \(2 {\pi}\)

Value of \\(2 {\pi}\\)
sourceraw docstring

TWO_THIRDclj

Value of \(\frac{2}{3}\)

Value of \\(\frac{2}{3}\\)
sourceraw docstring

TWO_THIRDSclj

Value of \(\frac{2}{3}\)

Value of \\(\frac{2}{3}\\)
sourceraw docstring

ulpclj

(ulp x)

Unit in the Last Place, distance between next value larger than x and x

Unit in the Last Place, distance between next value larger than `x` and `x`
sourceraw docstring

unsigned-bit-shift-rightclj

(unsigned-bit-shift-right x shift)

Shift bits right and set most significant bit to 0

Shift bits right and set most significant bit to `0`
sourceraw docstring

unuse-primitive-operatorsclj

(unuse-primitive-operators)
(unuse-primitive-operators skip-set)

Undoes the work of use-primitive-operators. This is idempotent.

Undoes the work of [[use-primitive-operators]]. This is idempotent.
sourceraw docstring

use-primitive-operatorsclj

(use-primitive-operators)
(use-primitive-operators skip-set)

Replaces Clojure's arithmetic and number coercion functions with primitive equivalents. These are defined as macros, so they cannot be used as higher-order functions. This is an idempotent operation. Undo with unuse-primitive-operators.

Replaces Clojure's arithmetic and number coercion functions with primitive equivalents.  These are
defined as macros, so they cannot be used as higher-order functions. This is an idempotent operation. Undo with [[unuse-primitive-operators]].
sourceraw docstring

valid-double?clj

(valid-double? v)

Check if a number is finite double.

Check if a number is finite double.
sourceraw docstring

vercosclj

(vercos x)

Vercosine

Vercosine
sourceraw docstring

versinclj

(versin x)

Versine

Versine
sourceraw docstring

wrapclj

(wrap [start stop] value)
(wrap start stop value)

Wrap overflowed value into the range, similar to ofWrap.

Wrap overflowed value into the range, similar to [ofWrap](http://openframeworks.cc/documentation/math/ofMath/#!show_ofWrap).
sourceraw docstring

xexpxclj

(xexpx x)

x * exp(x)

x * exp(x)
sourceraw docstring

xexpyclj

(xexpy x y)

x * exp(x)

x * exp(x)
sourceraw docstring

xlog1pyclj

(xlog1py x y)

x * log(1+y)

x * log(1+y)
sourceraw docstring

xlogxclj

(xlogx x)

x * log(x)

x * log(x)
sourceraw docstring

xlogyclj

(xlogy x y)

x * log(y)

x * log(y)
sourceraw docstring

xorclj

(xor x y)
(xor x y & r)

Primitive boolean xor

Primitive boolean xor
sourceraw docstring

zero?clj

(zero? x)

Primitive and inlined zero?

Primitive and inlined `zero?`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close