Average Error: 61.5 → 0.9
Time: 15.7s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\left(\sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}} \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}\right) \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\left(\sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}} \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}\right) \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}
double f(double x) {
        double r357 = 1.0;
        double r358 = x;
        double r359 = r357 - r358;
        double r360 = log(r359);
        double r361 = r357 + r358;
        double r362 = log(r361);
        double r363 = r360 / r362;
        return r363;
}

double f(double x) {
        double r364 = 1.0;
        double r365 = log(r364);
        double r366 = x;
        double r367 = r364 * r366;
        double r368 = 0.5;
        double r369 = 2.0;
        double r370 = pow(r366, r369);
        double r371 = pow(r364, r369);
        double r372 = r370 / r371;
        double r373 = r368 * r372;
        double r374 = r367 + r373;
        double r375 = r365 - r374;
        double r376 = r367 + r365;
        double r377 = exp(r373);
        double r378 = log(r377);
        double r379 = r376 - r378;
        double r380 = r375 / r379;
        double r381 = cbrt(r380);
        double r382 = r381 * r381;
        double r383 = r382 * r381;
        return r383;
}

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.9
\[-\left(\left(\left(1 + x\right) + \frac{x \cdot x}{2}\right) + 0.416666666666666685 \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(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}}\]
  3. 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)}}{\left(1 \cdot x + \log 1\right) - \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\]
  4. Using strategy rm
  5. Applied add-log-exp0.9

    \[\leadsto \frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \color{blue}{\log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt0.9

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}} \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}\right) \cdot \sqrt[3]{\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\left(1 \cdot x + \log 1\right) - \log \left(e^{\frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}}\right)}}}\]
  8. Final simplification0.9

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

Reproduce

herbie shell --seed 2020025 
(FPCore (x)
  :name "qlog (example 3.10)"
  :precision binary64
  :pre (and (< -1 x) (< x 1))

  :herbie-target
  (- (+ (+ (+ 1 x) (/ (* x x) 2)) (* 0.4166666666666667 (pow x 3))))

  (/ (log (- 1 x)) (log (+ 1 x))))