math-log1p.js 279 B

12345678
  1. var log = Math.log;
  2. // `Math.log1p` method implementation
  3. // https://tc39.es/ecma262/#sec-math.log1p
  4. // eslint-disable-next-line es-x/no-math-log1p -- safe
  5. module.exports = Math.log1p || function log1p(x) {
  6. return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
  7. };