Average Error: 0.1 → 0.1
Time: 6.3s
Precision: 64
\[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
\[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}
\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}
double f(double t) {
        double r98009 = 1.0;
        double r98010 = 2.0;
        double r98011 = t;
        double r98012 = r98010 * r98011;
        double r98013 = r98009 + r98011;
        double r98014 = r98012 / r98013;
        double r98015 = r98014 * r98014;
        double r98016 = r98009 + r98015;
        double r98017 = r98010 + r98015;
        double r98018 = r98016 / r98017;
        return r98018;
}

double f(double t) {
        double r98019 = 1.0;
        double r98020 = 2.0;
        double r98021 = t;
        double r98022 = r98020 * r98021;
        double r98023 = r98019 + r98021;
        double r98024 = r98022 / r98023;
        double r98025 = r98024 * r98024;
        double r98026 = r98019 + r98025;
        double r98027 = r98020 + r98025;
        double r98028 = r98026 / r98027;
        return r98028;
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
  2. Final simplification0.1

    \[\leadsto \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]

Reproduce

herbie shell --seed 2020034 +o rules:numerics
(FPCore (t)
  :name "Kahan p13 Example 1"
  :precision binary64
  (/ (+ 1 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t)))) (+ 2 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t))))))