(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 (cbrt (cos k)))
(t_3 (* (* l (sqrt 2.0)) (/ t_2 (sqrt k)))))
(if (<= k -1.55e-5)
(/
(* (* l (/ l k)) (* 2.0 (cbrt (pow (cos k) 2.0))))
(* t_1 (/ t (/ t_2 k))))
(if (<= k -1.75e-65)
(* 2.0 (* (/ l t) (/ l (pow k 4.0))))
(if (<= k -7.2e-149)
(* (/ 2.0 (* t (* k k))) (/ l (/ t_1 (* l (cos k)))))
(* (/ t_3 t_1) (/ t_3 (* t (/ k t_2)))))))))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 = cbrt(cos(k));
double t_3 = (l * sqrt(2.0)) * (t_2 / sqrt(k));
double tmp;
if (k <= -1.55e-5) {
tmp = ((l * (l / k)) * (2.0 * cbrt(pow(cos(k), 2.0)))) / (t_1 * (t / (t_2 / k)));
} else if (k <= -1.75e-65) {
tmp = 2.0 * ((l / t) * (l / pow(k, 4.0)));
} else if (k <= -7.2e-149) {
tmp = (2.0 / (t * (k * k))) * (l / (t_1 / (l * cos(k))));
} else {
tmp = (t_3 / t_1) * (t_3 / (t * (k / t_2)));
}
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.cbrt(Math.cos(k));
double t_3 = (l * Math.sqrt(2.0)) * (t_2 / Math.sqrt(k));
double tmp;
if (k <= -1.55e-5) {
tmp = ((l * (l / k)) * (2.0 * Math.cbrt(Math.pow(Math.cos(k), 2.0)))) / (t_1 * (t / (t_2 / k)));
} else if (k <= -1.75e-65) {
tmp = 2.0 * ((l / t) * (l / Math.pow(k, 4.0)));
} else if (k <= -7.2e-149) {
tmp = (2.0 / (t * (k * k))) * (l / (t_1 / (l * Math.cos(k))));
} else {
tmp = (t_3 / t_1) * (t_3 / (t * (k / t_2)));
}
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 = cbrt(cos(k)) t_3 = Float64(Float64(l * sqrt(2.0)) * Float64(t_2 / sqrt(k))) tmp = 0.0 if (k <= -1.55e-5) tmp = Float64(Float64(Float64(l * Float64(l / k)) * Float64(2.0 * cbrt((cos(k) ^ 2.0)))) / Float64(t_1 * Float64(t / Float64(t_2 / k)))); elseif (k <= -1.75e-65) tmp = Float64(2.0 * Float64(Float64(l / t) * Float64(l / (k ^ 4.0)))); elseif (k <= -7.2e-149) tmp = Float64(Float64(2.0 / Float64(t * Float64(k * k))) * Float64(l / Float64(t_1 / Float64(l * cos(k))))); else tmp = Float64(Float64(t_3 / t_1) * Float64(t_3 / Float64(t * Float64(k / t_2)))); 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[Power[N[Cos[k], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.55e-5], N[(N[(N[(l * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Power[N[Power[N[Cos[k], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[(t / N[(t$95$2 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -1.75e-65], N[(2.0 * N[(N[(l / t), $MachinePrecision] * N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -7.2e-149], N[(N[(2.0 / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$1 / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 / t$95$1), $MachinePrecision] * N[(t$95$3 / N[(t * N[(k / t$95$2), $MachinePrecision]), $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 := {\sin k}^{2}\\
t_2 := \sqrt[3]{\cos k}\\
t_3 := \left(\ell \cdot \sqrt{2}\right) \cdot \frac{t_2}{\sqrt{k}}\\
\mathbf{if}\;k \leq -1.55 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(\ell \cdot \frac{\ell}{k}\right) \cdot \left(2 \cdot \sqrt[3]{{\cos k}^{2}}\right)}{t_1 \cdot \frac{t}{\frac{t_2}{k}}}\\
\mathbf{elif}\;k \leq -1.75 \cdot 10^{-65}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{{k}^{4}}\right)\\
\mathbf{elif}\;k \leq -7.2 \cdot 10^{-149}:\\
\;\;\;\;\frac{2}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{\frac{t_1}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3}{t_1} \cdot \frac{t_3}{t \cdot \frac{k}{t_2}}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if k < -1.55000000000000007e-5Initial program 43.4
Simplified35.8
Taylor expanded in t around 0 19.1
Simplified16.3
Applied egg-rr16.2
Applied egg-rr14.7
Taylor expanded in k around inf 14.6
Simplified8.7
if -1.55000000000000007e-5 < k < -1.75000000000000002e-65Initial program 57.8
Simplified43.7
Taylor expanded in t around 0 20.6
Simplified20.7
Taylor expanded in k around 0 20.7
Simplified1.4
if -1.75000000000000002e-65 < k < -7.2000000000000004e-149Initial program 63.3
Simplified61.5
Taylor expanded in t around 0 42.9
Simplified43.3
Applied egg-rr43.3
Taylor expanded in k around inf 42.9
Simplified21.4
if -7.2000000000000004e-149 < k Initial program 48.4
Simplified41.1
Taylor expanded in t around 0 23.8
Simplified22.0
Applied egg-rr21.8
Applied egg-rr19.8
Applied egg-rr7.9
Final simplification8.5
herbie shell --seed 2022166
(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))))