Skip to content

numeric

there are a few functions needed specifically for better numerical performance:

name decomposition notation common names
sqrt(c) root(c, 2) \(\sqrt{c}\)
cbrt(c) root(c, 3) \(\sqrt[3]{c}\)
lb(c) log(c, 2) \(\log_2(c)\) log2
lg(c) log(c, 10) \(\log_{10}(c)\) log10
ln(c) log(c, e) \(\log_{\mathrm e}(c)\) log
exp(b) pow(e, b) \(\mathrm e^b\)
ln1p(c) ln(add(1, c)) \(\ln(1 + c)\) log1p
expm1(b) sub(exp(b), 1) \(\mathrm e ^ b - 1\)
fma(a, b, c) add(mul(a, b), c) \(ab + c\)
radius(x, y) \(\sqrt{x^2 + y^2}\) hypot
angle(x, y) atan2