Average Error: 14.3 → 0.1
Time: 14.4s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1}{x + 1}}{\frac{x - 1}{-2 \cdot 1}}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1}{x + 1}}{\frac{x - 1}{-2 \cdot 1}}
double f(double x) {
        double r94378 = 1.0;
        double r94379 = x;
        double r94380 = r94379 + r94378;
        double r94381 = r94378 / r94380;
        double r94382 = r94379 - r94378;
        double r94383 = r94378 / r94382;
        double r94384 = r94381 - r94383;
        return r94384;
}

double f(double x) {
        double r94385 = 1.0;
        double r94386 = x;
        double r94387 = r94386 + r94385;
        double r94388 = r94385 / r94387;
        double r94389 = r94386 - r94385;
        double r94390 = -2.0;
        double r94391 = r94390 * r94385;
        double r94392 = r94389 / r94391;
        double r94393 = r94388 / r94392;
        return r94393;
}

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--28.7

    \[\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.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.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. 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 *-un-lft-identity0.1

    \[\leadsto \frac{\frac{1}{x + 1}}{\color{blue}{1 \cdot \left(x - 1\right)}} \cdot \left(0 - \left(1 + 1\right)\right)\]
  14. Applied *-un-lft-identity0.1

    \[\leadsto \frac{\frac{1}{\color{blue}{1 \cdot \left(x + 1\right)}}}{1 \cdot \left(x - 1\right)} \cdot \left(0 - \left(1 + 1\right)\right)\]
  15. Applied *-un-lft-identity0.1

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot 1}}{1 \cdot \left(x + 1\right)}}{1 \cdot \left(x - 1\right)} \cdot \left(0 - \left(1 + 1\right)\right)\]
  16. Applied times-frac0.1

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{1}{x + 1}}}{1 \cdot \left(x - 1\right)} \cdot \left(0 - \left(1 + 1\right)\right)\]
  17. Applied times-frac0.1

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

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

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

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

Reproduce

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