Average Error: 0.0 → 0.0
Time: 11.9s
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 r5401545 = 1.0;
        double r5401546 = x;
        double r5401547 = r5401546 - r5401545;
        double r5401548 = r5401545 / r5401547;
        double r5401549 = r5401546 + r5401545;
        double r5401550 = r5401546 / r5401549;
        double r5401551 = r5401548 + r5401550;
        return r5401551;
}

double f(double x) {
        double r5401552 = 1.0;
        double r5401553 = x;
        double r5401554 = r5401553 * r5401553;
        double r5401555 = r5401552 * r5401552;
        double r5401556 = r5401554 - r5401555;
        double r5401557 = r5401552 / r5401556;
        double r5401558 = r5401553 + r5401552;
        double r5401559 = r5401557 * r5401558;
        double r5401560 = r5401553 / r5401558;
        double r5401561 = r5401559 + r5401560;
        return r5401561;
}

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 2019169 
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1.0 (- x 1.0)) (/ x (+ x 1.0))))