Average Error: 14.3 → 0.1
Time: 14.4s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\left(1 \cdot -2\right) \cdot \frac{1}{x - 1}}{x + 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\left(1 \cdot -2\right) \cdot \frac{1}{x - 1}}{x + 1}
double f(double x) {
        double r82246 = 1.0;
        double r82247 = x;
        double r82248 = r82247 + r82246;
        double r82249 = r82246 / r82248;
        double r82250 = r82247 - r82246;
        double r82251 = r82246 / r82250;
        double r82252 = r82249 - r82251;
        return r82252;
}

double f(double x) {
        double r82253 = 1.0;
        double r82254 = -2.0;
        double r82255 = r82253 * r82254;
        double r82256 = x;
        double r82257 = r82256 - r82253;
        double r82258 = r82253 / r82257;
        double r82259 = r82255 * r82258;
        double r82260 = r82256 + r82253;
        double r82261 = r82259 / r82260;
        return r82261;
}

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

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

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

    \[\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. Using strategy rm
  9. Applied flip--60.5

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{x + 1} \cdot \color{blue}{\left(\frac{\sqrt[3]{1}}{x - 1} \cdot \left(\left(-1\right) - 1\right)\right)}\]
  18. Using strategy rm
  19. Applied associate-*l/0.1

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

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

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

Reproduce

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