\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 4.9928687176460827 \cdot 10^{+297}:\\
\;\;\;\;\frac{2}{\frac{k}{\frac{\left(\ell \cdot \ell\right) \cdot \cos k}{k \cdot \left(\sin k \cdot \left(t \cdot \sin k\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\sin k \cdot \left(\frac{t}{\ell} \cdot \left(t \cdot \frac{t}{\ell}\right)\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\
\end{array}(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
(FPCore (t l k)
:precision binary64
(if (<= (* l l) 4.9928687176460827e+297)
(/ 2.0 (/ k (/ (* (* l l) (cos k)) (* k (* (sin k) (* t (sin k)))))))
(/
2.0
(* (* (* (sin k) (* (/ t l) (* t (/ t l)))) (tan k)) (pow (/ k t) 2.0)))))double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 4.9928687176460827e+297) {
tmp = 2.0 / (k / (((l * l) * cos(k)) / (k * (sin(k) * (t * sin(k))))));
} else {
tmp = 2.0 / (((sin(k) * ((t / l) * (t * (t / l)))) * tan(k)) * pow((k / t), 2.0));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 4.99287e297Initial program 45.8
Simplified36.5
Taylor expanded around inf 16.1
Simplified16.1
rmApplied associate-*l*_binary6413.5
rmApplied associate-/l*_binary6410.9
rmApplied unpow2_binary6410.9
Applied associate-*r*_binary6410.7
if 4.99287e297 < (*.f64 l l) Initial program 63.5
Simplified63.3
rmApplied cube-mult_binary6463.3
Applied times-frac_binary6450.0
Simplified40.5
Final simplification15.3
herbie shell --seed 2020231
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))