Average Error: 61.5 → 0.9
Time: 8.9s
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 r71608 = 1.0;
        double r71609 = x;
        double r71610 = r71608 - r71609;
        double r71611 = log(r71610);
        double r71612 = r71608 + r71609;
        double r71613 = log(r71612);
        double r71614 = r71611 / r71613;
        return r71614;
}

double f(double x) {
        double r71615 = 1.0;
        double r71616 = log(r71615);
        double r71617 = x;
        double r71618 = r71615 * r71617;
        double r71619 = 0.5;
        double r71620 = 2.0;
        double r71621 = pow(r71617, r71620);
        double r71622 = pow(r71615, r71620);
        double r71623 = r71621 / r71622;
        double r71624 = r71619 * r71623;
        double r71625 = r71618 + r71624;
        double r71626 = r71616 - r71625;
        double r71627 = r71618 + r71616;
        double r71628 = exp(r71624);
        double r71629 = log(r71628);
        double r71630 = r71627 - r71629;
        double r71631 = r71626 / r71630;
        double r71632 = cbrt(r71631);
        double r71633 = r71632 * r71632;
        double r71634 = r71633 * r71632;
        return r71634;
}

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))))