Average Error: 14.5 → 0.1
Time: 2.6s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[1 \cdot \frac{\left(-2\right) \cdot \frac{1}{x + 1}}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
1 \cdot \frac{\left(-2\right) \cdot \frac{1}{x + 1}}{x - 1}
double f(double x) {
        double r144430 = 1.0;
        double r144431 = x;
        double r144432 = r144431 + r144430;
        double r144433 = r144430 / r144432;
        double r144434 = r144431 - r144430;
        double r144435 = r144430 / r144434;
        double r144436 = r144433 - r144435;
        return r144436;
}

double f(double x) {
        double r144437 = 1.0;
        double r144438 = 2.0;
        double r144439 = -r144438;
        double r144440 = 1.0;
        double r144441 = x;
        double r144442 = r144441 + r144437;
        double r144443 = r144440 / r144442;
        double r144444 = r144439 * r144443;
        double r144445 = r144441 - r144437;
        double r144446 = r144444 / r144445;
        double r144447 = r144437 * r144446;
        return r144447;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.5

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

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

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

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

    \[\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. Taylor expanded around 0 0.3

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(-2\right)}\]
  9. Using strategy rm
  10. Applied div-inv0.3

    \[\leadsto \color{blue}{\left(1 \cdot \frac{1}{x \cdot x - 1 \cdot 1}\right)} \cdot \left(-2\right)\]
  11. Applied associate-*l*0.3

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

    \[\leadsto 1 \cdot \color{blue}{\frac{\frac{-2}{x + 1}}{x - 1}}\]
  13. Using strategy rm
  14. Applied div-inv0.1

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

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

Reproduce

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