Average Error: 14.0 → 0.4
Time: 14.7s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{x \cdot x - 1} \cdot -2\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x \cdot x - 1} \cdot -2
double f(double x) {
        double r3871143 = 1.0;
        double r3871144 = x;
        double r3871145 = r3871144 + r3871143;
        double r3871146 = r3871143 / r3871145;
        double r3871147 = r3871144 - r3871143;
        double r3871148 = r3871143 / r3871147;
        double r3871149 = r3871146 - r3871148;
        return r3871149;
}

double f(double x) {
        double r3871150 = 1.0;
        double r3871151 = x;
        double r3871152 = r3871151 * r3871151;
        double r3871153 = r3871152 - r3871150;
        double r3871154 = r3871150 / r3871153;
        double r3871155 = -2.0;
        double r3871156 = r3871154 * r3871155;
        return r3871156;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.0

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

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

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

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

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

Reproduce

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