\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 7.66 \cdot 10^{-322}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2}}{\mathsf{fma}\left(\frac{\ell}{t}, \frac{\ell}{k \cdot k}, \frac{\ell \cdot \ell}{t} \cdot -0.16666666666666666\right)}}\\
\mathbf{elif}\;\ell \cdot \ell \leq 4.847791631987853 \cdot 10^{+303}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot \left(\left(\ell \cdot \ell\right) \cdot \cos k\right)}{\frac{k}{\frac{1}{t \cdot \left(\sin k \cdot \sin k\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t \cdot t}{\ell} \cdot \left(\sin k \cdot \frac{t}{\ell}\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\
\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) 7.66e-322)
(/
2.0
(/
(pow k 2.0)
(fma (/ l t) (/ l (* k k)) (* (/ (* l l) t) -0.16666666666666666))))
(if (<= (* l l) 4.847791631987853e+303)
(/
(* (/ 2.0 k) (* (* l l) (cos k)))
(/ k (/ 1.0 (* t (* (sin k) (sin k))))))
(/
2.0
(*
(* (* (/ (* t t) l) (* (sin k) (/ t l))) (tan k))
(pow (/ k t) 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) <= 7.66e-322) {
tmp = 2.0 / (pow(k, 2.0) / fma((l / t), (l / (k * k)), (((l * l) / t) * -0.16666666666666666)));
} else if ((l * l) <= 4.847791631987853e+303) {
tmp = ((2.0 / k) * ((l * l) * cos(k))) / (k / (1.0 / (t * (sin(k) * sin(k)))));
} else {
tmp = 2.0 / (((((t * t) / l) * (sin(k) * (t / l))) * tan(k)) * pow((k / t), 2.0));
}
return tmp;
}



Bits error versus t



Bits error versus l



Bits error versus k
if (*.f64 l l) < 7.65802e-322Initial program 45.7
Simplified37.5
Taylor expanded in t around 0 21.0
Applied associate-/l*_binary6420.7
Taylor expanded in k around 0 20.8
Simplified11.9
if 7.65802e-322 < (*.f64 l l) < 4.84779163198785305e303Initial program 45.5
Simplified35.9
Taylor expanded in t around 0 12.7
Applied associate-/l*_binary6411.1
Applied div-inv_binary6411.2
Applied unpow2_binary6411.2
Applied times-frac_binary644.8
Applied associate-/r*_binary644.6
Simplified4.5
Applied add-sqr-sqrt_binary6434.3
Applied unpow-prod-down_binary6434.3
Simplified34.2
Simplified4.5
if 4.84779163198785305e303 < (*.f64 l l) Initial program 63.6
Simplified63.5
Applied unpow3_binary6463.5
Applied times-frac_binary6447.9
Applied associate-*l*_binary6447.9
Final simplification13.7
herbie shell --seed 2021329
(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))))