rStats.js v1.3.0
    Preparing search index...

    Function log1pmx

    • log(1 + x) - x, accurate for small |x| (where log1p(x) - x would cancel). Not an R function. R has it only in its C API (Rmath.h), as log1pmx.

      Parameters

      • x: number

        A number >= -1.

      Returns number

      log(1 + x) - x; -Infinity at x = -1 and x = Infinity, NaN for x < -1.

      log1pmx(1e-5); // -4.9999666669166655e-11