Average Error: 39.1 → 0
Time: 5.1s
Precision: 64
Internal Precision: 1408
\[\log \left(1 + x\right)\]
\[\log_* (1 + x)\]

Error

Bits error versus x

Target

Original39.1
Target0.2
Herbie0
\[\begin{array}{l} \mathbf{if}\;1 + x = 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \log \left(1 + x\right)}{\left(1 + x\right) - 1}\\ \end{array}\]

Derivation

  1. Initial program 39.1

    \[\log \left(1 + x\right)\]
  2. Applied simplify0

    \[\leadsto \color{blue}{\log_* (1 + x)}\]

Runtime

Time bar (total: 5.1s)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' +o rules:numerics
(FPCore (x)
  :name "ln(1 + x)"

  :herbie-target
  (if (== (+ 1 x) 1) x (/ (* x (log (+ 1 x))) (- (+ 1 x) 1)))

  (log (+ 1 x)))