Average Error: 14.7 → 0.1
Time: 41.1s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{x + 1} \cdot \left(\frac{1}{x - 1} \cdot -2\right)\]
double f(double x) {
        double r16763243 = 1.0;
        double r16763244 = x;
        double r16763245 = r16763244 + r16763243;
        double r16763246 = r16763243 / r16763245;
        double r16763247 = r16763244 - r16763243;
        double r16763248 = r16763243 / r16763247;
        double r16763249 = r16763246 - r16763248;
        return r16763249;
}

double f(double x) {
        double r16763250 = 1.0;
        double r16763251 = x;
        double r16763252 = r16763251 + r16763250;
        double r16763253 = r16763250 / r16763252;
        double r16763254 = r16763251 - r16763250;
        double r16763255 = r16763250 / r16763254;
        double r16763256 = -2.0;
        double r16763257 = r16763255 * r16763256;
        double r16763258 = r16763253 * r16763257;
        return r16763258;
}

\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x + 1} \cdot \left(\frac{1}{x - 1} \cdot -2\right)

Error

Bits error versus x

Derivation

  1. Initial program 14.7

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

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

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

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

    \[\leadsto \frac{1}{x \cdot x - 1} \cdot \color{blue}{-2}\]
  10. Using strategy rm
  11. Applied difference-of-sqr-10.3

    \[\leadsto \frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}} \cdot -2\]
  12. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\color{blue}{1 \cdot 1}}{\left(x + 1\right) \cdot \left(x - 1\right)} \cdot -2\]
  13. Applied times-frac0.1

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

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

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

Reproduce

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