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



Bits error versus t



Bits error versus l



Bits error versus k
Results
if t < -4.7053463514632678e166Initial program 56.8
Simplified42.4
Taylor expanded in t around 0 22.5
Applied egg-rr20.7
Applied egg-rr12.5
Applied egg-rr14.6
if -4.7053463514632678e166 < t < -5.7330020911729971e-223Initial program 41.8
Simplified35.8
Taylor expanded in t around 0 22.8
Applied egg-rr21.6
Applied egg-rr17.4
Applied egg-rr13.7
if -5.7330020911729971e-223 < t < 1.30302927720250425e-243Initial program 64.0
Simplified64.0
Taylor expanded in t around 0 27.3
Applied egg-rr31.5
Applied egg-rr27.8
Applied egg-rr21.4
if 1.30302927720250425e-243 < t < 1.02286137443285191e-44Initial program 53.3
Simplified53.0
Taylor expanded in t around 0 24.0
Applied egg-rr15.7
if 1.02286137443285191e-44 < t Initial program 43.8
Simplified31.6
Taylor expanded in t around 0 21.2
Applied egg-rr18.9
Applied egg-rr13.5
Applied egg-rr11.1
Final simplification13.9
herbie shell --seed 2022137
(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))))