Average Error: 14.6 → 0.1
Time: 9.8s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{1}{\frac{1 + x}{1 \cdot -2}}}{x - 1}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{1}{\frac{1 + x}{1 \cdot -2}}}{x - 1}
double f(double x) {
        double r140003 = 1.0;
        double r140004 = x;
        double r140005 = r140004 + r140003;
        double r140006 = r140003 / r140005;
        double r140007 = r140004 - r140003;
        double r140008 = r140003 / r140007;
        double r140009 = r140006 - r140008;
        return r140009;
}

double f(double x) {
        double r140010 = 1.0;
        double r140011 = x;
        double r140012 = r140010 + r140011;
        double r140013 = -2.0;
        double r140014 = r140010 * r140013;
        double r140015 = r140012 / r140014;
        double r140016 = r140010 / r140015;
        double r140017 = r140011 - r140010;
        double r140018 = r140016 / r140017;
        return r140018;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.6

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity14.0

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \color{blue}{1 \cdot \left(x + 1\right)}\right)\]
  10. Applied *-un-lft-identity14.0

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\color{blue}{1 \cdot \left(x - 1\right)} - 1 \cdot \left(x + 1\right)\right)\]
  11. Applied distribute-lft-out--14.0

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(1 \cdot \color{blue}{\left(\left(0 - 1\right) - 1\right)}\right)\]
  13. Using strategy rm
  14. Applied difference-of-squares0.4

    \[\leadsto \frac{1}{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}} \cdot \left(1 \cdot \left(\left(0 - 1\right) - 1\right)\right)\]
  15. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{1}{x + 1}}{x - 1}} \cdot \left(1 \cdot \left(\left(0 - 1\right) - 1\right)\right)\]
  16. Using strategy rm
  17. Applied associate-*l/0.1

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

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1 + x}{1 \cdot -2}}}}{x - 1}\]
  19. Final simplification0.1

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

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(FPCore (x)
  :name "Asymptote A"
  :precision binary64
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))