Average Error: 0.0 → 0.0
Time: 10.5s
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 r108612 = 1.0;
        double r108613 = x;
        double r108614 = r108613 - r108612;
        double r108615 = r108612 / r108614;
        double r108616 = r108613 + r108612;
        double r108617 = r108613 / r108616;
        double r108618 = r108615 + r108617;
        return r108618;
}

double f(double x) {
        double r108619 = 1.0;
        double r108620 = x;
        double r108621 = r108620 * r108620;
        double r108622 = r108619 * r108619;
        double r108623 = r108621 - r108622;
        double r108624 = r108619 / r108623;
        double r108625 = r108620 + r108619;
        double r108626 = r108624 * r108625;
        double r108627 = r108620 / r108625;
        double r108628 = r108626 + r108627;
        return r108628;
}

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 2019325 
(FPCore (x)
  :name "Asymptote B"
  :precision binary64
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))