
(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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}
\\
\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)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}
\\
\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)}
\end{array}
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 6.8e-206)
(/
2.0
(* (/ (* t_m (pow k 2.0)) (cos k)) (/ (pow (sin k) 2.0) (pow l_m 2.0))))
(if (<= t_m 3.6e-119)
(pow
(/
(/ (sqrt 2.0) (* (/ (pow t_m 1.5) l_m) (sqrt (* (sin k) (tan k)))))
(hypot 1.0 (hypot 1.0 (/ k t_m))))
2.0)
(/
1.0
(*
(/
(* (tan k) (+ 2.0 (pow (/ k t_m) 2.0)))
(/ 2.0 (pow (/ t_m (sqrt l_m)) 2.0)))
(* (sin k) (/ t_m l_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 6.8e-206) {
tmp = 2.0 / (((t_m * pow(k, 2.0)) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
} else if (t_m <= 3.6e-119) {
tmp = pow(((sqrt(2.0) / ((pow(t_m, 1.5) / l_m) * sqrt((sin(k) * tan(k))))) / hypot(1.0, hypot(1.0, (k / t_m)))), 2.0);
} else {
tmp = 1.0 / (((tan(k) * (2.0 + pow((k / t_m), 2.0))) / (2.0 / pow((t_m / sqrt(l_m)), 2.0))) * (sin(k) * (t_m / l_m)));
}
return t_s * tmp;
}
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 6.8e-206) {
tmp = 2.0 / (((t_m * Math.pow(k, 2.0)) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
} else if (t_m <= 3.6e-119) {
tmp = Math.pow(((Math.sqrt(2.0) / ((Math.pow(t_m, 1.5) / l_m) * Math.sqrt((Math.sin(k) * Math.tan(k))))) / Math.hypot(1.0, Math.hypot(1.0, (k / t_m)))), 2.0);
} else {
tmp = 1.0 / (((Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))) / (2.0 / Math.pow((t_m / Math.sqrt(l_m)), 2.0))) * (Math.sin(k) * (t_m / l_m)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 6.8e-206: tmp = 2.0 / (((t_m * math.pow(k, 2.0)) / math.cos(k)) * (math.pow(math.sin(k), 2.0) / math.pow(l_m, 2.0))) elif t_m <= 3.6e-119: tmp = math.pow(((math.sqrt(2.0) / ((math.pow(t_m, 1.5) / l_m) * math.sqrt((math.sin(k) * math.tan(k))))) / math.hypot(1.0, math.hypot(1.0, (k / t_m)))), 2.0) else: tmp = 1.0 / (((math.tan(k) * (2.0 + math.pow((k / t_m), 2.0))) / (2.0 / math.pow((t_m / math.sqrt(l_m)), 2.0))) * (math.sin(k) * (t_m / l_m))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 6.8e-206) tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k ^ 2.0)) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0)))); elseif (t_m <= 3.6e-119) tmp = Float64(Float64(sqrt(2.0) / Float64(Float64((t_m ^ 1.5) / l_m) * sqrt(Float64(sin(k) * tan(k))))) / hypot(1.0, hypot(1.0, Float64(k / t_m)))) ^ 2.0; else tmp = Float64(1.0 / Float64(Float64(Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))) / Float64(2.0 / (Float64(t_m / sqrt(l_m)) ^ 2.0))) * Float64(sin(k) * Float64(t_m / l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 6.8e-206) tmp = 2.0 / (((t_m * (k ^ 2.0)) / cos(k)) * ((sin(k) ^ 2.0) / (l_m ^ 2.0))); elseif (t_m <= 3.6e-119) tmp = ((sqrt(2.0) / (((t_m ^ 1.5) / l_m) * sqrt((sin(k) * tan(k))))) / hypot(1.0, hypot(1.0, (k / t_m)))) ^ 2.0; else tmp = 1.0 / (((tan(k) * (2.0 + ((k / t_m) ^ 2.0))) / (2.0 / ((t_m / sqrt(l_m)) ^ 2.0))) * (sin(k) * (t_m / l_m))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6.8e-206], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.6e-119], N[Power[N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k / t$95$m), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(1.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 / N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 6.8 \cdot 10^{-206}:\\
\;\;\;\;\frac{2}{\frac{t_m \cdot {k}^{2}}{\cos k} \cdot \frac{{\sin k}^{2}}{{l_m}^{2}}}\\
\mathbf{elif}\;t_m \leq 3.6 \cdot 10^{-119}:\\
\;\;\;\;{\left(\frac{\frac{\sqrt{2}}{\frac{{t_m}^{1.5}}{l_m} \cdot \sqrt{\sin k \cdot \tan k}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t_m}\right)\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\tan k \cdot \left(2 + {\left(\frac{k}{t_m}\right)}^{2}\right)}{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2}}} \cdot \left(\sin k \cdot \frac{t_m}{l_m}\right)}\\
\end{array}
\end{array}
if t < 6.7999999999999997e-206Initial program 43.5%
associate-*l*43.5%
sqr-neg43.5%
sqr-neg43.5%
associate-/r*49.8%
distribute-rgt-in49.8%
unpow249.8%
times-frac37.5%
sqr-neg37.5%
times-frac49.8%
unpow249.8%
distribute-rgt-in49.8%
Simplified49.8%
add-cube-cbrt49.7%
pow349.7%
associate-/r*43.4%
cbrt-div43.4%
rem-cbrt-cube49.3%
cbrt-prod64.4%
pow264.4%
Applied egg-rr64.4%
Taylor expanded in t around 0 50.5%
associate-*r*50.5%
*-commutative50.5%
times-frac53.5%
Simplified53.5%
if 6.7999999999999997e-206 < t < 3.6e-119Initial program 37.3%
associate-/r*37.3%
sqr-neg37.3%
associate-*l*37.3%
sqr-neg37.3%
associate-/r*41.9%
associate-+l+41.9%
unpow241.9%
times-frac23.3%
sqr-neg23.3%
times-frac41.9%
unpow241.9%
Simplified41.9%
add-sqr-sqrt41.9%
pow241.9%
Applied egg-rr81.1%
if 3.6e-119 < t Initial program 64.9%
associate-*l*64.9%
sqr-neg64.9%
sqr-neg64.9%
associate-/r*71.8%
distribute-rgt-in71.8%
unpow271.8%
times-frac62.9%
sqr-neg62.9%
times-frac71.8%
unpow271.8%
distribute-rgt-in71.8%
Simplified71.8%
associate-/r*64.9%
unpow364.9%
times-frac74.6%
pow274.6%
Applied egg-rr74.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod41.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod47.1%
add-sqr-sqrt47.1%
Applied egg-rr47.1%
unpow247.1%
Simplified47.1%
*-un-lft-identity47.1%
associate-/r*46.7%
associate-*l*49.5%
Applied egg-rr49.5%
clear-num49.0%
inv-pow49.0%
associate-/r*49.0%
Applied egg-rr49.0%
unpow-149.0%
associate-/r/50.9%
*-commutative50.9%
Simplified50.9%
Final simplification54.9%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(let* ((t_2 (pow (/ k t_m) 2.0)))
(*
t_s
(if (<=
(*
(* (tan k) (* (sin k) (/ (pow t_m 3.0) (* l_m l_m))))
(+ 1.0 (+ 1.0 t_2)))
1e+223)
(/
2.0
(*
(* (tan k) (+ 2.0 t_2))
(* (sin k) (* (/ t_m l_m) (/ (pow t_m 2.0) l_m)))))
(/
2.0
(pow
(*
(/ (pow t_m 1.5) l_m)
(* (sqrt 2.0) (+ k (* (pow k 3.0) -0.08333333333333333))))
2.0))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double t_2 = pow((k / t_m), 2.0);
double tmp;
if (((tan(k) * (sin(k) * (pow(t_m, 3.0) / (l_m * l_m)))) * (1.0 + (1.0 + t_2))) <= 1e+223) {
tmp = 2.0 / ((tan(k) * (2.0 + t_2)) * (sin(k) * ((t_m / l_m) * (pow(t_m, 2.0) / l_m))));
} else {
tmp = 2.0 / pow(((pow(t_m, 1.5) / l_m) * (sqrt(2.0) * (k + (pow(k, 3.0) * -0.08333333333333333)))), 2.0);
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = (k / t_m) ** 2.0d0
if (((tan(k) * (sin(k) * ((t_m ** 3.0d0) / (l_m * l_m)))) * (1.0d0 + (1.0d0 + t_2))) <= 1d+223) then
tmp = 2.0d0 / ((tan(k) * (2.0d0 + t_2)) * (sin(k) * ((t_m / l_m) * ((t_m ** 2.0d0) / l_m))))
else
tmp = 2.0d0 / ((((t_m ** 1.5d0) / l_m) * (sqrt(2.0d0) * (k + ((k ** 3.0d0) * (-0.08333333333333333d0))))) ** 2.0d0)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double t_2 = Math.pow((k / t_m), 2.0);
double tmp;
if (((Math.tan(k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l_m * l_m)))) * (1.0 + (1.0 + t_2))) <= 1e+223) {
tmp = 2.0 / ((Math.tan(k) * (2.0 + t_2)) * (Math.sin(k) * ((t_m / l_m) * (Math.pow(t_m, 2.0) / l_m))));
} else {
tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l_m) * (Math.sqrt(2.0) * (k + (Math.pow(k, 3.0) * -0.08333333333333333)))), 2.0);
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): t_2 = math.pow((k / t_m), 2.0) tmp = 0 if ((math.tan(k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l_m * l_m)))) * (1.0 + (1.0 + t_2))) <= 1e+223: tmp = 2.0 / ((math.tan(k) * (2.0 + t_2)) * (math.sin(k) * ((t_m / l_m) * (math.pow(t_m, 2.0) / l_m)))) else: tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l_m) * (math.sqrt(2.0) * (k + (math.pow(k, 3.0) * -0.08333333333333333)))), 2.0) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) t_2 = Float64(k / t_m) ^ 2.0 tmp = 0.0 if (Float64(Float64(tan(k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l_m * l_m)))) * Float64(1.0 + Float64(1.0 + t_2))) <= 1e+223) tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(2.0 + t_2)) * Float64(sin(k) * Float64(Float64(t_m / l_m) * Float64((t_m ^ 2.0) / l_m))))); else tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l_m) * Float64(sqrt(2.0) * Float64(k + Float64((k ^ 3.0) * -0.08333333333333333)))) ^ 2.0)); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) t_2 = (k / t_m) ^ 2.0; tmp = 0.0; if (((tan(k) * (sin(k) * ((t_m ^ 3.0) / (l_m * l_m)))) * (1.0 + (1.0 + t_2))) <= 1e+223) tmp = 2.0 / ((tan(k) * (2.0 + t_2)) * (sin(k) * ((t_m / l_m) * ((t_m ^ 2.0) / l_m)))); else tmp = 2.0 / ((((t_m ^ 1.5) / l_m) * (sqrt(2.0) * (k + ((k ^ 3.0) * -0.08333333333333333)))) ^ 2.0); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+223], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(k + N[(N[Power[k, 3.0], $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := {\left(\frac{k}{t_m}\right)}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\tan k \cdot \left(\sin k \cdot \frac{{t_m}^{3}}{l_m \cdot l_m}\right)\right) \cdot \left(1 + \left(1 + t_2\right)\right) \leq 10^{+223}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + t_2\right)\right) \cdot \left(\sin k \cdot \left(\frac{t_m}{l_m} \cdot \frac{{t_m}^{2}}{l_m}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t_m}^{1.5}}{l_m} \cdot \left(\sqrt{2} \cdot \left(k + {k}^{3} \cdot -0.08333333333333333\right)\right)\right)}^{2}}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) < 1.00000000000000005e223Initial program 83.7%
associate-*l*83.7%
sqr-neg83.7%
sqr-neg83.7%
associate-/r*88.6%
distribute-rgt-in88.6%
unpow288.6%
times-frac72.1%
sqr-neg72.1%
times-frac88.6%
unpow288.6%
distribute-rgt-in88.6%
Simplified88.6%
associate-/r*83.7%
unpow383.7%
times-frac93.1%
pow293.1%
Applied egg-rr93.1%
if 1.00000000000000005e223 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) Initial program 25.0%
*-commutative25.0%
sqr-neg25.0%
*-commutative25.0%
associate-*l*25.0%
*-commutative25.0%
sqr-neg25.0%
Simplified25.0%
Taylor expanded in k around 0 27.6%
*-commutative27.6%
Simplified27.6%
add-sqr-sqrt19.5%
pow219.5%
Applied egg-rr20.5%
*-commutative20.5%
Simplified20.5%
Taylor expanded in k around 0 34.0%
associate-*r*34.0%
distribute-rgt-out34.0%
*-commutative34.0%
Simplified34.0%
Final simplification60.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 4.4e-119)
(*
2.0
(* (/ (pow l_m 2.0) (* t_m (pow k 2.0))) (/ (cos k) (pow (sin k) 2.0))))
(*
(/ (/ 2.0 (pow (/ t_m (sqrt l_m)) 2.0)) (* (sin k) (/ t_m l_m)))
(/ 1.0 (* (tan k) (+ 2.0 (pow (/ k t_m) 2.0))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 4.4e-119) {
tmp = 2.0 * ((pow(l_m, 2.0) / (t_m * pow(k, 2.0))) * (cos(k) / pow(sin(k), 2.0)));
} else {
tmp = ((2.0 / pow((t_m / sqrt(l_m)), 2.0)) / (sin(k) * (t_m / l_m))) * (1.0 / (tan(k) * (2.0 + pow((k / t_m), 2.0))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 4.4d-119) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (t_m * (k ** 2.0d0))) * (cos(k) / (sin(k) ** 2.0d0)))
else
tmp = ((2.0d0 / ((t_m / sqrt(l_m)) ** 2.0d0)) / (sin(k) * (t_m / l_m))) * (1.0d0 / (tan(k) * (2.0d0 + ((k / t_m) ** 2.0d0))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 4.4e-119) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / (t_m * Math.pow(k, 2.0))) * (Math.cos(k) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = ((2.0 / Math.pow((t_m / Math.sqrt(l_m)), 2.0)) / (Math.sin(k) * (t_m / l_m))) * (1.0 / (Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 4.4e-119: tmp = 2.0 * ((math.pow(l_m, 2.0) / (t_m * math.pow(k, 2.0))) * (math.cos(k) / math.pow(math.sin(k), 2.0))) else: tmp = ((2.0 / math.pow((t_m / math.sqrt(l_m)), 2.0)) / (math.sin(k) * (t_m / l_m))) * (1.0 / (math.tan(k) * (2.0 + math.pow((k / t_m), 2.0)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 4.4e-119) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / Float64(t_m * (k ^ 2.0))) * Float64(cos(k) / (sin(k) ^ 2.0)))); else tmp = Float64(Float64(Float64(2.0 / (Float64(t_m / sqrt(l_m)) ^ 2.0)) / Float64(sin(k) * Float64(t_m / l_m))) * Float64(1.0 / Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 4.4e-119) tmp = 2.0 * (((l_m ^ 2.0) / (t_m * (k ^ 2.0))) * (cos(k) / (sin(k) ^ 2.0))); else tmp = ((2.0 / ((t_m / sqrt(l_m)) ^ 2.0)) / (sin(k) * (t_m / l_m))) * (1.0 / (tan(k) * (2.0 + ((k / t_m) ^ 2.0)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.4e-119], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 4.4 \cdot 10^{-119}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{t_m \cdot {k}^{2}} \cdot \frac{\cos k}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2}}}{\sin k \cdot \frac{t_m}{l_m}} \cdot \frac{1}{\tan k \cdot \left(2 + {\left(\frac{k}{t_m}\right)}^{2}\right)}\\
\end{array}
\end{array}
if t < 4.4000000000000001e-119Initial program 42.6%
associate-/r*43.0%
sqr-neg43.0%
associate-*l*39.7%
sqr-neg39.7%
associate-/r*45.8%
associate-+l+45.8%
unpow245.8%
times-frac32.7%
sqr-neg32.7%
times-frac45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in t around 0 53.1%
associate-*r*53.1%
times-frac56.2%
Simplified56.2%
if 4.4000000000000001e-119 < t Initial program 64.9%
associate-*l*64.9%
sqr-neg64.9%
sqr-neg64.9%
associate-/r*71.8%
distribute-rgt-in71.8%
unpow271.8%
times-frac62.9%
sqr-neg62.9%
times-frac71.8%
unpow271.8%
distribute-rgt-in71.8%
Simplified71.8%
associate-/r*64.9%
unpow364.9%
times-frac74.6%
pow274.6%
Applied egg-rr74.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod41.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod47.1%
add-sqr-sqrt47.1%
Applied egg-rr47.1%
unpow247.1%
Simplified47.1%
*-un-lft-identity47.1%
associate-/r*46.7%
associate-*l*49.5%
Applied egg-rr49.5%
div-inv49.4%
associate-/r*49.6%
Applied egg-rr49.6%
Final simplification53.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 2.4e-137)
(*
2.0
(* (/ (pow l_m 2.0) (* t_m (pow k 2.0))) (/ (cos k) (pow (sin k) 2.0))))
(/
1.0
(*
(/
(* (tan k) (+ 2.0 (pow (/ k t_m) 2.0)))
(/ 2.0 (pow (/ t_m (sqrt l_m)) 2.0)))
(* (sin k) (/ t_m l_m)))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 2.4e-137) {
tmp = 2.0 * ((pow(l_m, 2.0) / (t_m * pow(k, 2.0))) * (cos(k) / pow(sin(k), 2.0)));
} else {
tmp = 1.0 / (((tan(k) * (2.0 + pow((k / t_m), 2.0))) / (2.0 / pow((t_m / sqrt(l_m)), 2.0))) * (sin(k) * (t_m / l_m)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.4d-137) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (t_m * (k ** 2.0d0))) * (cos(k) / (sin(k) ** 2.0d0)))
else
tmp = 1.0d0 / (((tan(k) * (2.0d0 + ((k / t_m) ** 2.0d0))) / (2.0d0 / ((t_m / sqrt(l_m)) ** 2.0d0))) * (sin(k) * (t_m / l_m)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 2.4e-137) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / (t_m * Math.pow(k, 2.0))) * (Math.cos(k) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = 1.0 / (((Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))) / (2.0 / Math.pow((t_m / Math.sqrt(l_m)), 2.0))) * (Math.sin(k) * (t_m / l_m)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 2.4e-137: tmp = 2.0 * ((math.pow(l_m, 2.0) / (t_m * math.pow(k, 2.0))) * (math.cos(k) / math.pow(math.sin(k), 2.0))) else: tmp = 1.0 / (((math.tan(k) * (2.0 + math.pow((k / t_m), 2.0))) / (2.0 / math.pow((t_m / math.sqrt(l_m)), 2.0))) * (math.sin(k) * (t_m / l_m))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 2.4e-137) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / Float64(t_m * (k ^ 2.0))) * Float64(cos(k) / (sin(k) ^ 2.0)))); else tmp = Float64(1.0 / Float64(Float64(Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))) / Float64(2.0 / (Float64(t_m / sqrt(l_m)) ^ 2.0))) * Float64(sin(k) * Float64(t_m / l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 2.4e-137) tmp = 2.0 * (((l_m ^ 2.0) / (t_m * (k ^ 2.0))) * (cos(k) / (sin(k) ^ 2.0))); else tmp = 1.0 / (((tan(k) * (2.0 + ((k / t_m) ^ 2.0))) / (2.0 / ((t_m / sqrt(l_m)) ^ 2.0))) * (sin(k) * (t_m / l_m))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.4e-137], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 / N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2.4 \cdot 10^{-137}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{t_m \cdot {k}^{2}} \cdot \frac{\cos k}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\tan k \cdot \left(2 + {\left(\frac{k}{t_m}\right)}^{2}\right)}{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2}}} \cdot \left(\sin k \cdot \frac{t_m}{l_m}\right)}\\
\end{array}
\end{array}
if t < 2.4e-137Initial program 42.5%
associate-/r*42.9%
sqr-neg42.9%
associate-*l*39.6%
sqr-neg39.6%
associate-/r*45.8%
associate-+l+45.8%
unpow245.8%
times-frac32.5%
sqr-neg32.5%
times-frac45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in t around 0 53.1%
associate-*r*53.1%
times-frac56.3%
Simplified56.3%
if 2.4e-137 < t Initial program 64.6%
associate-*l*64.6%
sqr-neg64.6%
sqr-neg64.6%
associate-/r*71.3%
distribute-rgt-in71.3%
unpow271.3%
times-frac62.7%
sqr-neg62.7%
times-frac71.3%
unpow271.3%
distribute-rgt-in71.3%
Simplified71.3%
associate-/r*64.6%
unpow364.6%
times-frac74.2%
pow274.2%
Applied egg-rr74.2%
add-sqr-sqrt41.7%
sqrt-div41.7%
unpow241.7%
sqrt-prod41.7%
add-sqr-sqrt41.7%
sqrt-div41.7%
unpow241.7%
sqrt-prod47.2%
add-sqr-sqrt47.2%
Applied egg-rr47.2%
unpow247.2%
Simplified47.2%
*-un-lft-identity47.2%
associate-/r*46.7%
associate-*l*49.5%
Applied egg-rr49.5%
clear-num49.0%
inv-pow49.0%
associate-/r*49.0%
Applied egg-rr49.0%
unpow-149.0%
associate-/r/50.9%
*-commutative50.9%
Simplified50.9%
Final simplification54.1%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 7.2e-119)
(*
2.0
(* (/ (pow l_m 2.0) (* t_m (pow k 2.0))) (/ (cos k) (pow (sin k) 2.0))))
(/
(/ 2.0 (* (pow (/ t_m (sqrt l_m)) 2.0) (* (sin k) (/ t_m l_m))))
(* (tan k) (+ 2.0 (* (/ k t_m) (/ k t_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 7.2e-119) {
tmp = 2.0 * ((pow(l_m, 2.0) / (t_m * pow(k, 2.0))) * (cos(k) / pow(sin(k), 2.0)));
} else {
tmp = (2.0 / (pow((t_m / sqrt(l_m)), 2.0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0 + ((k / t_m) * (k / t_m))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 7.2d-119) then
tmp = 2.0d0 * (((l_m ** 2.0d0) / (t_m * (k ** 2.0d0))) * (cos(k) / (sin(k) ** 2.0d0)))
else
tmp = (2.0d0 / (((t_m / sqrt(l_m)) ** 2.0d0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0d0 + ((k / t_m) * (k / t_m))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 7.2e-119) {
tmp = 2.0 * ((Math.pow(l_m, 2.0) / (t_m * Math.pow(k, 2.0))) * (Math.cos(k) / Math.pow(Math.sin(k), 2.0)));
} else {
tmp = (2.0 / (Math.pow((t_m / Math.sqrt(l_m)), 2.0) * (Math.sin(k) * (t_m / l_m)))) / (Math.tan(k) * (2.0 + ((k / t_m) * (k / t_m))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 7.2e-119: tmp = 2.0 * ((math.pow(l_m, 2.0) / (t_m * math.pow(k, 2.0))) * (math.cos(k) / math.pow(math.sin(k), 2.0))) else: tmp = (2.0 / (math.pow((t_m / math.sqrt(l_m)), 2.0) * (math.sin(k) * (t_m / l_m)))) / (math.tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 7.2e-119) tmp = Float64(2.0 * Float64(Float64((l_m ^ 2.0) / Float64(t_m * (k ^ 2.0))) * Float64(cos(k) / (sin(k) ^ 2.0)))); else tmp = Float64(Float64(2.0 / Float64((Float64(t_m / sqrt(l_m)) ^ 2.0) * Float64(sin(k) * Float64(t_m / l_m)))) / Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) * Float64(k / t_m))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 7.2e-119) tmp = 2.0 * (((l_m ^ 2.0) / (t_m * (k ^ 2.0))) * (cos(k) / (sin(k) ^ 2.0))); else tmp = (2.0 / (((t_m / sqrt(l_m)) ^ 2.0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0 + ((k / t_m) * (k / t_m)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 7.2e-119], N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 7.2 \cdot 10^{-119}:\\
\;\;\;\;2 \cdot \left(\frac{{l_m}^{2}}{t_m \cdot {k}^{2}} \cdot \frac{\cos k}{{\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2} \cdot \left(\sin k \cdot \frac{t_m}{l_m}\right)}}{\tan k \cdot \left(2 + \frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\
\end{array}
\end{array}
if t < 7.2e-119Initial program 42.6%
associate-/r*43.0%
sqr-neg43.0%
associate-*l*39.7%
sqr-neg39.7%
associate-/r*45.8%
associate-+l+45.8%
unpow245.8%
times-frac32.7%
sqr-neg32.7%
times-frac45.8%
unpow245.8%
Simplified45.8%
Taylor expanded in t around 0 53.1%
associate-*r*53.1%
times-frac56.2%
Simplified56.2%
if 7.2e-119 < t Initial program 64.9%
associate-*l*64.9%
sqr-neg64.9%
sqr-neg64.9%
associate-/r*71.8%
distribute-rgt-in71.8%
unpow271.8%
times-frac62.9%
sqr-neg62.9%
times-frac71.8%
unpow271.8%
distribute-rgt-in71.8%
Simplified71.8%
associate-/r*64.9%
unpow364.9%
times-frac74.6%
pow274.6%
Applied egg-rr74.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod41.6%
add-sqr-sqrt41.6%
sqrt-div41.6%
unpow241.6%
sqrt-prod47.1%
add-sqr-sqrt47.1%
Applied egg-rr47.1%
unpow247.1%
Simplified47.1%
*-un-lft-identity47.1%
associate-/r*46.7%
associate-*l*49.5%
Applied egg-rr49.5%
unpow271.7%
Applied egg-rr49.5%
Final simplification53.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 2.65e-42)
(/
2.0
(pow
(*
(/ (pow t_m 1.5) l_m)
(* (sqrt 2.0) (+ k (* (pow k 3.0) -0.08333333333333333))))
2.0))
(if (<= t_m 2.5e+91)
(/
2.0
(/
(*
(* (tan k) (+ 2.0 (pow (/ k t_m) 2.0)))
(* (sin k) (/ (pow t_m 3.0) l_m)))
l_m))
(/
(/ 2.0 (* (pow (/ t_m (sqrt l_m)) 2.0) (* (sin k) (/ t_m l_m))))
(* 2.0 k))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 2.65e-42) {
tmp = 2.0 / pow(((pow(t_m, 1.5) / l_m) * (sqrt(2.0) * (k + (pow(k, 3.0) * -0.08333333333333333)))), 2.0);
} else if (t_m <= 2.5e+91) {
tmp = 2.0 / (((tan(k) * (2.0 + pow((k / t_m), 2.0))) * (sin(k) * (pow(t_m, 3.0) / l_m))) / l_m);
} else {
tmp = (2.0 / (pow((t_m / sqrt(l_m)), 2.0) * (sin(k) * (t_m / l_m)))) / (2.0 * k);
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.65d-42) then
tmp = 2.0d0 / ((((t_m ** 1.5d0) / l_m) * (sqrt(2.0d0) * (k + ((k ** 3.0d0) * (-0.08333333333333333d0))))) ** 2.0d0)
else if (t_m <= 2.5d+91) then
tmp = 2.0d0 / (((tan(k) * (2.0d0 + ((k / t_m) ** 2.0d0))) * (sin(k) * ((t_m ** 3.0d0) / l_m))) / l_m)
else
tmp = (2.0d0 / (((t_m / sqrt(l_m)) ** 2.0d0) * (sin(k) * (t_m / l_m)))) / (2.0d0 * k)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 2.65e-42) {
tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l_m) * (Math.sqrt(2.0) * (k + (Math.pow(k, 3.0) * -0.08333333333333333)))), 2.0);
} else if (t_m <= 2.5e+91) {
tmp = 2.0 / (((Math.tan(k) * (2.0 + Math.pow((k / t_m), 2.0))) * (Math.sin(k) * (Math.pow(t_m, 3.0) / l_m))) / l_m);
} else {
tmp = (2.0 / (Math.pow((t_m / Math.sqrt(l_m)), 2.0) * (Math.sin(k) * (t_m / l_m)))) / (2.0 * k);
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 2.65e-42: tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l_m) * (math.sqrt(2.0) * (k + (math.pow(k, 3.0) * -0.08333333333333333)))), 2.0) elif t_m <= 2.5e+91: tmp = 2.0 / (((math.tan(k) * (2.0 + math.pow((k / t_m), 2.0))) * (math.sin(k) * (math.pow(t_m, 3.0) / l_m))) / l_m) else: tmp = (2.0 / (math.pow((t_m / math.sqrt(l_m)), 2.0) * (math.sin(k) * (t_m / l_m)))) / (2.0 * k) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 2.65e-42) tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l_m) * Float64(sqrt(2.0) * Float64(k + Float64((k ^ 3.0) * -0.08333333333333333)))) ^ 2.0)); elseif (t_m <= 2.5e+91) tmp = Float64(2.0 / Float64(Float64(Float64(tan(k) * Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(sin(k) * Float64((t_m ^ 3.0) / l_m))) / l_m)); else tmp = Float64(Float64(2.0 / Float64((Float64(t_m / sqrt(l_m)) ^ 2.0) * Float64(sin(k) * Float64(t_m / l_m)))) / Float64(2.0 * k)); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 2.65e-42) tmp = 2.0 / ((((t_m ^ 1.5) / l_m) * (sqrt(2.0) * (k + ((k ^ 3.0) * -0.08333333333333333)))) ^ 2.0); elseif (t_m <= 2.5e+91) tmp = 2.0 / (((tan(k) * (2.0 + ((k / t_m) ^ 2.0))) * (sin(k) * ((t_m ^ 3.0) / l_m))) / l_m); else tmp = (2.0 / (((t_m / sqrt(l_m)) ^ 2.0) * (sin(k) * (t_m / l_m)))) / (2.0 * k); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.65e-42], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(k + N[(N[Power[k, 3.0], $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.5e+91], N[(2.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2.65 \cdot 10^{-42}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t_m}^{1.5}}{l_m} \cdot \left(\sqrt{2} \cdot \left(k + {k}^{3} \cdot -0.08333333333333333\right)\right)\right)}^{2}}\\
\mathbf{elif}\;t_m \leq 2.5 \cdot 10^{+91}:\\
\;\;\;\;\frac{2}{\frac{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t_m}\right)}^{2}\right)\right) \cdot \left(\sin k \cdot \frac{{t_m}^{3}}{l_m}\right)}{l_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2} \cdot \left(\sin k \cdot \frac{t_m}{l_m}\right)}}{2 \cdot k}\\
\end{array}
\end{array}
if t < 2.65e-42Initial program 45.4%
*-commutative45.4%
sqr-neg45.4%
*-commutative45.4%
associate-*l*45.4%
*-commutative45.4%
sqr-neg45.4%
Simplified45.4%
Taylor expanded in k around 0 43.8%
*-commutative43.8%
Simplified43.8%
add-sqr-sqrt20.1%
pow220.1%
Applied egg-rr15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in k around 0 19.7%
associate-*r*19.7%
distribute-rgt-out19.7%
*-commutative19.7%
Simplified19.7%
if 2.65e-42 < t < 2.5000000000000001e91Initial program 72.3%
associate-*l*72.3%
sqr-neg72.3%
sqr-neg72.3%
associate-/r*81.0%
distribute-rgt-in81.0%
unpow281.0%
times-frac75.0%
sqr-neg75.0%
times-frac81.0%
unpow281.0%
distribute-rgt-in81.0%
Simplified81.0%
associate-*l/87.0%
associate-*l/93.1%
Applied egg-rr93.1%
if 2.5000000000000001e91 < t Initial program 58.4%
associate-*l*58.4%
sqr-neg58.4%
sqr-neg58.4%
associate-/r*64.5%
distribute-rgt-in64.5%
unpow264.5%
times-frac51.0%
sqr-neg51.0%
times-frac64.5%
unpow264.5%
distribute-rgt-in64.5%
Simplified64.5%
associate-/r*58.4%
unpow358.4%
times-frac70.0%
pow270.0%
Applied egg-rr70.0%
add-sqr-sqrt44.5%
sqrt-div44.5%
unpow244.5%
sqrt-prod44.5%
add-sqr-sqrt44.5%
sqrt-div44.4%
unpow244.4%
sqrt-prod55.2%
add-sqr-sqrt55.3%
Applied egg-rr55.3%
unpow255.3%
Simplified55.3%
*-un-lft-identity55.3%
associate-/r*55.8%
associate-*l*57.6%
Applied egg-rr57.6%
Taylor expanded in k around 0 46.6%
*-commutative64.8%
Simplified46.6%
Final simplification34.3%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= t_m 1.9e-211)
(/
2.0
(*
(* (sin k) (* (/ t_m l_m) (/ (pow t_m 2.0) l_m)))
(* 2.0 (/ (sin k) (cos k)))))
(/
(/ 2.0 (* (pow (/ t_m (sqrt l_m)) 2.0) (* (sin k) (/ t_m l_m))))
(* (tan k) (+ 2.0 (* (/ k t_m) (/ k t_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 1.9e-211) {
tmp = 2.0 / ((sin(k) * ((t_m / l_m) * (pow(t_m, 2.0) / l_m))) * (2.0 * (sin(k) / cos(k))));
} else {
tmp = (2.0 / (pow((t_m / sqrt(l_m)), 2.0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0 + ((k / t_m) * (k / t_m))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 1.9d-211) then
tmp = 2.0d0 / ((sin(k) * ((t_m / l_m) * ((t_m ** 2.0d0) / l_m))) * (2.0d0 * (sin(k) / cos(k))))
else
tmp = (2.0d0 / (((t_m / sqrt(l_m)) ** 2.0d0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0d0 + ((k / t_m) * (k / t_m))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (t_m <= 1.9e-211) {
tmp = 2.0 / ((Math.sin(k) * ((t_m / l_m) * (Math.pow(t_m, 2.0) / l_m))) * (2.0 * (Math.sin(k) / Math.cos(k))));
} else {
tmp = (2.0 / (Math.pow((t_m / Math.sqrt(l_m)), 2.0) * (Math.sin(k) * (t_m / l_m)))) / (Math.tan(k) * (2.0 + ((k / t_m) * (k / t_m))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if t_m <= 1.9e-211: tmp = 2.0 / ((math.sin(k) * ((t_m / l_m) * (math.pow(t_m, 2.0) / l_m))) * (2.0 * (math.sin(k) / math.cos(k)))) else: tmp = (2.0 / (math.pow((t_m / math.sqrt(l_m)), 2.0) * (math.sin(k) * (t_m / l_m)))) / (math.tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (t_m <= 1.9e-211) tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(Float64(t_m / l_m) * Float64((t_m ^ 2.0) / l_m))) * Float64(2.0 * Float64(sin(k) / cos(k))))); else tmp = Float64(Float64(2.0 / Float64((Float64(t_m / sqrt(l_m)) ^ 2.0) * Float64(sin(k) * Float64(t_m / l_m)))) / Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) * Float64(k / t_m))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (t_m <= 1.9e-211) tmp = 2.0 / ((sin(k) * ((t_m / l_m) * ((t_m ^ 2.0) / l_m))) * (2.0 * (sin(k) / cos(k)))); else tmp = (2.0 / (((t_m / sqrt(l_m)) ^ 2.0) * (sin(k) * (t_m / l_m)))) / (tan(k) * (2.0 + ((k / t_m) * (k / t_m)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.9e-211], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[k], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[N[(t$95$m / N[Sqrt[l$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 1.9 \cdot 10^{-211}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{t_m}{l_m} \cdot \frac{{t_m}^{2}}{l_m}\right)\right) \cdot \left(2 \cdot \frac{\sin k}{\cos k}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{t_m}{\sqrt{l_m}}\right)}^{2} \cdot \left(\sin k \cdot \frac{t_m}{l_m}\right)}}{\tan k \cdot \left(2 + \frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\
\end{array}
\end{array}
if t < 1.90000000000000006e-211Initial program 43.4%
associate-*l*43.4%
sqr-neg43.4%
sqr-neg43.4%
associate-/r*49.8%
distribute-rgt-in49.8%
unpow249.8%
times-frac38.1%
sqr-neg38.1%
times-frac49.8%
unpow249.8%
distribute-rgt-in49.8%
Simplified49.8%
associate-/r*43.4%
unpow343.4%
times-frac54.9%
pow254.9%
Applied egg-rr54.9%
Taylor expanded in t around inf 53.8%
if 1.90000000000000006e-211 < t Initial program 59.8%
associate-*l*59.8%
sqr-neg59.8%
sqr-neg59.8%
associate-/r*66.2%
distribute-rgt-in66.2%
unpow266.2%
times-frac55.0%
sqr-neg55.0%
times-frac66.2%
unpow266.2%
distribute-rgt-in66.2%
Simplified66.2%
associate-/r*59.8%
unpow359.8%
times-frac69.1%
pow269.1%
Applied egg-rr69.1%
add-sqr-sqrt37.8%
sqrt-div37.8%
unpow237.8%
sqrt-prod37.8%
add-sqr-sqrt37.8%
sqrt-div37.8%
unpow237.8%
sqrt-prod44.0%
add-sqr-sqrt44.0%
Applied egg-rr44.0%
unpow244.0%
Simplified44.0%
*-un-lft-identity44.0%
associate-/r*44.2%
associate-*l*46.4%
Applied egg-rr46.4%
unpow266.1%
Applied egg-rr46.4%
Final simplification50.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(let* ((t_2 (/ (pow t_m 1.5) l_m)))
(*
t_s
(if (<= k 1.3e-24)
(/ 2.0 (pow (* t_2 (* k (sqrt 2.0))) 2.0))
(/
(/ 2.0 (* (* (sin k) (tan k)) (pow t_2 2.0)))
(+ 2.0 (* (/ k t_m) (/ k t_m))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double t_2 = pow(t_m, 1.5) / l_m;
double tmp;
if (k <= 1.3e-24) {
tmp = 2.0 / pow((t_2 * (k * sqrt(2.0))), 2.0);
} else {
tmp = (2.0 / ((sin(k) * tan(k)) * pow(t_2, 2.0))) / (2.0 + ((k / t_m) * (k / t_m)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = (t_m ** 1.5d0) / l_m
if (k <= 1.3d-24) then
tmp = 2.0d0 / ((t_2 * (k * sqrt(2.0d0))) ** 2.0d0)
else
tmp = (2.0d0 / ((sin(k) * tan(k)) * (t_2 ** 2.0d0))) / (2.0d0 + ((k / t_m) * (k / t_m)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double t_2 = Math.pow(t_m, 1.5) / l_m;
double tmp;
if (k <= 1.3e-24) {
tmp = 2.0 / Math.pow((t_2 * (k * Math.sqrt(2.0))), 2.0);
} else {
tmp = (2.0 / ((Math.sin(k) * Math.tan(k)) * Math.pow(t_2, 2.0))) / (2.0 + ((k / t_m) * (k / t_m)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): t_2 = math.pow(t_m, 1.5) / l_m tmp = 0 if k <= 1.3e-24: tmp = 2.0 / math.pow((t_2 * (k * math.sqrt(2.0))), 2.0) else: tmp = (2.0 / ((math.sin(k) * math.tan(k)) * math.pow(t_2, 2.0))) / (2.0 + ((k / t_m) * (k / t_m))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) t_2 = Float64((t_m ^ 1.5) / l_m) tmp = 0.0 if (k <= 1.3e-24) tmp = Float64(2.0 / (Float64(t_2 * Float64(k * sqrt(2.0))) ^ 2.0)); else tmp = Float64(Float64(2.0 / Float64(Float64(sin(k) * tan(k)) * (t_2 ^ 2.0))) / Float64(2.0 + Float64(Float64(k / t_m) * Float64(k / t_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) t_2 = (t_m ^ 1.5) / l_m; tmp = 0.0; if (k <= 1.3e-24) tmp = 2.0 / ((t_2 * (k * sqrt(2.0))) ^ 2.0); else tmp = (2.0 / ((sin(k) * tan(k)) * (t_2 ^ 2.0))) / (2.0 + ((k / t_m) * (k / t_m))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.3e-24], N[(2.0 / N[Power[N[(t$95$2 * N[(k * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{{t_m}^{1.5}}{l_m}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.3 \cdot 10^{-24}:\\
\;\;\;\;\frac{2}{{\left(t_2 \cdot \left(k \cdot \sqrt{2}\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\left(\sin k \cdot \tan k\right) \cdot {t_2}^{2}}}{2 + \frac{k}{t_m} \cdot \frac{k}{t_m}}\\
\end{array}
\end{array}
\end{array}
if k < 1.3e-24Initial program 52.6%
*-commutative52.6%
sqr-neg52.6%
*-commutative52.6%
associate-*l*52.6%
*-commutative52.6%
sqr-neg52.6%
Simplified52.6%
Taylor expanded in k around 0 52.4%
*-commutative52.4%
Simplified52.4%
add-sqr-sqrt29.2%
pow229.2%
Applied egg-rr29.3%
*-commutative29.3%
Simplified29.3%
Taylor expanded in k around 0 37.6%
if 1.3e-24 < k Initial program 48.3%
associate-/r*48.7%
sqr-neg48.7%
associate-*l*48.7%
sqr-neg48.7%
associate-/r*56.9%
associate-+l+56.9%
unpow256.9%
times-frac47.2%
sqr-neg47.2%
times-frac56.9%
unpow256.9%
Simplified56.9%
add-sqr-sqrt35.9%
pow235.9%
associate-/r*30.6%
sqrt-div30.6%
sqrt-pow133.8%
metadata-eval33.8%
sqrt-prod24.8%
add-sqr-sqrt44.3%
Applied egg-rr44.3%
unpow256.3%
Applied egg-rr44.3%
Final simplification39.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 6.4e+16)
(/ 2.0 (pow (* (/ (pow t_m 1.5) l_m) (* k (sqrt 2.0))) 2.0))
(/
2.0
(*
(* (tan k) (+ 2.0 (* (/ k t_m) (/ k t_m))))
(* (sin k) (/ (/ 1.0 (/ l_m (pow t_m 3.0))) l_m)))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 6.4e+16) {
tmp = 2.0 / pow(((pow(t_m, 1.5) / l_m) * (k * sqrt(2.0))), 2.0);
} else {
tmp = 2.0 / ((tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) * (sin(k) * ((1.0 / (l_m / pow(t_m, 3.0))) / l_m)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 6.4d+16) then
tmp = 2.0d0 / ((((t_m ** 1.5d0) / l_m) * (k * sqrt(2.0d0))) ** 2.0d0)
else
tmp = 2.0d0 / ((tan(k) * (2.0d0 + ((k / t_m) * (k / t_m)))) * (sin(k) * ((1.0d0 / (l_m / (t_m ** 3.0d0))) / l_m)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 6.4e+16) {
tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l_m) * (k * Math.sqrt(2.0))), 2.0);
} else {
tmp = 2.0 / ((Math.tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) * (Math.sin(k) * ((1.0 / (l_m / Math.pow(t_m, 3.0))) / l_m)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 6.4e+16: tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l_m) * (k * math.sqrt(2.0))), 2.0) else: tmp = 2.0 / ((math.tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) * (math.sin(k) * ((1.0 / (l_m / math.pow(t_m, 3.0))) / l_m))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 6.4e+16) tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l_m) * Float64(k * sqrt(2.0))) ^ 2.0)); else tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(2.0 + Float64(Float64(k / t_m) * Float64(k / t_m)))) * Float64(sin(k) * Float64(Float64(1.0 / Float64(l_m / (t_m ^ 3.0))) / l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 6.4e+16) tmp = 2.0 / ((((t_m ^ 1.5) / l_m) * (k * sqrt(2.0))) ^ 2.0); else tmp = 2.0 / ((tan(k) * (2.0 + ((k / t_m) * (k / t_m)))) * (sin(k) * ((1.0 / (l_m / (t_m ^ 3.0))) / l_m))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 6.4e+16], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(1.0 / N[(l$95$m / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 6.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t_m}^{1.5}}{l_m} \cdot \left(k \cdot \sqrt{2}\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + \frac{k}{t_m} \cdot \frac{k}{t_m}\right)\right) \cdot \left(\sin k \cdot \frac{\frac{1}{\frac{l_m}{{t_m}^{3}}}}{l_m}\right)}\\
\end{array}
\end{array}
if k < 6.4e16Initial program 51.0%
*-commutative51.0%
sqr-neg51.0%
*-commutative51.0%
associate-*l*51.0%
*-commutative51.0%
sqr-neg51.0%
Simplified51.0%
Taylor expanded in k around 0 51.0%
*-commutative51.0%
Simplified51.0%
add-sqr-sqrt28.4%
pow228.4%
Applied egg-rr28.5%
*-commutative28.5%
Simplified28.5%
Taylor expanded in k around 0 36.5%
if 6.4e16 < k Initial program 52.8%
associate-*l*52.8%
sqr-neg52.8%
sqr-neg52.8%
associate-/r*60.5%
distribute-rgt-in60.5%
unpow260.5%
times-frac49.2%
sqr-neg49.2%
times-frac60.5%
unpow260.5%
distribute-rgt-in60.5%
Simplified60.5%
clear-num60.5%
inv-pow60.5%
Applied egg-rr60.5%
unpow-160.5%
Simplified60.5%
unpow260.5%
Applied egg-rr60.5%
Final simplification42.3%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 1.92e+30)
(/ 2.0 (* (* 2.0 k) (/ (* (sin k) (/ (pow t_m 3.0) l_m)) l_m)))
(/ (/ (pow l_m 2.0) (pow k 2.0)) (pow t_m 3.0)))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 1.92e+30) {
tmp = 2.0 / ((2.0 * k) * ((sin(k) * (pow(t_m, 3.0) / l_m)) / l_m));
} else {
tmp = (pow(l_m, 2.0) / pow(k, 2.0)) / pow(t_m, 3.0);
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 1.92d+30) then
tmp = 2.0d0 / ((2.0d0 * k) * ((sin(k) * ((t_m ** 3.0d0) / l_m)) / l_m))
else
tmp = ((l_m ** 2.0d0) / (k ** 2.0d0)) / (t_m ** 3.0d0)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 1.92e+30) {
tmp = 2.0 / ((2.0 * k) * ((Math.sin(k) * (Math.pow(t_m, 3.0) / l_m)) / l_m));
} else {
tmp = (Math.pow(l_m, 2.0) / Math.pow(k, 2.0)) / Math.pow(t_m, 3.0);
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 1.92e+30: tmp = 2.0 / ((2.0 * k) * ((math.sin(k) * (math.pow(t_m, 3.0) / l_m)) / l_m)) else: tmp = (math.pow(l_m, 2.0) / math.pow(k, 2.0)) / math.pow(t_m, 3.0) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 1.92e+30) tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(Float64(sin(k) * Float64((t_m ^ 3.0) / l_m)) / l_m))); else tmp = Float64(Float64((l_m ^ 2.0) / (k ^ 2.0)) / (t_m ^ 3.0)); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 1.92e+30) tmp = 2.0 / ((2.0 * k) * ((sin(k) * ((t_m ^ 3.0) / l_m)) / l_m)); else tmp = ((l_m ^ 2.0) / (k ^ 2.0)) / (t_m ^ 3.0); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 1.92e+30], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.92 \cdot 10^{+30}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \frac{\sin k \cdot \frac{{t_m}^{3}}{l_m}}{l_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{l_m}^{2}}{{k}^{2}}}{{t_m}^{3}}\\
\end{array}
\end{array}
if k < 1.9200000000000001e30Initial program 52.4%
associate-*l*52.4%
sqr-neg52.4%
sqr-neg52.4%
associate-/r*58.2%
distribute-rgt-in58.2%
unpow258.2%
times-frac47.0%
sqr-neg47.0%
times-frac58.2%
unpow258.2%
distribute-rgt-in58.2%
Simplified58.2%
associate-/r*52.4%
unpow352.4%
times-frac61.4%
pow261.4%
Applied egg-rr61.4%
Taylor expanded in k around 0 57.6%
*-commutative57.6%
Simplified57.6%
associate-*r/57.5%
Applied egg-rr57.5%
associate-*l/59.4%
associate-*l/58.4%
unpow258.4%
unpow358.4%
Applied egg-rr58.4%
if 1.9200000000000001e30 < k Initial program 47.8%
associate-*l*47.8%
sqr-neg47.8%
sqr-neg47.8%
associate-/r*56.3%
distribute-rgt-in56.3%
unpow256.3%
times-frac43.8%
sqr-neg43.8%
times-frac56.3%
unpow256.3%
distribute-rgt-in56.3%
Simplified56.3%
add-cube-cbrt56.2%
pow356.2%
associate-/r*47.7%
cbrt-div47.6%
rem-cbrt-cube55.0%
cbrt-prod71.3%
pow271.3%
Applied egg-rr71.3%
Taylor expanded in k around 0 42.0%
associate-/r*42.1%
Simplified42.1%
Final simplification54.8%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (/ 2.0 (pow (* (/ (pow t_m 1.5) l_m) (* k (sqrt 2.0))) 2.0))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / pow(((pow(t_m, 1.5) / l_m) * (k * sqrt(2.0))), 2.0));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 / ((((t_m ** 1.5d0) / l_m) * (k * sqrt(2.0d0))) ** 2.0d0))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / Math.pow(((Math.pow(t_m, 1.5) / l_m) * (k * Math.sqrt(2.0))), 2.0));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 / math.pow(((math.pow(t_m, 1.5) / l_m) * (k * math.sqrt(2.0))), 2.0))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l_m) * Float64(k * sqrt(2.0))) ^ 2.0))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 / ((((t_m ^ 1.5) / l_m) * (k * sqrt(2.0))) ^ 2.0)); end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \frac{2}{{\left(\frac{{t_m}^{1.5}}{l_m} \cdot \left(k \cdot \sqrt{2}\right)\right)}^{2}}
\end{array}
Initial program 51.4%
*-commutative51.4%
sqr-neg51.4%
*-commutative51.4%
associate-*l*51.4%
*-commutative51.4%
sqr-neg51.4%
Simplified51.4%
Taylor expanded in k around 0 48.0%
*-commutative48.0%
Simplified48.0%
add-sqr-sqrt27.2%
pow227.2%
Applied egg-rr25.6%
*-commutative25.6%
Simplified25.6%
Taylor expanded in k around 0 36.3%
Final simplification36.3%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
:precision binary64
(*
t_s
(if (<= k 2.32e+30)
(/ 2.0 (* (* 2.0 k) (/ (* (sin k) (/ (pow t_m 3.0) l_m)) l_m)))
(/ 2.0 (* (* 2.0 k) (/ k (/ (pow l_m 2.0) (pow t_m 3.0))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 2.32e+30) {
tmp = 2.0 / ((2.0 * k) * ((sin(k) * (pow(t_m, 3.0) / l_m)) / l_m));
} else {
tmp = 2.0 / ((2.0 * k) * (k / (pow(l_m, 2.0) / pow(t_m, 3.0))));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2.32d+30) then
tmp = 2.0d0 / ((2.0d0 * k) * ((sin(k) * ((t_m ** 3.0d0) / l_m)) / l_m))
else
tmp = 2.0d0 / ((2.0d0 * k) * (k / ((l_m ** 2.0d0) / (t_m ** 3.0d0))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
double tmp;
if (k <= 2.32e+30) {
tmp = 2.0 / ((2.0 * k) * ((Math.sin(k) * (Math.pow(t_m, 3.0) / l_m)) / l_m));
} else {
tmp = 2.0 / ((2.0 * k) * (k / (Math.pow(l_m, 2.0) / Math.pow(t_m, 3.0))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): tmp = 0 if k <= 2.32e+30: tmp = 2.0 / ((2.0 * k) * ((math.sin(k) * (math.pow(t_m, 3.0) / l_m)) / l_m)) else: tmp = 2.0 / ((2.0 * k) * (k / (math.pow(l_m, 2.0) / math.pow(t_m, 3.0)))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) tmp = 0.0 if (k <= 2.32e+30) tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(Float64(sin(k) * Float64((t_m ^ 3.0) / l_m)) / l_m))); else tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(k / Float64((l_m ^ 2.0) / (t_m ^ 3.0))))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l_m, k) tmp = 0.0; if (k <= 2.32e+30) tmp = 2.0 / ((2.0 * k) * ((sin(k) * ((t_m ^ 3.0) / l_m)) / l_m)); else tmp = 2.0 / ((2.0 * k) * (k / ((l_m ^ 2.0) / (t_m ^ 3.0)))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 2.32e+30], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(k / N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 2.32 \cdot 10^{+30}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \frac{\sin k \cdot \frac{{t_m}^{3}}{l_m}}{l_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \frac{k}{\frac{{l_m}^{2}}{{t_m}^{3}}}}\\
\end{array}
\end{array}
if k < 2.32e30Initial program 52.4%
associate-*l*52.4%
sqr-neg52.4%
sqr-neg52.4%
associate-/r*58.2%
distribute-rgt-in58.2%
unpow258.2%
times-frac47.0%
sqr-neg47.0%
times-frac58.2%
unpow258.2%
distribute-rgt-in58.2%
Simplified58.2%
associate-/r*52.4%
unpow352.4%
times-frac61.4%
pow261.4%
Applied egg-rr61.4%
Taylor expanded in k around 0 57.6%
*-commutative57.6%
Simplified57.6%
associate-*r/57.5%
Applied egg-rr57.5%
associate-*l/59.4%
associate-*l/58.4%
unpow258.4%
unpow358.4%
Applied egg-rr58.4%
if 2.32e30 < k Initial program 47.8%
associate-*l*47.8%
sqr-neg47.8%
sqr-neg47.8%
associate-/r*56.3%
distribute-rgt-in56.3%
unpow256.3%
times-frac43.8%
sqr-neg43.8%
times-frac56.3%
unpow256.3%
distribute-rgt-in56.3%
Simplified56.3%
associate-/r*47.8%
unpow347.8%
times-frac63.2%
pow263.2%
Applied egg-rr63.2%
Taylor expanded in k around 0 39.5%
*-commutative39.5%
Simplified39.5%
associate-*r/39.5%
Applied egg-rr39.5%
Taylor expanded in k around 0 42.9%
associate-/l*42.9%
Simplified42.9%
Final simplification55.0%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (/ 2.0 (* (* 2.0 k) (/ k (/ (pow l_m 2.0) (pow t_m 3.0)))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / ((2.0 * k) * (k / (pow(l_m, 2.0) / pow(t_m, 3.0)))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 / ((2.0d0 * k) * (k / ((l_m ** 2.0d0) / (t_m ** 3.0d0)))))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / ((2.0 * k) * (k / (Math.pow(l_m, 2.0) / Math.pow(t_m, 3.0)))));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 / ((2.0 * k) * (k / (math.pow(l_m, 2.0) / math.pow(t_m, 3.0)))))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * k) * Float64(k / Float64((l_m ^ 2.0) / (t_m ^ 3.0)))))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 / ((2.0 * k) * (k / ((l_m ^ 2.0) / (t_m ^ 3.0))))); end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(k / N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \frac{2}{\left(2 \cdot k\right) \cdot \frac{k}{\frac{{l_m}^{2}}{{t_m}^{3}}}}
\end{array}
Initial program 51.4%
associate-*l*51.4%
sqr-neg51.4%
sqr-neg51.4%
associate-/r*57.8%
distribute-rgt-in57.8%
unpow257.8%
times-frac46.3%
sqr-neg46.3%
times-frac57.8%
unpow257.8%
distribute-rgt-in57.8%
Simplified57.8%
associate-/r*51.4%
unpow351.4%
times-frac61.8%
pow261.8%
Applied egg-rr61.8%
Taylor expanded in k around 0 53.6%
*-commutative53.6%
Simplified53.6%
associate-*r/53.6%
Applied egg-rr53.6%
Taylor expanded in k around 0 51.2%
associate-/l*50.8%
Simplified50.8%
Final simplification50.8%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l_m k) :precision binary64 (* t_s (/ 2.0 (* (* 2.0 k) (/ (* k (pow t_m 3.0)) (pow l_m 2.0))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / ((2.0 * k) * ((k * pow(t_m, 3.0)) / pow(l_m, 2.0))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = t_s * (2.0d0 / ((2.0d0 * k) * ((k * (t_m ** 3.0d0)) / (l_m ** 2.0d0))))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
return t_s * (2.0 / ((2.0 * k) * ((k * Math.pow(t_m, 3.0)) / Math.pow(l_m, 2.0))));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l_m, k): return t_s * (2.0 / ((2.0 * k) * ((k * math.pow(t_m, 3.0)) / math.pow(l_m, 2.0))))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l_m, k) return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * k) * Float64(Float64(k * (t_m ^ 3.0)) / (l_m ^ 2.0))))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l_m, k) tmp = t_s * (2.0 / ((2.0 * k) * ((k * (t_m ^ 3.0)) / (l_m ^ 2.0)))); end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \frac{2}{\left(2 \cdot k\right) \cdot \frac{k \cdot {t_m}^{3}}{{l_m}^{2}}}
\end{array}
Initial program 51.4%
associate-*l*51.4%
sqr-neg51.4%
sqr-neg51.4%
associate-/r*57.8%
distribute-rgt-in57.8%
unpow257.8%
times-frac46.3%
sqr-neg46.3%
times-frac57.8%
unpow257.8%
distribute-rgt-in57.8%
Simplified57.8%
associate-/r*51.4%
unpow351.4%
times-frac61.8%
pow261.8%
Applied egg-rr61.8%
Taylor expanded in k around 0 53.6%
*-commutative53.6%
Simplified53.6%
associate-*r/53.6%
Applied egg-rr53.6%
Taylor expanded in k around 0 51.2%
Final simplification51.2%
herbie shell --seed 2024018
(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))))