Average Error: 0.0 → 0.0
Time: 8.7s
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 r6561502 = 1.0;
        double r6561503 = x;
        double r6561504 = r6561503 - r6561502;
        double r6561505 = r6561502 / r6561504;
        double r6561506 = r6561503 + r6561502;
        double r6561507 = r6561503 / r6561506;
        double r6561508 = r6561505 + r6561507;
        return r6561508;
}

double f(double x) {
        double r6561509 = 1.0;
        double r6561510 = x;
        double r6561511 = r6561510 * r6561510;
        double r6561512 = r6561509 * r6561509;
        double r6561513 = r6561511 - r6561512;
        double r6561514 = r6561509 / r6561513;
        double r6561515 = r6561510 + r6561509;
        double r6561516 = r6561514 * r6561515;
        double r6561517 = r6561510 / r6561515;
        double r6561518 = r6561516 + r6561517;
        return r6561518;
}

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))))