Average Error: 14.3 → 0.1
Time: 16.4s
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 r96951 = 1.0;
        double r96952 = x;
        double r96953 = r96952 + r96951;
        double r96954 = r96951 / r96953;
        double r96955 = r96952 - r96951;
        double r96956 = r96951 / r96955;
        double r96957 = r96954 - r96956;
        return r96957;
}

double f(double x) {
        double r96958 = -2.0;
        double r96959 = 1.0;
        double r96960 = 4.0;
        double r96961 = pow(r96959, r96960);
        double r96962 = r96958 * r96961;
        double r96963 = x;
        double r96964 = r96959 + r96963;
        double r96965 = r96962 / r96964;
        double r96966 = r96963 - r96959;
        double r96967 = r96965 / r96966;
        double r96968 = r96959 * r96959;
        double r96969 = -r96959;
        double r96970 = r96969 * r96959;
        double r96971 = r96970 + r96968;
        double r96972 = r96968 + r96971;
        double r96973 = r96967 / r96972;
        return r96973;
}

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--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.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. Simplified0.3

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

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

    \[\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 2019303 
(FPCore (x)
  :name "Asymptote A"
  :precision binary64
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))