Average Error: 14.7 → 0.1
Time: 13.9s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1}{1 + x} \cdot {\left(-2 \cdot 1\right)}^{3}}{\left(4 \cdot \left(1 \cdot 1\right)\right) \cdot \left(x - 1\right)}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1}{1 + x} \cdot {\left(-2 \cdot 1\right)}^{3}}{\left(4 \cdot \left(1 \cdot 1\right)\right) \cdot \left(x - 1\right)}
double f(double x) {
        double r95265 = 1.0;
        double r95266 = x;
        double r95267 = r95266 + r95265;
        double r95268 = r95265 / r95267;
        double r95269 = r95266 - r95265;
        double r95270 = r95265 / r95269;
        double r95271 = r95268 - r95270;
        return r95271;
}

double f(double x) {
        double r95272 = 1.0;
        double r95273 = x;
        double r95274 = r95272 + r95273;
        double r95275 = r95272 / r95274;
        double r95276 = -2.0;
        double r95277 = r95276 * r95272;
        double r95278 = 3.0;
        double r95279 = pow(r95277, r95278);
        double r95280 = r95275 * r95279;
        double r95281 = 4.0;
        double r95282 = r95272 * r95272;
        double r95283 = r95281 * r95282;
        double r95284 = r95273 - r95272;
        double r95285 = r95283 * r95284;
        double r95286 = r95280 / r95285;
        return r95286;
}

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 flip3--0.1

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

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

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

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

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

Reproduce

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