Skip to main content

log

Function log 

pub fn log(x: f64) -> f64
Expand description

Natural logarithm, fdlibm’s __ieee754_log.

Writes x = 2^k * (1 + f) with sqrt(2)/2 < 1 + f < sqrt(2), then returns k * ln 2 + log(1 + f), with log(1 + f) from a degree-14 polynomial in s = f / (2 + f) (or a short series when |f| < 2^-20). log(±0) is -inf, negative arguments give NaN, log(+inf) is +inf.