Average Error: 61.0 → 0.4
Time: 15.4s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\left(\frac{-1}{2} \cdot \left(x \cdot x\right) + -1\right) - x\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\left(\frac{-1}{2} \cdot \left(x \cdot x\right) + -1\right) - x
double f(double x) {
        double r3573737 = 1.0;
        double r3573738 = x;
        double r3573739 = r3573737 - r3573738;
        double r3573740 = log(r3573739);
        double r3573741 = r3573737 + r3573738;
        double r3573742 = log(r3573741);
        double r3573743 = r3573740 / r3573742;
        return r3573743;
}

double f(double x) {
        double r3573744 = -0.5;
        double r3573745 = x;
        double r3573746 = r3573745 * r3573745;
        double r3573747 = r3573744 * r3573746;
        double r3573748 = -1.0;
        double r3573749 = r3573747 + r3573748;
        double r3573750 = r3573749 - r3573745;
        return r3573750;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 61.0

    \[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
  2. Taylor expanded around 0 0.4

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

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

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

Reproduce

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