(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 (pow (sin k) 2.0))
(t_2 (* (cos k) (pow k -2.0)))
(t_3 (* 2.0 (* (/ (cos k) k) (/ (* l l) (* (* k t) t_1))))))
(if (<= l -1e+152)
(pow
(cbrt
(pow (* (/ l (* (sin k) (sqrt t))) (/ (sqrt (* 2.0 (cos k))) k)) 2.0))
3.0)
(if (<= l -1e-158)
t_3
(if (<= l 1e-160)
(* (* 2.0 t_2) (* l (/ (/ l t) t_1)))
(if (<= l 1e+135)
t_3
(/
(/ (* 2.0 (* t_2 (* l (/ l t)))) (cbrt (pow (sin k) 4.0)))
(pow (cbrt (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 t_1 = pow(sin(k), 2.0);
double t_2 = cos(k) * pow(k, -2.0);
double t_3 = 2.0 * ((cos(k) / k) * ((l * l) / ((k * t) * t_1)));
double tmp;
if (l <= -1e+152) {
tmp = pow(cbrt(pow(((l / (sin(k) * sqrt(t))) * (sqrt((2.0 * cos(k))) / k)), 2.0)), 3.0);
} else if (l <= -1e-158) {
tmp = t_3;
} else if (l <= 1e-160) {
tmp = (2.0 * t_2) * (l * ((l / t) / t_1));
} else if (l <= 1e+135) {
tmp = t_3;
} else {
tmp = ((2.0 * (t_2 * (l * (l / t)))) / cbrt(pow(sin(k), 4.0))) / pow(cbrt(sin(k)), 2.0);
}
return tmp;
}
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * Math.pow(k, -2.0);
double t_3 = 2.0 * ((Math.cos(k) / k) * ((l * l) / ((k * t) * t_1)));
double tmp;
if (l <= -1e+152) {
tmp = Math.pow(Math.cbrt(Math.pow(((l / (Math.sin(k) * Math.sqrt(t))) * (Math.sqrt((2.0 * Math.cos(k))) / k)), 2.0)), 3.0);
} else if (l <= -1e-158) {
tmp = t_3;
} else if (l <= 1e-160) {
tmp = (2.0 * t_2) * (l * ((l / t) / t_1));
} else if (l <= 1e+135) {
tmp = t_3;
} else {
tmp = ((2.0 * (t_2 * (l * (l / t)))) / Math.cbrt(Math.pow(Math.sin(k), 4.0))) / Math.pow(Math.cbrt(Math.sin(k)), 2.0);
}
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 = sin(k) ^ 2.0 t_2 = Float64(cos(k) * (k ^ -2.0)) t_3 = Float64(2.0 * Float64(Float64(cos(k) / k) * Float64(Float64(l * l) / Float64(Float64(k * t) * t_1)))) tmp = 0.0 if (l <= -1e+152) tmp = cbrt((Float64(Float64(l / Float64(sin(k) * sqrt(t))) * Float64(sqrt(Float64(2.0 * cos(k))) / k)) ^ 2.0)) ^ 3.0; elseif (l <= -1e-158) tmp = t_3; elseif (l <= 1e-160) tmp = Float64(Float64(2.0 * t_2) * Float64(l * Float64(Float64(l / t) / t_1))); elseif (l <= 1e+135) tmp = t_3; else tmp = Float64(Float64(Float64(2.0 * Float64(t_2 * Float64(l * Float64(l / t)))) / cbrt((sin(k) ^ 4.0))) / (cbrt(sin(k)) ^ 2.0)); 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[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e+152], N[Power[N[Power[N[Power[N[(N[(l / N[(N[Sin[k], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(2.0 * N[Cos[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[l, -1e-158], t$95$3, If[LessEqual[l, 1e-160], N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(l * N[(N[(l / t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+135], t$95$3, N[(N[(N[(2.0 * N[(t$95$2 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Power[N[Sin[k], $MachinePrecision], 4.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $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 := {\sin k}^{2}\\
t_2 := \cos k \cdot {k}^{-2}\\
t_3 := 2 \cdot \left(\frac{\cos k}{k} \cdot \frac{\ell \cdot \ell}{\left(k \cdot t\right) \cdot t_1}\right)\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{+152}:\\
\;\;\;\;{\left(\sqrt[3]{{\left(\frac{\ell}{\sin k \cdot \sqrt{t}} \cdot \frac{\sqrt{2 \cdot \cos k}}{k}\right)}^{2}}\right)}^{3}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-158}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;\ell \leq 10^{-160}:\\
\;\;\;\;\left(2 \cdot t_2\right) \cdot \left(\ell \cdot \frac{\frac{\ell}{t}}{t_1}\right)\\
\mathbf{elif}\;\ell \leq 10^{+135}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2 \cdot \left(t_2 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\right)}{\sqrt[3]{{\sin k}^{4}}}}{{\left(\sqrt[3]{\sin k}\right)}^{2}}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if l < -1e152Initial program 63.4
Simplified63.5
Taylor expanded in t around 0 63.1
Simplified63.3
Taylor expanded in l around 0 63.3
Simplified46.5
Applied egg-rr50.4
if -1e152 < l < -1.00000000000000006e-158 or 9.9999999999999999e-161 < l < 9.99999999999999962e134Initial program 43.5
Simplified34.3
Taylor expanded in t around 0 11.9
Simplified12.3
Taylor expanded in l around 0 11.0
Simplified10.9
Taylor expanded in l around 0 10.9
Simplified11.1
Taylor expanded in k around inf 11.9
Simplified4.0
if -1.00000000000000006e-158 < l < 9.9999999999999999e-161Initial program 45.0
Simplified36.2
Taylor expanded in t around 0 18.2
Simplified17.9
Taylor expanded in l around 0 18.0
Simplified12.2
Taylor expanded in l around 0 12.2
Simplified8.7
Applied egg-rr8.7
if 9.99999999999999962e134 < l Initial program 61.9
Simplified60.7
Taylor expanded in t around 0 58.5
Simplified59.0
Applied egg-rr44.6
Final simplification12.9
herbie shell --seed 2022178
(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))))