\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.3923082163925979 \cdot 10^{-149} \lor \neg \left(\ell \cdot \ell \leq 3.6894671702728764 \cdot 10^{+128}\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(\left|\frac{\ell}{k}\right| \cdot \left|\ell\right|\right)}{\left(t \cdot {\sin k}^{2}\right) \cdot \left|k\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) 1.3923082163925979e-149)
(not (<= (* l l) 3.6894671702728764e+128)))
(* 2.0 (/ (* (* (/ l k) (/ l k)) (cos k)) (* (sin k) (* t (sin k)))))
(*
2.0
(/
(* (cos k) (* (fabs (/ l k)) (fabs l)))
(* (* t (pow (sin k) 2.0)) (fabs 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.3923082163925979e-149) || !((l * l) <= 3.6894671702728764e+128)) {
tmp = 2.0 * ((((l / k) * (l / k)) * cos(k)) / (sin(k) * (t * sin(k))));
} else {
tmp = 2.0 * ((cos(k) * (fabs(l / k) * fabs(l))) / ((t * pow(sin(k), 2.0)) * fabs(k)));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 1.3923082163925979e-149 or 3.6894671702728764e128 < (*.f64 l l) Initial program 49.8
Simplified42.6
Taylor expanded around 0 26.6
Simplified26.6
rmApplied associate-/r*_binary6425.7
Simplified25.7
rmApplied add-sqr-sqrt_binary6425.8
Simplified25.7
Simplified10.1
rmApplied unpow2_binary6410.1
Applied associate-*r*_binary648.2
if 1.3923082163925979e-149 < (*.f64 l l) < 3.6894671702728764e128Initial program 43.7
Simplified33.8
Taylor expanded around 0 8.8
Simplified8.8
rmApplied associate-/r*_binary647.6
Simplified7.6
rmApplied add-sqr-sqrt_binary647.7
Simplified7.6
Simplified6.3
rmApplied fabs-div_binary646.3
Applied associate-*l/_binary646.2
Applied associate-*l/_binary646.2
Applied associate-/l/_binary641.1
Final simplification6.5
herbie shell --seed 2021174
(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))))