Average Error: 0.0 → 0.0
Time: 12.1s
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 + \mathsf{expm1}\left(\mathsf{log1p}\left(\log \left(\sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}} \cdot \sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}}\right)\right)\right)}{2 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}\]
\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 + \mathsf{expm1}\left(\mathsf{log1p}\left(\log \left(\sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}} \cdot \sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}}\right)\right)\right)}{2 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}
double f(double t) {
        double r81749 = 1.0;
        double r81750 = 2.0;
        double r81751 = t;
        double r81752 = r81750 * r81751;
        double r81753 = r81749 + r81751;
        double r81754 = r81752 / r81753;
        double r81755 = r81754 * r81754;
        double r81756 = r81749 + r81755;
        double r81757 = r81750 + r81755;
        double r81758 = r81756 / r81757;
        return r81758;
}

double f(double t) {
        double r81759 = 1.0;
        double r81760 = 2.0;
        double r81761 = t;
        double r81762 = r81760 * r81761;
        double r81763 = r81759 + r81761;
        double r81764 = r81762 / r81763;
        double r81765 = r81764 * r81764;
        double r81766 = exp(r81765);
        double r81767 = sqrt(r81766);
        double r81768 = r81767 * r81767;
        double r81769 = log(r81768);
        double r81770 = log1p(r81769);
        double r81771 = expm1(r81770);
        double r81772 = r81759 + r81771;
        double r81773 = log1p(r81765);
        double r81774 = expm1(r81773);
        double r81775 = r81760 + r81774;
        double r81776 = r81772 / r81775;
        return r81776;
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\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 expm1-log1p-u0.1

    \[\leadsto \frac{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
  4. Using strategy rm
  5. Applied expm1-log1p-u0.0

    \[\leadsto \frac{1 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}{2 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}}\]
  6. Using strategy rm
  7. Applied add-log-exp0.0

    \[\leadsto \frac{1 + \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\log \left(e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\right)}\right)\right)}{2 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt0.0

    \[\leadsto \frac{1 + \mathsf{expm1}\left(\mathsf{log1p}\left(\log \color{blue}{\left(\sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}} \cdot \sqrt{e^{\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}}\right)}\right)\right)}{2 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)\right)}\]
  10. Final simplification0.0

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

Reproduce

herbie shell --seed 2020042 +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))))))