Average Error: 14.7 → 0.1
Time: 8.9s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1}{x + 1}}{x - 1} \cdot -2\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1}{x + 1}}{x - 1} \cdot -2
double f(double x) {
        double r2498397 = 1.0;
        double r2498398 = x;
        double r2498399 = r2498398 + r2498397;
        double r2498400 = r2498397 / r2498399;
        double r2498401 = r2498398 - r2498397;
        double r2498402 = r2498397 / r2498401;
        double r2498403 = r2498400 - r2498402;
        return r2498403;
}

double f(double x) {
        double r2498404 = 1.0;
        double r2498405 = x;
        double r2498406 = r2498405 + r2498404;
        double r2498407 = r2498404 / r2498406;
        double r2498408 = r2498405 - r2498404;
        double r2498409 = r2498407 / r2498408;
        double r2498410 = -2.0;
        double r2498411 = r2498409 * r2498410;
        return r2498411;
}

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

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

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

    \[\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. Taylor expanded around 0 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. Final simplification0.1

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

Reproduce

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