Average Error: 14.7 → 0.1
Time: 11.5s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\left(-2 \cdot 1\right) \cdot 1}{1 + x}}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\left(-2 \cdot 1\right) \cdot 1}{1 + x}}{x - 1}
double f(double x) {
        double r112857 = 1.0;
        double r112858 = x;
        double r112859 = r112858 + r112857;
        double r112860 = r112857 / r112859;
        double r112861 = r112858 - r112857;
        double r112862 = r112857 / r112861;
        double r112863 = r112860 - r112862;
        return r112863;
}

double f(double x) {
        double r112864 = -2.0;
        double r112865 = 1.0;
        double r112866 = r112864 * r112865;
        double r112867 = r112866 * r112865;
        double r112868 = x;
        double r112869 = r112865 + r112868;
        double r112870 = r112867 / r112869;
        double r112871 = r112868 - r112865;
        double r112872 = r112870 / r112871;
        return r112872;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.7

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

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

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

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

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

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(0 - \left(1 + 1\right)\right)}\]
  9. Using strategy rm
  10. Applied difference-of-squares0.4

    \[\leadsto \frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}} \cdot \left(0 - \left(1 + 1\right)\right)\]
  11. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1}}{x - 1}} \cdot \left(0 - \left(1 + 1\right)\right)\]
  12. Using strategy rm
  13. Applied associate-*l/0.1

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

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

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

Reproduce

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