(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 (* (/ (cos k) k) l))
(t_2 (* 2.0 (/ t_1 (* k (/ t (* (/ 1.0 (sin k)) (/ l (sin k)))))))))
(if (<= t -1.1128609500028873e+63)
t_2
(if (<= t 5.903013830898229e+63)
(* 2.0 (/ t_1 (/ (* t k) (/ l (pow (sin k) 2.0)))))
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 = (cos(k) / k) * l;
double t_2 = 2.0 * (t_1 / (k * (t / ((1.0 / sin(k)) * (l / sin(k))))));
double tmp;
if (t <= -1.1128609500028873e+63) {
tmp = t_2;
} else if (t <= 5.903013830898229e+63) {
tmp = 2.0 * (t_1 / ((t * k) / (l / pow(sin(k), 2.0))));
} else {
tmp = t_2;
}
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) :: tmp
t_1 = (cos(k) / k) * l
t_2 = 2.0d0 * (t_1 / (k * (t / ((1.0d0 / sin(k)) * (l / sin(k))))))
if (t <= (-1.1128609500028873d+63)) then
tmp = t_2
else if (t <= 5.903013830898229d+63) then
tmp = 2.0d0 * (t_1 / ((t * k) / (l / (sin(k) ** 2.0d0))))
else
tmp = t_2
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.cos(k) / k) * l;
double t_2 = 2.0 * (t_1 / (k * (t / ((1.0 / Math.sin(k)) * (l / Math.sin(k))))));
double tmp;
if (t <= -1.1128609500028873e+63) {
tmp = t_2;
} else if (t <= 5.903013830898229e+63) {
tmp = 2.0 * (t_1 / ((t * k) / (l / Math.pow(Math.sin(k), 2.0))));
} else {
tmp = t_2;
}
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.cos(k) / k) * l t_2 = 2.0 * (t_1 / (k * (t / ((1.0 / math.sin(k)) * (l / math.sin(k)))))) tmp = 0 if t <= -1.1128609500028873e+63: tmp = t_2 elif t <= 5.903013830898229e+63: tmp = 2.0 * (t_1 / ((t * k) / (l / math.pow(math.sin(k), 2.0)))) else: tmp = 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 = Float64(Float64(cos(k) / k) * l) t_2 = Float64(2.0 * Float64(t_1 / Float64(k * Float64(t / Float64(Float64(1.0 / sin(k)) * Float64(l / sin(k))))))) tmp = 0.0 if (t <= -1.1128609500028873e+63) tmp = t_2; elseif (t <= 5.903013830898229e+63) tmp = Float64(2.0 * Float64(t_1 / Float64(Float64(t * k) / Float64(l / (sin(k) ^ 2.0))))); else tmp = t_2; 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 = (cos(k) / k) * l; t_2 = 2.0 * (t_1 / (k * (t / ((1.0 / sin(k)) * (l / sin(k)))))); tmp = 0.0; if (t <= -1.1128609500028873e+63) tmp = t_2; elseif (t <= 5.903013830898229e+63) tmp = 2.0 * (t_1 / ((t * k) / (l / (sin(k) ^ 2.0)))); else tmp = t_2; 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[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision] * l), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(t$95$1 / N[(k * N[(t / N[(N[(1.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.1128609500028873e+63], t$95$2, If[LessEqual[t, 5.903013830898229e+63], N[(2.0 * N[(t$95$1 / N[(N[(t * k), $MachinePrecision] / N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\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{\cos k}{k} \cdot \ell\\
t_2 := 2 \cdot \frac{t_1}{k \cdot \frac{t}{\frac{1}{\sin k} \cdot \frac{\ell}{\sin k}}}\\
\mathbf{if}\;t \leq -1.1128609500028873 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 5.903013830898229 \cdot 10^{+63}:\\
\;\;\;\;2 \cdot \frac{t_1}{\frac{t \cdot k}{\frac{\ell}{{\sin k}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if t < -1.1128609500028873e63 or 5.9030138308982288e63 < t Initial program 49.8
Simplified35.7
Taylor expanded in t around 0 20.9
Applied egg-rr18.2
Applied egg-rr3.8
Applied egg-rr0.4
if -1.1128609500028873e63 < t < 5.9030138308982288e63Initial program 46.5
Simplified43.8
Taylor expanded in t around 0 24.0
Applied egg-rr24.7
Applied egg-rr7.2
Applied egg-rr2.7
Final simplification1.6
herbie shell --seed 2022134
(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))))