Average Error: 60.8 → 0.2
Time: 3.0m
Precision: 64
Internal Precision: 1344
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\frac{\log \left({1}^{3} - {x}^{3}\right) - \log_* (1 + (x \cdot x + x)_*)}{\log_* (1 + x)}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 60.8

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

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

    \[\leadsto \frac{\log \color{blue}{\left(\frac{{1}^{3} - {x}^{3}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)}}{\log_* (1 + x)}\]
  5. Applied log-div59.8

    \[\leadsto \frac{\color{blue}{\log \left({1}^{3} - {x}^{3}\right) - \log \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}}{\log_* (1 + x)}\]
  6. Applied simplify0.2

    \[\leadsto \frac{\log \left({1}^{3} - {x}^{3}\right) - \color{blue}{\log_* (1 + (x \cdot x + x)_*)}}{\log_* (1 + x)}\]

Runtime

Time bar (total: 3.0m)Debug logProfile

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