Average Error: 14.2 → 0.1
Time: 13.0s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{-2}{1 + x}}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{-2}{1 + x}}{x - 1}
double f(double x) {
        double r2073868 = 1.0;
        double r2073869 = x;
        double r2073870 = r2073869 + r2073868;
        double r2073871 = r2073868 / r2073870;
        double r2073872 = r2073869 - r2073868;
        double r2073873 = r2073868 / r2073872;
        double r2073874 = r2073871 - r2073873;
        return r2073874;
}

double f(double x) {
        double r2073875 = -2.0;
        double r2073876 = 1.0;
        double r2073877 = x;
        double r2073878 = r2073876 + r2073877;
        double r2073879 = r2073875 / r2073878;
        double r2073880 = r2073877 - r2073876;
        double r2073881 = r2073879 / r2073880;
        return r2073881;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.2

    \[\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/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.2

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

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

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Taylor expanded around -inf 0.4

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{-2}\]
  9. Using strategy rm
  10. Applied difference-of-squares0.4

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1}}{x - 1}} \cdot -2\]
  12. Using strategy rm
  13. Applied associate-*l/0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1} \cdot -2}{x - 1}}\]
  14. Simplified0.1

    \[\leadsto \frac{\color{blue}{\frac{-2}{1 + x}}}{x - 1}\]
  15. Final simplification0.1

    \[\leadsto \frac{\frac{-2}{1 + x}}{x - 1}\]

Reproduce

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