Average Error: 14.1 → 0.1
Time: 9.1s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{\frac{\frac{-2 \cdot {1}^{4}}{1 + x}}{x - 1}}{1 \cdot 1 + \left(\left(-1\right) \cdot 1 + 1 \cdot 1\right)}
double f(double x) {
        double r99149 = 1.0;
        double r99150 = x;
        double r99151 = r99150 + r99149;
        double r99152 = r99149 / r99151;
        double r99153 = r99150 - r99149;
        double r99154 = r99149 / r99153;
        double r99155 = r99152 - r99154;
        return r99155;
}

double f(double x) {
        double r99156 = -2.0;
        double r99157 = 1.0;
        double r99158 = 4.0;
        double r99159 = pow(r99157, r99158);
        double r99160 = r99156 * r99159;
        double r99161 = x;
        double r99162 = r99157 + r99161;
        double r99163 = r99160 / r99162;
        double r99164 = r99161 - r99157;
        double r99165 = r99163 / r99164;
        double r99166 = r99157 * r99157;
        double r99167 = -r99157;
        double r99168 = r99167 * r99157;
        double r99169 = r99168 + r99166;
        double r99170 = r99166 + r99169;
        double r99171 = r99165 / r99170;
        return r99171;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.1

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

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

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

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

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

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \color{blue}{\left(\left(0 - 1\right) - 1\right)}\]
  9. Using strategy rm
  10. Applied flip3--0.4

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

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

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

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

Reproduce

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