\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}\;k \leq 4.842177147515977 \cdot 10^{-74}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{\frac{k}{\ell}} \cdot \cos k}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\
\mathbf{elif}\;k \leq 1.0962257049040088 \cdot 10^{-13}:\\
\;\;\;\;\frac{2}{0.16666666666666666 \cdot \frac{{k}^{6}}{\frac{\ell}{\frac{t}{\ell}}} + \frac{{k}^{4}}{\frac{\ell}{\frac{t}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot \left(\frac{\ell}{\sqrt{k}} \cdot \frac{\ell}{\sqrt{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 (<= k 4.842177147515977e-74)
(* 2.0 (/ (* (/ l (/ k l)) (cos k)) (* k (* t (pow (sin k) 2.0)))))
(if (<= k 1.0962257049040088e-13)
(/
2.0
(+
(* 0.16666666666666666 (/ (pow k 6.0) (/ l (/ t l))))
(/ (pow k 4.0) (/ l (/ t l)))))
(*
2.0
(/
(* (cos k) (* (/ l (sqrt k)) (/ l (sqrt 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 (k <= 4.842177147515977e-74) {
tmp = 2.0 * (((l / (k / l)) * cos(k)) / (k * (t * pow(sin(k), 2.0))));
} else if (k <= 1.0962257049040088e-13) {
tmp = 2.0 / ((0.16666666666666666 * (pow(k, 6.0) / (l / (t / l)))) + (pow(k, 4.0) / (l / (t / l))));
} else {
tmp = 2.0 * ((cos(k) * ((l / sqrt(k)) * (l / sqrt(k)))) / (k * (t * pow(sin(k), 2.0))));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if k < 4.8421771475159773e-74Initial program 49.5
Simplified42.5
Taylor expanded around inf 26.4
Simplified26.4
rmApplied associate-*l*_binary6424.6
rmApplied associate-/r*_binary6422.1
Simplified22.1
rmApplied associate-/l*_binary6417.1
if 4.8421771475159773e-74 < k < 1.0962257049040088e-13Initial program 60.4
Simplified49.8
Taylor expanded around 0 24.0
Simplified15.1
if 1.0962257049040088e-13 < k Initial program 44.5
Simplified36.4
Taylor expanded around inf 18.8
Simplified18.8
rmApplied associate-*l*_binary6416.1
rmApplied associate-/r*_binary6414.0
Simplified14.0
rmApplied add-sqr-sqrt_binary6414.1
Applied times-frac_binary649.0
Final simplification13.8
herbie shell --seed 2020232
(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))))