Average Error: 60.9 → 0.0
Time: 1.3m
Precision: 64
Internal Precision: 1344
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\log \left((e^{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}} - 1)^* + 1\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.9
Target0.3
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. Initial simplification60.0

    \[\leadsto \frac{\log \left(1 - x\right)}{\log_* (1 + x)}\]
  3. Using strategy rm
  4. Applied sub-neg60.0

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

    \[\leadsto \frac{\color{blue}{\log_* (1 + \left(-x\right))}}{\log_* (1 + x)}\]
  6. Using strategy rm
  7. Applied log1p-expm1-u0.0

    \[\leadsto \color{blue}{\log_* (1 + (e^{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}} - 1)^*)}\]
  8. Using strategy rm
  9. Applied log1p-udef0.0

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

    \[\leadsto \log \left((e^{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}} - 1)^* + 1\right)\]

Runtime

Time bar (total: 1.3m)Debug logProfile

herbie shell --seed 2018214 +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))))