Average Error: 14.8 → 0.1
Time: 10.3s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\left(-1\right) - 1}{x + 1}}{x - 1} \cdot 1\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\left(-1\right) - 1}{x + 1}}{x - 1} \cdot 1
double f(double x) {
        double r113357 = 1.0;
        double r113358 = x;
        double r113359 = r113358 + r113357;
        double r113360 = r113357 / r113359;
        double r113361 = r113358 - r113357;
        double r113362 = r113357 / r113361;
        double r113363 = r113360 - r113362;
        return r113363;
}

double f(double x) {
        double r113364 = 1.0;
        double r113365 = -r113364;
        double r113366 = r113365 - r113364;
        double r113367 = x;
        double r113368 = r113367 + r113364;
        double r113369 = r113366 / r113368;
        double r113370 = r113367 - r113364;
        double r113371 = r113369 / r113370;
        double r113372 = r113371 * r113364;
        return r113372;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.8

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

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

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

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

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

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(\left(\left(x - 1\right) - x\right) - 1\right)}\]
  9. Taylor expanded around 0 0.3

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\color{blue}{\left(-1\right)} - 1\right)\]
  10. Using strategy rm
  11. Applied div-inv0.3

    \[\leadsto \color{blue}{\left(1 \cdot \frac{1}{x \cdot x - 1 \cdot 1}\right)} \cdot \left(\left(-1\right) - 1\right)\]
  12. Applied associate-*l*0.3

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

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

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

Reproduce

herbie shell --seed 2019194 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))