Average Error: 0.1 → 0.1
Time: 3.6s
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 r84639 = 1.0;
        double r84640 = 2.0;
        double r84641 = t;
        double r84642 = r84640 * r84641;
        double r84643 = r84639 + r84641;
        double r84644 = r84642 / r84643;
        double r84645 = r84644 * r84644;
        double r84646 = r84639 + r84645;
        double r84647 = r84640 + r84645;
        double r84648 = r84646 / r84647;
        return r84648;
}

double f(double t) {
        double r84649 = 1.0;
        double r84650 = 2.0;
        double r84651 = t;
        double r84652 = r84650 * r84651;
        double r84653 = r84649 + r84651;
        double r84654 = r84652 / r84653;
        double r84655 = r84654 * r84654;
        double r84656 = r84649 + r84655;
        double r84657 = r84650 + r84655;
        double r84658 = r84656 / r84657;
        return r84658;
}

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