Average Error: 0.1 → 0.1
Time: 14.9s
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{\log \left(e^{\frac{2 \cdot t}{t + 1} \cdot \frac{2 \cdot t}{t + 1}} \cdot e\right)}{\frac{2 \cdot t}{t + 1} \cdot \frac{2 \cdot t}{t + 1} + 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{\log \left(e^{\frac{2 \cdot t}{t + 1} \cdot \frac{2 \cdot t}{t + 1}} \cdot e\right)}{\frac{2 \cdot t}{t + 1} \cdot \frac{2 \cdot t}{t + 1} + 2}
double f(double t) {
        double r955254 = 1.0;
        double r955255 = 2.0;
        double r955256 = t;
        double r955257 = r955255 * r955256;
        double r955258 = r955254 + r955256;
        double r955259 = r955257 / r955258;
        double r955260 = r955259 * r955259;
        double r955261 = r955254 + r955260;
        double r955262 = r955255 + r955260;
        double r955263 = r955261 / r955262;
        return r955263;
}

double f(double t) {
        double r955264 = 2.0;
        double r955265 = t;
        double r955266 = r955264 * r955265;
        double r955267 = 1.0;
        double r955268 = r955265 + r955267;
        double r955269 = r955266 / r955268;
        double r955270 = r955269 * r955269;
        double r955271 = exp(r955270);
        double r955272 = exp(1.0);
        double r955273 = r955271 * r955272;
        double r955274 = log(r955273);
        double r955275 = r955270 + r955264;
        double r955276 = r955274 / r955275;
        return r955276;
}

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 + \color{blue}{\log \left(e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
  4. Applied add-log-exp0.1

    \[\leadsto \frac{\color{blue}{\log \left(e^{1}\right)} + \log \left(e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\right)}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
  5. Applied sum-log0.1

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

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

Reproduce

herbie shell --seed 2019153 
(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))))))