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



Bits error versus t



Bits error versus l



Bits error versus k
Results
if t < 6.915526448265006e-266Initial program 49.4
Simplified42.0
Taylor expanded in t around 0 23.5
Applied egg-rr23.2
Applied egg-rr11.1
Applied egg-rr4.2
if 6.915526448265006e-266 < t Initial program 46.9
Simplified38.6
Taylor expanded in t around 0 22.1
Applied egg-rr20.5
Applied egg-rr8.6
Applied egg-rr5.4
Final simplification4.8
herbie shell --seed 2022131
(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))))