(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
(/
(/ (* (* l 2.0) (/ (cos k) k)) k)
(* (/ (sin k) l) (/ (sin k) (pow t -1.0))))))
(if (<= t -8.4e+15)
t_1
(if (<= t 8.6e+49)
(*
(/ (/ (* l 2.0) (/ k (cos k))) (/ (pow (sin k) 2.0) l))
(/ (/ 1.0 k) t))
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 = (((l * 2.0) * (cos(k) / k)) / k) / ((sin(k) / l) * (sin(k) / pow(t, -1.0)));
double tmp;
if (t <= -8.4e+15) {
tmp = t_1;
} else if (t <= 8.6e+49) {
tmp = (((l * 2.0) / (k / cos(k))) / (pow(sin(k), 2.0) / l)) * ((1.0 / k) / t);
} else {
tmp = 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 = (((l * 2.0d0) * (cos(k) / k)) / k) / ((sin(k) / l) * (sin(k) / (t ** (-1.0d0))))
if (t <= (-8.4d+15)) then
tmp = t_1
else if (t <= 8.6d+49) then
tmp = (((l * 2.0d0) / (k / cos(k))) / ((sin(k) ** 2.0d0) / l)) * ((1.0d0 / k) / t)
else
tmp = 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 = (((l * 2.0) * (Math.cos(k) / k)) / k) / ((Math.sin(k) / l) * (Math.sin(k) / Math.pow(t, -1.0)));
double tmp;
if (t <= -8.4e+15) {
tmp = t_1;
} else if (t <= 8.6e+49) {
tmp = (((l * 2.0) / (k / Math.cos(k))) / (Math.pow(Math.sin(k), 2.0) / l)) * ((1.0 / k) / t);
} else {
tmp = 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 = (((l * 2.0) * (math.cos(k) / k)) / k) / ((math.sin(k) / l) * (math.sin(k) / math.pow(t, -1.0))) tmp = 0 if t <= -8.4e+15: tmp = t_1 elif t <= 8.6e+49: tmp = (((l * 2.0) / (k / math.cos(k))) / (math.pow(math.sin(k), 2.0) / l)) * ((1.0 / k) / t) else: tmp = 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(Float64(Float64(Float64(l * 2.0) * Float64(cos(k) / k)) / k) / Float64(Float64(sin(k) / l) * Float64(sin(k) / (t ^ -1.0)))) tmp = 0.0 if (t <= -8.4e+15) tmp = t_1; elseif (t <= 8.6e+49) tmp = Float64(Float64(Float64(Float64(l * 2.0) / Float64(k / cos(k))) / Float64((sin(k) ^ 2.0) / l)) * Float64(Float64(1.0 / k) / t)); else tmp = 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 = (((l * 2.0) * (cos(k) / k)) / k) / ((sin(k) / l) * (sin(k) / (t ^ -1.0))); tmp = 0.0; if (t <= -8.4e+15) tmp = t_1; elseif (t <= 8.6e+49) tmp = (((l * 2.0) / (k / cos(k))) / ((sin(k) ^ 2.0) / l)) * ((1.0 / k) / t); else tmp = 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[(N[(N[(l * 2.0), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[Power[t, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.4e+15], t$95$1, If[LessEqual[t, 8.6e+49], N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / k), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\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{\frac{\left(\ell \cdot 2\right) \cdot \frac{\cos k}{k}}{k}}{\frac{\sin k}{\ell} \cdot \frac{\sin k}{{t}^{-1}}}\\
\mathbf{if}\;t \leq -8.4 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+49}:\\
\;\;\;\;\frac{\frac{\ell \cdot 2}{\frac{k}{\cos k}}}{\frac{{\sin k}^{2}}{\ell}} \cdot \frac{\frac{1}{k}}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Results
if t < -8.4e15 or 8.5999999999999998e49 < t Initial program 47.0
Simplified34.5
Taylor expanded in t around 0 21.8
Simplified19.2
Applied egg-rr12.3
Applied egg-rr6.8
Applied egg-rr1.2
if -8.4e15 < t < 8.5999999999999998e49Initial program 48.2
Simplified46.2
Taylor expanded in t around 0 24.5
Simplified25.7
Applied egg-rr16.9
Applied egg-rr13.5
Applied egg-rr7.5
Final simplification4.3
herbie shell --seed 2022181
(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))))