
(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 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= k_m 2.25e+14)
(/ 2.0 (pow (* (* k_m (sqrt 2.0)) (pow (/ (sqrt t_m) (cbrt l)) 3.0)) 2.0))
(if (<= k_m 6e+151)
(/
2.0
(/
(* (* (* t_m (pow k_m 2.0)) (pow l -2.0)) (pow (sin k_m) 2.0))
(cos k_m)))
(/
2.0
(pow
(*
(/ t_m (pow (cbrt l) 2.0))
(cbrt (* (* (sin k_m) (tan k_m)) (+ 2.0 (pow (/ k_m t_m) 2.0)))))
3.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.25e+14) {
tmp = 2.0 / pow(((k_m * sqrt(2.0)) * pow((sqrt(t_m) / cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 6e+151) {
tmp = 2.0 / ((((t_m * pow(k_m, 2.0)) * pow(l, -2.0)) * pow(sin(k_m), 2.0)) / cos(k_m));
} else {
tmp = 2.0 / pow(((t_m / pow(cbrt(l), 2.0)) * cbrt(((sin(k_m) * tan(k_m)) * (2.0 + pow((k_m / t_m), 2.0))))), 3.0);
}
return t_s * tmp;
}
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.25e+14) {
tmp = 2.0 / Math.pow(((k_m * Math.sqrt(2.0)) * Math.pow((Math.sqrt(t_m) / Math.cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 6e+151) {
tmp = 2.0 / ((((t_m * Math.pow(k_m, 2.0)) * Math.pow(l, -2.0)) * Math.pow(Math.sin(k_m), 2.0)) / Math.cos(k_m));
} else {
tmp = 2.0 / Math.pow(((t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(((Math.sin(k_m) * Math.tan(k_m)) * (2.0 + Math.pow((k_m / t_m), 2.0))))), 3.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.25e+14) tmp = Float64(2.0 / (Float64(Float64(k_m * sqrt(2.0)) * (Float64(sqrt(t_m) / cbrt(l)) ^ 3.0)) ^ 2.0)); elseif (k_m <= 6e+151) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * (k_m ^ 2.0)) * (l ^ -2.0)) * (sin(k_m) ^ 2.0)) / cos(k_m))); else tmp = Float64(2.0 / (Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(Float64(Float64(sin(k_m) * tan(k_m)) * Float64(2.0 + (Float64(k_m / t_m) ^ 2.0))))) ^ 3.0)); end return Float64(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.25e+14], N[(2.0 / N[Power[N[(N[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sqrt[t$95$m], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 6e+151], N[(2.0 / N[(N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.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}\;k\_m \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{{\left(\left(k\_m \cdot \sqrt{2}\right) \cdot {\left(\frac{\sqrt{t\_m}}{\sqrt[3]{\ell}}\right)}^{3}\right)}^{2}}\\
\mathbf{elif}\;k\_m \leq 6 \cdot 10^{+151}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(t\_m \cdot {k\_m}^{2}\right) \cdot {\ell}^{-2}\right) \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(2 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right)}\right)}^{3}}\\
\end{array}
\end{array}
if k < 2.25e14Initial program 58.2%
Simplified59.7%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/55.0%
unpow255.0%
cbrt-div55.0%
unpow355.0%
add-cbrt-cube60.0%
unpow260.0%
cbrt-prod66.0%
unpow266.0%
cube-mult66.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
pow266.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
Applied egg-rr66.0%
unpow266.0%
cube-mult66.0%
Simplified66.0%
Applied egg-rr38.5%
unpow138.5%
*-commutative38.5%
associate-*l/38.5%
Simplified38.5%
associate-*l/38.5%
add-cube-cbrt38.3%
associate-*l*38.4%
pow238.4%
cbrt-div38.4%
metadata-eval38.4%
sqrt-pow134.7%
unpow334.7%
sqrt-prod37.0%
sqrt-unprod38.4%
add-cbrt-cube38.4%
Applied egg-rr39.7%
associate-*r*39.7%
*-commutative39.7%
pow-plus39.7%
metadata-eval39.7%
Simplified39.7%
if 2.25e14 < k < 5.9999999999999998e151Initial program 66.5%
Simplified66.7%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
times-frac93.2%
Simplified93.2%
associate-*r/93.2%
div-inv93.2%
*-commutative93.2%
pow-flip93.1%
metadata-eval93.1%
Applied egg-rr93.1%
if 5.9999999999999998e151 < k Initial program 53.3%
Simplified53.4%
associate-*l*53.4%
associate-/r*66.6%
associate-+r+66.6%
metadata-eval66.6%
associate-*l*66.6%
add-cube-cbrt66.5%
pow366.6%
Applied egg-rr83.5%
Final simplification47.9%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(let* ((t_2 (* k_m (sqrt 2.0))))
(*
t_s
(if (<= k_m 4.3e+14)
(/ 2.0 (pow (* t_2 (pow (/ (sqrt t_m) (cbrt l)) 3.0)) 2.0))
(if (<= k_m 5.8e+152)
(/
2.0
(*
(/ (* t_m (pow k_m 2.0)) (pow l 2.0))
(/ (pow (sin k_m) 2.0) (cos k_m))))
(/ 2.0 (pow (* t_m (* (sqrt t_m) (/ t_2 l))) 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 = k_m * sqrt(2.0);
double tmp;
if (k_m <= 4.3e+14) {
tmp = 2.0 / pow((t_2 * pow((sqrt(t_m) / cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.8e+152) {
tmp = 2.0 / (((t_m * pow(k_m, 2.0)) / pow(l, 2.0)) * (pow(sin(k_m), 2.0) / cos(k_m)));
} else {
tmp = 2.0 / pow((t_m * (sqrt(t_m) * (t_2 / l))), 2.0);
}
return t_s * tmp;
}
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 = k_m * Math.sqrt(2.0);
double tmp;
if (k_m <= 4.3e+14) {
tmp = 2.0 / Math.pow((t_2 * Math.pow((Math.sqrt(t_m) / Math.cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.8e+152) {
tmp = 2.0 / (((t_m * Math.pow(k_m, 2.0)) / Math.pow(l, 2.0)) * (Math.pow(Math.sin(k_m), 2.0) / Math.cos(k_m)));
} else {
tmp = 2.0 / Math.pow((t_m * (Math.sqrt(t_m) * (t_2 / l))), 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(k_m * sqrt(2.0)) tmp = 0.0 if (k_m <= 4.3e+14) tmp = Float64(2.0 / (Float64(t_2 * (Float64(sqrt(t_m) / cbrt(l)) ^ 3.0)) ^ 2.0)); elseif (k_m <= 5.8e+152) tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * Float64((sin(k_m) ^ 2.0) / cos(k_m)))); else tmp = Float64(2.0 / (Float64(t_m * Float64(sqrt(t_m) * Float64(t_2 / l))) ^ 2.0)); end return Float64(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[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 4.3e+14], N[(2.0 / N[Power[N[(t$95$2 * N[Power[N[(N[Sqrt[t$95$m], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5.8e+152], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(t$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(t$95$2 / l), $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)
\\
\begin{array}{l}
t_2 := k\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{{\left(t\_2 \cdot {\left(\frac{\sqrt{t\_m}}{\sqrt[3]{\ell}}\right)}^{3}\right)}^{2}}\\
\mathbf{elif}\;k\_m \leq 5.8 \cdot 10^{+152}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k\_m}^{2}}{{\ell}^{2}} \cdot \frac{{\sin k\_m}^{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot \left(\sqrt{t\_m} \cdot \frac{t\_2}{\ell}\right)\right)}^{2}}\\
\end{array}
\end{array}
\end{array}
if k < 4.3e14Initial program 58.2%
Simplified59.7%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/55.0%
unpow255.0%
cbrt-div55.0%
unpow355.0%
add-cbrt-cube60.0%
unpow260.0%
cbrt-prod66.0%
unpow266.0%
cube-mult66.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
pow266.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
Applied egg-rr66.0%
unpow266.0%
cube-mult66.0%
Simplified66.0%
Applied egg-rr38.5%
unpow138.5%
*-commutative38.5%
associate-*l/38.5%
Simplified38.5%
associate-*l/38.5%
add-cube-cbrt38.3%
associate-*l*38.4%
pow238.4%
cbrt-div38.4%
metadata-eval38.4%
sqrt-pow134.7%
unpow334.7%
sqrt-prod37.0%
sqrt-unprod38.4%
add-cbrt-cube38.4%
Applied egg-rr39.7%
associate-*r*39.7%
*-commutative39.7%
pow-plus39.7%
metadata-eval39.7%
Simplified39.7%
if 4.3e14 < k < 5.7999999999999997e152Initial program 66.5%
Simplified66.7%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
times-frac93.2%
Simplified93.2%
if 5.7999999999999997e152 < k Initial program 53.3%
Simplified66.6%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/50.3%
unpow250.3%
cbrt-div50.3%
unpow350.3%
add-cbrt-cube56.9%
unpow256.9%
cbrt-prod67.1%
unpow267.1%
cube-mult67.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
pow267.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
Applied egg-rr67.1%
unpow267.1%
cube-mult67.1%
Simplified67.1%
Applied egg-rr36.8%
unpow136.8%
*-commutative36.8%
associate-*l/36.8%
Simplified36.8%
associate-/l*36.7%
add-cbrt-cube30.0%
pow-prod-up30.0%
metadata-eval30.0%
cbrt-prod36.7%
rem-cbrt-cube36.7%
associate-*l*36.7%
metadata-eval36.7%
sqrt-pow136.9%
unpow336.9%
sqrt-prod36.7%
sqrt-unprod36.7%
add-cbrt-cube43.4%
Applied egg-rr43.4%
Final simplification43.2%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(let* ((t_2 (* k_m (sqrt 2.0))))
(*
t_s
(if (<= k_m 3.2e+14)
(/ 2.0 (pow (* t_2 (pow (/ (sqrt t_m) (cbrt l)) 3.0)) 2.0))
(if (<= k_m 5.3e+153)
(/
2.0
(/
(* (* (* t_m (pow k_m 2.0)) (pow l -2.0)) (pow (sin k_m) 2.0))
(cos k_m)))
(/ 2.0 (pow (* t_m (* (sqrt t_m) (/ t_2 l))) 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 = k_m * sqrt(2.0);
double tmp;
if (k_m <= 3.2e+14) {
tmp = 2.0 / pow((t_2 * pow((sqrt(t_m) / cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.3e+153) {
tmp = 2.0 / ((((t_m * pow(k_m, 2.0)) * pow(l, -2.0)) * pow(sin(k_m), 2.0)) / cos(k_m));
} else {
tmp = 2.0 / pow((t_m * (sqrt(t_m) * (t_2 / l))), 2.0);
}
return t_s * tmp;
}
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 = k_m * Math.sqrt(2.0);
double tmp;
if (k_m <= 3.2e+14) {
tmp = 2.0 / Math.pow((t_2 * Math.pow((Math.sqrt(t_m) / Math.cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.3e+153) {
tmp = 2.0 / ((((t_m * Math.pow(k_m, 2.0)) * Math.pow(l, -2.0)) * Math.pow(Math.sin(k_m), 2.0)) / Math.cos(k_m));
} else {
tmp = 2.0 / Math.pow((t_m * (Math.sqrt(t_m) * (t_2 / l))), 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(k_m * sqrt(2.0)) tmp = 0.0 if (k_m <= 3.2e+14) tmp = Float64(2.0 / (Float64(t_2 * (Float64(sqrt(t_m) / cbrt(l)) ^ 3.0)) ^ 2.0)); elseif (k_m <= 5.3e+153) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * (k_m ^ 2.0)) * (l ^ -2.0)) * (sin(k_m) ^ 2.0)) / cos(k_m))); else tmp = Float64(2.0 / (Float64(t_m * Float64(sqrt(t_m) * Float64(t_2 / l))) ^ 2.0)); end return Float64(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[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 3.2e+14], N[(2.0 / N[Power[N[(t$95$2 * N[Power[N[(N[Sqrt[t$95$m], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5.3e+153], N[(2.0 / N[(N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(t$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(t$95$2 / l), $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)
\\
\begin{array}{l}
t_2 := k\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{{\left(t\_2 \cdot {\left(\frac{\sqrt{t\_m}}{\sqrt[3]{\ell}}\right)}^{3}\right)}^{2}}\\
\mathbf{elif}\;k\_m \leq 5.3 \cdot 10^{+153}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(t\_m \cdot {k\_m}^{2}\right) \cdot {\ell}^{-2}\right) \cdot {\sin k\_m}^{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot \left(\sqrt{t\_m} \cdot \frac{t\_2}{\ell}\right)\right)}^{2}}\\
\end{array}
\end{array}
\end{array}
if k < 3.2e14Initial program 58.2%
Simplified59.7%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/55.0%
unpow255.0%
cbrt-div55.0%
unpow355.0%
add-cbrt-cube60.0%
unpow260.0%
cbrt-prod66.0%
unpow266.0%
cube-mult66.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
pow266.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
Applied egg-rr66.0%
unpow266.0%
cube-mult66.0%
Simplified66.0%
Applied egg-rr38.5%
unpow138.5%
*-commutative38.5%
associate-*l/38.5%
Simplified38.5%
associate-*l/38.5%
add-cube-cbrt38.3%
associate-*l*38.4%
pow238.4%
cbrt-div38.4%
metadata-eval38.4%
sqrt-pow134.7%
unpow334.7%
sqrt-prod37.0%
sqrt-unprod38.4%
add-cbrt-cube38.4%
Applied egg-rr39.7%
associate-*r*39.7%
*-commutative39.7%
pow-plus39.7%
metadata-eval39.7%
Simplified39.7%
if 3.2e14 < k < 5.2999999999999999e153Initial program 66.5%
Simplified66.7%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
times-frac93.2%
Simplified93.2%
associate-*r/93.2%
div-inv93.2%
*-commutative93.2%
pow-flip93.1%
metadata-eval93.1%
Applied egg-rr93.1%
if 5.2999999999999999e153 < k Initial program 53.3%
Simplified66.6%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/50.3%
unpow250.3%
cbrt-div50.3%
unpow350.3%
add-cbrt-cube56.9%
unpow256.9%
cbrt-prod67.1%
unpow267.1%
cube-mult67.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
pow267.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
Applied egg-rr67.1%
unpow267.1%
cube-mult67.1%
Simplified67.1%
Applied egg-rr36.8%
unpow136.8%
*-commutative36.8%
associate-*l/36.8%
Simplified36.8%
associate-/l*36.7%
add-cbrt-cube30.0%
pow-prod-up30.0%
metadata-eval30.0%
cbrt-prod36.7%
rem-cbrt-cube36.7%
associate-*l*36.7%
metadata-eval36.7%
sqrt-pow136.9%
unpow336.9%
sqrt-prod36.7%
sqrt-unprod36.7%
add-cbrt-cube43.4%
Applied egg-rr43.4%
Final simplification43.2%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(let* ((t_2 (* k_m (sqrt 2.0))))
(*
t_s
(if (<= k_m 2.1e+14)
(/ 2.0 (pow (* t_2 (pow (/ (sqrt t_m) (cbrt l)) 3.0)) 2.0))
(if (<= k_m 5.3e+153)
(/
2.0
(*
(/ (* t_m (pow k_m 2.0)) (pow l 2.0))
(/ (- 0.5 (/ (cos (* k_m 2.0)) 2.0)) (cos k_m))))
(/ 2.0 (pow (* t_m (* (sqrt t_m) (/ t_2 l))) 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 = k_m * sqrt(2.0);
double tmp;
if (k_m <= 2.1e+14) {
tmp = 2.0 / pow((t_2 * pow((sqrt(t_m) / cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.3e+153) {
tmp = 2.0 / (((t_m * pow(k_m, 2.0)) / pow(l, 2.0)) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
} else {
tmp = 2.0 / pow((t_m * (sqrt(t_m) * (t_2 / l))), 2.0);
}
return t_s * tmp;
}
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 = k_m * Math.sqrt(2.0);
double tmp;
if (k_m <= 2.1e+14) {
tmp = 2.0 / Math.pow((t_2 * Math.pow((Math.sqrt(t_m) / Math.cbrt(l)), 3.0)), 2.0);
} else if (k_m <= 5.3e+153) {
tmp = 2.0 / (((t_m * Math.pow(k_m, 2.0)) / Math.pow(l, 2.0)) * ((0.5 - (Math.cos((k_m * 2.0)) / 2.0)) / Math.cos(k_m)));
} else {
tmp = 2.0 / Math.pow((t_m * (Math.sqrt(t_m) * (t_2 / l))), 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(k_m * sqrt(2.0)) tmp = 0.0 if (k_m <= 2.1e+14) tmp = Float64(2.0 / (Float64(t_2 * (Float64(sqrt(t_m) / cbrt(l)) ^ 3.0)) ^ 2.0)); elseif (k_m <= 5.3e+153) tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * Float64(Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0)) / cos(k_m)))); else tmp = Float64(2.0 / (Float64(t_m * Float64(sqrt(t_m) * Float64(t_2 / l))) ^ 2.0)); end return Float64(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[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 2.1e+14], N[(2.0 / N[Power[N[(t$95$2 * N[Power[N[(N[Sqrt[t$95$m], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5.3e+153], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(t$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(t$95$2 / l), $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)
\\
\begin{array}{l}
t_2 := k\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{{\left(t\_2 \cdot {\left(\frac{\sqrt{t\_m}}{\sqrt[3]{\ell}}\right)}^{3}\right)}^{2}}\\
\mathbf{elif}\;k\_m \leq 5.3 \cdot 10^{+153}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k\_m}^{2}}{{\ell}^{2}} \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot \left(\sqrt{t\_m} \cdot \frac{t\_2}{\ell}\right)\right)}^{2}}\\
\end{array}
\end{array}
\end{array}
if k < 2.1e14Initial program 58.2%
Simplified59.7%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/55.0%
unpow255.0%
cbrt-div55.0%
unpow355.0%
add-cbrt-cube60.0%
unpow260.0%
cbrt-prod66.0%
unpow266.0%
cube-mult66.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
pow266.0%
div-inv66.0%
pow-flip66.0%
metadata-eval66.0%
Applied egg-rr66.0%
unpow266.0%
cube-mult66.0%
Simplified66.0%
Applied egg-rr38.5%
unpow138.5%
*-commutative38.5%
associate-*l/38.5%
Simplified38.5%
associate-*l/38.5%
add-cube-cbrt38.3%
associate-*l*38.4%
pow238.4%
cbrt-div38.4%
metadata-eval38.4%
sqrt-pow134.7%
unpow334.7%
sqrt-prod37.0%
sqrt-unprod38.4%
add-cbrt-cube38.4%
Applied egg-rr39.7%
associate-*r*39.7%
*-commutative39.7%
pow-plus39.7%
metadata-eval39.7%
Simplified39.7%
if 2.1e14 < k < 5.2999999999999999e153Initial program 66.5%
Simplified66.7%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
times-frac93.2%
Simplified93.2%
unpow293.2%
sin-mult93.3%
Applied egg-rr93.3%
div-sub93.3%
+-inverses93.3%
cos-093.3%
metadata-eval93.3%
count-293.3%
*-commutative93.3%
Simplified93.3%
if 5.2999999999999999e153 < k Initial program 53.3%
Simplified66.6%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/50.3%
unpow250.3%
cbrt-div50.3%
unpow350.3%
add-cbrt-cube56.9%
unpow256.9%
cbrt-prod67.1%
unpow267.1%
cube-mult67.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
pow267.1%
div-inv67.1%
pow-flip67.1%
metadata-eval67.1%
Applied egg-rr67.1%
unpow267.1%
cube-mult67.1%
Simplified67.1%
Applied egg-rr36.8%
unpow136.8%
*-commutative36.8%
associate-*l/36.8%
Simplified36.8%
associate-/l*36.7%
add-cbrt-cube30.0%
pow-prod-up30.0%
metadata-eval30.0%
cbrt-prod36.7%
rem-cbrt-cube36.7%
associate-*l*36.7%
metadata-eval36.7%
sqrt-pow136.9%
unpow336.9%
sqrt-prod36.7%
sqrt-unprod36.7%
add-cbrt-cube43.4%
Applied egg-rr43.4%
Final simplification43.2%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (or (<= k_m 9.5e+14) (not (<= k_m 5.3e+153)))
(/ 2.0 (pow (* t_m (* (sqrt t_m) (/ (* k_m (sqrt 2.0)) l))) 2.0))
(/
2.0
(*
(/ (* t_m (pow k_m 2.0)) (pow l 2.0))
(/ (- 0.5 (/ (cos (* k_m 2.0)) 2.0)) (cos k_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) {
double tmp;
if ((k_m <= 9.5e+14) || !(k_m <= 5.3e+153)) {
tmp = 2.0 / pow((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0)) / l))), 2.0);
} else {
tmp = 2.0 / (((t_m * pow(k_m, 2.0)) / pow(l, 2.0)) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m)));
}
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 <= 9.5d+14) .or. (.not. (k_m <= 5.3d+153))) then
tmp = 2.0d0 / ((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0d0)) / l))) ** 2.0d0)
else
tmp = 2.0d0 / (((t_m * (k_m ** 2.0d0)) / (l ** 2.0d0)) * ((0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)) / cos(k_m)))
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 <= 9.5e+14) || !(k_m <= 5.3e+153)) {
tmp = 2.0 / Math.pow((t_m * (Math.sqrt(t_m) * ((k_m * Math.sqrt(2.0)) / l))), 2.0);
} else {
tmp = 2.0 / (((t_m * Math.pow(k_m, 2.0)) / Math.pow(l, 2.0)) * ((0.5 - (Math.cos((k_m * 2.0)) / 2.0)) / Math.cos(k_m)));
}
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 <= 9.5e+14) or not (k_m <= 5.3e+153): tmp = 2.0 / math.pow((t_m * (math.sqrt(t_m) * ((k_m * math.sqrt(2.0)) / l))), 2.0) else: tmp = 2.0 / (((t_m * math.pow(k_m, 2.0)) / math.pow(l, 2.0)) * ((0.5 - (math.cos((k_m * 2.0)) / 2.0)) / math.cos(k_m))) 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 <= 9.5e+14) || !(k_m <= 5.3e+153)) tmp = Float64(2.0 / (Float64(t_m * Float64(sqrt(t_m) * Float64(Float64(k_m * sqrt(2.0)) / l))) ^ 2.0)); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * Float64(Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0)) / cos(k_m)))); 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 <= 9.5e+14) || ~((k_m <= 5.3e+153))) tmp = 2.0 / ((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0)) / l))) ^ 2.0); else tmp = 2.0 / (((t_m * (k_m ^ 2.0)) / (l ^ 2.0)) * ((0.5 - (cos((k_m * 2.0)) / 2.0)) / cos(k_m))); 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[Or[LessEqual[k$95$m, 9.5e+14], N[Not[LessEqual[k$95$m, 5.3e+153]], $MachinePrecision]], N[(2.0 / N[Power[N[(t$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(N[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $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 9.5 \cdot 10^{+14} \lor \neg \left(k\_m \leq 5.3 \cdot 10^{+153}\right):\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot \left(\sqrt{t\_m} \cdot \frac{k\_m \cdot \sqrt{2}}{\ell}\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k\_m}^{2}}{{\ell}^{2}} \cdot \frac{0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}}{\cos k\_m}}\\
\end{array}
\end{array}
if k < 9.5e14 or 5.2999999999999999e153 < k Initial program 57.6%
Simplified60.5%
Taylor expanded in k around 0 60.4%
add-cube-cbrt60.4%
pow360.4%
associate-/l/54.4%
unpow254.4%
cbrt-div54.4%
unpow354.4%
add-cbrt-cube59.7%
unpow259.7%
cbrt-prod66.1%
unpow266.1%
cube-mult66.1%
div-inv66.1%
pow-flip66.1%
metadata-eval66.1%
pow266.1%
div-inv66.1%
pow-flip66.1%
metadata-eval66.1%
Applied egg-rr66.1%
unpow266.1%
cube-mult66.1%
Simplified66.1%
Applied egg-rr38.3%
unpow138.3%
*-commutative38.3%
associate-*l/38.3%
Simplified38.3%
associate-/l*37.9%
add-cbrt-cube33.7%
pow-prod-up33.7%
metadata-eval33.7%
cbrt-prod34.9%
rem-cbrt-cube37.9%
associate-*l*37.9%
metadata-eval37.9%
sqrt-pow135.5%
unpow335.5%
sqrt-prod37.4%
sqrt-unprod37.8%
add-cbrt-cube39.6%
Applied egg-rr39.6%
if 9.5e14 < k < 5.2999999999999999e153Initial program 66.5%
Simplified66.7%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
times-frac93.2%
Simplified93.2%
unpow293.2%
sin-mult93.3%
Applied egg-rr93.3%
div-sub93.3%
+-inverses93.3%
cos-093.3%
metadata-eval93.3%
count-293.3%
*-commutative93.3%
Simplified93.3%
Final simplification42.7%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= t_m 3.4e-96)
(* 2.0 (pow (* l (/ (pow k_m -2.0) (sqrt t_m))) 2.0))
(/ 2.0 (pow (* t_m (* (sqrt t_m) (/ (* k_m (sqrt 2.0)) l))) 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 (t_m <= 3.4e-96) {
tmp = 2.0 * pow((l * (pow(k_m, -2.0) / sqrt(t_m))), 2.0);
} else {
tmp = 2.0 / pow((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0)) / l))), 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 (t_m <= 3.4d-96) then
tmp = 2.0d0 * ((l * ((k_m ** (-2.0d0)) / sqrt(t_m))) ** 2.0d0)
else
tmp = 2.0d0 / ((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0d0)) / l))) ** 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 (t_m <= 3.4e-96) {
tmp = 2.0 * Math.pow((l * (Math.pow(k_m, -2.0) / Math.sqrt(t_m))), 2.0);
} else {
tmp = 2.0 / Math.pow((t_m * (Math.sqrt(t_m) * ((k_m * Math.sqrt(2.0)) / l))), 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 t_m <= 3.4e-96: tmp = 2.0 * math.pow((l * (math.pow(k_m, -2.0) / math.sqrt(t_m))), 2.0) else: tmp = 2.0 / math.pow((t_m * (math.sqrt(t_m) * ((k_m * math.sqrt(2.0)) / l))), 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 (t_m <= 3.4e-96) tmp = Float64(2.0 * (Float64(l * Float64((k_m ^ -2.0) / sqrt(t_m))) ^ 2.0)); else tmp = Float64(2.0 / (Float64(t_m * Float64(sqrt(t_m) * Float64(Float64(k_m * sqrt(2.0)) / l))) ^ 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 (t_m <= 3.4e-96) tmp = 2.0 * ((l * ((k_m ^ -2.0) / sqrt(t_m))) ^ 2.0); else tmp = 2.0 / ((t_m * (sqrt(t_m) * ((k_m * sqrt(2.0)) / l))) ^ 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[t$95$m, 3.4e-96], N[(2.0 * N[Power[N[(l * N[(N[Power[k$95$m, -2.0], $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(t$95$m * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(N[(k$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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}\;t\_m \leq 3.4 \cdot 10^{-96}:\\
\;\;\;\;2 \cdot {\left(\ell \cdot \frac{{k\_m}^{-2}}{\sqrt{t\_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot \left(\sqrt{t\_m} \cdot \frac{k\_m \cdot \sqrt{2}}{\ell}\right)\right)}^{2}}\\
\end{array}
\end{array}
if t < 3.4000000000000001e-96Initial program 52.2%
Simplified50.0%
Taylor expanded in k around 0 46.9%
associate-/r*47.9%
Simplified47.9%
Taylor expanded in k around inf 57.0%
*-commutative57.0%
associate-/r*58.3%
Simplified58.3%
*-un-lft-identity58.3%
div-inv58.3%
pow-flip58.3%
metadata-eval58.3%
Applied egg-rr58.3%
*-lft-identity58.3%
associate-*l/57.9%
associate-/l*57.0%
Simplified57.0%
add-sqr-sqrt38.7%
pow238.7%
sqrt-prod35.3%
sqrt-pow139.4%
metadata-eval39.4%
pow139.4%
sqrt-div18.2%
sqrt-pow118.2%
metadata-eval18.2%
Applied egg-rr18.2%
if 3.4000000000000001e-96 < t Initial program 71.7%
Simplified68.0%
Taylor expanded in k around 0 65.6%
add-cube-cbrt65.5%
pow365.5%
associate-/l/61.5%
unpow261.5%
cbrt-div61.5%
unpow361.5%
add-cbrt-cube64.6%
unpow264.6%
cbrt-prod71.8%
unpow271.8%
cube-mult71.7%
div-inv71.8%
pow-flip71.8%
metadata-eval71.8%
pow271.8%
div-inv71.7%
pow-flip71.7%
metadata-eval71.7%
Applied egg-rr71.7%
unpow271.7%
cube-mult71.7%
Simplified71.7%
Applied egg-rr90.6%
unpow190.6%
*-commutative90.6%
associate-*l/90.6%
Simplified90.6%
associate-/l*88.3%
add-cbrt-cube79.1%
pow-prod-up79.1%
metadata-eval79.1%
cbrt-prod81.7%
rem-cbrt-cube88.3%
associate-*l*88.3%
metadata-eval88.3%
sqrt-pow181.7%
unpow381.6%
sqrt-prod86.7%
sqrt-unprod88.2%
add-cbrt-cube89.7%
Applied egg-rr89.7%
Final simplification39.7%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= t_m 3.1e-105)
(* 2.0 (/ (pow (/ l (sqrt t_m)) 2.0) (pow k_m 4.0)))
(/ 1.0 (pow (* k_m (/ (pow t_m 1.5) l)) 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 (t_m <= 3.1e-105) {
tmp = 2.0 * (pow((l / sqrt(t_m)), 2.0) / pow(k_m, 4.0));
} else {
tmp = 1.0 / pow((k_m * (pow(t_m, 1.5) / l)), 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 (t_m <= 3.1d-105) then
tmp = 2.0d0 * (((l / sqrt(t_m)) ** 2.0d0) / (k_m ** 4.0d0))
else
tmp = 1.0d0 / ((k_m * ((t_m ** 1.5d0) / l)) ** 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 (t_m <= 3.1e-105) {
tmp = 2.0 * (Math.pow((l / Math.sqrt(t_m)), 2.0) / Math.pow(k_m, 4.0));
} else {
tmp = 1.0 / Math.pow((k_m * (Math.pow(t_m, 1.5) / l)), 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 t_m <= 3.1e-105: tmp = 2.0 * (math.pow((l / math.sqrt(t_m)), 2.0) / math.pow(k_m, 4.0)) else: tmp = 1.0 / math.pow((k_m * (math.pow(t_m, 1.5) / l)), 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 (t_m <= 3.1e-105) tmp = Float64(2.0 * Float64((Float64(l / sqrt(t_m)) ^ 2.0) / (k_m ^ 4.0))); else tmp = Float64(1.0 / (Float64(k_m * Float64((t_m ^ 1.5) / l)) ^ 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 (t_m <= 3.1e-105) tmp = 2.0 * (((l / sqrt(t_m)) ^ 2.0) / (k_m ^ 4.0)); else tmp = 1.0 / ((k_m * ((t_m ^ 1.5) / l)) ^ 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[t$95$m, 3.1e-105], N[(2.0 * N[(N[Power[N[(l / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(k$95$m * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $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}\;t\_m \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{\sqrt{t\_m}}\right)}^{2}}{{k\_m}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(k\_m \cdot \frac{{t\_m}^{1.5}}{\ell}\right)}^{2}}\\
\end{array}
\end{array}
if t < 3.10000000000000014e-105Initial program 52.0%
Simplified49.8%
Taylor expanded in k around 0 46.5%
associate-/r*47.6%
Simplified47.6%
Taylor expanded in k around inf 56.8%
*-commutative56.8%
associate-/r*58.2%
Simplified58.2%
add-sqr-sqrt30.7%
sqrt-div15.3%
sqrt-pow19.2%
metadata-eval9.2%
pow19.2%
sqrt-div9.2%
sqrt-pow117.2%
metadata-eval17.2%
pow117.2%
Applied egg-rr17.2%
unpow217.2%
Simplified17.2%
if 3.10000000000000014e-105 < t Initial program 71.5%
Simplified69.2%
Taylor expanded in k around 0 66.9%
add-cube-cbrt66.8%
pow366.8%
associate-/l/61.7%
unpow261.7%
cbrt-div61.7%
unpow361.7%
add-cbrt-cube64.7%
unpow264.7%
cbrt-prod72.8%
unpow272.8%
cube-mult72.8%
div-inv72.8%
pow-flip72.8%
metadata-eval72.8%
pow272.8%
div-inv72.8%
pow-flip72.8%
metadata-eval72.8%
Applied egg-rr72.8%
unpow272.8%
cube-mult72.8%
Simplified72.8%
Applied egg-rr91.0%
unpow191.0%
*-commutative91.0%
Simplified91.0%
frac-2neg91.0%
metadata-eval91.0%
div-inv91.0%
associate-*l/91.0%
associate-*l/91.0%
associate-*r*90.9%
unpow-prod-down91.0%
pow291.0%
rem-square-sqrt91.1%
Applied egg-rr91.1%
associate-*r/91.1%
metadata-eval91.1%
neg-mul-191.1%
associate-/r*91.1%
metadata-eval91.1%
*-commutative91.1%
associate-/r*91.1%
metadata-eval91.1%
*-commutative91.1%
Simplified91.1%
Final simplification40.3%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= t_m 1.42e-95)
(* 2.0 (pow (* l (/ (pow k_m -2.0) (sqrt t_m))) 2.0))
(/ 1.0 (pow (* k_m (/ (pow t_m 1.5) l)) 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 (t_m <= 1.42e-95) {
tmp = 2.0 * pow((l * (pow(k_m, -2.0) / sqrt(t_m))), 2.0);
} else {
tmp = 1.0 / pow((k_m * (pow(t_m, 1.5) / l)), 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 (t_m <= 1.42d-95) then
tmp = 2.0d0 * ((l * ((k_m ** (-2.0d0)) / sqrt(t_m))) ** 2.0d0)
else
tmp = 1.0d0 / ((k_m * ((t_m ** 1.5d0) / l)) ** 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 (t_m <= 1.42e-95) {
tmp = 2.0 * Math.pow((l * (Math.pow(k_m, -2.0) / Math.sqrt(t_m))), 2.0);
} else {
tmp = 1.0 / Math.pow((k_m * (Math.pow(t_m, 1.5) / l)), 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 t_m <= 1.42e-95: tmp = 2.0 * math.pow((l * (math.pow(k_m, -2.0) / math.sqrt(t_m))), 2.0) else: tmp = 1.0 / math.pow((k_m * (math.pow(t_m, 1.5) / l)), 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 (t_m <= 1.42e-95) tmp = Float64(2.0 * (Float64(l * Float64((k_m ^ -2.0) / sqrt(t_m))) ^ 2.0)); else tmp = Float64(1.0 / (Float64(k_m * Float64((t_m ^ 1.5) / l)) ^ 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 (t_m <= 1.42e-95) tmp = 2.0 * ((l * ((k_m ^ -2.0) / sqrt(t_m))) ^ 2.0); else tmp = 1.0 / ((k_m * ((t_m ^ 1.5) / l)) ^ 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[t$95$m, 1.42e-95], N[(2.0 * N[Power[N[(l * N[(N[Power[k$95$m, -2.0], $MachinePrecision] / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(k$95$m * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $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}\;t\_m \leq 1.42 \cdot 10^{-95}:\\
\;\;\;\;2 \cdot {\left(\ell \cdot \frac{{k\_m}^{-2}}{\sqrt{t\_m}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(k\_m \cdot \frac{{t\_m}^{1.5}}{\ell}\right)}^{2}}\\
\end{array}
\end{array}
if t < 1.42000000000000007e-95Initial program 52.2%
Simplified50.0%
Taylor expanded in k around 0 46.9%
associate-/r*47.9%
Simplified47.9%
Taylor expanded in k around inf 57.0%
*-commutative57.0%
associate-/r*58.3%
Simplified58.3%
*-un-lft-identity58.3%
div-inv58.3%
pow-flip58.3%
metadata-eval58.3%
Applied egg-rr58.3%
*-lft-identity58.3%
associate-*l/57.9%
associate-/l*57.0%
Simplified57.0%
add-sqr-sqrt38.7%
pow238.7%
sqrt-prod35.3%
sqrt-pow139.4%
metadata-eval39.4%
pow139.4%
sqrt-div18.2%
sqrt-pow118.2%
metadata-eval18.2%
Applied egg-rr18.2%
if 1.42000000000000007e-95 < t Initial program 71.7%
Simplified68.0%
Taylor expanded in k around 0 65.6%
add-cube-cbrt65.5%
pow365.5%
associate-/l/61.5%
unpow261.5%
cbrt-div61.5%
unpow361.5%
add-cbrt-cube64.6%
unpow264.6%
cbrt-prod71.8%
unpow271.8%
cube-mult71.7%
div-inv71.8%
pow-flip71.8%
metadata-eval71.8%
pow271.8%
div-inv71.7%
pow-flip71.7%
metadata-eval71.7%
Applied egg-rr71.7%
unpow271.7%
cube-mult71.7%
Simplified71.7%
Applied egg-rr90.6%
unpow190.6%
*-commutative90.6%
Simplified90.6%
frac-2neg90.6%
metadata-eval90.6%
div-inv90.6%
associate-*l/90.6%
associate-*l/90.6%
associate-*r*90.6%
unpow-prod-down90.6%
pow290.6%
rem-square-sqrt90.7%
Applied egg-rr90.7%
associate-*r/90.7%
metadata-eval90.7%
neg-mul-190.7%
associate-/r*90.7%
metadata-eval90.7%
*-commutative90.7%
associate-/r*90.7%
metadata-eval90.7%
*-commutative90.7%
Simplified90.7%
Final simplification40.0%
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
:precision binary64
(*
t_s
(if (<= t_m 3.1e-111)
(* 2.0 (/ (/ (pow l 2.0) t_m) (pow k_m 4.0)))
(/ 1.0 (pow (* k_m (/ (pow t_m 1.5) l)) 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 (t_m <= 3.1e-111) {
tmp = 2.0 * ((pow(l, 2.0) / t_m) / pow(k_m, 4.0));
} else {
tmp = 1.0 / pow((k_m * (pow(t_m, 1.5) / l)), 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 (t_m <= 3.1d-111) then
tmp = 2.0d0 * (((l ** 2.0d0) / t_m) / (k_m ** 4.0d0))
else
tmp = 1.0d0 / ((k_m * ((t_m ** 1.5d0) / l)) ** 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 (t_m <= 3.1e-111) {
tmp = 2.0 * ((Math.pow(l, 2.0) / t_m) / Math.pow(k_m, 4.0));
} else {
tmp = 1.0 / Math.pow((k_m * (Math.pow(t_m, 1.5) / l)), 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 t_m <= 3.1e-111: tmp = 2.0 * ((math.pow(l, 2.0) / t_m) / math.pow(k_m, 4.0)) else: tmp = 1.0 / math.pow((k_m * (math.pow(t_m, 1.5) / l)), 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 (t_m <= 3.1e-111) tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t_m) / (k_m ^ 4.0))); else tmp = Float64(1.0 / (Float64(k_m * Float64((t_m ^ 1.5) / l)) ^ 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 (t_m <= 3.1e-111) tmp = 2.0 * (((l ^ 2.0) / t_m) / (k_m ^ 4.0)); else tmp = 1.0 / ((k_m * ((t_m ^ 1.5) / l)) ^ 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[t$95$m, 3.1e-111], 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], N[(1.0 / N[Power[N[(k$95$m * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $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}\;t\_m \leq 3.1 \cdot 10^{-111}:\\
\;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t\_m}}{{k\_m}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(k\_m \cdot \frac{{t\_m}^{1.5}}{\ell}\right)}^{2}}\\
\end{array}
\end{array}
if t < 3.10000000000000014e-111Initial program 52.0%
Simplified49.8%
Taylor expanded in k around 0 46.5%
associate-/r*47.6%
Simplified47.6%
Taylor expanded in k around inf 56.8%
*-commutative56.8%
associate-/r*58.2%
Simplified58.2%
if 3.10000000000000014e-111 < t Initial program 71.5%
Simplified69.2%
Taylor expanded in k around 0 66.9%
add-cube-cbrt66.8%
pow366.8%
associate-/l/61.7%
unpow261.7%
cbrt-div61.7%
unpow361.7%
add-cbrt-cube64.7%
unpow264.7%
cbrt-prod72.8%
unpow272.8%
cube-mult72.8%
div-inv72.8%
pow-flip72.8%
metadata-eval72.8%
pow272.8%
div-inv72.8%
pow-flip72.8%
metadata-eval72.8%
Applied egg-rr72.8%
unpow272.8%
cube-mult72.8%
Simplified72.8%
Applied egg-rr91.0%
unpow191.0%
*-commutative91.0%
Simplified91.0%
frac-2neg91.0%
metadata-eval91.0%
div-inv91.0%
associate-*l/91.0%
associate-*l/91.0%
associate-*r*90.9%
unpow-prod-down91.0%
pow291.0%
rem-square-sqrt91.1%
Applied egg-rr91.1%
associate-*r/91.1%
metadata-eval91.1%
neg-mul-191.1%
associate-/r*91.1%
metadata-eval91.1%
*-commutative91.1%
associate-/r*91.1%
metadata-eval91.1%
*-commutative91.1%
Simplified91.1%
Final simplification68.4%
k_m = (fabs.f64 k) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) 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((l ^ 2.0) * Float64((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[Power[l, 2.0], $MachinePrecision] * N[(N[Power[k$95$m, -4.0], $MachinePrecision] / t$95$m), $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({\ell}^{2} \cdot \frac{{k\_m}^{-4}}{t\_m}\right)\right)
\end{array}
Initial program 58.1%
Simplified54.6%
Taylor expanded in k around 0 52.0%
associate-/r*52.0%
Simplified52.0%
Taylor expanded in k around inf 55.2%
*-commutative55.2%
associate-/r*56.4%
Simplified56.4%
*-un-lft-identity56.4%
div-inv56.4%
pow-flip56.4%
metadata-eval56.4%
Applied egg-rr56.4%
*-lft-identity56.4%
associate-*l/55.8%
associate-/l*55.2%
Simplified55.2%
Final simplification55.2%
k_m = (fabs.f64 k) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) 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 \frac{\frac{{\ell}^{2}}{t\_m}}{{k\_m}^{4}}\right)
\end{array}
Initial program 58.1%
Simplified54.6%
Taylor expanded in k around 0 52.0%
associate-/r*52.0%
Simplified52.0%
Taylor expanded in k around inf 55.2%
*-commutative55.2%
associate-/r*56.4%
Simplified56.4%
Final simplification56.4%
herbie shell --seed 2024077
(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))))