Average Error: 0.0 → 0.0
Time: 9.0s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[1 \cdot \frac{x + 1}{x \cdot x - 1 \cdot 1} + \frac{x}{x + 1}\]
\frac{1}{x - 1} + \frac{x}{x + 1}
1 \cdot \frac{x + 1}{x \cdot x - 1 \cdot 1} + \frac{x}{x + 1}
double f(double x) {
        double r6429987 = 1.0;
        double r6429988 = x;
        double r6429989 = r6429988 - r6429987;
        double r6429990 = r6429987 / r6429989;
        double r6429991 = r6429988 + r6429987;
        double r6429992 = r6429988 / r6429991;
        double r6429993 = r6429990 + r6429992;
        return r6429993;
}

double f(double x) {
        double r6429994 = 1.0;
        double r6429995 = x;
        double r6429996 = r6429995 + r6429994;
        double r6429997 = r6429995 * r6429995;
        double r6429998 = r6429994 * r6429994;
        double r6429999 = r6429997 - r6429998;
        double r6430000 = r6429996 / r6429999;
        double r6430001 = r6429994 * r6430000;
        double r6430002 = r6429995 / r6429996;
        double r6430003 = r6430001 + r6430002;
        return r6430003;
}

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 \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}} + \frac{x}{x + 1}\]
  4. Applied associate-/r/0.0

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)} + \frac{x}{x + 1}\]
  5. Using strategy rm
  6. Applied div-inv0.0

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

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1.0 (- x 1.0)) (/ x (+ x 1.0))))