Average Error: 14.7 → 0.1
Time: 2.9s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\left(\frac{1}{x + 1} \cdot \frac{1}{x - 1}\right) \cdot \left(-2\right)\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\left(\frac{1}{x + 1} \cdot \frac{1}{x - 1}\right) \cdot \left(-2\right)
double f(double x) {
        double r125203 = 1.0;
        double r125204 = x;
        double r125205 = r125204 + r125203;
        double r125206 = r125203 / r125205;
        double r125207 = r125204 - r125203;
        double r125208 = r125203 / r125207;
        double r125209 = r125206 - r125208;
        return r125209;
}

double f(double x) {
        double r125210 = 1.0;
        double r125211 = x;
        double r125212 = 1.0;
        double r125213 = r125211 + r125212;
        double r125214 = r125210 / r125213;
        double r125215 = r125211 - r125212;
        double r125216 = r125212 / r125215;
        double r125217 = r125214 * r125216;
        double r125218 = 2.0;
        double r125219 = -r125218;
        double r125220 = r125217 * r125219;
        return r125220;
}

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.3

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

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

    \[\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}{\color{blue}{\sqrt[3]{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(x \cdot x - 1 \cdot 1\right)}}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  10. Applied add-cbrt-cube14.1

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(1 \cdot 1\right) \cdot 1}}}{\sqrt[3]{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(x \cdot x - 1 \cdot 1\right)}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  11. Applied cbrt-undiv14.1

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

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{x \cdot x - 1 \cdot 1}\right)}^{3}}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  13. Taylor expanded around 0 10.3

    \[\leadsto \sqrt[3]{{\left(\frac{1}{x \cdot x - 1 \cdot 1}\right)}^{3}} \cdot \color{blue}{\left(-2\right)}\]
  14. Using strategy rm
  15. Applied difference-of-squares10.3

    \[\leadsto \sqrt[3]{{\left(\frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right)}^{3}} \cdot \left(-2\right)\]
  16. Applied *-un-lft-identity10.3

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

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\frac{1}{x + 1} \cdot \frac{1}{x - 1}\right)}}^{3}} \cdot \left(-2\right)\]
  18. Applied unpow-prod-down10.3

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{x + 1}\right)}^{3} \cdot {\left(\frac{1}{x - 1}\right)}^{3}}} \cdot \left(-2\right)\]
  19. Applied cbrt-prod5.4

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

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

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

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

Reproduce

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