\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}
t_1 := t \cdot {\sin k}^{2}\\
\mathbf{if}\;\ell \cdot \ell \leq 2.3014336485196733 \cdot 10^{-296}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{\frac{\frac{k \cdot k}{\cos k}}{\ell}}}{t_1}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5.357562004404354 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \frac{\ell \cdot \ell}{t_1}}{k \cdot k}\\
\mathbf{elif}\;\ell \cdot \ell \leq 3.707793217772486 \cdot 10^{+158}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \frac{\ell \cdot \ell}{k}}{k \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k \cdot \frac{\ell}{\frac{k}{\ell}}}{k}}{t_1}\\
\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
(let* ((t_1 (* t (pow (sin k) 2.0))))
(if (<= (* l l) 2.3014336485196733e-296)
(* 2.0 (/ (/ l (/ (/ (* k k) (cos k)) l)) t_1))
(if (<= (* l l) 5.357562004404354e+60)
(* 2.0 (/ (* (cos k) (/ (* l l) t_1)) (* k k)))
(if (<= (* l l) 3.707793217772486e+158)
(* 2.0 (/ (* (cos k) (/ (* l l) k)) (* k t_1)))
(* 2.0 (/ (/ (* (cos k) (/ l (/ k l))) k) t_1)))))))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 t_1 = t * pow(sin(k), 2.0);
double tmp;
if ((l * l) <= 2.3014336485196733e-296) {
tmp = 2.0 * ((l / (((k * k) / cos(k)) / l)) / t_1);
} else if ((l * l) <= 5.357562004404354e+60) {
tmp = 2.0 * ((cos(k) * ((l * l) / t_1)) / (k * k));
} else if ((l * l) <= 3.707793217772486e+158) {
tmp = 2.0 * ((cos(k) * ((l * l) / k)) / (k * t_1));
} else {
tmp = 2.0 * (((cos(k) * (l / (k / l))) / k) / t_1);
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 2.30143364851967326e-296Initial program 46.6
Simplified37.6
Taylor expanded around 0 19.3
Simplified19.3
rmApplied associate-/r*_binary6419.2
Simplified19.2
rmApplied clear-num_binary6419.2
Applied un-div-inv_binary6419.2
Applied associate-/l*_binary6414.1
if 2.30143364851967326e-296 < (*.f64 l l) < 5.3575620044043539e60Initial program 43.8
Simplified33.6
Taylor expanded around 0 7.8
Simplified7.8
rmApplied times-frac_binary645.8
Applied associate-*l/_binary645.7
if 5.3575620044043539e60 < (*.f64 l l) < 3.7077932177724858e158Initial program 42.4
Simplified32.9
Taylor expanded around 0 13.7
Simplified13.7
rmApplied associate-/r*_binary6411.1
Simplified11.1
rmApplied associate-*r/_binary6411.1
Applied associate-/r*_binary645.4
Simplified5.4
rmApplied associate-/l/_binary641.0
Simplified1.0
if 3.7077932177724858e158 < (*.f64 l l) Initial program 57.9
Simplified55.3
Taylor expanded around 0 49.1
Simplified49.1
rmApplied associate-/r*_binary6447.1
Simplified47.1
rmApplied associate-*r/_binary6447.1
Applied associate-/r*_binary6440.5
Simplified40.5
rmApplied associate-/l*_binary6415.9
Final simplification10.9
herbie shell --seed 2021211
(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))))