Average Error: 14.3 → 0.4
Time: 8.1s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(-2\right)\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(-2\right)
double f(double x) {
        double r107776 = 1.0;
        double r107777 = x;
        double r107778 = r107777 + r107776;
        double r107779 = r107776 / r107778;
        double r107780 = r107777 - r107776;
        double r107781 = r107776 / r107780;
        double r107782 = r107779 - r107781;
        return r107782;
}

double f(double x) {
        double r107783 = 1.0;
        double r107784 = x;
        double r107785 = r107784 * r107784;
        double r107786 = r107783 * r107783;
        double r107787 = r107785 - r107786;
        double r107788 = r107783 / r107787;
        double r107789 = 2.0;
        double r107790 = -r107789;
        double r107791 = r107788 * r107790;
        return r107791;
}

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

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

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

    \[\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. Taylor expanded around 0 0.4

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

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

Reproduce

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