Average Error: 14.3 → 0.1
Time: 15.4s
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 r75396 = 1.0;
        double r75397 = x;
        double r75398 = r75397 + r75396;
        double r75399 = r75396 / r75398;
        double r75400 = r75397 - r75396;
        double r75401 = r75396 / r75400;
        double r75402 = r75399 - r75401;
        return r75402;
}

double f(double x) {
        double r75403 = 1.0;
        double r75404 = x;
        double r75405 = r75404 + r75403;
        double r75406 = r75403 / r75405;
        double r75407 = -r75403;
        double r75408 = r75407 - r75403;
        double r75409 = r75406 * r75408;
        double r75410 = r75404 - r75403;
        double r75411 = r75409 / r75410;
        return r75411;
}

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

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

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

    \[\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 add-log-exp13.7

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + \color{blue}{\log \left(e^{1}\right)}\right)\right)\]
  10. Applied add-log-exp31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(\color{blue}{\log \left(e^{x}\right)} + \log \left(e^{1}\right)\right)\right)\]
  11. Applied sum-log31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \color{blue}{\log \left(e^{x} \cdot e^{1}\right)}\right)\]
  12. Applied add-log-exp31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - \color{blue}{\log \left(e^{1}\right)}\right) - \log \left(e^{x} \cdot e^{1}\right)\right)\]
  13. Applied add-log-exp31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(\color{blue}{\log \left(e^{x}\right)} - \log \left(e^{1}\right)\right) - \log \left(e^{x} \cdot e^{1}\right)\right)\]
  14. Applied diff-log31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\color{blue}{\log \left(\frac{e^{x}}{e^{1}}\right)} - \log \left(e^{x} \cdot e^{1}\right)\right)\]
  15. Applied diff-log31.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\log \left(\frac{\frac{e^{x}}{e^{1}}}{e^{x} \cdot e^{1}}\right)}\]
  16. Simplified0.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \log \color{blue}{\left(\frac{e^{-1}}{e^{1}}\right)}\]
  17. Using strategy rm
  18. Applied difference-of-squares0.4

    \[\leadsto \frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}} \cdot \log \left(\frac{e^{-1}}{e^{1}}\right)\]
  19. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1}}{x - 1}} \cdot \log \left(\frac{e^{-1}}{e^{1}}\right)\]
  20. Using strategy rm
  21. Applied associate-*l/0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1} \cdot \log \left(\frac{e^{-1}}{e^{1}}\right)}{x - 1}}\]
  22. Simplified0.1

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

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

Reproduce

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