Average Error: 61.1 → 0.0
Time: 43.0s
Precision: 64
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[{\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)} \cdot \frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}\]
double f(double x) {
        double r7926265 = 1.0;
        double r7926266 = x;
        double r7926267 = r7926265 - r7926266;
        double r7926268 = log(r7926267);
        double r7926269 = r7926265 + r7926266;
        double r7926270 = log(r7926269);
        double r7926271 = r7926268 / r7926270;
        return r7926271;
}

double f(double x) {
        double r7926272 = x;
        double r7926273 = -r7926272;
        double r7926274 = log1p(r7926273);
        double r7926275 = log1p(r7926272);
        double r7926276 = r7926274 / r7926275;
        double r7926277 = r7926276 * r7926276;
        double r7926278 = 0.3333333333333333;
        double r7926279 = pow(r7926277, r7926278);
        double r7926280 = cbrt(r7926276);
        double r7926281 = r7926279 * r7926280;
        return r7926281;
}

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

Error

Bits error versus x

Target

Original61.1
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 61.1

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

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

    \[\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 add-cube-cbrt0.1

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}} \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}\right) \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}}\]
  8. Using strategy rm
  9. Applied pow1/363.6

    \[\leadsto \left(\sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}} \cdot \color{blue}{{\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}}}\right) \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}\]
  10. Applied pow1/363.6

    \[\leadsto \left(\color{blue}{{\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}}} \cdot {\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}\]
  11. Applied pow-prod-down0.0

    \[\leadsto \color{blue}{{\left(\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)} \cdot \frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{\frac{\log_* (1 + \left(-x\right))}{\log_* (1 + x)}}\]
  12. Final simplification0.0

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

Reproduce

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