Average Error: 14.4 → 0.1
Time: 11.7s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}
double f(double x) {
        double r76379 = 1.0;
        double r76380 = x;
        double r76381 = r76380 + r76379;
        double r76382 = r76379 / r76381;
        double r76383 = r76380 - r76379;
        double r76384 = r76379 / r76383;
        double r76385 = r76382 - r76384;
        return r76385;
}

double f(double x) {
        double r76386 = -2.0;
        double r76387 = 1.0;
        double r76388 = 4.0;
        double r76389 = pow(r76387, r76388);
        double r76390 = r76386 * r76389;
        double r76391 = x;
        double r76392 = r76387 + r76391;
        double r76393 = r76390 / r76392;
        double r76394 = r76391 - r76387;
        double r76395 = r76393 / r76394;
        double r76396 = r76387 * r76387;
        double r76397 = -r76387;
        double r76398 = r76397 * r76387;
        double r76399 = r76398 + r76396;
        double r76400 = r76396 + r76399;
        double r76401 = r76395 / r76400;
        return r76401;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.4

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

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

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

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

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

    \[\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(\left(0 - 1\right) - 1\right)}\]
  9. Using strategy rm
  10. Applied flip3--0.4

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

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

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

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

Reproduce

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