Average Error: 0.0 → 0.0
Time: 7.9s
Precision: 64
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[\frac{1 \cdot \left(x + 1\right)}{x \cdot x - 1 \cdot 1} + \frac{x}{x + 1}\]
\frac{1}{x - 1} + \frac{x}{x + 1}
\frac{1 \cdot \left(x + 1\right)}{x \cdot x - 1 \cdot 1} + \frac{x}{x + 1}
double f(double x) {
        double r7115600 = 1.0;
        double r7115601 = x;
        double r7115602 = r7115601 - r7115600;
        double r7115603 = r7115600 / r7115602;
        double r7115604 = r7115601 + r7115600;
        double r7115605 = r7115601 / r7115604;
        double r7115606 = r7115603 + r7115605;
        return r7115606;
}

double f(double x) {
        double r7115607 = 1.0;
        double r7115608 = x;
        double r7115609 = r7115608 + r7115607;
        double r7115610 = r7115607 * r7115609;
        double r7115611 = r7115608 * r7115608;
        double r7115612 = r7115607 * r7115607;
        double r7115613 = r7115611 - r7115612;
        double r7115614 = r7115610 / r7115613;
        double r7115615 = r7115608 / r7115609;
        double r7115616 = r7115614 + r7115615;
        return r7115616;
}

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 associate-*l/0.0

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

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

Reproduce

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