Average Error: 0.0 → 0.0
Time: 11.3s
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 r96521 = 1.0;
        double r96522 = x;
        double r96523 = r96522 - r96521;
        double r96524 = r96521 / r96523;
        double r96525 = r96522 + r96521;
        double r96526 = r96522 / r96525;
        double r96527 = r96524 + r96526;
        return r96527;
}

double f(double x) {
        double r96528 = 1.0;
        double r96529 = x;
        double r96530 = r96529 * r96529;
        double r96531 = r96528 * r96528;
        double r96532 = r96530 - r96531;
        double r96533 = r96528 / r96532;
        double r96534 = r96529 + r96528;
        double r96535 = r96533 * r96534;
        double r96536 = r96529 / r96534;
        double r96537 = r96535 + r96536;
        return r96537;
}

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