Average Error: 14.6 → 0.1
Time: 7.5s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1 \cdot \left(-4 \cdot \left(1 \cdot 1\right)\right)}{1 + x}}{\left(x - 1\right) \cdot \left(1 + 1\right)}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1 \cdot \left(-4 \cdot \left(1 \cdot 1\right)\right)}{1 + x}}{\left(x - 1\right) \cdot \left(1 + 1\right)}
double f(double x) {
        double r148250 = 1.0;
        double r148251 = x;
        double r148252 = r148251 + r148250;
        double r148253 = r148250 / r148252;
        double r148254 = r148251 - r148250;
        double r148255 = r148250 / r148254;
        double r148256 = r148253 - r148255;
        return r148256;
}

double f(double x) {
        double r148257 = 1.0;
        double r148258 = 4.0;
        double r148259 = r148257 * r148257;
        double r148260 = r148258 * r148259;
        double r148261 = -r148260;
        double r148262 = r148257 * r148261;
        double r148263 = x;
        double r148264 = r148257 + r148263;
        double r148265 = r148262 / r148264;
        double r148266 = r148263 - r148257;
        double r148267 = r148257 + r148257;
        double r148268 = r148266 * r148267;
        double r148269 = r148265 / r148268;
        return r148269;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.6

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

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

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

    \[\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 flip--0.1

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

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

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

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

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

Reproduce

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