Average Error: 61.6 → 0.4
Time: 13.4s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\log 1 - \left(\frac{\frac{{x}^{2}}{{1}^{2}}}{2} - 1 \cdot x\right)}\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\frac{\log 1 - \left(1 \cdot x + \frac{1}{2} \cdot \frac{{x}^{2}}{{1}^{2}}\right)}{\log 1 - \left(\frac{\frac{{x}^{2}}{{1}^{2}}}{2} - 1 \cdot x\right)}
double f(double x) {
        double r310818 = 1.0;
        double r310819 = x;
        double r310820 = r310818 - r310819;
        double r310821 = log(r310820);
        double r310822 = r310818 + r310819;
        double r310823 = log(r310822);
        double r310824 = r310821 / r310823;
        return r310824;
}

double f(double x) {
        double r310825 = 1.0;
        double r310826 = log(r310825);
        double r310827 = x;
        double r310828 = r310825 * r310827;
        double r310829 = 1.0;
        double r310830 = 2.0;
        double r310831 = r310829 / r310830;
        double r310832 = pow(r310827, r310830);
        double r310833 = pow(r310825, r310830);
        double r310834 = r310832 / r310833;
        double r310835 = r310831 * r310834;
        double r310836 = r310828 + r310835;
        double r310837 = r310826 - r310836;
        double r310838 = r310834 / r310830;
        double r310839 = r310838 - r310828;
        double r310840 = r310826 - r310839;
        double r310841 = r310837 / r310840;
        return r310841;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original61.6
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.6

    \[\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. Simplified60.6

    \[\leadsto \frac{\log \left(1 - x\right)}{\color{blue}{\log 1 - \left(\frac{\frac{{x}^{2}}{{1}^{2}}}{2} - 1 \cdot x\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)}}{\log 1 - \left(\frac{\frac{{x}^{2}}{{1}^{2}}}{2} - 1 \cdot x\right)}\]
  5. Simplified0.4

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

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

Reproduce

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

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

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