Average Error: 0.1 → 0.1
Time: 35.8s
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{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}{\log \left(e^{\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}\right) + 2}\]
\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{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}{\log \left(e^{\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}\right) + 2}
double f(double t) {
        double r1817808 = 1.0;
        double r1817809 = 2.0;
        double r1817810 = t;
        double r1817811 = r1817809 * r1817810;
        double r1817812 = r1817808 + r1817810;
        double r1817813 = r1817811 / r1817812;
        double r1817814 = r1817813 * r1817813;
        double r1817815 = r1817808 + r1817814;
        double r1817816 = r1817809 + r1817814;
        double r1817817 = r1817815 / r1817816;
        return r1817817;
}

double f(double t) {
        double r1817818 = 1.0;
        double r1817819 = t;
        double r1817820 = 2.0;
        double r1817821 = r1817819 * r1817820;
        double r1817822 = r1817818 + r1817819;
        double r1817823 = r1817821 / r1817822;
        double r1817824 = r1817823 * r1817823;
        double r1817825 = r1817818 + r1817824;
        double r1817826 = exp(r1817824);
        double r1817827 = log(r1817826);
        double r1817828 = r1817827 + r1817820;
        double r1817829 = r1817825 / r1817828;
        return r1817829;
}

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. Using strategy rm
  3. Applied add-log-exp0.1

    \[\leadsto \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \color{blue}{\log \left(e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\right)}}\]
  4. Final simplification0.1

    \[\leadsto \frac{1 + \frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}{\log \left(e^{\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}}\right) + 2}\]

Reproduce

herbie shell --seed 2019138 
(FPCore (t)
  :name "Kahan p13 Example 1"
  (/ (+ 1 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t)))) (+ 2 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t))))))