Average Error: 60.9 → 0.5
Time: 19.8s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\left(\left(-x\right) + -1\right) + \left(x \cdot x\right) \cdot \frac{-1}{2}\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\left(\left(-x\right) + -1\right) + \left(x \cdot x\right) \cdot \frac{-1}{2}
double f(double x) {
        double r1754535 = 1.0;
        double r1754536 = x;
        double r1754537 = r1754535 - r1754536;
        double r1754538 = log(r1754537);
        double r1754539 = r1754535 + r1754536;
        double r1754540 = log(r1754539);
        double r1754541 = r1754538 / r1754540;
        return r1754541;
}

double f(double x) {
        double r1754542 = x;
        double r1754543 = -r1754542;
        double r1754544 = -1.0;
        double r1754545 = r1754543 + r1754544;
        double r1754546 = r1754542 * r1754542;
        double r1754547 = -0.5;
        double r1754548 = r1754546 * r1754547;
        double r1754549 = r1754545 + r1754548;
        return r1754549;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.9
Target0.4
Herbie0.5
\[-\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. Taylor expanded around 0 0.5

    \[\leadsto \color{blue}{-\left(x + \left(\frac{1}{2} \cdot {x}^{2} + 1\right)\right)}\]
  3. Simplified0.5

    \[\leadsto \color{blue}{\left(\left(-x\right) + -1\right) + \left(x \cdot x\right) \cdot \frac{-1}{2}}\]
  4. Final simplification0.5

    \[\leadsto \left(\left(-x\right) + -1\right) + \left(x \cdot x\right) \cdot \frac{-1}{2}\]

Reproduce

herbie shell --seed 2019165 
(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))))