Average Error: 61.3 → 0.7
Time: 24.8s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[1 \cdot \left(\frac{\log 1}{x} + \log 1\right) + \left(\left(1 \cdot \left(\log 1 \cdot x\right) + 0.25 \cdot \frac{\log 1 \cdot x}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right)}\right) - \left(\left(0.3333333333333333148296162562473909929395 \cdot \frac{\log 1 \cdot x}{1 \cdot \left(1 \cdot 1\right)} + \frac{\log 1}{1 \cdot 1} \cdot 0.5\right) + \left(\frac{1 \cdot \left(\log 1 \cdot x\right)}{1 \cdot 1} + \left(1 \cdot x + 1\right)\right)\right)\right)\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
1 \cdot \left(\frac{\log 1}{x} + \log 1\right) + \left(\left(1 \cdot \left(\log 1 \cdot x\right) + 0.25 \cdot \frac{\log 1 \cdot x}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right)}\right) - \left(\left(0.3333333333333333148296162562473909929395 \cdot \frac{\log 1 \cdot x}{1 \cdot \left(1 \cdot 1\right)} + \frac{\log 1}{1 \cdot 1} \cdot 0.5\right) + \left(\frac{1 \cdot \left(\log 1 \cdot x\right)}{1 \cdot 1} + \left(1 \cdot x + 1\right)\right)\right)\right)
double f(double x) {
        double r10224417 = 1.0;
        double r10224418 = x;
        double r10224419 = r10224417 - r10224418;
        double r10224420 = log(r10224419);
        double r10224421 = r10224417 + r10224418;
        double r10224422 = log(r10224421);
        double r10224423 = r10224420 / r10224422;
        return r10224423;
}

double f(double x) {
        double r10224424 = 1.0;
        double r10224425 = log(r10224424);
        double r10224426 = x;
        double r10224427 = r10224425 / r10224426;
        double r10224428 = r10224427 + r10224425;
        double r10224429 = r10224424 * r10224428;
        double r10224430 = r10224425 * r10224426;
        double r10224431 = r10224424 * r10224430;
        double r10224432 = 0.25;
        double r10224433 = r10224424 * r10224424;
        double r10224434 = r10224433 * r10224433;
        double r10224435 = r10224430 / r10224434;
        double r10224436 = r10224432 * r10224435;
        double r10224437 = r10224431 + r10224436;
        double r10224438 = 0.3333333333333333;
        double r10224439 = r10224424 * r10224433;
        double r10224440 = r10224430 / r10224439;
        double r10224441 = r10224438 * r10224440;
        double r10224442 = r10224425 / r10224433;
        double r10224443 = 0.5;
        double r10224444 = r10224442 * r10224443;
        double r10224445 = r10224441 + r10224444;
        double r10224446 = r10224431 / r10224433;
        double r10224447 = r10224424 * r10224426;
        double r10224448 = r10224447 + r10224424;
        double r10224449 = r10224446 + r10224448;
        double r10224450 = r10224445 + r10224449;
        double r10224451 = r10224437 - r10224450;
        double r10224452 = r10224429 + r10224451;
        return r10224452;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 61.3

    \[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
  2. Using strategy rm
  3. Applied flip-+61.0

    \[\leadsto \frac{\log \left(1 - x\right)}{\log \color{blue}{\left(\frac{1 \cdot 1 - x \cdot x}{1 - x}\right)}}\]
  4. Applied log-div61.2

    \[\leadsto \frac{\log \left(1 - x\right)}{\color{blue}{\log \left(1 \cdot 1 - x \cdot x\right) - \log \left(1 - x\right)}}\]
  5. Taylor expanded around 0 59.9

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

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

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

    \[\leadsto \color{blue}{1 \cdot \left(\frac{\log 1}{x} + \log 1\right) + \left(\left(1 \cdot \left(\log 1 \cdot x\right) + 0.25 \cdot \frac{\log 1 \cdot x}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right)}\right) - \left(\left(0.3333333333333333148296162562473909929395 \cdot \frac{\log 1 \cdot x}{1 \cdot \left(1 \cdot 1\right)} + \frac{\log 1}{1 \cdot 1} \cdot 0.5\right) + \left(\frac{1 \cdot \left(\log 1 \cdot x\right)}{1 \cdot 1} + \left(1 \cdot x + 1\right)\right)\right)\right)}\]
  9. Final simplification0.7

    \[\leadsto 1 \cdot \left(\frac{\log 1}{x} + \log 1\right) + \left(\left(1 \cdot \left(\log 1 \cdot x\right) + 0.25 \cdot \frac{\log 1 \cdot x}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right)}\right) - \left(\left(0.3333333333333333148296162562473909929395 \cdot \frac{\log 1 \cdot x}{1 \cdot \left(1 \cdot 1\right)} + \frac{\log 1}{1 \cdot 1} \cdot 0.5\right) + \left(\frac{1 \cdot \left(\log 1 \cdot x\right)}{1 \cdot 1} + \left(1 \cdot x + 1\right)\right)\right)\right)\]

Reproduce

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