Average Error: 60.7 → 0.4
Time: 19.3s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[x \cdot \left(\frac{-1}{2} \cdot x\right) + \left(-1 - x\right)\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
x \cdot \left(\frac{-1}{2} \cdot x\right) + \left(-1 - x\right)
double f(double x) {
        double r2545802 = 1.0;
        double r2545803 = x;
        double r2545804 = r2545802 - r2545803;
        double r2545805 = log(r2545804);
        double r2545806 = r2545802 + r2545803;
        double r2545807 = log(r2545806);
        double r2545808 = r2545805 / r2545807;
        return r2545808;
}

double f(double x) {
        double r2545809 = x;
        double r2545810 = -0.5;
        double r2545811 = r2545810 * r2545809;
        double r2545812 = r2545809 * r2545811;
        double r2545813 = -1.0;
        double r2545814 = r2545813 - r2545809;
        double r2545815 = r2545812 + r2545814;
        return r2545815;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.7
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 60.7

    \[\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(-1 + \left(x \cdot x\right) \cdot \frac{-1}{2}\right) - x}\]
  4. Taylor expanded around inf 0.4

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

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

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

Reproduce

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