\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.908952939768733 \cdot 10^{-257} \lor \neg \left(\ell \cdot \ell \leq 6.352659668616961 \cdot 10^{+286}\right):\\
\;\;\;\;2 \cdot \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{\sin k \cdot \left(t \cdot \sin k\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \frac{\ell}{k}\right)}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\
\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 (or (<= (* l l) 4.908952939768733e-257)
(not (<= (* l l) 6.352659668616961e+286)))
(* 2.0 (/ (* (* (/ l k) (/ l k)) (cos k)) (* (sin k) (* t (sin k)))))
(* 2.0 (/ (* (cos k) (* l (/ l k))) (* k (* t (pow (sin k) 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.908952939768733e-257) || !((l * l) <= 6.352659668616961e+286)) {
tmp = 2.0 * ((((l / k) * (l / k)) * cos(k)) / (sin(k) * (t * sin(k))));
} else {
tmp = 2.0 * ((cos(k) * (l * (l / k))) / (k * (t * pow(sin(k), 2.0))));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 4.908952939768733e-257 or 6.3526596686169608e286 < (*.f64 l l) Initial program 51.6
Simplified44.8
Taylor expanded around 0 32.1
Simplified32.1
rmApplied associate-/r*_binary64_36331.4
Simplified31.4
rmApplied times-frac_binary64_42512.6
rmApplied unpow2_binary64_48412.6
Applied associate-*r*_binary64_3599.8
if 4.908952939768733e-257 < (*.f64 l l) < 6.3526596686169608e286Initial program 45.0
Simplified36.1
Taylor expanded around 0 12.9
Simplified12.9
rmApplied associate-/r*_binary64_36311.2
Simplified11.2
rmApplied times-frac_binary64_4256.8
rmApplied associate-*l/_binary64_3626.7
Applied associate-*l/_binary64_3626.7
Applied associate-/l/_binary64_3663.2
Final simplification6.9
herbie shell --seed 2021019
(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))))