Average Error: 0.0 → 0.0
Time: 3.5s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\frac{\left(\frac{1}{x - 1} \cdot \frac{1}{x \cdot x - 1 \cdot 1}\right) \cdot \left(x + 1\right) - \frac{x}{x + 1} \cdot \frac{x}{x + 1}}{\frac{1}{x - 1} - \frac{x}{x + 1}}\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\frac{\left(\frac{1}{x - 1} \cdot \frac{1}{x \cdot x - 1 \cdot 1}\right) \cdot \left(x + 1\right) - \frac{x}{x + 1} \cdot \frac{x}{x + 1}}{\frac{1}{x - 1} - \frac{x}{x + 1}}
double f(double x) {
        double r122871 = 1.0;
        double r122872 = x;
        double r122873 = r122872 - r122871;
        double r122874 = r122871 / r122873;
        double r122875 = r122872 + r122871;
        double r122876 = r122872 / r122875;
        double r122877 = r122874 + r122876;
        return r122877;
}

double f(double x) {
        double r122878 = 1.0;
        double r122879 = x;
        double r122880 = r122879 - r122878;
        double r122881 = r122878 / r122880;
        double r122882 = r122879 * r122879;
        double r122883 = r122878 * r122878;
        double r122884 = r122882 - r122883;
        double r122885 = r122878 / r122884;
        double r122886 = r122881 * r122885;
        double r122887 = r122879 + r122878;
        double r122888 = r122886 * r122887;
        double r122889 = r122879 / r122887;
        double r122890 = r122889 * r122889;
        double r122891 = r122888 - r122890;
        double r122892 = r122881 - r122889;
        double r122893 = r122891 / r122892;
        return r122893;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\frac{\frac{1}{x - 1} \cdot \frac{1}{x - 1} - \frac{x}{x + 1} \cdot \frac{x}{x + 1}}{\frac{1}{x - 1} - \frac{x}{x + 1}}}\]
  4. Using strategy rm
  5. Applied flip--0.0

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

    \[\leadsto \frac{\frac{1}{x - 1} \cdot \color{blue}{\left(\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\right)} - \frac{x}{x + 1} \cdot \frac{x}{x + 1}}{\frac{1}{x - 1} - \frac{x}{x + 1}}\]
  7. Applied associate-*r*0.0

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

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

Reproduce

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