(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 (sqrt t) 3.0) l)))
(if (<= (* l l) 5.78035664198339e+298)
(/ 2.0 (/ k (/ (* (cos k) (pow l 2.0)) (* k (* (sin k) (* t (sin k)))))))
(/ 2.0 (* (* (* t_1 (* (sin k) t_1)) (tan k)) (pow (/ k t) 2.0))))))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(sqrt(t), 3.0) / l;
double tmp;
if ((l * l) <= 5.78035664198339e+298) {
tmp = 2.0 / (k / ((cos(k) * pow(l, 2.0)) / (k * (sin(k) * (t * sin(k))))));
} else {
tmp = 2.0 / (((t_1 * (sin(k) * t_1)) * tan(k)) * pow((k / t), 2.0));
}
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 = (sqrt(t) ** 3.0d0) / l
if ((l * l) <= 5.78035664198339d+298) then
tmp = 2.0d0 / (k / ((cos(k) * (l ** 2.0d0)) / (k * (sin(k) * (t * sin(k))))))
else
tmp = 2.0d0 / (((t_1 * (sin(k) * t_1)) * tan(k)) * ((k / t) ** 2.0d0))
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.sqrt(t), 3.0) / l;
double tmp;
if ((l * l) <= 5.78035664198339e+298) {
tmp = 2.0 / (k / ((Math.cos(k) * Math.pow(l, 2.0)) / (k * (Math.sin(k) * (t * Math.sin(k))))));
} else {
tmp = 2.0 / (((t_1 * (Math.sin(k) * t_1)) * Math.tan(k)) * Math.pow((k / t), 2.0));
}
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.sqrt(t), 3.0) / l tmp = 0 if (l * l) <= 5.78035664198339e+298: tmp = 2.0 / (k / ((math.cos(k) * math.pow(l, 2.0)) / (k * (math.sin(k) * (t * math.sin(k)))))) else: tmp = 2.0 / (((t_1 * (math.sin(k) * t_1)) * math.tan(k)) * math.pow((k / t), 2.0)) 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((sqrt(t) ^ 3.0) / l) tmp = 0.0 if (Float64(l * l) <= 5.78035664198339e+298) tmp = Float64(2.0 / Float64(k / Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(k * Float64(sin(k) * Float64(t * sin(k))))))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_1 * Float64(sin(k) * t_1)) * tan(k)) * (Float64(k / t) ^ 2.0))); 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 = (sqrt(t) ^ 3.0) / l; tmp = 0.0; if ((l * l) <= 5.78035664198339e+298) tmp = 2.0 / (k / ((cos(k) * (l ^ 2.0)) / (k * (sin(k) * (t * sin(k)))))); else tmp = 2.0 / (((t_1 * (sin(k) * t_1)) * tan(k)) * ((k / t) ^ 2.0)); 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[Power[N[Sqrt[t], $MachinePrecision], 3.0], $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5.78035664198339e+298], N[(2.0 / N[(k / N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * N[(N[Sin[k], $MachinePrecision] * N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$1 * N[(N[Sin[k], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $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{{\left(\sqrt{t}\right)}^{3}}{\ell}\\
\mathbf{if}\;\ell \cdot \ell \leq 5.78035664198339 \cdot 10^{+298}:\\
\;\;\;\;\frac{2}{\frac{k}{\frac{\cos k \cdot {\ell}^{2}}{k \cdot \left(\sin k \cdot \left(t \cdot \sin k\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(t_1 \cdot \left(\sin k \cdot t_1\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\
\end{array}



Bits error versus t



Bits error versus l



Bits error versus k
Results
if (*.f64 l l) < 5.7803566419833897e298Initial program 45.2
Simplified35.9
Taylor expanded in t around 0 15.2
Applied unpow2_binary6415.2
Applied associate-*l*_binary6412.9
Applied associate-/l*_binary6410.4
Applied unpow2_binary6410.4
Applied associate-*r*_binary6410.2
if 5.7803566419833897e298 < (*.f64 l l) Initial program 63.8
Simplified63.7
Applied add-sqr-sqrt_binary6463.7
Applied unpow-prod-down_binary6463.7
Applied times-frac_binary6453.6
Applied associate-*l*_binary6453.6
Final simplification17.1
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))))