\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 1.5776458828935156 \cdot 10^{+274}:\\
\;\;\;\;\frac{\ell}{\sqrt[3]{k} \cdot \sqrt[3]{k}} \cdot \left(\frac{\ell}{\sqrt[3]{k}} \cdot \frac{2}{\frac{k \cdot \left(t \cdot {\sin k}^{2}\right)}{\cos k}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k}}\\
\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) 1.5776458828935156e+274)
(*
(/ l (* (cbrt k) (cbrt k)))
(* (/ l (cbrt k)) (/ 2.0 (/ (* k (* t (pow (sin k) 2.0))) (cos k)))))
(* (* (/ l k) (/ l k)) (/ 2.0 (/ (* t (pow (sin k) 2.0)) (cos k))))))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) <= 1.5776458828935156e+274) {
tmp = (l / (cbrt(k) * cbrt(k))) * ((l / cbrt(k)) * (2.0 / ((k * (t * pow(sin(k), 2.0))) / cos(k))));
} else {
tmp = ((l / k) * (l / k)) * (2.0 / ((t * pow(sin(k), 2.0)) / cos(k)));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 1.5776458828935156e274Initial program 45.3
Simplified36.0
Taylor expanded around 0 14.7
Simplified14.7
rmApplied associate-*l*_binary64_36012.5
rmApplied times-frac_binary64_42510.5
Applied *-un-lft-identity_binary64_41910.5
Applied times-frac_binary64_42510.5
Simplified10.4
rmApplied add-cube-cbrt_binary64_45410.6
Applied times-frac_binary64_4259.7
Applied associate-*l*_binary64_3607.0
if 1.5776458828935156e274 < (*.f64 l l) Initial program 62.2
Simplified61.5
Taylor expanded around 0 59.7
Simplified59.7
rmApplied associate-*l*_binary64_36058.4
rmApplied times-frac_binary64_42557.2
Applied *-un-lft-identity_binary64_41957.2
Applied times-frac_binary64_42557.2
Simplified57.2
rmApplied *-un-lft-identity_binary64_41957.2
Applied times-frac_binary64_42557.2
Applied *-un-lft-identity_binary64_41957.2
Applied times-frac_binary64_42557.1
Applied associate-*r*_binary64_35956.5
Simplified8.7
Final simplification7.3
herbie shell --seed 2021015
(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))))