\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 \leq -1.4035772650202036 \cdot 10^{+114}:\\
\;\;\;\;\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k}}\\
\mathbf{elif}\;\ell \leq 7.457626896955295 \cdot 10^{-145}:\\
\;\;\;\;\ell \cdot \left(\frac{\ell}{k} \cdot \frac{2}{\frac{k \cdot \left(t \cdot {\sin k}^{2}\right)}{\cos k}}\right)\\
\mathbf{elif}\;\ell \leq 3.7798603524990884 \cdot 10^{+136}:\\
\;\;\;\;\frac{2}{\frac{k \cdot \left(t \cdot {\sin k}^{2}\right)}{\cos k}} \cdot \frac{\ell}{\frac{k}{\ell}}\\
\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 -1.4035772650202036e+114)
(* (* (/ l k) (/ l k)) (/ 2.0 (/ (* t (pow (sin k) 2.0)) (cos k))))
(if (<= l 7.457626896955295e-145)
(* l (* (/ l k) (/ 2.0 (/ (* k (* t (pow (sin k) 2.0))) (cos k)))))
(if (<= l 3.7798603524990884e+136)
(* (/ 2.0 (/ (* k (* t (pow (sin k) 2.0))) (cos k))) (/ l (/ k l)))
(* (* (/ 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 <= -1.4035772650202036e+114) {
tmp = ((l / k) * (l / k)) * (2.0 / ((t * pow(sin(k), 2.0)) / cos(k)));
} else if (l <= 7.457626896955295e-145) {
tmp = l * ((l / k) * (2.0 / ((k * (t * pow(sin(k), 2.0))) / cos(k))));
} else if (l <= 3.7798603524990884e+136) {
tmp = (2.0 / ((k * (t * pow(sin(k), 2.0))) / cos(k))) * (l / (k / l));
} 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 l < -1.40357726502020359e114 or 3.7798603524990884e136 < l Initial program 61.7
Simplified60.6
Taylor expanded around inf 58.0
Simplified58.0
rmApplied associate-*l*_binary64_36056.6
rmApplied times-frac_binary64_42554.0
Applied *-un-lft-identity_binary64_41954.0
Applied times-frac_binary64_42554.1
Simplified54.1
rmApplied *-un-lft-identity_binary64_41954.1
Applied times-frac_binary64_42554.1
Applied *-un-lft-identity_binary64_41954.1
Applied times-frac_binary64_42554.0
Applied associate-*r*_binary64_35953.5
Simplified10.0
if -1.40357726502020359e114 < l < 7.45762689695529526e-145Initial program 45.8
Simplified36.5
Taylor expanded around inf 16.3
Simplified16.3
rmApplied associate-*l*_binary64_36014.8
rmApplied times-frac_binary64_42513.3
Applied *-un-lft-identity_binary64_41913.3
Applied times-frac_binary64_42513.3
Simplified13.2
rmApplied *-un-lft-identity_binary64_41913.2
Applied times-frac_binary64_42511.9
Applied associate-*l*_binary64_3608.8
Simplified8.8
if 7.45762689695529526e-145 < l < 3.7798603524990884e136Initial program 43.7
Simplified34.4
Taylor expanded around inf 11.2
Simplified11.2
rmApplied associate-*l*_binary64_3607.5
rmApplied times-frac_binary64_4253.9
Applied *-un-lft-identity_binary64_4193.9
Applied times-frac_binary64_4253.7
Simplified3.5
rmApplied associate-/l*_binary64_3643.5
Final simplification7.8
herbie shell --seed 2020298
(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))))