(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 (/ (* (cos k) (* l 2.0)) (/ k (pow (sin k) -2.0)))))
(if (<= k -1.0153296323308793e-47)
(* (* (/ 1.0 t) t_1) (/ l k))
(if (<= k 3.306798165625435e-60)
(/
(fma (/ 2.0 k) (/ l k) (* l -0.3333333333333333))
(/ (* k t) (/ l k)))
(/ t_1 (* t (/ k l)))))))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 = (cos(k) * (l * 2.0)) / (k / pow(sin(k), -2.0));
double tmp;
if (k <= -1.0153296323308793e-47) {
tmp = ((1.0 / t) * t_1) * (l / k);
} else if (k <= 3.306798165625435e-60) {
tmp = fma((2.0 / k), (l / k), (l * -0.3333333333333333)) / ((k * t) / (l / k));
} else {
tmp = t_1 / (t * (k / l));
}
return tmp;
}
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function code(t, l, k) t_1 = Float64(Float64(cos(k) * Float64(l * 2.0)) / Float64(k / (sin(k) ^ -2.0))) tmp = 0.0 if (k <= -1.0153296323308793e-47) tmp = Float64(Float64(Float64(1.0 / t) * t_1) * Float64(l / k)); elseif (k <= 3.306798165625435e-60) tmp = Float64(fma(Float64(2.0 / k), Float64(l / k), Float64(l * -0.3333333333333333)) / Float64(Float64(k * t) / Float64(l / k))); else tmp = Float64(t_1 / Float64(t * Float64(k / l))); end return tmp end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(N[Cos[k], $MachinePrecision] * N[(l * 2.0), $MachinePrecision]), $MachinePrecision] / N[(k / N[Power[N[Sin[k], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.0153296323308793e-47], N[(N[(N[(1.0 / t), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.306798165625435e-60], N[(N[(N[(2.0 / k), $MachinePrecision] * N[(l / k), $MachinePrecision] + N[(l * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] / N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(t * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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 := \frac{\cos k \cdot \left(\ell \cdot 2\right)}{\frac{k}{{\sin k}^{-2}}}\\
\mathbf{if}\;k \leq -1.0153296323308793 \cdot 10^{-47}:\\
\;\;\;\;\left(\frac{1}{t} \cdot t_1\right) \cdot \frac{\ell}{k}\\
\mathbf{elif}\;k \leq 3.306798165625435 \cdot 10^{-60}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{2}{k}, \frac{\ell}{k}, \ell \cdot -0.3333333333333333\right)}{\frac{k \cdot t}{\frac{\ell}{k}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t \cdot \frac{k}{\ell}}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
if k < -1.0153296323308793e-47Initial program 45.2
Simplified36.6
Taylor expanded in t around 0 18.6
Simplified10.7
Applied egg-rr5.1
Applied egg-rr3.9
Applied egg-rr0.4
if -1.0153296323308793e-47 < k < 3.3067981656254352e-60Initial program 63.5
Simplified62.4
Taylor expanded in t around 0 44.8
Simplified33.0
Applied egg-rr18.7
Taylor expanded in k around 0 17.5
Simplified3.5
if 3.3067981656254352e-60 < k Initial program 46.5
Simplified38.2
Taylor expanded in t around 0 19.5
Simplified11.1
Applied egg-rr5.6
Applied egg-rr4.5
Applied egg-rr0.4
Final simplification0.8
herbie shell --seed 2022146
(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))))