Average Error: 60.9 → 0.0
Time: 21.7s
Precision: 64
Internal Precision: 1408
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\]

Error

Bits error versus x

Target

Original60.9
Target0.4
Herbie0.0
\[-\left(\left(\left(1 + x\right) + \frac{x \cdot x}{2}\right) + \frac{5}{12} \cdot {x}^{3}\right)\]

Derivation

  1. Initial program 60.9

    \[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
  2. Applied simplify59.9

    \[\leadsto \color{blue}{\frac{\log \left(1 - x\right)}{\log_* (1 + x)}}\]
  3. Using strategy rm
  4. Applied log1p-expm1-u59.9

    \[\leadsto \frac{\color{blue}{\log_* (1 + (e^{\log \left(1 - x\right)} - 1)^*)}}{\log_* (1 + x)}\]
  5. Applied simplify0.0

    \[\leadsto \frac{\log_* (1 + \color{blue}{\left(-x\right)})}{\log_* (1 + x)}\]

Runtime

Time bar (total: 21.7s)Debug logProfile

herbie shell --seed '#(1070864556 424010669 783715395 1203517814 4070606583 4107618214)' +o rules:numerics
(FPCore (x)
  :name "qlog (example 3.10)"
  :pre (and (< -1 x) (< x 1))

  :herbie-target
  (- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 5/12 (pow x 3))))

  (/ (log (- 1 x)) (log (+ 1 x))))