Average Error: 61.5 → 0.4
Time: 20.3s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\frac{\log 1 - 1 \cdot x}{\left(\log 1 + 1 \cdot x\right) + \frac{\frac{-1}{2}}{\frac{1 \cdot 1}{{x}^{2}}}} - \frac{\frac{x}{1}}{\frac{\left(\log 1 + 1 \cdot x\right) + \frac{\frac{-1}{2}}{\frac{1 \cdot 1}{{x}^{2}}}}{\frac{\frac{1}{2}}{\frac{1}{x}}}}\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\frac{\log 1 - 1 \cdot x}{\left(\log 1 + 1 \cdot x\right) + \frac{\frac{-1}{2}}{\frac{1 \cdot 1}{{x}^{2}}}} - \frac{\frac{x}{1}}{\frac{\left(\log 1 + 1 \cdot x\right) + \frac{\frac{-1}{2}}{\frac{1 \cdot 1}{{x}^{2}}}}{\frac{\frac{1}{2}}{\frac{1}{x}}}}
double f(double x) {
        double r55397 = 1.0;
        double r55398 = x;
        double r55399 = r55397 - r55398;
        double r55400 = log(r55399);
        double r55401 = r55397 + r55398;
        double r55402 = log(r55401);
        double r55403 = r55400 / r55402;
        return r55403;
}

double f(double x) {
        double r55404 = 1.0;
        double r55405 = log(r55404);
        double r55406 = x;
        double r55407 = r55404 * r55406;
        double r55408 = r55405 - r55407;
        double r55409 = r55405 + r55407;
        double r55410 = -0.5;
        double r55411 = r55404 * r55404;
        double r55412 = 2.0;
        double r55413 = pow(r55406, r55412);
        double r55414 = r55411 / r55413;
        double r55415 = r55410 / r55414;
        double r55416 = r55409 + r55415;
        double r55417 = r55408 / r55416;
        double r55418 = r55406 / r55404;
        double r55419 = 0.5;
        double r55420 = r55404 / r55406;
        double r55421 = r55419 / r55420;
        double r55422 = r55416 / r55421;
        double r55423 = r55418 / r55422;
        double r55424 = r55417 - r55423;
        return r55424;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 61.5

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

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

    \[\leadsto \frac{\log \left(1 - x\right)}{\color{blue}{\frac{{x}^{2} \cdot \frac{-1}{2}}{1 \cdot 1} + \left(1 \cdot x + \log 1\right)}}\]
  4. Taylor expanded around 0 0.4

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

    \[\leadsto \frac{\color{blue}{\left(\log 1 - 1 \cdot x\right) - \frac{\frac{1}{2} \cdot x}{1} \cdot \frac{x}{1}}}{\frac{{x}^{2} \cdot \frac{-1}{2}}{1 \cdot 1} + \left(1 \cdot x + \log 1\right)}\]
  6. Using strategy rm
  7. Applied div-sub0.4

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

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

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (x)
  :name "qlog (example 3.10)"
  :pre (and (< -1.0 x) (< x 1.0))

  :herbie-target
  (- (+ (+ (+ 1.0 x) (/ (* x x) 2.0)) (* 0.4166666666666667 (pow x 3.0))))

  (/ (log (- 1.0 x)) (log (+ 1.0 x))))