\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 5.404420770027635 \cdot 10^{-199}:\\
\;\;\;\;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{elif}\;\ell \cdot \ell \leq 9.42696047899692 \cdot 10^{+123}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\ell \cdot \frac{\ell}{k}\right)}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t} \cdot \frac{\cos k}{{\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 (<= (* l l) 5.404420770027635e-199)
(* 2.0 (/ (* (* (/ l k) (/ l k)) (cos k)) (* (sin k) (* t (sin k)))))
(if (<= (* l l) 9.42696047899692e+123)
(* 2.0 (/ (* (cos k) (* l (/ l k))) (* k (* t (pow (sin k) 2.0)))))
(* 2.0 (* (/ (* (/ l k) (/ l k)) t) (/ (cos k) (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) <= 5.404420770027635e-199) {
tmp = 2.0 * ((((l / k) * (l / k)) * cos(k)) / (sin(k) * (t * sin(k))));
} else if ((l * l) <= 9.42696047899692e+123) {
tmp = 2.0 * ((cos(k) * (l * (l / k))) / (k * (t * pow(sin(k), 2.0))));
} else {
tmp = 2.0 * ((((l / k) * (l / k)) / t) * (cos(k) / pow(sin(k), 2.0)));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 5.4044207700276351e-199Initial program 46.1
Simplified36.5
Taylor expanded around 0 17.7
Simplified17.7
rmApplied associate-/r*_binary64_36317.2
Simplified17.2
rmApplied times-frac_binary64_42512.5
rmApplied unpow2_binary64_48412.5
Applied associate-*r*_binary64_3599.4
if 5.4044207700276351e-199 < (*.f64 l l) < 9.42696047899691992e123Initial program 45.0
Simplified34.7
Taylor expanded around 0 8.8
Simplified8.8
rmApplied associate-/r*_binary64_3637.9
Simplified7.9
rmApplied times-frac_binary64_4256.9
rmApplied associate-*l/_binary64_3626.8
Applied associate-*l/_binary64_3626.8
Applied associate-/l/_binary64_3661.8
if 9.42696047899691992e123 < (*.f64 l l) Initial program 56.2
Simplified52.9
Taylor expanded around 0 45.2
Simplified45.2
rmApplied associate-/r*_binary64_36343.2
Simplified43.2
rmApplied times-frac_binary64_4257.6
rmApplied times-frac_binary64_4257.6
Final simplification6.8
herbie shell --seed 2021023
(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))))