Average Error: 0.1 → 0.1
Time: 4.3m
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 r28768534 = 1.0;
        double r28768535 = 2.0;
        double r28768536 = t;
        double r28768537 = r28768535 * r28768536;
        double r28768538 = r28768534 + r28768536;
        double r28768539 = r28768537 / r28768538;
        double r28768540 = r28768539 * r28768539;
        double r28768541 = r28768534 + r28768540;
        double r28768542 = r28768535 + r28768540;
        double r28768543 = r28768541 / r28768542;
        return r28768543;
}

double f(double t) {
        double r28768544 = 1.0;
        double r28768545 = t;
        double r28768546 = 2.0;
        double r28768547 = r28768545 * r28768546;
        double r28768548 = r28768544 + r28768545;
        double r28768549 = r28768547 / r28768548;
        double r28768550 = r28768549 * r28768549;
        double r28768551 = r28768544 + r28768550;
        double r28768552 = exp(r28768550);
        double r28768553 = log(r28768552);
        double r28768554 = r28768553 + r28768546;
        double r28768555 = r28768551 / r28768554;
        return r28768555;
}

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 2019124 
(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))))))