Average Error: 15.0 → 0.1
Time: 4.4s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\left(-{\left(\sqrt[3]{1}\right)}^{3}\right) \cdot 2}{x + 1}}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\left(-{\left(\sqrt[3]{1}\right)}^{3}\right) \cdot 2}{x + 1}}{x - 1}
double f(double x) {
        double r123440 = 1.0;
        double r123441 = x;
        double r123442 = r123441 + r123440;
        double r123443 = r123440 / r123442;
        double r123444 = r123441 - r123440;
        double r123445 = r123440 / r123444;
        double r123446 = r123443 - r123445;
        return r123446;
}

double f(double x) {
        double r123447 = 1.0;
        double r123448 = cbrt(r123447);
        double r123449 = 3.0;
        double r123450 = pow(r123448, r123449);
        double r123451 = -r123450;
        double r123452 = 2.0;
        double r123453 = r123451 * r123452;
        double r123454 = x;
        double r123455 = r123454 + r123447;
        double r123456 = r123453 / r123455;
        double r123457 = r123454 - r123447;
        double r123458 = r123456 / r123457;
        return r123458;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.0

    \[\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-+15.1

    \[\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/15.1

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

    \[\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 difference-of-squares14.5

    \[\leadsto \frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  10. Applied add-cube-cbrt14.5

    \[\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 \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  11. Applied times-frac14.5

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{x + 1} \cdot \sqrt[3]{1}}{x - 1}} \cdot \left(-2\right)\]
  15. Applied associate-*l/0.1

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

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

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

Reproduce

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