Average Error: 14.7 → 0.1
Time: 15.6s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1}{x + 1} \cdot \left(\left(-1\right) - 1\right)}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1}{x + 1} \cdot \left(\left(-1\right) - 1\right)}{x - 1}
double f(double x) {
        double r92112 = 1.0;
        double r92113 = x;
        double r92114 = r92113 + r92112;
        double r92115 = r92112 / r92114;
        double r92116 = r92113 - r92112;
        double r92117 = r92112 / r92116;
        double r92118 = r92115 - r92117;
        return r92118;
}

double f(double x) {
        double r92119 = 1.0;
        double r92120 = x;
        double r92121 = r92120 + r92119;
        double r92122 = r92119 / r92121;
        double r92123 = -r92119;
        double r92124 = r92123 - r92119;
        double r92125 = r92122 * r92124;
        double r92126 = r92120 - r92119;
        double r92127 = r92125 / r92126;
        return r92127;
}

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. Using strategy rm
  9. Applied add-cbrt-cube14.1

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \sqrt[3]{\color{blue}{{\left(\left(0 - 1\right) - 1\right)}^{3}}}\]
  11. Using strategy rm
  12. Applied difference-of-squares0.4

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1}}{x - 1}} \cdot \sqrt[3]{{\left(\left(0 - 1\right) - 1\right)}^{3}}\]
  14. Using strategy rm
  15. Applied pow10.1

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

    \[\leadsto \color{blue}{{\left(\frac{\frac{1}{x + 1}}{x - 1}\right)}^{1}} \cdot {\left(\sqrt[3]{{\left(\left(0 - 1\right) - 1\right)}^{3}}\right)}^{1}\]
  17. Applied pow-prod-down0.1

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

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

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

Reproduce

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