Average Error: 14.3 → 0.4
Time: 40.9s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{x \cdot x - 1} \cdot -2\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x \cdot x - 1} \cdot -2
double f(double x) {
        double r16252563 = 1.0;
        double r16252564 = x;
        double r16252565 = r16252564 + r16252563;
        double r16252566 = r16252563 / r16252565;
        double r16252567 = r16252564 - r16252563;
        double r16252568 = r16252563 / r16252567;
        double r16252569 = r16252566 - r16252568;
        return r16252569;
}

double f(double x) {
        double r16252570 = 1.0;
        double r16252571 = x;
        double r16252572 = r16252571 * r16252571;
        double r16252573 = r16252572 - r16252570;
        double r16252574 = r16252570 / r16252573;
        double r16252575 = -2.0;
        double r16252576 = r16252574 * r16252575;
        return r16252576;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.3

    \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
  2. Using strategy rm
  3. Applied flip--29.2

    \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}}\]
  4. Applied associate-/r/29.2

    \[\leadsto \frac{1}{x + 1} - \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)}\]
  5. Applied flip-+14.3

    \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  6. Applied associate-/r/14.3

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  7. Applied distribute-lft-out--13.7

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Simplified13.7

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

    \[\leadsto \frac{1}{x \cdot x - 1} \cdot \color{blue}{-2}\]
  10. Final simplification0.4

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

Reproduce

herbie shell --seed 2019119 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))