\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}\;t \leq -0.005821799030628546 \lor \neg \left(t \leq 1.6563213069108411 \cdot 10^{-196}\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 (<= t -0.005821799030628546) (not (<= t 1.6563213069108411e-196))) (* 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 ((t <= -0.005821799030628546) || !(t <= 1.6563213069108411e-196)) {
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 t < -0.0058217990306285456 or 1.6563213069108411e-196 < t Initial program 46.3
Simplified35.7
Taylor expanded around inf 22.3
Simplified22.3
rmApplied associate-/r*_binary6420.5
Simplified20.5
rmApplied times-frac_binary647.9
rmApplied unpow2_binary647.9
Applied associate-*r*_binary645.6
if -0.0058217990306285456 < t < 1.6563213069108411e-196Initial program 54.5
Simplified53.5
Taylor expanded around inf 25.6
Simplified25.6
rmApplied associate-/r*_binary6427.7
Simplified27.7
rmApplied times-frac_binary6416.0
rmApplied associate-*l/_binary6417.4
Applied associate-*l/_binary6417.4
Applied associate-/l/_binary6411.8
Simplified11.8
Final simplification7.3
herbie shell --seed 2020253
(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))))