Average Error: 10.2 → 0.3
Time: 4.3s
Precision: 64
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
\[\frac{2}{{x}^{3} - 1 \cdot x}\]
\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}
\frac{2}{{x}^{3} - 1 \cdot x}
double f(double x) {
        double r136033 = 1.0;
        double r136034 = x;
        double r136035 = r136034 + r136033;
        double r136036 = r136033 / r136035;
        double r136037 = 2.0;
        double r136038 = r136037 / r136034;
        double r136039 = r136036 - r136038;
        double r136040 = r136034 - r136033;
        double r136041 = r136033 / r136040;
        double r136042 = r136039 + r136041;
        return r136042;
}

double f(double x) {
        double r136043 = 2.0;
        double r136044 = x;
        double r136045 = 3.0;
        double r136046 = pow(r136044, r136045);
        double r136047 = 1.0;
        double r136048 = r136047 * r136044;
        double r136049 = r136046 - r136048;
        double r136050 = r136043 / r136049;
        return r136050;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.2
Target0.3
Herbie0.3
\[\frac{2}{x \cdot \left(x \cdot x - 1\right)}\]

Derivation

  1. Initial program 10.2

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{{x}^{3} - 1 \cdot x}}\]
  7. Final simplification0.3

    \[\leadsto \frac{2}{{x}^{3} - 1 \cdot x}\]

Reproduce

herbie shell --seed 2020027 
(FPCore (x)
  :name "3frac (problem 3.3.3)"
  :precision binary64

  :herbie-target
  (/ 2 (* x (- (* x x) 1)))

  (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))))