Average Error: 0.0 → 0.4
Time: 1.8s
Precision: binary64
\[-\log \left(\frac{1}{x} - 1\right)\]
\[\left(\log x + x \cdot \left(1 + 0.5 \cdot \frac{x}{1 \cdot 1}\right)\right) - \log 1\]

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[-\log \left(\frac{1}{x} - 1\right)\]
  2. Taylor expanded around 0 0.4

    \[\leadsto -\color{blue}{\left(\log 1 - \left(\log x + \left(1 \cdot x + 0.5 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\right)}\]
  3. Simplified0.4

    \[\leadsto -\color{blue}{\left(\log 1 - \left(\log x + x \cdot \left(1 + 0.5 \cdot \frac{x}{1 \cdot 1}\right)\right)\right)}\]
  4. Final simplification0.4

    \[\leadsto \left(\log x + x \cdot \left(1 + 0.5 \cdot \frac{x}{1 \cdot 1}\right)\right) - \log 1\]

Reproduce

herbie shell --seed 2020185 
(FPCore (x)
  :name "neg log"
  :precision binary64
  (neg (log (- (/ 1.0 x) 1.0))))