
(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 11 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}
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(let* ((t_2 (/ t_m (cos k_m))))
(*
t_s
(if (<= k_m 1.35e-9)
(* 2.0 (pow (/ (/ (/ l k_m) (sqrt t_2)) k_m) 2.0))
(* 2.0 (* (/ (pow (/ l k_m) 2.0) t_2) (pow (sin k_m) -2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double t_2 = t_m / cos(k_m);
double tmp;
if (k_m <= 1.35e-9) {
tmp = 2.0 * pow((((l / k_m) / sqrt(t_2)) / k_m), 2.0);
} else {
tmp = 2.0 * ((pow((l / k_m), 2.0) / t_2) * pow(sin(k_m), -2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: t_2
real(8) :: tmp
t_2 = t_m / cos(k_m)
if (k_m <= 1.35d-9) then
tmp = 2.0d0 * ((((l / k_m) / sqrt(t_2)) / k_m) ** 2.0d0)
else
tmp = 2.0d0 * ((((l / k_m) ** 2.0d0) / t_2) * (sin(k_m) ** (-2.0d0)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double t_2 = t_m / Math.cos(k_m);
double tmp;
if (k_m <= 1.35e-9) {
tmp = 2.0 * Math.pow((((l / k_m) / Math.sqrt(t_2)) / k_m), 2.0);
} else {
tmp = 2.0 * ((Math.pow((l / k_m), 2.0) / t_2) * Math.pow(Math.sin(k_m), -2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): t_2 = t_m / math.cos(k_m) tmp = 0 if k_m <= 1.35e-9: tmp = 2.0 * math.pow((((l / k_m) / math.sqrt(t_2)) / k_m), 2.0) else: tmp = 2.0 * ((math.pow((l / k_m), 2.0) / t_2) * math.pow(math.sin(k_m), -2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) t_2 = Float64(t_m / cos(k_m)) tmp = 0.0 if (k_m <= 1.35e-9) tmp = Float64(2.0 * (Float64(Float64(Float64(l / k_m) / sqrt(t_2)) / k_m) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k_m) ^ 2.0) / t_2) * (sin(k_m) ^ -2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) t_2 = t_m / cos(k_m); tmp = 0.0; if (k_m <= 1.35e-9) tmp = 2.0 * ((((l / k_m) / sqrt(t_2)) / k_m) ^ 2.0); else tmp = 2.0 * ((((l / k_m) ^ 2.0) / t_2) * (sin(k_m) ^ -2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := Block[{t$95$2 = N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 1.35e-9], N[(2.0 * N[Power[N[(N[(N[(l / k$95$m), $MachinePrecision] / N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{t\_m}{\cos k\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.35 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\frac{\ell}{k\_m}}{\sqrt{t\_2}}}{k\_m}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t\_2} \cdot {\sin k\_m}^{-2}\right)\\
\end{array}
\end{array}
\end{array}
if k < 1.3500000000000001e-9Initial program 30.6%
associate-*l*30.6%
associate-/r*30.5%
sub-neg30.5%
distribute-rgt-in23.2%
unpow223.2%
times-frac14.9%
sqr-neg14.9%
times-frac23.2%
unpow223.2%
distribute-rgt-in30.5%
+-commutative30.5%
associate-+l+40.2%
Simplified40.2%
Taylor expanded in t around 0 68.0%
times-frac67.9%
Simplified67.9%
expm1-log1p-u38.2%
expm1-udef34.5%
div-inv34.5%
pow-flip34.5%
metadata-eval34.5%
associate-/r*34.5%
Applied egg-rr34.5%
expm1-def38.2%
expm1-log1p67.9%
associate-/r*67.9%
associate-*r/67.9%
associate-*l*67.9%
*-commutative67.9%
times-frac69.0%
Simplified69.0%
Taylor expanded in k around 0 63.3%
expm1-log1p-u36.4%
expm1-udef33.7%
Applied egg-rr28.0%
expm1-def32.2%
expm1-log1p32.7%
Simplified32.7%
if 1.3500000000000001e-9 < k Initial program 25.3%
associate-*l*25.3%
associate-/r*25.3%
sub-neg25.3%
distribute-rgt-in25.3%
unpow225.3%
times-frac22.6%
sqr-neg22.6%
times-frac25.3%
unpow225.3%
distribute-rgt-in25.3%
+-commutative25.3%
associate-+l+40.0%
Simplified40.0%
Taylor expanded in t around 0 72.8%
times-frac74.1%
Simplified74.1%
expm1-log1p-u63.1%
expm1-udef52.0%
div-inv52.0%
pow-flip52.0%
metadata-eval52.0%
associate-/r*52.0%
Applied egg-rr52.0%
expm1-def63.1%
expm1-log1p74.1%
associate-/r*74.0%
associate-*r/74.1%
associate-*l*74.0%
*-commutative74.0%
times-frac72.7%
Simplified72.7%
associate-*l/72.7%
associate-/l*72.7%
Applied egg-rr72.7%
div-inv72.8%
associate-*r/74.1%
metadata-eval74.1%
pow-flip74.1%
div-inv74.1%
add-sqr-sqrt74.0%
pow274.0%
sqrt-div74.0%
pow274.0%
sqrt-prod38.4%
add-sqr-sqrt78.2%
unpow278.2%
sqrt-prod93.2%
add-sqr-sqrt93.3%
pow-flip93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Final simplification50.7%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= (* l l) 5e-53)
(* 2.0 (/ (pow (* l (pow k_m -2.0)) 2.0) t_m))
(* 2.0 (pow (/ (/ l k_m) (* (sqrt (/ t_m (cos k_m))) (sin k_m))) 2.0)))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if ((l * l) <= 5e-53) {
tmp = 2.0 * (pow((l * pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * pow(((l / k_m) / (sqrt((t_m / cos(k_m))) * sin(k_m))), 2.0);
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if ((l * l) <= 5d-53) then
tmp = 2.0d0 * (((l * (k_m ** (-2.0d0))) ** 2.0d0) / t_m)
else
tmp = 2.0d0 * (((l / k_m) / (sqrt((t_m / cos(k_m))) * sin(k_m))) ** 2.0d0)
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if ((l * l) <= 5e-53) {
tmp = 2.0 * (Math.pow((l * Math.pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * Math.pow(((l / k_m) / (Math.sqrt((t_m / Math.cos(k_m))) * Math.sin(k_m))), 2.0);
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if (l * l) <= 5e-53: tmp = 2.0 * (math.pow((l * math.pow(k_m, -2.0)), 2.0) / t_m) else: tmp = 2.0 * math.pow(((l / k_m) / (math.sqrt((t_m / math.cos(k_m))) * math.sin(k_m))), 2.0) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (Float64(l * l) <= 5e-53) tmp = Float64(2.0 * Float64((Float64(l * (k_m ^ -2.0)) ^ 2.0) / t_m)); else tmp = Float64(2.0 * (Float64(Float64(l / k_m) / Float64(sqrt(Float64(t_m / cos(k_m))) * sin(k_m))) ^ 2.0)); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if ((l * l) <= 5e-53) tmp = 2.0 * (((l * (k_m ^ -2.0)) ^ 2.0) / t_m); else tmp = 2.0 * (((l / k_m) / (sqrt((t_m / cos(k_m))) * sin(k_m))) ^ 2.0); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 5e-53], N[(2.0 * N[(N[Power[N[(l * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[N[(N[(l / k$95$m), $MachinePrecision] / N[(N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
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 5 \cdot 10^{-53}:\\
\;\;\;\;2 \cdot \frac{{\left(\ell \cdot {k\_m}^{-2}\right)}^{2}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\ell}{k\_m}}{\sqrt{\frac{t\_m}{\cos k\_m}} \cdot \sin k\_m}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 l l) < 5e-53Initial program 25.5%
associate-*l*25.5%
associate-/r*25.5%
sub-neg25.5%
distribute-rgt-in23.0%
unpow223.0%
times-frac17.5%
sqr-neg17.5%
times-frac23.0%
unpow223.0%
distribute-rgt-in25.5%
+-commutative25.5%
associate-+l+41.5%
Simplified41.5%
Taylor expanded in k around 0 58.9%
*-commutative58.9%
associate-/r*57.4%
Simplified57.4%
div-inv56.6%
pow-flip56.6%
metadata-eval56.6%
Applied egg-rr56.6%
associate-*l/59.0%
Simplified59.0%
add-sqr-sqrt59.0%
pow259.0%
sqrt-prod59.0%
pow259.0%
sqrt-prod38.7%
add-sqr-sqrt74.7%
sqrt-pow184.5%
metadata-eval84.5%
Applied egg-rr84.5%
if 5e-53 < (*.f64 l l) Initial program 32.4%
associate-*l*32.4%
associate-/r*32.4%
sub-neg32.4%
distribute-rgt-in24.6%
unpow224.6%
times-frac16.9%
sqr-neg16.9%
times-frac24.6%
unpow224.6%
distribute-rgt-in32.4%
+-commutative32.4%
associate-+l+38.8%
Simplified38.8%
Taylor expanded in t around 0 72.8%
times-frac74.2%
Simplified74.2%
expm1-log1p-u35.3%
expm1-udef27.4%
div-inv27.4%
pow-flip27.4%
metadata-eval27.4%
associate-/r*27.4%
Applied egg-rr27.4%
expm1-def35.3%
expm1-log1p74.2%
associate-/r*74.2%
associate-*r/74.2%
associate-*l*74.2%
*-commutative74.2%
times-frac72.0%
Simplified72.0%
associate-*l/73.4%
associate-/l*73.4%
Applied egg-rr73.4%
expm1-log1p-u34.4%
expm1-udef28.6%
Applied egg-rr32.3%
expm1-def39.6%
expm1-log1p40.4%
associate-/l/40.5%
Simplified40.5%
Final simplification62.2%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= (* l l) 5e-53)
(* 2.0 (/ (pow (* l (pow k_m -2.0)) 2.0) t_m))
(* 2.0 (pow (/ (/ (/ l k_m) (sqrt (/ t_m (cos k_m)))) (sin k_m)) 2.0)))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if ((l * l) <= 5e-53) {
tmp = 2.0 * (pow((l * pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * pow((((l / k_m) / sqrt((t_m / cos(k_m)))) / sin(k_m)), 2.0);
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if ((l * l) <= 5d-53) then
tmp = 2.0d0 * (((l * (k_m ** (-2.0d0))) ** 2.0d0) / t_m)
else
tmp = 2.0d0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / sin(k_m)) ** 2.0d0)
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if ((l * l) <= 5e-53) {
tmp = 2.0 * (Math.pow((l * Math.pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * Math.pow((((l / k_m) / Math.sqrt((t_m / Math.cos(k_m)))) / Math.sin(k_m)), 2.0);
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if (l * l) <= 5e-53: tmp = 2.0 * (math.pow((l * math.pow(k_m, -2.0)), 2.0) / t_m) else: tmp = 2.0 * math.pow((((l / k_m) / math.sqrt((t_m / math.cos(k_m)))) / math.sin(k_m)), 2.0) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (Float64(l * l) <= 5e-53) tmp = Float64(2.0 * Float64((Float64(l * (k_m ^ -2.0)) ^ 2.0) / t_m)); else tmp = Float64(2.0 * (Float64(Float64(Float64(l / k_m) / sqrt(Float64(t_m / cos(k_m)))) / sin(k_m)) ^ 2.0)); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if ((l * l) <= 5e-53) tmp = 2.0 * (((l * (k_m ^ -2.0)) ^ 2.0) / t_m); else tmp = 2.0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / sin(k_m)) ^ 2.0); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 5e-53], N[(2.0 * N[(N[Power[N[(l * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[N[(N[(N[(l / k$95$m), $MachinePrecision] / N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
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 5 \cdot 10^{-53}:\\
\;\;\;\;2 \cdot \frac{{\left(\ell \cdot {k\_m}^{-2}\right)}^{2}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\frac{\ell}{k\_m}}{\sqrt{\frac{t\_m}{\cos k\_m}}}}{\sin k\_m}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 l l) < 5e-53Initial program 25.5%
associate-*l*25.5%
associate-/r*25.5%
sub-neg25.5%
distribute-rgt-in23.0%
unpow223.0%
times-frac17.5%
sqr-neg17.5%
times-frac23.0%
unpow223.0%
distribute-rgt-in25.5%
+-commutative25.5%
associate-+l+41.5%
Simplified41.5%
Taylor expanded in k around 0 58.9%
*-commutative58.9%
associate-/r*57.4%
Simplified57.4%
div-inv56.6%
pow-flip56.6%
metadata-eval56.6%
Applied egg-rr56.6%
associate-*l/59.0%
Simplified59.0%
add-sqr-sqrt59.0%
pow259.0%
sqrt-prod59.0%
pow259.0%
sqrt-prod38.7%
add-sqr-sqrt74.7%
sqrt-pow184.5%
metadata-eval84.5%
Applied egg-rr84.5%
if 5e-53 < (*.f64 l l) Initial program 32.4%
associate-*l*32.4%
associate-/r*32.4%
sub-neg32.4%
distribute-rgt-in24.6%
unpow224.6%
times-frac16.9%
sqr-neg16.9%
times-frac24.6%
unpow224.6%
distribute-rgt-in32.4%
+-commutative32.4%
associate-+l+38.8%
Simplified38.8%
Taylor expanded in t around 0 72.8%
times-frac74.2%
Simplified74.2%
expm1-log1p-u35.3%
expm1-udef27.4%
div-inv27.4%
pow-flip27.4%
metadata-eval27.4%
associate-/r*27.4%
Applied egg-rr27.4%
expm1-def35.3%
expm1-log1p74.2%
associate-/r*74.2%
associate-*r/74.2%
associate-*l*74.2%
*-commutative74.2%
times-frac72.0%
Simplified72.0%
associate-*l/73.4%
associate-/l*73.4%
Applied egg-rr73.4%
add-sqr-sqrt31.1%
pow231.1%
Applied egg-rr40.4%
Final simplification62.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 2.15e-7)
(* 2.0 (pow (/ (/ (/ l k_m) (sqrt (/ t_m (cos k_m)))) k_m) 2.0))
(*
2.0
(* (/ (pow (/ l k_m) 2.0) t_m) (/ (cos k_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 2.15e-7) {
tmp = 2.0 * pow((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m), 2.0);
} else {
tmp = 2.0 * ((pow((l / k_m), 2.0) / t_m) * (cos(k_m) / pow(sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 2.15d-7) then
tmp = 2.0d0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m) ** 2.0d0)
else
tmp = 2.0d0 * ((((l / k_m) ** 2.0d0) / t_m) * (cos(k_m) / (sin(k_m) ** 2.0d0)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if (k_m <= 2.15e-7) {
tmp = 2.0 * Math.pow((((l / k_m) / Math.sqrt((t_m / Math.cos(k_m)))) / k_m), 2.0);
} else {
tmp = 2.0 * ((Math.pow((l / k_m), 2.0) / t_m) * (Math.cos(k_m) / Math.pow(Math.sin(k_m), 2.0)));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 2.15e-7: tmp = 2.0 * math.pow((((l / k_m) / math.sqrt((t_m / math.cos(k_m)))) / k_m), 2.0) else: tmp = 2.0 * ((math.pow((l / k_m), 2.0) / t_m) * (math.cos(k_m) / math.pow(math.sin(k_m), 2.0))) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 2.15e-7) tmp = Float64(2.0 * (Float64(Float64(Float64(l / k_m) / sqrt(Float64(t_m / cos(k_m)))) / k_m) ^ 2.0)); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k_m) ^ 2.0) / t_m) * Float64(cos(k_m) / (sin(k_m) ^ 2.0)))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 2.15e-7) tmp = 2.0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m) ^ 2.0); else tmp = 2.0 * ((((l / k_m) ^ 2.0) / t_m) * (cos(k_m) / (sin(k_m) ^ 2.0))); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.15e-7], N[(2.0 * N[Power[N[(N[(N[(l / k$95$m), $MachinePrecision] / N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\frac{\ell}{k\_m}}{\sqrt{\frac{t\_m}{\cos k\_m}}}}{k\_m}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t\_m} \cdot \frac{\cos k\_m}{{\sin k\_m}^{2}}\right)\\
\end{array}
\end{array}
if k < 2.1500000000000001e-7Initial program 30.4%
associate-*l*30.4%
associate-/r*30.4%
sub-neg30.4%
distribute-rgt-in23.1%
unpow223.1%
times-frac14.8%
sqr-neg14.8%
times-frac23.1%
unpow223.1%
distribute-rgt-in30.4%
+-commutative30.4%
associate-+l+40.5%
Simplified40.5%
Taylor expanded in t around 0 68.1%
times-frac68.1%
Simplified68.1%
expm1-log1p-u38.5%
expm1-udef34.9%
div-inv34.9%
pow-flip34.9%
metadata-eval34.9%
associate-/r*34.9%
Applied egg-rr34.9%
expm1-def38.5%
expm1-log1p68.1%
associate-/r*68.1%
associate-*r/68.1%
associate-*l*68.1%
*-commutative68.1%
times-frac69.1%
Simplified69.1%
Taylor expanded in k around 0 63.5%
expm1-log1p-u36.7%
expm1-udef34.0%
Applied egg-rr28.3%
expm1-def32.5%
expm1-log1p33.1%
Simplified33.1%
if 2.1500000000000001e-7 < k Initial program 25.6%
associate-*l*25.6%
associate-/r*25.6%
sub-neg25.6%
distribute-rgt-in25.6%
unpow225.6%
times-frac22.9%
sqr-neg22.9%
times-frac25.6%
unpow225.6%
distribute-rgt-in25.6%
+-commutative25.6%
associate-+l+39.2%
Simplified39.2%
Taylor expanded in t around 0 72.5%
times-frac73.7%
Simplified73.7%
expm1-log1p-u62.7%
expm1-udef51.5%
div-inv51.5%
pow-flip51.5%
metadata-eval51.5%
associate-/r*51.5%
Applied egg-rr51.5%
expm1-def62.7%
expm1-log1p73.7%
associate-/r*73.7%
associate-*r/73.7%
associate-*l*73.7%
*-commutative73.7%
times-frac72.4%
Simplified72.4%
associate-*l/72.4%
associate-/l*72.4%
Applied egg-rr72.4%
Taylor expanded in l around 0 72.5%
associate-*r*72.4%
times-frac72.4%
associate-/r*73.8%
unpow273.8%
unpow273.8%
times-frac93.2%
unpow293.2%
Simplified93.2%
Final simplification50.7%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 1.92e-25)
(* 2.0 (/ (pow (* l (pow k_m -2.0)) 2.0) t_m))
(if (<= k_m 7.4e+77)
(* 2.0 (* (/ (pow l 2.0) t_m) (/ (cos k_m) (pow k_m 4.0))))
(* 2.0 (/ (/ (pow (/ l k_m) 2.0) t_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 1.92e-25) {
tmp = 2.0 * (pow((l * pow(k_m, -2.0)), 2.0) / t_m);
} else if (k_m <= 7.4e+77) {
tmp = 2.0 * ((pow(l, 2.0) / t_m) * (cos(k_m) / pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((pow((l / k_m), 2.0) / t_m) / pow(sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 1.92d-25) then
tmp = 2.0d0 * (((l * (k_m ** (-2.0d0))) ** 2.0d0) / t_m)
else if (k_m <= 7.4d+77) then
tmp = 2.0d0 * (((l ** 2.0d0) / t_m) * (cos(k_m) / (k_m ** 4.0d0)))
else
tmp = 2.0d0 * ((((l / k_m) ** 2.0d0) / t_m) / (sin(k_m) ** 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if (k_m <= 1.92e-25) {
tmp = 2.0 * (Math.pow((l * Math.pow(k_m, -2.0)), 2.0) / t_m);
} else if (k_m <= 7.4e+77) {
tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) * (Math.cos(k_m) / Math.pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((Math.pow((l / k_m), 2.0) / t_m) / Math.pow(Math.sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 1.92e-25: tmp = 2.0 * (math.pow((l * math.pow(k_m, -2.0)), 2.0) / t_m) elif k_m <= 7.4e+77: tmp = 2.0 * ((math.pow(l, 2.0) / t_m) * (math.cos(k_m) / math.pow(k_m, 4.0))) else: tmp = 2.0 * ((math.pow((l / k_m), 2.0) / t_m) / math.pow(math.sin(k_m), 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 1.92e-25) tmp = Float64(2.0 * Float64((Float64(l * (k_m ^ -2.0)) ^ 2.0) / t_m)); elseif (k_m <= 7.4e+77) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) * Float64(cos(k_m) / (k_m ^ 4.0)))); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 1.92e-25) tmp = 2.0 * (((l * (k_m ^ -2.0)) ^ 2.0) / t_m); elseif (k_m <= 7.4e+77) tmp = 2.0 * (((l ^ 2.0) / t_m) * (cos(k_m) / (k_m ^ 4.0))); else tmp = 2.0 * ((((l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 1.92e-25], N[(2.0 * N[(N[Power[N[(l * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 7.4e+77], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 1.92 \cdot 10^{-25}:\\
\;\;\;\;2 \cdot \frac{{\left(\ell \cdot {k\_m}^{-2}\right)}^{2}}{t\_m}\\
\mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+77}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t\_m} \cdot \frac{\cos k\_m}{{k\_m}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t\_m}}{{\sin k\_m}^{2}}\\
\end{array}
\end{array}
if k < 1.9200000000000001e-25Initial program 31.3%
associate-*l*31.3%
associate-/r*31.2%
sub-neg31.2%
distribute-rgt-in23.8%
unpow223.8%
times-frac15.2%
sqr-neg15.2%
times-frac23.8%
unpow223.8%
distribute-rgt-in31.2%
+-commutative31.2%
associate-+l+41.1%
Simplified41.1%
Taylor expanded in k around 0 57.1%
*-commutative57.1%
associate-/r*56.0%
Simplified56.0%
div-inv55.4%
pow-flip55.4%
metadata-eval55.4%
Applied egg-rr55.4%
associate-*l/57.1%
Simplified57.1%
add-sqr-sqrt57.1%
pow257.1%
sqrt-prod57.1%
pow257.1%
sqrt-prod33.1%
add-sqr-sqrt68.6%
sqrt-pow176.8%
metadata-eval76.8%
Applied egg-rr76.8%
if 1.9200000000000001e-25 < k < 7.3999999999999999e77Initial program 20.7%
associate-*l*20.8%
associate-/r*20.7%
sub-neg20.7%
distribute-rgt-in20.7%
unpow220.7%
times-frac20.7%
sqr-neg20.7%
times-frac20.7%
unpow220.7%
distribute-rgt-in20.7%
+-commutative20.7%
associate-+l+34.5%
Simplified34.5%
Taylor expanded in t around 0 93.2%
times-frac86.7%
Simplified86.7%
expm1-log1p-u65.2%
expm1-udef48.8%
div-inv48.8%
pow-flip48.8%
metadata-eval48.8%
associate-/r*48.8%
Applied egg-rr48.8%
expm1-def65.0%
expm1-log1p86.4%
associate-/r*86.4%
associate-*r/86.4%
associate-*l*86.4%
*-commutative86.4%
times-frac92.9%
Simplified92.9%
Taylor expanded in k around 0 67.3%
Taylor expanded in l around 0 64.0%
*-commutative64.0%
times-frac70.8%
Simplified70.8%
if 7.3999999999999999e77 < k Initial program 25.9%
associate-*l*25.9%
associate-/r*25.9%
sub-neg25.9%
distribute-rgt-in25.9%
unpow225.9%
times-frac21.9%
sqr-neg21.9%
times-frac25.9%
unpow225.9%
distribute-rgt-in25.9%
+-commutative25.9%
associate-+l+40.0%
Simplified40.0%
Taylor expanded in t around 0 59.6%
times-frac65.2%
Simplified65.2%
expm1-log1p-u59.1%
expm1-udef50.0%
div-inv50.0%
pow-flip50.0%
metadata-eval50.0%
associate-/r*50.0%
Applied egg-rr50.0%
expm1-def59.2%
expm1-log1p65.3%
associate-/r*65.2%
associate-*r/65.3%
associate-*l*65.3%
*-commutative65.3%
times-frac59.6%
Simplified59.6%
associate-*l/59.6%
associate-/l*59.6%
Applied egg-rr59.6%
Taylor expanded in k around 0 46.9%
associate-/r*47.7%
unpow247.7%
unpow247.7%
times-frac51.3%
unpow251.3%
Simplified51.3%
Final simplification71.0%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 2.5e-15)
(* 2.0 (pow (/ (/ l (* k_m (sqrt (/ t_m (cos k_m))))) k_m) 2.0))
(if (<= k_m 7.4e+77)
(* 2.0 (* (/ (pow l 2.0) t_m) (/ (cos k_m) (pow k_m 4.0))))
(* 2.0 (/ (/ (pow (/ l k_m) 2.0) t_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 2.5e-15) {
tmp = 2.0 * pow(((l / (k_m * sqrt((t_m / cos(k_m))))) / k_m), 2.0);
} else if (k_m <= 7.4e+77) {
tmp = 2.0 * ((pow(l, 2.0) / t_m) * (cos(k_m) / pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((pow((l / k_m), 2.0) / t_m) / pow(sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 2.5d-15) then
tmp = 2.0d0 * (((l / (k_m * sqrt((t_m / cos(k_m))))) / k_m) ** 2.0d0)
else if (k_m <= 7.4d+77) then
tmp = 2.0d0 * (((l ** 2.0d0) / t_m) * (cos(k_m) / (k_m ** 4.0d0)))
else
tmp = 2.0d0 * ((((l / k_m) ** 2.0d0) / t_m) / (sin(k_m) ** 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if (k_m <= 2.5e-15) {
tmp = 2.0 * Math.pow(((l / (k_m * Math.sqrt((t_m / Math.cos(k_m))))) / k_m), 2.0);
} else if (k_m <= 7.4e+77) {
tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) * (Math.cos(k_m) / Math.pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((Math.pow((l / k_m), 2.0) / t_m) / Math.pow(Math.sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 2.5e-15: tmp = 2.0 * math.pow(((l / (k_m * math.sqrt((t_m / math.cos(k_m))))) / k_m), 2.0) elif k_m <= 7.4e+77: tmp = 2.0 * ((math.pow(l, 2.0) / t_m) * (math.cos(k_m) / math.pow(k_m, 4.0))) else: tmp = 2.0 * ((math.pow((l / k_m), 2.0) / t_m) / math.pow(math.sin(k_m), 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 2.5e-15) tmp = Float64(2.0 * (Float64(Float64(l / Float64(k_m * sqrt(Float64(t_m / cos(k_m))))) / k_m) ^ 2.0)); elseif (k_m <= 7.4e+77) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) * Float64(cos(k_m) / (k_m ^ 4.0)))); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 2.5e-15) tmp = 2.0 * (((l / (k_m * sqrt((t_m / cos(k_m))))) / k_m) ^ 2.0); elseif (k_m <= 7.4e+77) tmp = 2.0 * (((l ^ 2.0) / t_m) * (cos(k_m) / (k_m ^ 4.0))); else tmp = 2.0 * ((((l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.5e-15], N[(2.0 * N[Power[N[(N[(l / N[(k$95$m * N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 7.4e+77], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.5 \cdot 10^{-15}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\ell}{k\_m \cdot \sqrt{\frac{t\_m}{\cos k\_m}}}}{k\_m}\right)}^{2}\\
\mathbf{elif}\;k\_m \leq 7.4 \cdot 10^{+77}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t\_m} \cdot \frac{\cos k\_m}{{k\_m}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t\_m}}{{\sin k\_m}^{2}}\\
\end{array}
\end{array}
if k < 2.5e-15Initial program 30.7%
associate-*l*30.7%
associate-/r*30.7%
sub-neg30.7%
distribute-rgt-in23.4%
unpow223.4%
times-frac15.0%
sqr-neg15.0%
times-frac23.4%
unpow223.4%
distribute-rgt-in30.7%
+-commutative30.7%
associate-+l+40.4%
Simplified40.4%
Taylor expanded in t around 0 67.8%
times-frac67.7%
Simplified67.7%
expm1-log1p-u37.9%
expm1-udef34.7%
div-inv34.7%
pow-flip34.7%
metadata-eval34.7%
associate-/r*34.7%
Applied egg-rr34.7%
expm1-def37.9%
expm1-log1p67.8%
associate-/r*67.7%
associate-*r/67.8%
associate-*l*67.7%
*-commutative67.7%
times-frac68.8%
Simplified68.8%
Taylor expanded in k around 0 63.1%
expm1-log1p-u36.1%
expm1-udef33.9%
Applied egg-rr28.1%
expm1-def31.8%
expm1-log1p32.4%
associate-/l/32.3%
Simplified32.3%
if 2.5e-15 < k < 7.3999999999999999e77Initial program 23.1%
associate-*l*23.2%
associate-/r*23.1%
sub-neg23.1%
distribute-rgt-in23.1%
unpow223.1%
times-frac23.1%
sqr-neg23.1%
times-frac23.1%
unpow223.1%
distribute-rgt-in23.1%
+-commutative23.1%
associate-+l+38.5%
Simplified38.5%
Taylor expanded in t around 0 99.7%
times-frac92.5%
Simplified92.5%
expm1-log1p-u72.4%
expm1-udef54.1%
div-inv54.1%
pow-flip54.1%
metadata-eval54.1%
associate-/r*54.1%
Applied egg-rr54.1%
expm1-def72.2%
expm1-log1p92.2%
associate-/r*92.2%
associate-*r/92.3%
associate-*l*92.2%
*-commutative92.2%
times-frac99.4%
Simplified99.4%
Taylor expanded in k around 0 70.9%
Taylor expanded in l around 0 67.1%
*-commutative67.1%
times-frac71.1%
Simplified71.1%
if 7.3999999999999999e77 < k Initial program 25.9%
associate-*l*25.9%
associate-/r*25.9%
sub-neg25.9%
distribute-rgt-in25.9%
unpow225.9%
times-frac21.9%
sqr-neg21.9%
times-frac25.9%
unpow225.9%
distribute-rgt-in25.9%
+-commutative25.9%
associate-+l+40.0%
Simplified40.0%
Taylor expanded in t around 0 59.6%
times-frac65.2%
Simplified65.2%
expm1-log1p-u59.1%
expm1-udef50.0%
div-inv50.0%
pow-flip50.0%
metadata-eval50.0%
associate-/r*50.0%
Applied egg-rr50.0%
expm1-def59.2%
expm1-log1p65.3%
associate-/r*65.2%
associate-*r/65.3%
associate-*l*65.3%
*-commutative65.3%
times-frac59.6%
Simplified59.6%
associate-*l/59.6%
associate-/l*59.6%
Applied egg-rr59.6%
Taylor expanded in k around 0 46.9%
associate-/r*47.7%
unpow247.7%
unpow247.7%
times-frac51.3%
unpow251.3%
Simplified51.3%
Final simplification40.0%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 5.2e-15)
(* 2.0 (pow (/ (/ (/ l k_m) (sqrt (/ t_m (cos k_m)))) k_m) 2.0))
(if (<= k_m 4.4e+77)
(* 2.0 (* (/ (pow l 2.0) t_m) (/ (cos k_m) (pow k_m 4.0))))
(* 2.0 (/ (/ (pow (/ l k_m) 2.0) t_m) (pow (sin k_m) 2.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (k_m <= 5.2e-15) {
tmp = 2.0 * pow((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m), 2.0);
} else if (k_m <= 4.4e+77) {
tmp = 2.0 * ((pow(l, 2.0) / t_m) * (cos(k_m) / pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((pow((l / k_m), 2.0) / t_m) / pow(sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 5.2d-15) then
tmp = 2.0d0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m) ** 2.0d0)
else if (k_m <= 4.4d+77) then
tmp = 2.0d0 * (((l ** 2.0d0) / t_m) * (cos(k_m) / (k_m ** 4.0d0)))
else
tmp = 2.0d0 * ((((l / k_m) ** 2.0d0) / t_m) / (sin(k_m) ** 2.0d0))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if (k_m <= 5.2e-15) {
tmp = 2.0 * Math.pow((((l / k_m) / Math.sqrt((t_m / Math.cos(k_m)))) / k_m), 2.0);
} else if (k_m <= 4.4e+77) {
tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) * (Math.cos(k_m) / Math.pow(k_m, 4.0)));
} else {
tmp = 2.0 * ((Math.pow((l / k_m), 2.0) / t_m) / Math.pow(Math.sin(k_m), 2.0));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if k_m <= 5.2e-15: tmp = 2.0 * math.pow((((l / k_m) / math.sqrt((t_m / math.cos(k_m)))) / k_m), 2.0) elif k_m <= 4.4e+77: tmp = 2.0 * ((math.pow(l, 2.0) / t_m) * (math.cos(k_m) / math.pow(k_m, 4.0))) else: tmp = 2.0 * ((math.pow((l / k_m), 2.0) / t_m) / math.pow(math.sin(k_m), 2.0)) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (k_m <= 5.2e-15) tmp = Float64(2.0 * (Float64(Float64(Float64(l / k_m) / sqrt(Float64(t_m / cos(k_m)))) / k_m) ^ 2.0)); elseif (k_m <= 4.4e+77) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) * Float64(cos(k_m) / (k_m ^ 4.0)))); else tmp = Float64(2.0 * Float64(Float64((Float64(l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (k_m <= 5.2e-15) tmp = 2.0 * ((((l / k_m) / sqrt((t_m / cos(k_m)))) / k_m) ^ 2.0); elseif (k_m <= 4.4e+77) tmp = 2.0 * (((l ^ 2.0) / t_m) * (cos(k_m) / (k_m ^ 4.0))); else tmp = 2.0 * ((((l / k_m) ^ 2.0) / t_m) / (sin(k_m) ^ 2.0)); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 5.2e-15], N[(2.0 * N[Power[N[(N[(N[(l / k$95$m), $MachinePrecision] / N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 4.4e+77], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{\frac{\ell}{k\_m}}{\sqrt{\frac{t\_m}{\cos k\_m}}}}{k\_m}\right)}^{2}\\
\mathbf{elif}\;k\_m \leq 4.4 \cdot 10^{+77}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t\_m} \cdot \frac{\cos k\_m}{{k\_m}^{4}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t\_m}}{{\sin k\_m}^{2}}\\
\end{array}
\end{array}
if k < 5.20000000000000009e-15Initial program 30.7%
associate-*l*30.7%
associate-/r*30.7%
sub-neg30.7%
distribute-rgt-in23.4%
unpow223.4%
times-frac15.0%
sqr-neg15.0%
times-frac23.4%
unpow223.4%
distribute-rgt-in30.7%
+-commutative30.7%
associate-+l+40.4%
Simplified40.4%
Taylor expanded in t around 0 67.8%
times-frac67.7%
Simplified67.7%
expm1-log1p-u37.9%
expm1-udef34.7%
div-inv34.7%
pow-flip34.7%
metadata-eval34.7%
associate-/r*34.7%
Applied egg-rr34.7%
expm1-def37.9%
expm1-log1p67.8%
associate-/r*67.7%
associate-*r/67.8%
associate-*l*67.7%
*-commutative67.7%
times-frac68.8%
Simplified68.8%
Taylor expanded in k around 0 63.1%
expm1-log1p-u36.1%
expm1-udef33.9%
Applied egg-rr28.1%
expm1-def31.8%
expm1-log1p32.4%
Simplified32.4%
if 5.20000000000000009e-15 < k < 4.4000000000000001e77Initial program 23.1%
associate-*l*23.2%
associate-/r*23.1%
sub-neg23.1%
distribute-rgt-in23.1%
unpow223.1%
times-frac23.1%
sqr-neg23.1%
times-frac23.1%
unpow223.1%
distribute-rgt-in23.1%
+-commutative23.1%
associate-+l+38.5%
Simplified38.5%
Taylor expanded in t around 0 99.7%
times-frac92.5%
Simplified92.5%
expm1-log1p-u72.4%
expm1-udef54.1%
div-inv54.1%
pow-flip54.1%
metadata-eval54.1%
associate-/r*54.1%
Applied egg-rr54.1%
expm1-def72.2%
expm1-log1p92.2%
associate-/r*92.2%
associate-*r/92.3%
associate-*l*92.2%
*-commutative92.2%
times-frac99.4%
Simplified99.4%
Taylor expanded in k around 0 70.9%
Taylor expanded in l around 0 67.1%
*-commutative67.1%
times-frac71.1%
Simplified71.1%
if 4.4000000000000001e77 < k Initial program 25.9%
associate-*l*25.9%
associate-/r*25.9%
sub-neg25.9%
distribute-rgt-in25.9%
unpow225.9%
times-frac21.9%
sqr-neg21.9%
times-frac25.9%
unpow225.9%
distribute-rgt-in25.9%
+-commutative25.9%
associate-+l+40.0%
Simplified40.0%
Taylor expanded in t around 0 59.6%
times-frac65.2%
Simplified65.2%
expm1-log1p-u59.1%
expm1-udef50.0%
div-inv50.0%
pow-flip50.0%
metadata-eval50.0%
associate-/r*50.0%
Applied egg-rr50.0%
expm1-def59.2%
expm1-log1p65.3%
associate-/r*65.2%
associate-*r/65.3%
associate-*l*65.3%
*-commutative65.3%
times-frac59.6%
Simplified59.6%
associate-*l/59.6%
associate-/l*59.6%
Applied egg-rr59.6%
Taylor expanded in k around 0 46.9%
associate-/r*47.7%
unpow247.7%
unpow247.7%
times-frac51.3%
unpow251.3%
Simplified51.3%
Final simplification40.1%
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= l 1.7e-27)
(* 2.0 (/ (pow (* l (pow k_m -2.0)) 2.0) t_m))
(* 2.0 (* (/ (pow l 2.0) t_m) (/ (cos k_m) (pow k_m 4.0)))))))k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
double tmp;
if (l <= 1.7e-27) {
tmp = 2.0 * (pow((l * pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * ((pow(l, 2.0) / t_m) * (cos(k_m) / pow(k_m, 4.0)));
}
return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (l <= 1.7d-27) then
tmp = 2.0d0 * (((l * (k_m ** (-2.0d0))) ** 2.0d0) / t_m)
else
tmp = 2.0d0 * (((l ** 2.0d0) / t_m) * (cos(k_m) / (k_m ** 4.0d0)))
end if
code = t_s * tmp
end function
k_m = Math.abs(k);
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_m) {
double tmp;
if (l <= 1.7e-27) {
tmp = 2.0 * (Math.pow((l * Math.pow(k_m, -2.0)), 2.0) / t_m);
} else {
tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) * (Math.cos(k_m) / Math.pow(k_m, 4.0)));
}
return t_s * tmp;
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): tmp = 0 if l <= 1.7e-27: tmp = 2.0 * (math.pow((l * math.pow(k_m, -2.0)), 2.0) / t_m) else: tmp = 2.0 * ((math.pow(l, 2.0) / t_m) * (math.cos(k_m) / math.pow(k_m, 4.0))) return t_s * tmp
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) tmp = 0.0 if (l <= 1.7e-27) tmp = Float64(2.0 * Float64((Float64(l * (k_m ^ -2.0)) ^ 2.0) / t_m)); else tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) * Float64(cos(k_m) / (k_m ^ 4.0)))); end return Float64(t_s * tmp) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k_m) tmp = 0.0; if (l <= 1.7e-27) tmp = 2.0 * (((l * (k_m ^ -2.0)) ^ 2.0) / t_m); else tmp = 2.0 * (((l ^ 2.0) / t_m) * (cos(k_m) / (k_m ^ 4.0))); end tmp_2 = t_s * tmp; end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[l, 1.7e-27], N[(2.0 * N[(N[Power[N[(l * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;2 \cdot \frac{{\left(\ell \cdot {k\_m}^{-2}\right)}^{2}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t\_m} \cdot \frac{\cos k\_m}{{k\_m}^{4}}\right)\\
\end{array}
\end{array}
if l < 1.69999999999999985e-27Initial program 29.2%
associate-*l*29.2%
associate-/r*29.2%
sub-neg29.2%
distribute-rgt-in24.0%
unpow224.0%
times-frac18.3%
sqr-neg18.3%
times-frac24.0%
unpow224.0%
distribute-rgt-in29.2%
+-commutative29.2%
associate-+l+42.7%
Simplified42.7%
Taylor expanded in k around 0 57.3%
*-commutative57.3%
associate-/r*56.8%
Simplified56.8%
div-inv56.2%
pow-flip56.2%
metadata-eval56.2%
Applied egg-rr56.2%
associate-*l/57.9%
Simplified57.9%
add-sqr-sqrt57.8%
pow257.8%
sqrt-prod57.9%
pow257.9%
sqrt-prod25.3%
add-sqr-sqrt67.8%
sqrt-pow174.8%
metadata-eval74.8%
Applied egg-rr74.8%
if 1.69999999999999985e-27 < l Initial program 28.3%
associate-*l*28.3%
associate-/r*28.3%
sub-neg28.3%
distribute-rgt-in23.4%
unpow223.4%
times-frac13.9%
sqr-neg13.9%
times-frac23.4%
unpow223.4%
distribute-rgt-in28.3%
+-commutative28.3%
associate-+l+32.3%
Simplified32.3%
Taylor expanded in t around 0 70.4%
times-frac71.8%
Simplified71.8%
expm1-log1p-u44.6%
expm1-udef31.2%
div-inv31.2%
pow-flip31.2%
metadata-eval31.2%
associate-/r*31.2%
Applied egg-rr31.2%
expm1-def44.6%
expm1-log1p71.9%
associate-/r*71.8%
associate-*r/71.8%
associate-*l*71.8%
*-commutative71.8%
times-frac67.4%
Simplified67.4%
Taylor expanded in k around 0 54.2%
Taylor expanded in l around 0 52.4%
*-commutative52.4%
times-frac52.3%
Simplified52.3%
Final simplification69.3%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (* (/ (pow l 2.0) t_m) (pow k_m -4.0)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * ((pow(l, 2.0) / t_m) * pow(k_m, -4.0)));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * (((l ** 2.0d0) / t_m) * (k_m ** (-4.0d0))))
end function
k_m = Math.abs(k);
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_m) {
return t_s * (2.0 * ((Math.pow(l, 2.0) / t_m) * Math.pow(k_m, -4.0)));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * ((math.pow(l, 2.0) / t_m) * math.pow(k_m, -4.0)))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) * (k_m ^ -4.0)))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * (((l ^ 2.0) / t_m) * (k_m ^ -4.0))); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(2 \cdot \left(\frac{{\ell}^{2}}{t\_m} \cdot {k\_m}^{-4}\right)\right)
\end{array}
Initial program 29.0%
associate-*l*29.0%
associate-/r*29.0%
sub-neg29.0%
distribute-rgt-in23.8%
unpow223.8%
times-frac17.2%
sqr-neg17.2%
times-frac23.8%
unpow223.8%
distribute-rgt-in29.0%
+-commutative29.0%
associate-+l+40.1%
Simplified40.1%
Taylor expanded in k around 0 54.5%
*-commutative54.5%
associate-/r*54.0%
Simplified54.0%
div-inv53.6%
pow-flip53.6%
metadata-eval53.6%
Applied egg-rr53.6%
Final simplification53.6%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (/ (* (pow l 2.0) (pow k_m -4.0)) t_m))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * ((pow(l, 2.0) * pow(k_m, -4.0)) / t_m));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * (((l ** 2.0d0) * (k_m ** (-4.0d0))) / t_m))
end function
k_m = Math.abs(k);
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_m) {
return t_s * (2.0 * ((Math.pow(l, 2.0) * Math.pow(k_m, -4.0)) / t_m));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * ((math.pow(l, 2.0) * math.pow(k_m, -4.0)) / t_m))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * Float64(Float64((l ^ 2.0) * (k_m ^ -4.0)) / t_m))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * (((l ^ 2.0) * (k_m ^ -4.0)) / t_m)); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(2 \cdot \frac{{\ell}^{2} \cdot {k\_m}^{-4}}{t\_m}\right)
\end{array}
Initial program 29.0%
associate-*l*29.0%
associate-/r*29.0%
sub-neg29.0%
distribute-rgt-in23.8%
unpow223.8%
times-frac17.2%
sqr-neg17.2%
times-frac23.8%
unpow223.8%
distribute-rgt-in29.0%
+-commutative29.0%
associate-+l+40.1%
Simplified40.1%
Taylor expanded in k around 0 54.5%
*-commutative54.5%
associate-/r*54.0%
Simplified54.0%
div-inv53.6%
pow-flip53.6%
metadata-eval53.6%
Applied egg-rr53.6%
associate-*l/54.5%
Simplified54.5%
Final simplification54.5%
k_m = (fabs.f64 k) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s t_m l k_m) :precision binary64 (* t_s (* 2.0 (/ (pow (* l (pow k_m -2.0)) 2.0) t_m))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
return t_s * (2.0 * (pow((l * pow(k_m, -2.0)), 2.0) / t_m));
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = t_s * (2.0d0 * (((l * (k_m ** (-2.0d0))) ** 2.0d0) / t_m))
end function
k_m = Math.abs(k);
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_m) {
return t_s * (2.0 * (Math.pow((l * Math.pow(k_m, -2.0)), 2.0) / t_m));
}
k_m = math.fabs(k) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, t_m, l, k_m): return t_s * (2.0 * (math.pow((l * math.pow(k_m, -2.0)), 2.0) / t_m))
k_m = abs(k) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, t_m, l, k_m) return Float64(t_s * Float64(2.0 * Float64((Float64(l * (k_m ^ -2.0)) ^ 2.0) / t_m))) end
k_m = abs(k); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k_m) tmp = t_s * (2.0 * (((l * (k_m ^ -2.0)) ^ 2.0) / t_m)); end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * N[(2.0 * N[(N[Power[N[(l * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(2 \cdot \frac{{\left(\ell \cdot {k\_m}^{-2}\right)}^{2}}{t\_m}\right)
\end{array}
Initial program 29.0%
associate-*l*29.0%
associate-/r*29.0%
sub-neg29.0%
distribute-rgt-in23.8%
unpow223.8%
times-frac17.2%
sqr-neg17.2%
times-frac23.8%
unpow223.8%
distribute-rgt-in29.0%
+-commutative29.0%
associate-+l+40.1%
Simplified40.1%
Taylor expanded in k around 0 54.5%
*-commutative54.5%
associate-/r*54.0%
Simplified54.0%
div-inv53.6%
pow-flip53.6%
metadata-eval53.6%
Applied egg-rr53.6%
associate-*l/54.5%
Simplified54.5%
add-sqr-sqrt54.5%
pow254.5%
sqrt-prod54.5%
pow254.5%
sqrt-prod30.1%
add-sqr-sqrt62.2%
sqrt-pow167.8%
metadata-eval67.8%
Applied egg-rr67.8%
Final simplification67.8%
herbie shell --seed 2024027
(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))))