Average Error: 14.4 → 0.1
Time: 11.2s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}
double f(double x) {
        double r123726 = 1.0;
        double r123727 = x;
        double r123728 = r123727 + r123726;
        double r123729 = r123726 / r123728;
        double r123730 = r123727 - r123726;
        double r123731 = r123726 / r123730;
        double r123732 = r123729 - r123731;
        return r123732;
}

double f(double x) {
        double r123733 = -2.0;
        double r123734 = 1.0;
        double r123735 = 4.0;
        double r123736 = pow(r123734, r123735);
        double r123737 = r123733 * r123736;
        double r123738 = x;
        double r123739 = r123734 + r123738;
        double r123740 = r123737 / r123739;
        double r123741 = r123738 - r123734;
        double r123742 = r123740 / r123741;
        double r123743 = r123734 * r123734;
        double r123744 = -r123734;
        double r123745 = r123744 * r123734;
        double r123746 = r123745 + r123743;
        double r123747 = r123743 + r123746;
        double r123748 = r123742 / r123747;
        return r123748;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.4

    \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
  2. Using strategy rm
  3. Applied flip--28.9

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

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

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

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(\left(0 - 1\right) - 1\right)}\]
  9. Using strategy rm
  10. Applied flip3--0.4

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

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

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

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

Reproduce

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