(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 (* (sin k) (sqrt t)))
(t_2 (* 2.0 (cos k)))
(t_3 (pow (/ l k) 2.0))
(t_4 (pow (sin k) 2.0)))
(if (<= t -3.5e-90)
(/ t_3 (/ (* t t_4) t_2))
(if (<= t 3.8e-105)
(* 2.0 (/ (/ (/ l (/ k l)) (/ t (/ (cos k) k))) t_4))
(/ (/ (* t_3 t_2) t_1) t_1)))))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 = sin(k) * sqrt(t);
double t_2 = 2.0 * cos(k);
double t_3 = pow((l / k), 2.0);
double t_4 = pow(sin(k), 2.0);
double tmp;
if (t <= -3.5e-90) {
tmp = t_3 / ((t * t_4) / t_2);
} else if (t <= 3.8e-105) {
tmp = 2.0 * (((l / (k / l)) / (t / (cos(k) / k))) / t_4);
} else {
tmp = ((t_3 * t_2) / t_1) / t_1;
}
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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sin(k) * sqrt(t)
t_2 = 2.0d0 * cos(k)
t_3 = (l / k) ** 2.0d0
t_4 = sin(k) ** 2.0d0
if (t <= (-3.5d-90)) then
tmp = t_3 / ((t * t_4) / t_2)
else if (t <= 3.8d-105) then
tmp = 2.0d0 * (((l / (k / l)) / (t / (cos(k) / k))) / t_4)
else
tmp = ((t_3 * t_2) / t_1) / t_1
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 = Math.sin(k) * Math.sqrt(t);
double t_2 = 2.0 * Math.cos(k);
double t_3 = Math.pow((l / k), 2.0);
double t_4 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (t <= -3.5e-90) {
tmp = t_3 / ((t * t_4) / t_2);
} else if (t <= 3.8e-105) {
tmp = 2.0 * (((l / (k / l)) / (t / (Math.cos(k) / k))) / t_4);
} else {
tmp = ((t_3 * t_2) / t_1) / t_1;
}
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 = math.sin(k) * math.sqrt(t) t_2 = 2.0 * math.cos(k) t_3 = math.pow((l / k), 2.0) t_4 = math.pow(math.sin(k), 2.0) tmp = 0 if t <= -3.5e-90: tmp = t_3 / ((t * t_4) / t_2) elif t <= 3.8e-105: tmp = 2.0 * (((l / (k / l)) / (t / (math.cos(k) / k))) / t_4) else: tmp = ((t_3 * t_2) / t_1) / t_1 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(sin(k) * sqrt(t)) t_2 = Float64(2.0 * cos(k)) t_3 = Float64(l / k) ^ 2.0 t_4 = sin(k) ^ 2.0 tmp = 0.0 if (t <= -3.5e-90) tmp = Float64(t_3 / Float64(Float64(t * t_4) / t_2)); elseif (t <= 3.8e-105) tmp = Float64(2.0 * Float64(Float64(Float64(l / Float64(k / l)) / Float64(t / Float64(cos(k) / k))) / t_4)); else tmp = Float64(Float64(Float64(t_3 * t_2) / t_1) / t_1); 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 = sin(k) * sqrt(t); t_2 = 2.0 * cos(k); t_3 = (l / k) ^ 2.0; t_4 = sin(k) ^ 2.0; tmp = 0.0; if (t <= -3.5e-90) tmp = t_3 / ((t * t_4) / t_2); elseif (t <= 3.8e-105) tmp = 2.0 * (((l / (k / l)) / (t / (cos(k) / k))) / t_4); else tmp = ((t_3 * t_2) / t_1) / t_1; 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[Sin[k], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Cos[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t, -3.5e-90], N[(t$95$3 / N[(N[(t * t$95$4), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-105], N[(2.0 * N[(N[(N[(l / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(t / N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$3 * t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$1), $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 \cdot \sqrt{t}\\
t_2 := 2 \cdot \cos k\\
t_3 := {\left(\frac{\ell}{k}\right)}^{2}\\
t_4 := {\sin k}^{2}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-90}:\\
\;\;\;\;\frac{t_3}{\frac{t \cdot t_4}{t_2}}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-105}:\\
\;\;\;\;2 \cdot \frac{\frac{\frac{\ell}{\frac{k}{\ell}}}{\frac{t}{\frac{\cos k}{k}}}}{t_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_3 \cdot t_2}{t_1}}{t_1}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if t < -3.4999999999999999e-90Initial program 43.1
Simplified32.4
Taylor expanded in t around 0 20.5
Simplified18.3
Taylor expanded in k around inf 20.5
Simplified12.4
Applied egg-rr6.9
Applied egg-rr6.7
if -3.4999999999999999e-90 < t < 3.7999999999999998e-105Initial program 62.0
Simplified62.1
Taylor expanded in t around 0 26.7
Simplified29.6
Taylor expanded in k around inf 26.7
Simplified27.4
Taylor expanded in l around 0 26.7
Simplified10.6
if 3.7999999999999998e-105 < t Initial program 40.7
Simplified30.5
Taylor expanded in t around 0 21.0
Simplified19.4
Taylor expanded in k around inf 21.0
Simplified13.0
Applied egg-rr3.8
Final simplification6.9
herbie shell --seed 2022170
(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))))