Average Error: 0.0 → 0.0
Time: 11.1s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right) + \frac{x}{x + 1}\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right) + \frac{x}{x + 1}
double f(double x) {
        double r5827980 = 1.0;
        double r5827981 = x;
        double r5827982 = r5827981 - r5827980;
        double r5827983 = r5827980 / r5827982;
        double r5827984 = r5827981 + r5827980;
        double r5827985 = r5827981 / r5827984;
        double r5827986 = r5827983 + r5827985;
        return r5827986;
}

double f(double x) {
        double r5827987 = 1.0;
        double r5827988 = x;
        double r5827989 = r5827988 * r5827988;
        double r5827990 = r5827987 * r5827987;
        double r5827991 = r5827989 - r5827990;
        double r5827992 = r5827987 / r5827991;
        double r5827993 = r5827988 + r5827987;
        double r5827994 = r5827992 * r5827993;
        double r5827995 = r5827988 / r5827993;
        double r5827996 = r5827994 + r5827995;
        return r5827996;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019172 
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1.0 (- x 1.0)) (/ x (+ x 1.0))))