\frac{1 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}{2 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}
\begin{array}{l}
t_1 := 2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\\
\frac{1 + \log \left(1 + \mathsf{expm1}\left({t_1}^{2}\right)\right)}{2 + t_1 \cdot t_1}
\end{array}
(FPCore (t)
:precision binary64
(/
(+
1.0
(*
(- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t))))
(- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t))))))
(+
2.0
(*
(- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t))))
(- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t))))))))(FPCore (t) :precision binary64 (let* ((t_1 (- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t)))))) (/ (+ 1.0 (log (+ 1.0 (expm1 (pow t_1 2.0))))) (+ 2.0 (* t_1 t_1)))))
double code(double t) {
return (1.0 + ((2.0 - ((2.0 / t) / (1.0 + (1.0 / t)))) * (2.0 - ((2.0 / t) / (1.0 + (1.0 / t)))))) / (2.0 + ((2.0 - ((2.0 / t) / (1.0 + (1.0 / t)))) * (2.0 - ((2.0 / t) / (1.0 + (1.0 / t))))));
}
double code(double t) {
double t_1 = 2.0 - ((2.0 / t) / (1.0 + (1.0 / t)));
return (1.0 + log((1.0 + expm1(pow(t_1, 2.0))))) / (2.0 + (t_1 * t_1));
}



Bits error versus t
Results
Initial program 0.0
Applied egg-rr0.0
Final simplification0.0
herbie shell --seed 2022130
(FPCore (t)
:name "Kahan p13 Example 2"
:precision binary64
(/ (+ 1.0 (* (- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t)))) (- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t)))))) (+ 2.0 (* (- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t)))) (- 2.0 (/ (/ 2.0 t) (+ 1.0 (/ 1.0 t))))))))