(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 (/ (/ l k) t)))
(if (<= k -2.808363570812293e-144)
(* 2.0 (/ (* t_1 (* (cos k) (pow (sin k) -2.0))) (/ k l)))
(if (<= k 1.0658959369000571e-73)
(* 2.0 (/ (/ (* (cos k) (/ (pow (/ l k) 2.0) t)) (sin k)) (sin k)))
(* 2.0 (/ (* t_1 (* (cos k) (sqrt (pow (sin k) -4.0)))) (/ 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 = (l / k) / t;
double tmp;
if (k <= -2.808363570812293e-144) {
tmp = 2.0 * ((t_1 * (cos(k) * pow(sin(k), -2.0))) / (k / l));
} else if (k <= 1.0658959369000571e-73) {
tmp = 2.0 * (((cos(k) * (pow((l / k), 2.0) / t)) / sin(k)) / sin(k));
} else {
tmp = 2.0 * ((t_1 * (cos(k) * sqrt(pow(sin(k), -4.0)))) / (k / l));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (l / k) / t
if (k <= (-2.808363570812293d-144)) then
tmp = 2.0d0 * ((t_1 * (cos(k) * (sin(k) ** (-2.0d0)))) / (k / l))
else if (k <= 1.0658959369000571d-73) then
tmp = 2.0d0 * (((cos(k) * (((l / k) ** 2.0d0) / t)) / sin(k)) / sin(k))
else
tmp = 2.0d0 * ((t_1 * (cos(k) * sqrt((sin(k) ** (-4.0d0))))) / (k / l))
end if
code = tmp
end function
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 = (l / k) / t;
double tmp;
if (k <= -2.808363570812293e-144) {
tmp = 2.0 * ((t_1 * (Math.cos(k) * Math.pow(Math.sin(k), -2.0))) / (k / l));
} else if (k <= 1.0658959369000571e-73) {
tmp = 2.0 * (((Math.cos(k) * (Math.pow((l / k), 2.0) / t)) / Math.sin(k)) / Math.sin(k));
} else {
tmp = 2.0 * ((t_1 * (Math.cos(k) * Math.sqrt(Math.pow(Math.sin(k), -4.0)))) / (k / l));
}
return tmp;
}
def code(t, l, 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))
def code(t, l, k): t_1 = (l / k) / t tmp = 0 if k <= -2.808363570812293e-144: tmp = 2.0 * ((t_1 * (math.cos(k) * math.pow(math.sin(k), -2.0))) / (k / l)) elif k <= 1.0658959369000571e-73: tmp = 2.0 * (((math.cos(k) * (math.pow((l / k), 2.0) / t)) / math.sin(k)) / math.sin(k)) else: tmp = 2.0 * ((t_1 * (math.cos(k) * math.sqrt(math.pow(math.sin(k), -4.0)))) / (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(l / k) / t) tmp = 0.0 if (k <= -2.808363570812293e-144) tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(cos(k) * (sin(k) ^ -2.0))) / Float64(k / l))); elseif (k <= 1.0658959369000571e-73) tmp = Float64(2.0 * Float64(Float64(Float64(cos(k) * Float64((Float64(l / k) ^ 2.0) / t)) / sin(k)) / sin(k))); else tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(cos(k) * sqrt((sin(k) ^ -4.0)))) / Float64(k / l))); end return tmp end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
function tmp_2 = code(t, l, k) t_1 = (l / k) / t; tmp = 0.0; if (k <= -2.808363570812293e-144) tmp = 2.0 * ((t_1 * (cos(k) * (sin(k) ^ -2.0))) / (k / l)); elseif (k <= 1.0658959369000571e-73) tmp = 2.0 * (((cos(k) * (((l / k) ^ 2.0) / t)) / sin(k)) / sin(k)); else tmp = 2.0 * ((t_1 * (cos(k) * sqrt((sin(k) ^ -4.0)))) / (k / l)); end tmp_2 = 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[(l / k), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[k, -2.808363570812293e-144], N[(2.0 * N[(N[(t$95$1 * N[(N[Cos[k], $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0658959369000571e-73], N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] * N[(N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[(N[Cos[k], $MachinePrecision] * N[Sqrt[N[Power[N[Sin[k], $MachinePrecision], -4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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{\frac{\ell}{k}}{t}\\
\mathbf{if}\;k \leq -2.808363570812293 \cdot 10^{-144}:\\
\;\;\;\;2 \cdot \frac{t_1 \cdot \left(\cos k \cdot {\sin k}^{-2}\right)}{\frac{k}{\ell}}\\
\mathbf{elif}\;k \leq 1.0658959369000571 \cdot 10^{-73}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k \cdot \frac{{\left(\frac{\ell}{k}\right)}^{2}}{t}}{\sin k}}{\sin k}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{t_1 \cdot \left(\cos k \cdot \sqrt{{\sin k}^{-4}}\right)}{\frac{k}{\ell}}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if k < -2.8083635708122931e-144Initial program 47.4
Simplified39.0
Taylor expanded in t around 0 21.2
Simplified5.4
Applied egg-rr1.1
if -2.8083635708122931e-144 < k < 1.0658959369000571e-73Initial program 63.8
Simplified64.0
Taylor expanded in t around 0 54.4
Simplified37.2
Applied egg-rr16.5
if 1.0658959369000571e-73 < k Initial program 46.5
Simplified38.0
Taylor expanded in t around 0 19.3
Simplified4.9
Applied egg-rr0.5
Applied egg-rr0.5
Final simplification2.1
herbie shell --seed 2022148
(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))))