Average Error: 61.0 → 0.8
Time: 14.8s
Precision: 64
\[-1 \lt x \land x \lt 1\]
\[\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}\]
\[\left(\left(-\left(\left(\left(\frac{x \cdot \log 1}{1} \cdot \left(\frac{0.3333333333333333148296162562473909929395}{{1}^{2}} + 1\right) + 0.5 \cdot \frac{\log 1}{{1}^{2}}\right) + 1 \cdot x\right) + 1\right)\right) + \log 1 \cdot \left(\frac{1}{x} + 1\right)\right) + \left(x \cdot \log 1\right) \cdot \left(\frac{0.25}{{1}^{4}} + 1\right)\]
\frac{\log \left(1 - x\right)}{\log \left(1 + x\right)}
\left(\left(-\left(\left(\left(\frac{x \cdot \log 1}{1} \cdot \left(\frac{0.3333333333333333148296162562473909929395}{{1}^{2}} + 1\right) + 0.5 \cdot \frac{\log 1}{{1}^{2}}\right) + 1 \cdot x\right) + 1\right)\right) + \log 1 \cdot \left(\frac{1}{x} + 1\right)\right) + \left(x \cdot \log 1\right) \cdot \left(\frac{0.25}{{1}^{4}} + 1\right)
double f(double x) {
        double r53116 = 1.0;
        double r53117 = x;
        double r53118 = r53116 - r53117;
        double r53119 = log(r53118);
        double r53120 = r53116 + r53117;
        double r53121 = log(r53120);
        double r53122 = r53119 / r53121;
        return r53122;
}

double f(double x) {
        double r53123 = x;
        double r53124 = 1.0;
        double r53125 = log(r53124);
        double r53126 = r53123 * r53125;
        double r53127 = r53126 / r53124;
        double r53128 = 0.3333333333333333;
        double r53129 = 2.0;
        double r53130 = pow(r53124, r53129);
        double r53131 = r53128 / r53130;
        double r53132 = 1.0;
        double r53133 = r53131 + r53132;
        double r53134 = r53127 * r53133;
        double r53135 = 0.5;
        double r53136 = r53125 / r53130;
        double r53137 = r53135 * r53136;
        double r53138 = r53134 + r53137;
        double r53139 = r53124 * r53123;
        double r53140 = r53138 + r53139;
        double r53141 = r53140 + r53124;
        double r53142 = -r53141;
        double r53143 = r53124 / r53123;
        double r53144 = r53143 + r53124;
        double r53145 = r53125 * r53144;
        double r53146 = r53142 + r53145;
        double r53147 = 0.25;
        double r53148 = 4.0;
        double r53149 = pow(r53124, r53148);
        double r53150 = r53147 / r53149;
        double r53151 = r53150 + r53124;
        double r53152 = r53126 * r53151;
        double r53153 = r53146 + r53152;
        return r53153;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 61.0

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

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

    \[\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 0.8

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

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

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

Reproduce

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