
(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}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (sqrt 2.0) (sin k))))
(*
t_s
(if (<= (* l l) 2e-277)
(pow (* (* (/ l k) t_2) (sqrt (/ 1.0 t_m))) 2.0)
(if (<= (* l l) 2e+243)
(/
(/ 2.0 (* (pow k 2.0) (pow l -2.0)))
(/ t_m (* (cos k) (pow (sin k) -2.0))))
(pow (* (/ l k) (* t_2 (sqrt (/ (cos k) t_m)))) 2.0))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sqrt(2.0) / sin(k);
double tmp;
if ((l * l) <= 2e-277) {
tmp = pow((((l / k) * t_2) * sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 2e+243) {
tmp = (2.0 / (pow(k, 2.0) * pow(l, -2.0))) / (t_m / (cos(k) * pow(sin(k), -2.0)));
} else {
tmp = pow(((l / k) * (t_2 * sqrt((cos(k) / t_m)))), 2.0);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = sqrt(2.0d0) / sin(k)
if ((l * l) <= 2d-277) then
tmp = (((l / k) * t_2) * sqrt((1.0d0 / t_m))) ** 2.0d0
else if ((l * l) <= 2d+243) then
tmp = (2.0d0 / ((k ** 2.0d0) * (l ** (-2.0d0)))) / (t_m / (cos(k) * (sin(k) ** (-2.0d0))))
else
tmp = ((l / k) * (t_2 * sqrt((cos(k) / t_m)))) ** 2.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = Math.sqrt(2.0) / Math.sin(k);
double tmp;
if ((l * l) <= 2e-277) {
tmp = Math.pow((((l / k) * t_2) * Math.sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 2e+243) {
tmp = (2.0 / (Math.pow(k, 2.0) * Math.pow(l, -2.0))) / (t_m / (Math.cos(k) * Math.pow(Math.sin(k), -2.0)));
} else {
tmp = Math.pow(((l / k) * (t_2 * Math.sqrt((Math.cos(k) / t_m)))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = math.sqrt(2.0) / math.sin(k) tmp = 0 if (l * l) <= 2e-277: tmp = math.pow((((l / k) * t_2) * math.sqrt((1.0 / t_m))), 2.0) elif (l * l) <= 2e+243: tmp = (2.0 / (math.pow(k, 2.0) * math.pow(l, -2.0))) / (t_m / (math.cos(k) * math.pow(math.sin(k), -2.0))) else: tmp = math.pow(((l / k) * (t_2 * math.sqrt((math.cos(k) / t_m)))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(sqrt(2.0) / sin(k)) tmp = 0.0 if (Float64(l * l) <= 2e-277) tmp = Float64(Float64(Float64(l / k) * t_2) * sqrt(Float64(1.0 / t_m))) ^ 2.0; elseif (Float64(l * l) <= 2e+243) tmp = Float64(Float64(2.0 / Float64((k ^ 2.0) * (l ^ -2.0))) / Float64(t_m / Float64(cos(k) * (sin(k) ^ -2.0)))); else tmp = Float64(Float64(l / k) * Float64(t_2 * sqrt(Float64(cos(k) / t_m)))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = sqrt(2.0) / sin(k); tmp = 0.0; if ((l * l) <= 2e-277) tmp = (((l / k) * t_2) * sqrt((1.0 / t_m))) ^ 2.0; elseif ((l * l) <= 2e+243) tmp = (2.0 / ((k ^ 2.0) * (l ^ -2.0))) / (t_m / (cos(k) * (sin(k) ^ -2.0))); else tmp = ((l / k) * (t_2 * sqrt((cos(k) / t_m)))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-277], N[Power[N[(N[(N[(l / k), $MachinePrecision] * t$95$2), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 2e+243], N[(N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m / N[(N[Cos[k], $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(l / k), $MachinePrecision] * N[(t$95$2 * N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{\sqrt{2}}{\sin k}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-277}:\\
\;\;\;\;{\left(\left(\frac{\ell}{k} \cdot t_2\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+243}:\\
\;\;\;\;\frac{\frac{2}{{k}^{2} \cdot {\ell}^{-2}}}{\frac{t_m}{\cos k \cdot {\sin k}^{-2}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\ell}{k} \cdot \left(t_2 \cdot \sqrt{\frac{\cos k}{t_m}}\right)\right)}^{2}\\
\end{array}
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999994e-277Initial program 31.5%
associate-/r*31.5%
*-commutative31.5%
associate-*l*31.5%
associate-*l/31.5%
+-commutative31.5%
unpow231.5%
sqr-neg31.5%
distribute-frac-neg31.5%
distribute-frac-neg31.5%
unpow231.5%
associate--l+44.7%
metadata-eval44.7%
+-rgt-identity44.7%
unpow244.7%
distribute-frac-neg44.7%
distribute-frac-neg44.7%
Simplified44.7%
Applied egg-rr31.4%
Taylor expanded in k around inf 54.0%
times-frac55.1%
Simplified55.1%
Taylor expanded in k around 0 44.4%
if 1.99999999999999994e-277 < (*.f64 l l) < 2.0000000000000001e243Initial program 31.8%
Taylor expanded in t around 0 89.4%
times-frac91.0%
associate-/l*91.0%
Simplified91.0%
frac-times88.8%
div-inv88.8%
pow-flip88.8%
metadata-eval88.8%
Applied egg-rr88.8%
times-frac90.9%
Simplified90.9%
expm1-log1p-u65.5%
expm1-udef52.8%
div-inv52.8%
pow-flip52.8%
metadata-eval52.8%
Applied egg-rr52.8%
expm1-def65.5%
expm1-log1p90.9%
associate-/r*91.1%
Simplified91.1%
if 2.0000000000000001e243 < (*.f64 l l) Initial program 39.5%
associate-/r*39.5%
*-commutative39.5%
associate-*l*39.5%
associate-*l/39.5%
+-commutative39.5%
unpow239.5%
sqr-neg39.5%
distribute-frac-neg39.5%
distribute-frac-neg39.5%
unpow239.5%
associate--l+39.5%
metadata-eval39.5%
+-rgt-identity39.5%
unpow239.5%
distribute-frac-neg39.5%
distribute-frac-neg39.5%
Simplified39.5%
Applied egg-rr21.9%
Taylor expanded in k around inf 36.0%
times-frac36.0%
Simplified36.0%
pow136.0%
associate-*l*36.1%
Applied egg-rr36.1%
Final simplification61.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<=
(*
(* (* (sin k) (/ (pow t_m 3.0) (* l l))) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) -1.0))
INFINITY)
(*
(/ (/ 2.0 (sin k)) (/ (/ (pow t_m 3.0) l) (/ l (tan k))))
(pow (/ k t_m) -2.0))
(pow (* (* (/ l k) (/ (sqrt 2.0) (sin k))) (sqrt (/ 1.0 t_m))) 2.0))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((((sin(k) * (pow(t_m, 3.0) / (l * l))) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + -1.0)) <= ((double) INFINITY)) {
tmp = ((2.0 / sin(k)) / ((pow(t_m, 3.0) / l) / (l / tan(k)))) * pow((k / t_m), -2.0);
} else {
tmp = pow((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))), 2.0);
}
return t_s * tmp;
}
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((((Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l))) * Math.tan(k)) * ((1.0 + Math.pow((k / t_m), 2.0)) + -1.0)) <= Double.POSITIVE_INFINITY) {
tmp = ((2.0 / Math.sin(k)) / ((Math.pow(t_m, 3.0) / l) / (l / Math.tan(k)))) * Math.pow((k / t_m), -2.0);
} else {
tmp = Math.pow((((l / k) * (Math.sqrt(2.0) / Math.sin(k))) * Math.sqrt((1.0 / t_m))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (((math.sin(k) * (math.pow(t_m, 3.0) / (l * l))) * math.tan(k)) * ((1.0 + math.pow((k / t_m), 2.0)) + -1.0)) <= math.inf: tmp = ((2.0 / math.sin(k)) / ((math.pow(t_m, 3.0) / l) / (l / math.tan(k)))) * math.pow((k / t_m), -2.0) else: tmp = math.pow((((l / k) * (math.sqrt(2.0) / math.sin(k))) * math.sqrt((1.0 / t_m))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(Float64(Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l))) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t_m) ^ 2.0)) + -1.0)) <= Inf) tmp = Float64(Float64(Float64(2.0 / sin(k)) / Float64(Float64((t_m ^ 3.0) / l) / Float64(l / tan(k)))) * (Float64(k / t_m) ^ -2.0)); else tmp = Float64(Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) * sqrt(Float64(1.0 / t_m))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((((sin(k) * ((t_m ^ 3.0) / (l * l))) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) + -1.0)) <= Inf) tmp = ((2.0 / sin(k)) / (((t_m ^ 3.0) / l) / (l / tan(k)))) * ((k / t_m) ^ -2.0); else tmp = (((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[N[(N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(2.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(k / t$95$m), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(\sin k \cdot \frac{{t_m}^{3}}{\ell \cdot \ell}\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t_m}\right)}^{2}\right) + -1\right) \leq \infty:\\
\;\;\;\;\frac{\frac{2}{\sin k}}{\frac{\frac{{t_m}^{3}}{\ell}}{\frac{\ell}{\tan k}}} \cdot {\left(\frac{k}{t_m}\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\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)) < +inf.0Initial program 87.4%
associate-/r*87.5%
*-commutative87.5%
associate-*l*87.5%
associate-*l/87.5%
+-commutative87.5%
unpow287.5%
sqr-neg87.5%
distribute-frac-neg87.5%
distribute-frac-neg87.5%
unpow287.5%
associate--l+91.3%
metadata-eval91.3%
+-rgt-identity91.3%
unpow291.3%
distribute-frac-neg91.3%
distribute-frac-neg91.3%
Simplified91.3%
times-frac95.1%
Applied egg-rr95.1%
associate-*r/95.1%
Applied egg-rr95.1%
pow295.1%
div-inv95.1%
associate-/r*95.1%
associate-/l*95.1%
pow295.1%
pow-flip96.5%
metadata-eval96.5%
Applied egg-rr96.5%
if +inf.0 < (*.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 0.0%
associate-/r*0.0%
*-commutative0.0%
associate-*l*0.0%
associate-*l/0.0%
+-commutative0.0%
unpow20.0%
sqr-neg0.0%
distribute-frac-neg0.0%
distribute-frac-neg0.0%
unpow20.0%
associate--l+13.2%
metadata-eval13.2%
+-rgt-identity13.2%
unpow213.2%
distribute-frac-neg13.2%
distribute-frac-neg13.2%
Simplified13.2%
Applied egg-rr20.0%
Taylor expanded in k around inf 48.1%
times-frac48.7%
Simplified48.7%
Taylor expanded in k around 0 31.2%
Final simplification56.4%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= (* l l) 2e-277)
(pow (* (* (/ l k) (/ (sqrt 2.0) (sin k))) (sqrt (/ 1.0 t_m))) 2.0)
(if (<= (* l l) 5e+231)
(*
2.0
(* (/ (pow l 2.0) (pow k 2.0)) (/ (cos k) (* t_m (pow (sin k) 2.0)))))
(pow
(* (sqrt (/ (cos k) t_m)) (/ (* l (sqrt 2.0)) (* k (sin k))))
2.0)))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-277) {
tmp = pow((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 5e+231) {
tmp = 2.0 * ((pow(l, 2.0) / pow(k, 2.0)) * (cos(k) / (t_m * pow(sin(k), 2.0))));
} else {
tmp = pow((sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d-277) then
tmp = (((l / k) * (sqrt(2.0d0) / sin(k))) * sqrt((1.0d0 / t_m))) ** 2.0d0
else if ((l * l) <= 5d+231) then
tmp = 2.0d0 * (((l ** 2.0d0) / (k ** 2.0d0)) * (cos(k) / (t_m * (sin(k) ** 2.0d0))))
else
tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0d0)) / (k * sin(k)))) ** 2.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-277) {
tmp = Math.pow((((l / k) * (Math.sqrt(2.0) / Math.sin(k))) * Math.sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 5e+231) {
tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 2.0)) * (Math.cos(k) / (t_m * Math.pow(Math.sin(k), 2.0))));
} else {
tmp = Math.pow((Math.sqrt((Math.cos(k) / t_m)) * ((l * Math.sqrt(2.0)) / (k * Math.sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (l * l) <= 2e-277: tmp = math.pow((((l / k) * (math.sqrt(2.0) / math.sin(k))) * math.sqrt((1.0 / t_m))), 2.0) elif (l * l) <= 5e+231: tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k, 2.0)) * (math.cos(k) / (t_m * math.pow(math.sin(k), 2.0)))) else: tmp = math.pow((math.sqrt((math.cos(k) / t_m)) * ((l * math.sqrt(2.0)) / (k * math.sin(k)))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(l * l) <= 2e-277) tmp = Float64(Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) * sqrt(Float64(1.0 / t_m))) ^ 2.0; elseif (Float64(l * l) <= 5e+231) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 2.0)) * Float64(cos(k) / Float64(t_m * (sin(k) ^ 2.0))))); else tmp = Float64(sqrt(Float64(cos(k) / t_m)) * Float64(Float64(l * sqrt(2.0)) / Float64(k * sin(k)))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((l * l) <= 2e-277) tmp = (((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))) ^ 2.0; elseif ((l * l) <= 5e+231) tmp = 2.0 * (((l ^ 2.0) / (k ^ 2.0)) * (cos(k) / (t_m * (sin(k) ^ 2.0)))); else tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-277], N[Power[N[(N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+231], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-277}:\\
\;\;\;\;{\left(\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+231}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k}^{2}} \cdot \frac{\cos k}{t_m \cdot {\sin k}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\frac{\cos k}{t_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k \cdot \sin k}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999994e-277Initial program 31.5%
associate-/r*31.5%
*-commutative31.5%
associate-*l*31.5%
associate-*l/31.5%
+-commutative31.5%
unpow231.5%
sqr-neg31.5%
distribute-frac-neg31.5%
distribute-frac-neg31.5%
unpow231.5%
associate--l+44.7%
metadata-eval44.7%
+-rgt-identity44.7%
unpow244.7%
distribute-frac-neg44.7%
distribute-frac-neg44.7%
Simplified44.7%
Applied egg-rr31.4%
Taylor expanded in k around inf 54.0%
times-frac55.1%
Simplified55.1%
Taylor expanded in k around 0 44.4%
if 1.99999999999999994e-277 < (*.f64 l l) < 5.00000000000000028e231Initial program 32.1%
associate-/r*32.3%
*-commutative32.3%
associate-*l*32.3%
associate-*l/32.3%
+-commutative32.3%
unpow232.3%
sqr-neg32.3%
distribute-frac-neg32.3%
distribute-frac-neg32.3%
unpow232.3%
associate--l+45.4%
metadata-eval45.4%
+-rgt-identity45.4%
unpow245.4%
distribute-frac-neg45.4%
distribute-frac-neg45.4%
Simplified45.4%
Taylor expanded in k around inf 89.3%
times-frac91.0%
Simplified91.0%
if 5.00000000000000028e231 < (*.f64 l l) Initial program 38.9%
associate-/r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*l/38.9%
+-commutative38.9%
unpow238.9%
sqr-neg38.9%
distribute-frac-neg38.9%
distribute-frac-neg38.9%
unpow238.9%
associate--l+38.9%
metadata-eval38.9%
+-rgt-identity38.9%
unpow238.9%
distribute-frac-neg38.9%
distribute-frac-neg38.9%
Simplified38.9%
Applied egg-rr21.6%
Taylor expanded in k around inf 36.9%
Final simplification61.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= (* l l) 2e-277)
(pow (* (* (/ l k) (/ (sqrt 2.0) (sin k))) (sqrt (/ 1.0 t_m))) 2.0)
(if (<= (* l l) 2e+243)
(/
(/ 2.0 (* (pow k 2.0) (pow l -2.0)))
(/ t_m (* (cos k) (pow (sin k) -2.0))))
(pow
(* (sqrt (/ (cos k) t_m)) (/ (* l (sqrt 2.0)) (* k (sin k))))
2.0)))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-277) {
tmp = pow((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 2e+243) {
tmp = (2.0 / (pow(k, 2.0) * pow(l, -2.0))) / (t_m / (cos(k) * pow(sin(k), -2.0)));
} else {
tmp = pow((sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d-277) then
tmp = (((l / k) * (sqrt(2.0d0) / sin(k))) * sqrt((1.0d0 / t_m))) ** 2.0d0
else if ((l * l) <= 2d+243) then
tmp = (2.0d0 / ((k ** 2.0d0) * (l ** (-2.0d0)))) / (t_m / (cos(k) * (sin(k) ** (-2.0d0))))
else
tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0d0)) / (k * sin(k)))) ** 2.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-277) {
tmp = Math.pow((((l / k) * (Math.sqrt(2.0) / Math.sin(k))) * Math.sqrt((1.0 / t_m))), 2.0);
} else if ((l * l) <= 2e+243) {
tmp = (2.0 / (Math.pow(k, 2.0) * Math.pow(l, -2.0))) / (t_m / (Math.cos(k) * Math.pow(Math.sin(k), -2.0)));
} else {
tmp = Math.pow((Math.sqrt((Math.cos(k) / t_m)) * ((l * Math.sqrt(2.0)) / (k * Math.sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (l * l) <= 2e-277: tmp = math.pow((((l / k) * (math.sqrt(2.0) / math.sin(k))) * math.sqrt((1.0 / t_m))), 2.0) elif (l * l) <= 2e+243: tmp = (2.0 / (math.pow(k, 2.0) * math.pow(l, -2.0))) / (t_m / (math.cos(k) * math.pow(math.sin(k), -2.0))) else: tmp = math.pow((math.sqrt((math.cos(k) / t_m)) * ((l * math.sqrt(2.0)) / (k * math.sin(k)))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(l * l) <= 2e-277) tmp = Float64(Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) * sqrt(Float64(1.0 / t_m))) ^ 2.0; elseif (Float64(l * l) <= 2e+243) tmp = Float64(Float64(2.0 / Float64((k ^ 2.0) * (l ^ -2.0))) / Float64(t_m / Float64(cos(k) * (sin(k) ^ -2.0)))); else tmp = Float64(sqrt(Float64(cos(k) / t_m)) * Float64(Float64(l * sqrt(2.0)) / Float64(k * sin(k)))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((l * l) <= 2e-277) tmp = (((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))) ^ 2.0; elseif ((l * l) <= 2e+243) tmp = (2.0 / ((k ^ 2.0) * (l ^ -2.0))) / (t_m / (cos(k) * (sin(k) ^ -2.0))); else tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-277], N[Power[N[(N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 2e+243], N[(N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m / N[(N[Cos[k], $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-277}:\\
\;\;\;\;{\left(\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+243}:\\
\;\;\;\;\frac{\frac{2}{{k}^{2} \cdot {\ell}^{-2}}}{\frac{t_m}{\cos k \cdot {\sin k}^{-2}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\frac{\cos k}{t_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k \cdot \sin k}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999994e-277Initial program 31.5%
associate-/r*31.5%
*-commutative31.5%
associate-*l*31.5%
associate-*l/31.5%
+-commutative31.5%
unpow231.5%
sqr-neg31.5%
distribute-frac-neg31.5%
distribute-frac-neg31.5%
unpow231.5%
associate--l+44.7%
metadata-eval44.7%
+-rgt-identity44.7%
unpow244.7%
distribute-frac-neg44.7%
distribute-frac-neg44.7%
Simplified44.7%
Applied egg-rr31.4%
Taylor expanded in k around inf 54.0%
times-frac55.1%
Simplified55.1%
Taylor expanded in k around 0 44.4%
if 1.99999999999999994e-277 < (*.f64 l l) < 2.0000000000000001e243Initial program 31.8%
Taylor expanded in t around 0 89.4%
times-frac91.0%
associate-/l*91.0%
Simplified91.0%
frac-times88.8%
div-inv88.8%
pow-flip88.8%
metadata-eval88.8%
Applied egg-rr88.8%
times-frac90.9%
Simplified90.9%
expm1-log1p-u65.5%
expm1-udef52.8%
div-inv52.8%
pow-flip52.8%
metadata-eval52.8%
Applied egg-rr52.8%
expm1-def65.5%
expm1-log1p90.9%
associate-/r*91.1%
Simplified91.1%
if 2.0000000000000001e243 < (*.f64 l l) Initial program 39.5%
associate-/r*39.5%
*-commutative39.5%
associate-*l*39.5%
associate-*l/39.5%
+-commutative39.5%
unpow239.5%
sqr-neg39.5%
distribute-frac-neg39.5%
distribute-frac-neg39.5%
unpow239.5%
associate--l+39.5%
metadata-eval39.5%
+-rgt-identity39.5%
unpow239.5%
distribute-frac-neg39.5%
distribute-frac-neg39.5%
Simplified39.5%
Applied egg-rr21.9%
Taylor expanded in k around inf 36.0%
Final simplification61.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (/ l k) (/ (sqrt 2.0) (sin k)))))
(*
t_s
(if (<= (* l l) 2e-12)
(pow (* t_2 (sqrt (/ 1.0 t_m))) 2.0)
(pow (* t_2 (sqrt (/ (cos k) t_m))) 2.0)))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = (l / k) * (sqrt(2.0) / sin(k));
double tmp;
if ((l * l) <= 2e-12) {
tmp = pow((t_2 * sqrt((1.0 / t_m))), 2.0);
} else {
tmp = pow((t_2 * sqrt((cos(k) / t_m))), 2.0);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = (l / k) * (sqrt(2.0d0) / sin(k))
if ((l * l) <= 2d-12) then
tmp = (t_2 * sqrt((1.0d0 / t_m))) ** 2.0d0
else
tmp = (t_2 * sqrt((cos(k) / t_m))) ** 2.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = (l / k) * (Math.sqrt(2.0) / Math.sin(k));
double tmp;
if ((l * l) <= 2e-12) {
tmp = Math.pow((t_2 * Math.sqrt((1.0 / t_m))), 2.0);
} else {
tmp = Math.pow((t_2 * Math.sqrt((Math.cos(k) / t_m))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = (l / k) * (math.sqrt(2.0) / math.sin(k)) tmp = 0 if (l * l) <= 2e-12: tmp = math.pow((t_2 * math.sqrt((1.0 / t_m))), 2.0) else: tmp = math.pow((t_2 * math.sqrt((math.cos(k) / t_m))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) tmp = 0.0 if (Float64(l * l) <= 2e-12) tmp = Float64(t_2 * sqrt(Float64(1.0 / t_m))) ^ 2.0; else tmp = Float64(t_2 * sqrt(Float64(cos(k) / t_m))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = (l / k) * (sqrt(2.0) / sin(k)); tmp = 0.0; if ((l * l) <= 2e-12) tmp = (t_2 * sqrt((1.0 / t_m))) ^ 2.0; else tmp = (t_2 * sqrt((cos(k) / t_m))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := Block[{t$95$2 = N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-12], N[Power[N[(t$95$2 * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(t$95$2 * N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-12}:\\
\;\;\;\;{\left(t_2 \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(t_2 \cdot \sqrt{\frac{\cos k}{t_m}}\right)}^{2}\\
\end{array}
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999996e-12Initial program 32.4%
associate-/r*32.4%
*-commutative32.4%
associate-*l*32.4%
associate-*l/32.4%
+-commutative32.4%
unpow232.4%
sqr-neg32.4%
distribute-frac-neg32.4%
distribute-frac-neg32.4%
unpow232.4%
associate--l+45.4%
metadata-eval45.4%
+-rgt-identity45.4%
unpow245.4%
distribute-frac-neg45.4%
distribute-frac-neg45.4%
Simplified45.4%
Applied egg-rr27.1%
Taylor expanded in k around inf 50.6%
times-frac51.3%
Simplified51.3%
Taylor expanded in k around 0 40.7%
if 1.99999999999999996e-12 < (*.f64 l l) Initial program 35.2%
associate-/r*35.3%
*-commutative35.3%
associate-*l*35.3%
associate-*l/35.3%
+-commutative35.3%
unpow235.3%
sqr-neg35.3%
distribute-frac-neg35.3%
distribute-frac-neg35.3%
unpow235.3%
associate--l+41.3%
metadata-eval41.3%
+-rgt-identity41.3%
unpow241.3%
distribute-frac-neg41.3%
distribute-frac-neg41.3%
Simplified41.3%
Applied egg-rr26.2%
Taylor expanded in k around inf 44.0%
times-frac44.0%
Simplified44.0%
Final simplification42.3%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= (* l l) 2e-12)
(pow (* (* (/ l k) (/ (sqrt 2.0) (sin k))) (sqrt (/ 1.0 t_m))) 2.0)
(pow (* (sqrt (/ (cos k) t_m)) (/ (* l (sqrt 2.0)) (* k (sin k)))) 2.0))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-12) {
tmp = pow((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))), 2.0);
} else {
tmp = pow((sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d-12) then
tmp = (((l / k) * (sqrt(2.0d0) / sin(k))) * sqrt((1.0d0 / t_m))) ** 2.0d0
else
tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0d0)) / (k * sin(k)))) ** 2.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((l * l) <= 2e-12) {
tmp = Math.pow((((l / k) * (Math.sqrt(2.0) / Math.sin(k))) * Math.sqrt((1.0 / t_m))), 2.0);
} else {
tmp = Math.pow((Math.sqrt((Math.cos(k) / t_m)) * ((l * Math.sqrt(2.0)) / (k * Math.sin(k)))), 2.0);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (l * l) <= 2e-12: tmp = math.pow((((l / k) * (math.sqrt(2.0) / math.sin(k))) * math.sqrt((1.0 / t_m))), 2.0) else: tmp = math.pow((math.sqrt((math.cos(k) / t_m)) * ((l * math.sqrt(2.0)) / (k * math.sin(k)))), 2.0) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(l * l) <= 2e-12) tmp = Float64(Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) * sqrt(Float64(1.0 / t_m))) ^ 2.0; else tmp = Float64(sqrt(Float64(cos(k) / t_m)) * Float64(Float64(l * sqrt(2.0)) / Float64(k * sin(k)))) ^ 2.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((l * l) <= 2e-12) tmp = (((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))) ^ 2.0; else tmp = (sqrt((cos(k) / t_m)) * ((l * sqrt(2.0)) / (k * sin(k)))) ^ 2.0; end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-12], N[Power[N[(N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(N[Sqrt[N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-12}:\\
\;\;\;\;{\left(\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\frac{\cos k}{t_m}} \cdot \frac{\ell \cdot \sqrt{2}}{k \cdot \sin k}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999999999996e-12Initial program 32.4%
associate-/r*32.4%
*-commutative32.4%
associate-*l*32.4%
associate-*l/32.4%
+-commutative32.4%
unpow232.4%
sqr-neg32.4%
distribute-frac-neg32.4%
distribute-frac-neg32.4%
unpow232.4%
associate--l+45.4%
metadata-eval45.4%
+-rgt-identity45.4%
unpow245.4%
distribute-frac-neg45.4%
distribute-frac-neg45.4%
Simplified45.4%
Applied egg-rr27.1%
Taylor expanded in k around inf 50.6%
times-frac51.3%
Simplified51.3%
Taylor expanded in k around 0 40.7%
if 1.99999999999999996e-12 < (*.f64 l l) Initial program 35.2%
associate-/r*35.3%
*-commutative35.3%
associate-*l*35.3%
associate-*l/35.3%
+-commutative35.3%
unpow235.3%
sqr-neg35.3%
distribute-frac-neg35.3%
distribute-frac-neg35.3%
unpow235.3%
associate--l+41.3%
metadata-eval41.3%
+-rgt-identity41.3%
unpow241.3%
distribute-frac-neg41.3%
distribute-frac-neg41.3%
Simplified41.3%
Applied egg-rr26.2%
Taylor expanded in k around inf 44.0%
Final simplification42.3%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (pow (* (* (/ l k) (/ (sqrt 2.0) (sin k))) (sqrt (/ 1.0 t_m))) 2.0)))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * pow((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))), 2.0);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((((l / k) * (sqrt(2.0d0) / sin(k))) * sqrt((1.0d0 / t_m))) ** 2.0d0)
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * Math.pow((((l / k) * (Math.sqrt(2.0) / Math.sin(k))) * Math.sqrt((1.0 / t_m))), 2.0);
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * math.pow((((l / k) * (math.sqrt(2.0) / math.sin(k))) * math.sqrt((1.0 / t_m))), 2.0)
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * (Float64(Float64(Float64(l / k) * Float64(sqrt(2.0) / sin(k))) * sqrt(Float64(1.0 / t_m))) ^ 2.0)) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((((l / k) * (sqrt(2.0) / sin(k))) * sqrt((1.0 / t_m))) ^ 2.0); end
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_, k_] := N[(t$95$s * N[Power[N[(N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot {\left(\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{\sin k}\right) \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}
\end{array}
Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-*l*33.8%
associate-*l/33.8%
+-commutative33.8%
unpow233.8%
sqr-neg33.8%
distribute-frac-neg33.8%
distribute-frac-neg33.8%
unpow233.8%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
unpow243.4%
distribute-frac-neg43.4%
distribute-frac-neg43.4%
Simplified43.4%
Applied egg-rr26.7%
Taylor expanded in k around inf 47.4%
times-frac47.7%
Simplified47.7%
Taylor expanded in k around 0 34.3%
Final simplification34.3%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (pow (* (sqrt (/ 1.0 t_m)) (/ l (/ (pow k 2.0) (sqrt 2.0)))) 2.0)))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * pow((sqrt((1.0 / t_m)) * (l / (pow(k, 2.0) / sqrt(2.0)))), 2.0);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((sqrt((1.0d0 / t_m)) * (l / ((k ** 2.0d0) / sqrt(2.0d0)))) ** 2.0d0)
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * Math.pow((Math.sqrt((1.0 / t_m)) * (l / (Math.pow(k, 2.0) / Math.sqrt(2.0)))), 2.0);
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * math.pow((math.sqrt((1.0 / t_m)) * (l / (math.pow(k, 2.0) / math.sqrt(2.0)))), 2.0)
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * (Float64(sqrt(Float64(1.0 / t_m)) * Float64(l / Float64((k ^ 2.0) / sqrt(2.0)))) ^ 2.0)) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((sqrt((1.0 / t_m)) * (l / ((k ^ 2.0) / sqrt(2.0)))) ^ 2.0); end
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_, k_] := N[(t$95$s * N[Power[N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(l / N[(N[Power[k, 2.0], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot {\left(\sqrt{\frac{1}{t_m}} \cdot \frac{\ell}{\frac{{k}^{2}}{\sqrt{2}}}\right)}^{2}
\end{array}
Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-*l*33.8%
associate-*l/33.8%
+-commutative33.8%
unpow233.8%
sqr-neg33.8%
distribute-frac-neg33.8%
distribute-frac-neg33.8%
unpow233.8%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
unpow243.4%
distribute-frac-neg43.4%
distribute-frac-neg43.4%
Simplified43.4%
Applied egg-rr26.7%
Taylor expanded in k around 0 33.1%
associate-/l*33.1%
Simplified33.1%
Final simplification33.1%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (pow (* (sqrt (/ 1.0 t_m)) (/ (* l (sqrt 2.0)) (pow k 2.0))) 2.0)))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * pow((sqrt((1.0 / t_m)) * ((l * sqrt(2.0)) / pow(k, 2.0))), 2.0);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((sqrt((1.0d0 / t_m)) * ((l * sqrt(2.0d0)) / (k ** 2.0d0))) ** 2.0d0)
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * Math.pow((Math.sqrt((1.0 / t_m)) * ((l * Math.sqrt(2.0)) / Math.pow(k, 2.0))), 2.0);
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * math.pow((math.sqrt((1.0 / t_m)) * ((l * math.sqrt(2.0)) / math.pow(k, 2.0))), 2.0)
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * (Float64(sqrt(Float64(1.0 / t_m)) * Float64(Float64(l * sqrt(2.0)) / (k ^ 2.0))) ^ 2.0)) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((sqrt((1.0 / t_m)) * ((l * sqrt(2.0)) / (k ^ 2.0))) ^ 2.0); end
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_, k_] := N[(t$95$s * N[Power[N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot {\left(\sqrt{\frac{1}{t_m}} \cdot \frac{\ell \cdot \sqrt{2}}{{k}^{2}}\right)}^{2}
\end{array}
Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-*l*33.8%
associate-*l/33.8%
+-commutative33.8%
unpow233.8%
sqr-neg33.8%
distribute-frac-neg33.8%
distribute-frac-neg33.8%
unpow233.8%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
unpow243.4%
distribute-frac-neg43.4%
distribute-frac-neg43.4%
Simplified43.4%
Applied egg-rr26.7%
Taylor expanded in k around 0 33.1%
Final simplification33.1%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 8.8e-212)
(* 2.0 (/ (* (pow l 2.0) (pow k -4.0)) t_m))
(if (<= t_m 0.002)
(pow (/ (/ (sqrt 2.0) (/ k t_m)) (* k (/ (pow t_m 1.5) l))) 2.0)
(if (<= t_m 5.5e+102)
(/
2.0
(*
(* (tan k) (* (sin k) (/ (/ (pow t_m 3.0) l) l)))
(* (/ k t_m) (/ k t_m))))
(/ 2.0 (* (/ (pow k 2.0) (pow l 2.0)) (* t_m (pow k 2.0)))))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 8.8e-212) {
tmp = 2.0 * ((pow(l, 2.0) * pow(k, -4.0)) / t_m);
} else if (t_m <= 0.002) {
tmp = pow(((sqrt(2.0) / (k / t_m)) / (k * (pow(t_m, 1.5) / l))), 2.0);
} else if (t_m <= 5.5e+102) {
tmp = 2.0 / ((tan(k) * (sin(k) * ((pow(t_m, 3.0) / l) / l))) * ((k / t_m) * (k / t_m)));
} else {
tmp = 2.0 / ((pow(k, 2.0) / pow(l, 2.0)) * (t_m * pow(k, 2.0)));
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 8.8d-212) then
tmp = 2.0d0 * (((l ** 2.0d0) * (k ** (-4.0d0))) / t_m)
else if (t_m <= 0.002d0) then
tmp = ((sqrt(2.0d0) / (k / t_m)) / (k * ((t_m ** 1.5d0) / l))) ** 2.0d0
else if (t_m <= 5.5d+102) then
tmp = 2.0d0 / ((tan(k) * (sin(k) * (((t_m ** 3.0d0) / l) / l))) * ((k / t_m) * (k / t_m)))
else
tmp = 2.0d0 / (((k ** 2.0d0) / (l ** 2.0d0)) * (t_m * (k ** 2.0d0)))
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 8.8e-212) {
tmp = 2.0 * ((Math.pow(l, 2.0) * Math.pow(k, -4.0)) / t_m);
} else if (t_m <= 0.002) {
tmp = Math.pow(((Math.sqrt(2.0) / (k / t_m)) / (k * (Math.pow(t_m, 1.5) / l))), 2.0);
} else if (t_m <= 5.5e+102) {
tmp = 2.0 / ((Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 3.0) / l) / l))) * ((k / t_m) * (k / t_m)));
} else {
tmp = 2.0 / ((Math.pow(k, 2.0) / Math.pow(l, 2.0)) * (t_m * Math.pow(k, 2.0)));
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 8.8e-212: tmp = 2.0 * ((math.pow(l, 2.0) * math.pow(k, -4.0)) / t_m) elif t_m <= 0.002: tmp = math.pow(((math.sqrt(2.0) / (k / t_m)) / (k * (math.pow(t_m, 1.5) / l))), 2.0) elif t_m <= 5.5e+102: tmp = 2.0 / ((math.tan(k) * (math.sin(k) * ((math.pow(t_m, 3.0) / l) / l))) * ((k / t_m) * (k / t_m))) else: tmp = 2.0 / ((math.pow(k, 2.0) / math.pow(l, 2.0)) * (t_m * math.pow(k, 2.0))) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 8.8e-212) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) * (k ^ -4.0)) / t_m)); elseif (t_m <= 0.002) tmp = Float64(Float64(sqrt(2.0) / Float64(k / t_m)) / Float64(k * Float64((t_m ^ 1.5) / l))) ^ 2.0; elseif (t_m <= 5.5e+102) tmp = Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 3.0) / l) / l))) * Float64(Float64(k / t_m) * Float64(k / t_m)))); else tmp = Float64(2.0 / Float64(Float64((k ^ 2.0) / (l ^ 2.0)) * Float64(t_m * (k ^ 2.0)))); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 8.8e-212) tmp = 2.0 * (((l ^ 2.0) * (k ^ -4.0)) / t_m); elseif (t_m <= 0.002) tmp = ((sqrt(2.0) / (k / t_m)) / (k * ((t_m ^ 1.5) / l))) ^ 2.0; elseif (t_m <= 5.5e+102) tmp = 2.0 / ((tan(k) * (sin(k) * (((t_m ^ 3.0) / l) / l))) * ((k / t_m) * (k / t_m))); else tmp = 2.0 / (((k ^ 2.0) / (l ^ 2.0)) * (t_m * (k ^ 2.0))); end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 8.8e-212], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 0.002], N[Power[N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[t$95$m, 5.5e+102], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 8.8 \cdot 10^{-212}:\\
\;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t_m}\\
\mathbf{elif}\;t_m \leq 0.002:\\
\;\;\;\;{\left(\frac{\frac{\sqrt{2}}{\frac{k}{t_m}}}{k \cdot \frac{{t_m}^{1.5}}{\ell}}\right)}^{2}\\
\mathbf{elif}\;t_m \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{\frac{{t_m}^{3}}{\ell}}{\ell}\right)\right) \cdot \left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \left(t_m \cdot {k}^{2}\right)}\\
\end{array}
\end{array}
if t < 8.80000000000000012e-212Initial program 32.8%
associate-/r*32.8%
*-commutative32.8%
associate-*l*32.8%
associate-*l/32.8%
+-commutative32.8%
unpow232.8%
sqr-neg32.8%
distribute-frac-neg32.8%
distribute-frac-neg32.8%
unpow232.8%
associate--l+39.6%
metadata-eval39.6%
+-rgt-identity39.6%
unpow239.6%
distribute-frac-neg39.6%
distribute-frac-neg39.6%
Simplified39.6%
Taylor expanded in k around 0 62.0%
*-commutative62.0%
associate-/r*61.2%
Simplified61.2%
div-inv61.2%
pow-flip61.8%
metadata-eval61.8%
Applied egg-rr61.8%
associate-*l/62.7%
Applied egg-rr62.7%
if 8.80000000000000012e-212 < t < 2e-3Initial program 44.2%
associate-/r*44.2%
*-commutative44.2%
associate-*l*44.2%
associate-*l/44.2%
+-commutative44.2%
unpow244.2%
sqr-neg44.2%
distribute-frac-neg44.2%
distribute-frac-neg44.2%
unpow244.2%
associate--l+48.3%
metadata-eval48.3%
+-rgt-identity48.3%
unpow248.3%
distribute-frac-neg48.3%
distribute-frac-neg48.3%
Simplified48.3%
Applied egg-rr68.9%
Taylor expanded in k around 0 77.6%
if 2e-3 < t < 5.49999999999999981e102Initial program 50.5%
associate-/r*57.4%
div-inv57.3%
Applied egg-rr57.3%
+-commutative57.3%
associate--l+84.2%
metadata-eval84.2%
+-rgt-identity84.2%
unpow284.2%
Applied egg-rr84.2%
un-div-inv84.5%
Applied egg-rr84.5%
if 5.49999999999999981e102 < t Initial program 18.4%
Taylor expanded in t around 0 76.6%
times-frac82.8%
associate-/l*82.8%
Simplified82.8%
frac-times74.3%
div-inv74.3%
pow-flip74.3%
metadata-eval74.3%
Applied egg-rr74.3%
times-frac82.8%
Simplified82.8%
Taylor expanded in k around 0 75.1%
Final simplification68.6%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 2.8e-212)
(* 2.0 (/ (* (pow l 2.0) (pow k -4.0)) t_m))
(if (<= t_m 1.9e+183)
(pow (/ (/ (sqrt 2.0) (/ k t_m)) (* k (/ (pow t_m 1.5) l))) 2.0)
(/ 2.0 (* (/ (pow k 2.0) (pow l 2.0)) (* t_m (pow k 2.0))))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.8e-212) {
tmp = 2.0 * ((pow(l, 2.0) * pow(k, -4.0)) / t_m);
} else if (t_m <= 1.9e+183) {
tmp = pow(((sqrt(2.0) / (k / t_m)) / (k * (pow(t_m, 1.5) / l))), 2.0);
} else {
tmp = 2.0 / ((pow(k, 2.0) / pow(l, 2.0)) * (t_m * pow(k, 2.0)));
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.8d-212) then
tmp = 2.0d0 * (((l ** 2.0d0) * (k ** (-4.0d0))) / t_m)
else if (t_m <= 1.9d+183) then
tmp = ((sqrt(2.0d0) / (k / t_m)) / (k * ((t_m ** 1.5d0) / l))) ** 2.0d0
else
tmp = 2.0d0 / (((k ** 2.0d0) / (l ** 2.0d0)) * (t_m * (k ** 2.0d0)))
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.8e-212) {
tmp = 2.0 * ((Math.pow(l, 2.0) * Math.pow(k, -4.0)) / t_m);
} else if (t_m <= 1.9e+183) {
tmp = Math.pow(((Math.sqrt(2.0) / (k / t_m)) / (k * (Math.pow(t_m, 1.5) / l))), 2.0);
} else {
tmp = 2.0 / ((Math.pow(k, 2.0) / Math.pow(l, 2.0)) * (t_m * Math.pow(k, 2.0)));
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 2.8e-212: tmp = 2.0 * ((math.pow(l, 2.0) * math.pow(k, -4.0)) / t_m) elif t_m <= 1.9e+183: tmp = math.pow(((math.sqrt(2.0) / (k / t_m)) / (k * (math.pow(t_m, 1.5) / l))), 2.0) else: tmp = 2.0 / ((math.pow(k, 2.0) / math.pow(l, 2.0)) * (t_m * math.pow(k, 2.0))) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 2.8e-212) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) * (k ^ -4.0)) / t_m)); elseif (t_m <= 1.9e+183) tmp = Float64(Float64(sqrt(2.0) / Float64(k / t_m)) / Float64(k * Float64((t_m ^ 1.5) / l))) ^ 2.0; else tmp = Float64(2.0 / Float64(Float64((k ^ 2.0) / (l ^ 2.0)) * Float64(t_m * (k ^ 2.0)))); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 2.8e-212) tmp = 2.0 * (((l ^ 2.0) * (k ^ -4.0)) / t_m); elseif (t_m <= 1.9e+183) tmp = ((sqrt(2.0) / (k / t_m)) / (k * ((t_m ^ 1.5) / l))) ^ 2.0; else tmp = 2.0 / (((k ^ 2.0) / (l ^ 2.0)) * (t_m * (k ^ 2.0))); end tmp_2 = t_s * tmp; end
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_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.8e-212], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.9e+183], N[Power[N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
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.8 \cdot 10^{-212}:\\
\;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t_m}\\
\mathbf{elif}\;t_m \leq 1.9 \cdot 10^{+183}:\\
\;\;\;\;{\left(\frac{\frac{\sqrt{2}}{\frac{k}{t_m}}}{k \cdot \frac{{t_m}^{1.5}}{\ell}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \left(t_m \cdot {k}^{2}\right)}\\
\end{array}
\end{array}
if t < 2.80000000000000014e-212Initial program 32.8%
associate-/r*32.8%
*-commutative32.8%
associate-*l*32.8%
associate-*l/32.8%
+-commutative32.8%
unpow232.8%
sqr-neg32.8%
distribute-frac-neg32.8%
distribute-frac-neg32.8%
unpow232.8%
associate--l+39.6%
metadata-eval39.6%
+-rgt-identity39.6%
unpow239.6%
distribute-frac-neg39.6%
distribute-frac-neg39.6%
Simplified39.6%
Taylor expanded in k around 0 62.0%
*-commutative62.0%
associate-/r*61.2%
Simplified61.2%
div-inv61.2%
pow-flip61.8%
metadata-eval61.8%
Applied egg-rr61.8%
associate-*l/62.7%
Applied egg-rr62.7%
if 2.80000000000000014e-212 < t < 1.9e183Initial program 42.9%
associate-/r*43.0%
*-commutative43.0%
associate-*l*43.0%
associate-*l/43.0%
+-commutative43.0%
unpow243.0%
sqr-neg43.0%
distribute-frac-neg43.0%
distribute-frac-neg43.0%
unpow243.0%
associate--l+51.6%
metadata-eval51.6%
+-rgt-identity51.6%
unpow251.6%
distribute-frac-neg51.6%
distribute-frac-neg51.6%
Simplified51.6%
Applied egg-rr72.4%
Taylor expanded in k around 0 72.0%
if 1.9e183 < t Initial program 5.0%
Taylor expanded in t around 0 80.2%
times-frac86.8%
associate-/l*86.8%
Simplified86.8%
frac-times75.8%
div-inv75.8%
pow-flip75.9%
metadata-eval75.9%
Applied egg-rr75.9%
times-frac86.9%
Simplified86.9%
Taylor expanded in k around 0 77.3%
Final simplification66.8%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ 2.0 (* (/ (pow k 2.0) (pow l 2.0)) (* t_m (pow k 2.0))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((pow(k, 2.0) / pow(l, 2.0)) * (t_m * pow(k, 2.0))));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 / (((k ** 2.0d0) / (l ** 2.0d0)) * (t_m * (k ** 2.0d0))))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / ((Math.pow(k, 2.0) / Math.pow(l, 2.0)) * (t_m * Math.pow(k, 2.0))));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / ((math.pow(k, 2.0) / math.pow(l, 2.0)) * (t_m * math.pow(k, 2.0))))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64((k ^ 2.0) / (l ^ 2.0)) * Float64(t_m * (k ^ 2.0))))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / (((k ^ 2.0) / (l ^ 2.0)) * (t_m * (k ^ 2.0)))); end
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_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \left(t_m \cdot {k}^{2}\right)}
\end{array}
Initial program 33.8%
Taylor expanded in t around 0 73.4%
times-frac73.9%
associate-/l*73.9%
Simplified73.9%
frac-times73.2%
div-inv73.2%
pow-flip73.2%
metadata-eval73.2%
Applied egg-rr73.2%
times-frac73.8%
Simplified73.8%
Taylor expanded in k around 0 64.4%
Final simplification64.4%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* 2.0 (* (pow k -4.0) (/ (pow l 2.0) t_m)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 * (pow(k, -4.0) * (pow(l, 2.0) / t_m)));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 * ((k ** (-4.0d0)) * ((l ** 2.0d0) / t_m)))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 * (Math.pow(k, -4.0) * (Math.pow(l, 2.0) / t_m)));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 * (math.pow(k, -4.0) * (math.pow(l, 2.0) / t_m)))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 * Float64((k ^ -4.0) * Float64((l ^ 2.0) / t_m)))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 * ((k ^ -4.0) * ((l ^ 2.0) / t_m))); end
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_, k_] := N[(t$95$s * N[(2.0 * N[(N[Power[k, -4.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \left({k}^{-4} \cdot \frac{{\ell}^{2}}{t_m}\right)\right)
\end{array}
Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-*l*33.8%
associate-*l/33.8%
+-commutative33.8%
unpow233.8%
sqr-neg33.8%
distribute-frac-neg33.8%
distribute-frac-neg33.8%
unpow233.8%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
unpow243.4%
distribute-frac-neg43.4%
distribute-frac-neg43.4%
Simplified43.4%
Taylor expanded in k around 0 62.2%
*-commutative62.2%
associate-/r*60.2%
Simplified60.2%
div-inv60.2%
pow-flip60.6%
metadata-eval60.6%
Applied egg-rr60.6%
Final simplification60.6%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* 2.0 (/ (* (pow l 2.0) (pow k -4.0)) t_m))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 * ((pow(l, 2.0) * pow(k, -4.0)) / t_m));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (2.0d0 * (((l ** 2.0d0) * (k ** (-4.0d0))) / t_m))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 * ((Math.pow(l, 2.0) * Math.pow(k, -4.0)) / t_m));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 * ((math.pow(l, 2.0) * math.pow(k, -4.0)) / t_m))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 * Float64(Float64((l ^ 2.0) * (k ^ -4.0)) / t_m))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 * (((l ^ 2.0) * (k ^ -4.0)) / t_m)); end
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_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(2 \cdot \frac{{\ell}^{2} \cdot {k}^{-4}}{t_m}\right)
\end{array}
Initial program 33.8%
associate-/r*33.8%
*-commutative33.8%
associate-*l*33.8%
associate-*l/33.8%
+-commutative33.8%
unpow233.8%
sqr-neg33.8%
distribute-frac-neg33.8%
distribute-frac-neg33.8%
unpow233.8%
associate--l+43.4%
metadata-eval43.4%
+-rgt-identity43.4%
unpow243.4%
distribute-frac-neg43.4%
distribute-frac-neg43.4%
Simplified43.4%
Taylor expanded in k around 0 62.2%
*-commutative62.2%
associate-/r*60.2%
Simplified60.2%
div-inv60.2%
pow-flip60.6%
metadata-eval60.6%
Applied egg-rr60.6%
associate-*l/62.7%
Applied egg-rr62.7%
Final simplification62.7%
herbie shell --seed 2023339
(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))))