Average Error: 60.9 → 0.5
Time: 20.0s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\left(-1 + \left(x \cdot x\right) \cdot \frac{-1}{2}\right) - x\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\left(-1 + \left(x \cdot x\right) \cdot \frac{-1}{2}\right) - x
double f(double x) {
        double r2005175 = 1.0;
        double r2005176 = x;
        double r2005177 = r2005175 - r2005176;
        double r2005178 = log(r2005177);
        double r2005179 = r2005175 + r2005176;
        double r2005180 = log(r2005179);
        double r2005181 = r2005178 / r2005180;
        return r2005181;
}

double f(double x) {
        double r2005182 = -1.0;
        double r2005183 = x;
        double r2005184 = r2005183 * r2005183;
        double r2005185 = -0.5;
        double r2005186 = r2005184 * r2005185;
        double r2005187 = r2005182 + r2005186;
        double r2005188 = r2005187 - r2005183;
        return r2005188;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original60.9
Target0.3
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(-1 + \left(x \cdot x\right) \cdot \frac{-1}{2}\right) - x}\]
  4. Final simplification0.5

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

Reproduce

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