
(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 16 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}
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 4.5e-160)
(/
2.0
(* (/ (* t (pow k 2.0)) (cos k)) (log (pow (exp t_1) (pow l -2.0)))))
(if (<= k 2.8e+97)
(/ 2.0 (/ (* t_1 (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))
(/
2.0
(pow
(*
(/ t (pow (cbrt l) 2.0))
(cbrt (* (sin k) (* (tan k) (pow (/ k t) 2.0)))))
3.0))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 4.5e-160) {
tmp = 2.0 / (((t * pow(k, 2.0)) / cos(k)) * log(pow(exp(t_1), pow(l, -2.0))));
} else if (k <= 2.8e+97) {
tmp = 2.0 / ((t_1 * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
} else {
tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((sin(k) * (tan(k) * pow((k / t), 2.0))))), 3.0);
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 4.5e-160) {
tmp = 2.0 / (((t * Math.pow(k, 2.0)) / Math.cos(k)) * Math.log(Math.pow(Math.exp(t_1), Math.pow(l, -2.0))));
} else if (k <= 2.8e+97) {
tmp = 2.0 / ((t_1 * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
} else {
tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))))), 3.0);
}
return tmp;
}
k = abs(k) function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 4.5e-160) tmp = Float64(2.0 / Float64(Float64(Float64(t * (k ^ 2.0)) / cos(k)) * log((exp(t_1) ^ (l ^ -2.0))))); elseif (k <= 2.8e+97) tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0))); else tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))))) ^ 3.0)); end return tmp end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 4.5e-160], N[(2.0 / N[(N[(N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[Log[N[Power[N[Exp[t$95$1], $MachinePrecision], N[Power[l, -2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.8e+97], N[(2.0 / N[(N[(t$95$1 * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 4.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \log \left({\left(e^{t_1}\right)}^{\left({\ell}^{-2}\right)}\right)}\\
\mathbf{elif}\;k \leq 2.8 \cdot 10^{+97}:\\
\;\;\;\;\frac{2}{\frac{t_1 \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\
\end{array}
\end{array}
if k < 4.50000000000000026e-160Initial program 40.2%
Simplified48.4%
unpow348.4%
times-frac59.6%
pow259.6%
Applied egg-rr59.6%
Taylor expanded in t around 0 75.8%
associate-*r*75.8%
*-commutative75.8%
times-frac75.9%
*-commutative75.9%
Simplified75.9%
add-log-exp61.6%
div-inv61.6%
exp-prod68.3%
pow-flip68.3%
metadata-eval68.3%
Applied egg-rr68.3%
if 4.50000000000000026e-160 < k < 2.7999999999999999e97Initial program 27.9%
Simplified37.1%
unpow337.1%
times-frac44.5%
pow244.5%
Applied egg-rr44.5%
Taylor expanded in t around 0 82.3%
associate-*r*82.3%
*-commutative82.3%
times-frac81.9%
*-commutative81.9%
Simplified81.9%
associate-*r/82.2%
associate-/l*82.3%
Applied egg-rr82.3%
if 2.7999999999999999e97 < k Initial program 38.8%
Simplified46.7%
unpow346.7%
times-frac56.3%
pow256.3%
Applied egg-rr56.3%
unpow256.3%
clear-num56.3%
inv-pow56.3%
clear-num56.3%
inv-pow56.3%
unpow-prod-down56.3%
inv-pow56.3%
associate-/r*56.3%
clear-num56.3%
Applied egg-rr56.3%
Applied egg-rr71.6%
Final simplification71.9%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (or (<= k 4.5e-160) (not (<= k 3.2e+97)))
(/
2.0
(pow
(*
(/ t (pow (cbrt l) 2.0))
(cbrt (* (sin k) (* (tan k) (pow (/ k t) 2.0)))))
3.0))
(/
2.0
(/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if ((k <= 4.5e-160) || !(k <= 3.2e+97)) {
tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((sin(k) * (tan(k) * pow((k / t), 2.0))))), 3.0);
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if ((k <= 4.5e-160) || !(k <= 3.2e+97)) {
tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))))), 3.0);
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if ((k <= 4.5e-160) || !(k <= 3.2e+97)) tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))))) ^ 3.0)); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[Or[LessEqual[k, 4.5e-160], N[Not[LessEqual[k, 3.2e+97]], $MachinePrecision]], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-160} \lor \neg \left(k \leq 3.2 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\
\end{array}
\end{array}
if k < 4.50000000000000026e-160 or 3.20000000000000016e97 < k Initial program 39.8%
Simplified47.9%
unpow347.9%
times-frac58.8%
pow258.8%
Applied egg-rr58.8%
unpow258.8%
clear-num58.8%
inv-pow58.8%
clear-num58.8%
inv-pow58.8%
unpow-prod-down58.3%
inv-pow58.3%
associate-/r*58.8%
clear-num58.8%
Applied egg-rr58.8%
Applied egg-rr75.1%
if 4.50000000000000026e-160 < k < 3.20000000000000016e97Initial program 27.9%
Simplified37.1%
unpow337.1%
times-frac44.5%
pow244.5%
Applied egg-rr44.5%
Taylor expanded in t around 0 82.3%
associate-*r*82.3%
*-commutative82.3%
times-frac81.9%
*-commutative81.9%
Simplified81.9%
associate-*r/82.2%
associate-/l*82.3%
Applied egg-rr82.3%
Final simplification76.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 1.32e+154)
(/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))
(/
2.0
(*
(* (sin k) (* (tan k) (pow (/ k t) 2.0)))
(pow (/ t (pow (cbrt l) 2.0)) 3.0)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 1.32e+154) {
tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
} else {
tmp = 2.0 / ((sin(k) * (tan(k) * pow((k / t), 2.0))) * pow((t / pow(cbrt(l), 2.0)), 3.0));
}
return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.32e+154) {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
} else {
tmp = 2.0 / ((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))) * Math.pow((t / Math.pow(Math.cbrt(l), 2.0)), 3.0));
}
return tmp;
}
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 1.32e+154) tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0))); else tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))) * (Float64(t / (cbrt(l) ^ 2.0)) ^ 3.0))); end return tmp end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 1.32e+154], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}}\\
\end{array}
\end{array}
if k < 1.31999999999999998e154Initial program 36.9%
Simplified45.3%
unpow345.3%
times-frac55.8%
pow255.8%
Applied egg-rr55.8%
Taylor expanded in t around 0 77.2%
associate-*r*77.2%
*-commutative77.2%
times-frac77.2%
*-commutative77.2%
Simplified77.2%
associate-*r/77.2%
associate-/l*77.3%
Applied egg-rr77.3%
if 1.31999999999999998e154 < k Initial program 39.7%
Simplified47.7%
unpow347.6%
times-frac55.7%
pow255.7%
Applied egg-rr55.7%
unpow255.7%
clear-num55.7%
inv-pow55.7%
clear-num55.7%
inv-pow55.7%
unpow-prod-down55.7%
inv-pow55.7%
associate-/r*55.7%
clear-num55.7%
Applied egg-rr55.7%
Applied egg-rr74.0%
*-commutative74.0%
cube-prod67.9%
associate-*r*67.9%
*-commutative67.9%
rem-cube-cbrt68.0%
*-commutative68.0%
associate-*r*68.0%
Simplified68.0%
Final simplification75.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (* (/ (pow l 2.0) (pow (sin k) 2.0)) (/ (cos k) (* t (pow k 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((pow(l, 2.0) / pow(sin(k), 2.0)) * (cos(k) / (t * pow(k, 2.0))));
}
NOTE: k should be positive before calling this function
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 * (((l ** 2.0d0) / (sin(k) ** 2.0d0)) * (cos(k) / (t * (k ** 2.0d0))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((Math.pow(l, 2.0) / Math.pow(Math.sin(k), 2.0)) * (Math.cos(k) / (t * Math.pow(k, 2.0))));
}
k = abs(k) def code(t, l, k): return 2.0 * ((math.pow(l, 2.0) / math.pow(math.sin(k), 2.0)) * (math.cos(k) / (t * math.pow(k, 2.0))))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64((l ^ 2.0) / (sin(k) ^ 2.0)) * Float64(cos(k) / Float64(t * (k ^ 2.0))))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * (((l ^ 2.0) / (sin(k) ^ 2.0)) * (cos(k) / (t * (k ^ 2.0)))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t \cdot {k}^{2}}\right)
\end{array}
Initial program 37.3%
associate-/r*37.3%
associate-*l/37.7%
associate--l+37.7%
Simplified37.7%
+-commutative37.7%
associate-+l-46.0%
metadata-eval46.0%
--rgt-identity46.0%
unpow246.0%
clear-num46.0%
clear-num46.0%
frac-times45.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in t around 0 74.9%
associate-*r*74.9%
*-commutative74.9%
times-frac74.8%
*-commutative74.8%
Simplified74.8%
Final simplification74.8%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) (* t (pow (sin k) 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * (t * pow(sin(k), 2.0))));
}
NOTE: k should be positive before calling this function
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 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * (t * (sin(k) ** 2.0d0))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * (t * Math.pow(Math.sin(k), 2.0))));
}
k = abs(k) def code(t, l, k): return 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * (t * math.pow(math.sin(k), 2.0))))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * Float64(t * (sin(k) ^ 2.0))))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * (t * (sin(k) ^ 2.0)))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}
\end{array}
Initial program 37.3%
Simplified45.6%
Taylor expanded in t around 0 74.9%
Final simplification74.9%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
}
NOTE: k should be positive before calling this function
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 / (((sin(k) ** 2.0d0) * (t / (cos(k) / (k ** 2.0d0)))) / (l ** 2.0d0))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
}
k = abs(k) def code(t, l, k): return 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (math.cos(k) / math.pow(k, 2.0)))) / math.pow(l, 2.0))
k = abs(k) function code(t, l, k) return Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (cos(k) / (k ^ 2.0)))) / (l ^ 2.0)); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}
\end{array}
Initial program 37.3%
Simplified45.7%
unpow345.6%
times-frac55.8%
pow255.8%
Applied egg-rr55.8%
Taylor expanded in t around 0 74.9%
associate-*r*74.9%
*-commutative74.9%
times-frac74.9%
*-commutative74.9%
Simplified74.9%
associate-*r/74.9%
associate-/l*74.9%
Applied egg-rr74.9%
Final simplification74.9%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (pow k 2.0))))
(if (<= t -1.5e+151)
(* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1)))
(if (<= t -3.1e-140)
(/
2.0
(*
(* (sin k) (* (/ (pow t 2.0) l) (/ t l)))
(* (tan k) (* k (/ (/ k t) t)))))
(if (<= t 2.4e-116)
(/ 2.0 (* (/ t_1 (cos k)) (/ (pow k 2.0) (pow l 2.0))))
(if (<= t 6.5e+83)
(/
(/ 2.0 (* (tan k) (* (/ (pow t 3.0) l) (/ (sin k) l))))
(/ 1.0 (* (/ t k) (/ t k))))
(/
2.0
(/
(* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0))))
(pow l 2.0)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = t * pow(k, 2.0);
double tmp;
if (t <= -1.5e+151) {
tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
} else if (t <= -3.1e-140) {
tmp = 2.0 / ((sin(k) * ((pow(t, 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
} else if (t <= 2.4e-116) {
tmp = 2.0 / ((t_1 / cos(k)) * (pow(k, 2.0) / pow(l, 2.0)));
} else if (t <= 6.5e+83) {
tmp = (2.0 / (tan(k) * ((pow(t, 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * (k ** 2.0d0)
if (t <= (-1.5d+151)) then
tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
else if (t <= (-3.1d-140)) then
tmp = 2.0d0 / ((sin(k) * (((t ** 2.0d0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))))
else if (t <= 2.4d-116) then
tmp = 2.0d0 / ((t_1 / cos(k)) * ((k ** 2.0d0) / (l ** 2.0d0)))
else if (t <= 6.5d+83) then
tmp = (2.0d0 / (tan(k) * (((t ** 3.0d0) / l) * (sin(k) / l)))) / (1.0d0 / ((t / k) * (t / k)))
else
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = t * Math.pow(k, 2.0);
double tmp;
if (t <= -1.5e+151) {
tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
} else if (t <= -3.1e-140) {
tmp = 2.0 / ((Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l))) * (Math.tan(k) * (k * ((k / t) / t))));
} else if (t <= 2.4e-116) {
tmp = 2.0 / ((t_1 / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 2.0)));
} else if (t <= 6.5e+83) {
tmp = (2.0 / (Math.tan(k) * ((Math.pow(t, 3.0) / l) * (Math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = t * math.pow(k, 2.0) tmp = 0 if t <= -1.5e+151: tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1)) elif t <= -3.1e-140: tmp = 2.0 / ((math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))) * (math.tan(k) * (k * ((k / t) / t)))) elif t <= 2.4e-116: tmp = 2.0 / ((t_1 / math.cos(k)) * (math.pow(k, 2.0) / math.pow(l, 2.0))) elif t <= 6.5e+83: tmp = (2.0 / (math.tan(k) * ((math.pow(t, 3.0) / l) * (math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k))) else: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(t * (k ^ 2.0)) tmp = 0.0 if (t <= -1.5e+151) tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1))); elseif (t <= -3.1e-140) tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t))))); elseif (t <= 2.4e-116) tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64((k ^ 2.0) / (l ^ 2.0)))); elseif (t <= 6.5e+83) tmp = Float64(Float64(2.0 / Float64(tan(k) * Float64(Float64((t ^ 3.0) / l) * Float64(sin(k) / l)))) / Float64(1.0 / Float64(Float64(t / k) * Float64(t / k)))); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = t * (k ^ 2.0); tmp = 0.0; if (t <= -1.5e+151) tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1)); elseif (t <= -3.1e-140) tmp = 2.0 / ((sin(k) * (((t ^ 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t)))); elseif (t <= 2.4e-116) tmp = 2.0 / ((t_1 / cos(k)) * ((k ^ 2.0) / (l ^ 2.0))); elseif (t <= 6.5e+83) tmp = (2.0 / (tan(k) * (((t ^ 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k))); else tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+151], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.1e-140], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-116], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+83], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(t / k), $MachinePrecision] * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+151}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-140}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+83}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\
\end{array}
\end{array}
if t < -1.5e151Initial program 13.2%
Simplified34.6%
Taylor expanded in t around 0 89.6%
Taylor expanded in k around 0 87.3%
if -1.5e151 < t < -3.0999999999999999e-140Initial program 52.5%
Simplified58.3%
unpow358.3%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
unpow277.0%
clear-num77.0%
inv-pow77.0%
clear-num77.0%
inv-pow77.0%
unpow-prod-down77.1%
inv-pow77.1%
associate-/r*77.0%
clear-num77.0%
Applied egg-rr77.0%
associate-/r/77.1%
Applied egg-rr77.1%
if -3.0999999999999999e-140 < t < 2.39999999999999993e-116Initial program 35.5%
Simplified35.5%
unpow335.5%
times-frac42.2%
pow242.2%
Applied egg-rr42.2%
Taylor expanded in t around 0 77.2%
associate-*r*77.1%
*-commutative77.1%
times-frac78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in k around 0 64.5%
if 2.39999999999999993e-116 < t < 6.5000000000000003e83Initial program 55.5%
associate-/r*55.4%
associate-*l/55.4%
associate--l+55.4%
Simplified55.4%
+-commutative55.4%
associate-+l-71.0%
metadata-eval71.0%
--rgt-identity71.0%
unpow271.0%
clear-num71.0%
clear-num71.0%
frac-times71.1%
metadata-eval71.1%
Applied egg-rr71.1%
times-frac77.8%
Applied egg-rr77.8%
if 6.5000000000000003e83 < t Initial program 21.1%
Simplified31.9%
unpow331.9%
times-frac45.4%
pow245.4%
Applied egg-rr45.4%
Taylor expanded in t around 0 74.7%
associate-*r*74.7%
*-commutative74.7%
times-frac74.9%
*-commutative74.9%
Simplified74.9%
associate-*r/74.7%
associate-/l*74.6%
Applied egg-rr74.6%
Taylor expanded in k around 0 72.8%
Final simplification74.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 5.6e-5)
(/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0)))) (pow l 2.0)))
(*
2.0
(/
(* (cos k) (pow l 2.0))
(* (pow k 2.0) (* t (- 0.5 (/ (cos (* k 2.0)) 2.0))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5.6e-5) {
tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
} else {
tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * (t * (0.5 - (cos((k * 2.0)) / 2.0)))));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.6d-5) then
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
else
tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * (t * (0.5d0 - (cos((k * 2.0d0)) / 2.0d0)))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.6e-5) {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
} else {
tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * (t * (0.5 - (Math.cos((k * 2.0)) / 2.0)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 5.6e-5: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0)) else: tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * (t * (0.5 - (math.cos((k * 2.0)) / 2.0))))) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5.6e-5) tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0))); else tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * Float64(t * Float64(0.5 - Float64(cos(Float64(k * 2.0)) / 2.0)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.6e-5) tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0)); else tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * (t * (0.5 - (cos((k * 2.0)) / 2.0))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5.6e-5], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t * N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)\right)}\\
\end{array}
\end{array}
if k < 5.59999999999999992e-5Initial program 38.6%
Simplified46.8%
unpow346.8%
times-frac57.5%
pow257.5%
Applied egg-rr57.5%
Taylor expanded in t around 0 77.3%
associate-*r*77.3%
*-commutative77.3%
times-frac77.3%
*-commutative77.3%
Simplified77.3%
associate-*r/77.3%
associate-/l*77.3%
Applied egg-rr77.3%
Taylor expanded in k around 0 71.5%
if 5.59999999999999992e-5 < k Initial program 34.0%
Simplified42.7%
Taylor expanded in t around 0 68.5%
unpow268.5%
sin-mult68.3%
Applied egg-rr68.3%
div-sub68.3%
+-inverses68.3%
cos-068.3%
metadata-eval68.3%
count-268.3%
Simplified68.3%
Final simplification70.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= k 5.6e-5)
(/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0)))) (pow l 2.0)))
(/
2.0
(/
(* (/ t (/ (cos k) (pow k 2.0))) (- 0.5 (/ (cos (* k 2.0)) 2.0)))
(pow l 2.0)))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (k <= 5.6e-5) {
tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
} else {
tmp = 2.0 / (((t / (cos(k) / pow(k, 2.0))) * (0.5 - (cos((k * 2.0)) / 2.0))) / pow(l, 2.0));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.6d-5) then
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
else
tmp = 2.0d0 / (((t / (cos(k) / (k ** 2.0d0))) * (0.5d0 - (cos((k * 2.0d0)) / 2.0d0))) / (l ** 2.0d0))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.6e-5) {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
} else {
tmp = 2.0 / (((t / (Math.cos(k) / Math.pow(k, 2.0))) * (0.5 - (Math.cos((k * 2.0)) / 2.0))) / Math.pow(l, 2.0));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if k <= 5.6e-5: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0)) else: tmp = 2.0 / (((t / (math.cos(k) / math.pow(k, 2.0))) * (0.5 - (math.cos((k * 2.0)) / 2.0))) / math.pow(l, 2.0)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (k <= 5.6e-5) tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(t / Float64(cos(k) / (k ^ 2.0))) * Float64(0.5 - Float64(cos(Float64(k * 2.0)) / 2.0))) / (l ^ 2.0))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.6e-5) tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0)); else tmp = 2.0 / (((t / (cos(k) / (k ^ 2.0))) * (0.5 - (cos((k * 2.0)) / 2.0))) / (l ^ 2.0)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[k, 5.6e-5], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)}{{\ell}^{2}}}\\
\end{array}
\end{array}
if k < 5.59999999999999992e-5Initial program 38.6%
Simplified46.8%
unpow346.8%
times-frac57.5%
pow257.5%
Applied egg-rr57.5%
Taylor expanded in t around 0 77.3%
associate-*r*77.3%
*-commutative77.3%
times-frac77.3%
*-commutative77.3%
Simplified77.3%
associate-*r/77.3%
associate-/l*77.3%
Applied egg-rr77.3%
Taylor expanded in k around 0 71.5%
if 5.59999999999999992e-5 < k Initial program 34.0%
Simplified42.7%
unpow342.7%
times-frac51.1%
pow251.1%
Applied egg-rr51.1%
Taylor expanded in t around 0 68.5%
associate-*r*68.6%
*-commutative68.6%
times-frac68.5%
*-commutative68.5%
Simplified68.5%
associate-*r/68.5%
associate-/l*68.6%
Applied egg-rr68.6%
unpow268.5%
sin-mult68.3%
Applied egg-rr68.3%
div-sub68.3%
+-inverses68.3%
cos-068.3%
metadata-eval68.3%
count-268.3%
Simplified68.3%
Final simplification70.6%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ 2.0 (/ (* (pow (sin k) 2.0) (* t (pow k 2.0))) (pow l 2.0))))
(t_2 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
(if (<= t -3.2e+159)
t_1
(if (<= t -2e-143)
(/ 2.0 (* t_2 (* (tan k) (* k (/ (/ k t) t)))))
(if (or (<= t 3.2e-122) (not (<= t 1.42e+196)))
t_1
(/ 2.0 (* t_2 (* (tan k) (/ k (* t (/ t k)))))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = 2.0 / ((pow(sin(k), 2.0) * (t * pow(k, 2.0))) / pow(l, 2.0));
double t_2 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -3.2e+159) {
tmp = t_1;
} else if (t <= -2e-143) {
tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
} else if ((t <= 3.2e-122) || !(t <= 1.42e+196)) {
tmp = t_1;
} else {
tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 / (((sin(k) ** 2.0d0) * (t * (k ** 2.0d0))) / (l ** 2.0d0))
t_2 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
if (t <= (-3.2d+159)) then
tmp = t_1
else if (t <= (-2d-143)) then
tmp = 2.0d0 / (t_2 * (tan(k) * (k * ((k / t) / t))))
else if ((t <= 3.2d-122) .or. (.not. (t <= 1.42d+196))) then
tmp = t_1
else
tmp = 2.0d0 / (t_2 * (tan(k) * (k / (t * (t / k)))))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t * Math.pow(k, 2.0))) / Math.pow(l, 2.0));
double t_2 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -3.2e+159) {
tmp = t_1;
} else if (t <= -2e-143) {
tmp = 2.0 / (t_2 * (Math.tan(k) * (k * ((k / t) / t))));
} else if ((t <= 3.2e-122) || !(t <= 1.42e+196)) {
tmp = t_1;
} else {
tmp = 2.0 / (t_2 * (Math.tan(k) * (k / (t * (t / k)))));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = 2.0 / ((math.pow(math.sin(k), 2.0) * (t * math.pow(k, 2.0))) / math.pow(l, 2.0)) t_2 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l)) tmp = 0 if t <= -3.2e+159: tmp = t_1 elif t <= -2e-143: tmp = 2.0 / (t_2 * (math.tan(k) * (k * ((k / t) / t)))) elif (t <= 3.2e-122) or not (t <= 1.42e+196): tmp = t_1 else: tmp = 2.0 / (t_2 * (math.tan(k) * (k / (t * (t / k))))) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t * (k ^ 2.0))) / (l ^ 2.0))) t_2 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) tmp = 0.0 if (t <= -3.2e+159) tmp = t_1; elseif (t <= -2e-143) tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t))))); elseif ((t <= 3.2e-122) || !(t <= 1.42e+196)) tmp = t_1; else tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k)))))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = 2.0 / (((sin(k) ^ 2.0) * (t * (k ^ 2.0))) / (l ^ 2.0)); t_2 = sin(k) * (((t ^ 2.0) / l) * (t / l)); tmp = 0.0; if (t <= -3.2e+159) tmp = t_1; elseif (t <= -2e-143) tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t)))); elseif ((t <= 3.2e-122) || ~((t <= 1.42e+196))) tmp = t_1; else tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k))))); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+159], t$95$1, If[LessEqual[t, -2e-143], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.2e-122], N[Not[LessEqual[t, 1.42e+196]], $MachinePrecision]], t$95$1, N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\
t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-143}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-122} \lor \neg \left(t \leq 1.42 \cdot 10^{+196}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\
\end{array}
\end{array}
if t < -3.19999999999999985e159 or -1.9999999999999999e-143 < t < 3.2000000000000002e-122 or 1.42000000000000002e196 < t Initial program 26.4%
Simplified32.7%
unpow332.7%
times-frac36.0%
pow236.0%
Applied egg-rr36.0%
Taylor expanded in t around 0 80.7%
associate-*r*80.7%
*-commutative80.7%
times-frac80.6%
*-commutative80.6%
Simplified80.6%
associate-*r/80.7%
associate-/l*80.7%
Applied egg-rr80.7%
Taylor expanded in k around 0 71.8%
if -3.19999999999999985e159 < t < -1.9999999999999999e-143Initial program 51.1%
Simplified56.8%
unpow356.8%
times-frac75.0%
pow275.0%
Applied egg-rr75.0%
unpow275.0%
clear-num75.0%
inv-pow75.0%
clear-num75.0%
inv-pow75.0%
unpow-prod-down75.1%
inv-pow75.1%
associate-/r*75.0%
clear-num75.0%
Applied egg-rr75.0%
associate-/r/75.1%
Applied egg-rr75.1%
if 3.2000000000000002e-122 < t < 1.42000000000000002e196Initial program 44.7%
Simplified61.7%
unpow361.7%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
div-inv77.0%
unpow-prod-down67.5%
Applied egg-rr67.5%
pow-prod-down77.0%
div-inv77.0%
pow277.0%
clear-num77.0%
div-inv77.1%
associate-/l/77.1%
Applied egg-rr77.1%
Final simplification73.8%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (pow k 2.0)))
(t_2 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1))))
(t_3 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
(if (<= t -3.1e+152)
t_2
(if (<= t -5.5e-145)
(/ 2.0 (* t_3 (* (tan k) (* k (/ (/ k t) t)))))
(if (<= t 1.9e-123)
t_2
(if (<= t 1.42e+196)
(/ 2.0 (* t_3 (* (tan k) (/ k (* t (/ t k))))))
(/ 2.0 (/ (* (pow (sin k) 2.0) t_1) (pow l 2.0)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = t * pow(k, 2.0);
double t_2 = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
double t_3 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -3.1e+152) {
tmp = t_2;
} else if (t <= -5.5e-145) {
tmp = 2.0 / (t_3 * (tan(k) * (k * ((k / t) / t))));
} else if (t <= 1.9e-123) {
tmp = t_2;
} else if (t <= 1.42e+196) {
tmp = 2.0 / (t_3 * (tan(k) * (k / (t * (t / k)))));
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) * t_1) / pow(l, 2.0));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * (k ** 2.0d0)
t_2 = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
t_3 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
if (t <= (-3.1d+152)) then
tmp = t_2
else if (t <= (-5.5d-145)) then
tmp = 2.0d0 / (t_3 * (tan(k) * (k * ((k / t) / t))))
else if (t <= 1.9d-123) then
tmp = t_2
else if (t <= 1.42d+196) then
tmp = 2.0d0 / (t_3 * (tan(k) * (k / (t * (t / k)))))
else
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * t_1) / (l ** 2.0d0))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = t * Math.pow(k, 2.0);
double t_2 = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
double t_3 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -3.1e+152) {
tmp = t_2;
} else if (t <= -5.5e-145) {
tmp = 2.0 / (t_3 * (Math.tan(k) * (k * ((k / t) / t))));
} else if (t <= 1.9e-123) {
tmp = t_2;
} else if (t <= 1.42e+196) {
tmp = 2.0 / (t_3 * (Math.tan(k) * (k / (t * (t / k)))));
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * t_1) / Math.pow(l, 2.0));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = t * math.pow(k, 2.0) t_2 = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1)) t_3 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l)) tmp = 0 if t <= -3.1e+152: tmp = t_2 elif t <= -5.5e-145: tmp = 2.0 / (t_3 * (math.tan(k) * (k * ((k / t) / t)))) elif t <= 1.9e-123: tmp = t_2 elif t <= 1.42e+196: tmp = 2.0 / (t_3 * (math.tan(k) * (k / (t * (t / k))))) else: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * t_1) / math.pow(l, 2.0)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(t * (k ^ 2.0)) t_2 = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1))) t_3 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) tmp = 0.0 if (t <= -3.1e+152) tmp = t_2; elseif (t <= -5.5e-145) tmp = Float64(2.0 / Float64(t_3 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t))))); elseif (t <= 1.9e-123) tmp = t_2; elseif (t <= 1.42e+196) tmp = Float64(2.0 / Float64(t_3 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k)))))); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * t_1) / (l ^ 2.0))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = t * (k ^ 2.0); t_2 = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1)); t_3 = sin(k) * (((t ^ 2.0) / l) * (t / l)); tmp = 0.0; if (t <= -3.1e+152) tmp = t_2; elseif (t <= -5.5e-145) tmp = 2.0 / (t_3 * (tan(k) * (k * ((k / t) / t)))); elseif (t <= 1.9e-123) tmp = t_2; elseif (t <= 1.42e+196) tmp = 2.0 / (t_3 * (tan(k) * (k / (t * (t / k))))); else tmp = 2.0 / (((sin(k) ^ 2.0) * t_1) / (l ^ 2.0)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e+152], t$95$2, If[LessEqual[t, -5.5e-145], N[(2.0 / N[(t$95$3 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-123], t$95$2, If[LessEqual[t, 1.42e+196], N[(2.0 / N[(t$95$3 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
t_2 := 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\
t_3 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-145}:\\
\;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-123}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\
\;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\
\end{array}
\end{array}
if t < -3.1e152 or -5.50000000000000015e-145 < t < 1.89999999999999998e-123Initial program 28.3%
Simplified35.5%
Taylor expanded in t around 0 81.2%
Taylor expanded in k around 0 71.2%
if -3.1e152 < t < -5.50000000000000015e-145Initial program 52.5%
Simplified58.3%
unpow358.3%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
unpow277.0%
clear-num77.0%
inv-pow77.0%
clear-num77.0%
inv-pow77.0%
unpow-prod-down77.1%
inv-pow77.1%
associate-/r*77.0%
clear-num77.0%
Applied egg-rr77.0%
associate-/r/77.1%
Applied egg-rr77.1%
if 1.89999999999999998e-123 < t < 1.42000000000000002e196Initial program 44.7%
Simplified61.7%
unpow361.7%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
div-inv77.0%
unpow-prod-down67.5%
Applied egg-rr67.5%
pow-prod-down77.0%
div-inv77.0%
pow277.0%
clear-num77.0%
div-inv77.1%
associate-/l/77.1%
Applied egg-rr77.1%
if 1.42000000000000002e196 < t Initial program 11.1%
Simplified11.7%
unpow311.7%
times-frac12.2%
pow212.2%
Applied egg-rr12.2%
Taylor expanded in t around 0 74.4%
associate-*r*74.4%
*-commutative74.4%
times-frac74.6%
*-commutative74.6%
Simplified74.6%
associate-*r/74.4%
associate-/l*74.4%
Applied egg-rr74.4%
Taylor expanded in k around 0 70.3%
Final simplification74.0%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* t (pow k 2.0)))
(t_2 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
(if (<= t -5.2e+153)
(* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1)))
(if (<= t -4.2e-141)
(/ 2.0 (* t_2 (* (tan k) (* k (/ (/ k t) t)))))
(if (<= t 9e-120)
(/ 2.0 (* (/ t_1 (cos k)) (/ (pow k 2.0) (pow l 2.0))))
(if (<= t 1.42e+196)
(/ 2.0 (* t_2 (* (tan k) (/ k (* t (/ t k))))))
(/ 2.0 (/ (* (pow (sin k) 2.0) t_1) (pow l 2.0)))))))))k = abs(k);
double code(double t, double l, double k) {
double t_1 = t * pow(k, 2.0);
double t_2 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -5.2e+153) {
tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
} else if (t <= -4.2e-141) {
tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
} else if (t <= 9e-120) {
tmp = 2.0 / ((t_1 / cos(k)) * (pow(k, 2.0) / pow(l, 2.0)));
} else if (t <= 1.42e+196) {
tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) * t_1) / pow(l, 2.0));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (k ** 2.0d0)
t_2 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
if (t <= (-5.2d+153)) then
tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
else if (t <= (-4.2d-141)) then
tmp = 2.0d0 / (t_2 * (tan(k) * (k * ((k / t) / t))))
else if (t <= 9d-120) then
tmp = 2.0d0 / ((t_1 / cos(k)) * ((k ** 2.0d0) / (l ** 2.0d0)))
else if (t <= 1.42d+196) then
tmp = 2.0d0 / (t_2 * (tan(k) * (k / (t * (t / k)))))
else
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * t_1) / (l ** 2.0d0))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double t_1 = t * Math.pow(k, 2.0);
double t_2 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
double tmp;
if (t <= -5.2e+153) {
tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
} else if (t <= -4.2e-141) {
tmp = 2.0 / (t_2 * (Math.tan(k) * (k * ((k / t) / t))));
} else if (t <= 9e-120) {
tmp = 2.0 / ((t_1 / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 2.0)));
} else if (t <= 1.42e+196) {
tmp = 2.0 / (t_2 * (Math.tan(k) * (k / (t * (t / k)))));
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * t_1) / Math.pow(l, 2.0));
}
return tmp;
}
k = abs(k) def code(t, l, k): t_1 = t * math.pow(k, 2.0) t_2 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l)) tmp = 0 if t <= -5.2e+153: tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1)) elif t <= -4.2e-141: tmp = 2.0 / (t_2 * (math.tan(k) * (k * ((k / t) / t)))) elif t <= 9e-120: tmp = 2.0 / ((t_1 / math.cos(k)) * (math.pow(k, 2.0) / math.pow(l, 2.0))) elif t <= 1.42e+196: tmp = 2.0 / (t_2 * (math.tan(k) * (k / (t * (t / k))))) else: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * t_1) / math.pow(l, 2.0)) return tmp
k = abs(k) function code(t, l, k) t_1 = Float64(t * (k ^ 2.0)) t_2 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) tmp = 0.0 if (t <= -5.2e+153) tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1))); elseif (t <= -4.2e-141) tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t))))); elseif (t <= 9e-120) tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64((k ^ 2.0) / (l ^ 2.0)))); elseif (t <= 1.42e+196) tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k)))))); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * t_1) / (l ^ 2.0))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) t_1 = t * (k ^ 2.0); t_2 = sin(k) * (((t ^ 2.0) / l) * (t / l)); tmp = 0.0; if (t <= -5.2e+153) tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1)); elseif (t <= -4.2e-141) tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t)))); elseif (t <= 9e-120) tmp = 2.0 / ((t_1 / cos(k)) * ((k ^ 2.0) / (l ^ 2.0))); elseif (t <= 1.42e+196) tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k))))); else tmp = 2.0 / (((sin(k) ^ 2.0) * t_1) / (l ^ 2.0)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+153], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-141], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-120], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.42e+196], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-141}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\
\end{array}
\end{array}
if t < -5.1999999999999998e153Initial program 13.2%
Simplified34.6%
Taylor expanded in t around 0 89.6%
Taylor expanded in k around 0 87.3%
if -5.1999999999999998e153 < t < -4.1999999999999999e-141Initial program 52.5%
Simplified58.3%
unpow358.3%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
unpow277.0%
clear-num77.0%
inv-pow77.0%
clear-num77.0%
inv-pow77.0%
unpow-prod-down77.1%
inv-pow77.1%
associate-/r*77.0%
clear-num77.0%
Applied egg-rr77.0%
associate-/r/77.1%
Applied egg-rr77.1%
if -4.1999999999999999e-141 < t < 9e-120Initial program 36.0%
Simplified36.0%
unpow336.0%
times-frac41.4%
pow241.4%
Applied egg-rr41.4%
Taylor expanded in t around 0 76.9%
associate-*r*76.8%
*-commutative76.8%
times-frac77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in k around 0 64.1%
if 9e-120 < t < 1.42000000000000002e196Initial program 44.7%
Simplified61.7%
unpow361.7%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
div-inv77.0%
unpow-prod-down67.5%
Applied egg-rr67.5%
pow-prod-down77.0%
div-inv77.0%
pow277.0%
clear-num77.0%
div-inv77.1%
associate-/l/77.1%
Applied egg-rr77.1%
if 1.42000000000000002e196 < t Initial program 11.1%
Simplified11.7%
unpow311.7%
times-frac12.2%
pow212.2%
Applied egg-rr12.2%
Taylor expanded in t around 0 74.4%
associate-*r*74.4%
*-commutative74.4%
times-frac74.6%
*-commutative74.6%
Simplified74.6%
associate-*r/74.4%
associate-/l*74.4%
Applied egg-rr74.4%
Taylor expanded in k around 0 70.3%
Final simplification74.3%
NOTE: k should be positive before calling this function
(FPCore (t l k)
:precision binary64
(if (<= t -8e+149)
(* 2.0 (/ (* (cos k) (pow l 2.0)) (* t (pow k 4.0))))
(if (<= t -2.1e-146)
(/
2.0
(*
(* (sin k) (* (/ (pow t 2.0) l) (/ t l)))
(* (tan k) (* k (/ (/ k t) t)))))
(if (<= t 2.35e-116)
(* (pow k -4.0) (* (pow l 2.0) (/ 2.0 t)))
(if (<= t 4.5e+89)
(/
(/ 2.0 (* (tan k) (* (/ (pow t 3.0) l) (/ (sin k) l))))
(/ 1.0 (* (/ t k) (/ t k))))
(* (/ 2.0 t) (/ (pow l 2.0) (pow k 4.0))))))))k = abs(k);
double code(double t, double l, double k) {
double tmp;
if (t <= -8e+149) {
tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (t * pow(k, 4.0)));
} else if (t <= -2.1e-146) {
tmp = 2.0 / ((sin(k) * ((pow(t, 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
} else if (t <= 2.35e-116) {
tmp = pow(k, -4.0) * (pow(l, 2.0) * (2.0 / t));
} else if (t <= 4.5e+89) {
tmp = (2.0 / (tan(k) * ((pow(t, 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
} else {
tmp = (2.0 / t) * (pow(l, 2.0) / pow(k, 4.0));
}
return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= (-8d+149)) then
tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / (t * (k ** 4.0d0)))
else if (t <= (-2.1d-146)) then
tmp = 2.0d0 / ((sin(k) * (((t ** 2.0d0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))))
else if (t <= 2.35d-116) then
tmp = (k ** (-4.0d0)) * ((l ** 2.0d0) * (2.0d0 / t))
else if (t <= 4.5d+89) then
tmp = (2.0d0 / (tan(k) * (((t ** 3.0d0) / l) * (sin(k) / l)))) / (1.0d0 / ((t / k) * (t / k)))
else
tmp = (2.0d0 / t) * ((l ** 2.0d0) / (k ** 4.0d0))
end if
code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
double tmp;
if (t <= -8e+149) {
tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t * Math.pow(k, 4.0)));
} else if (t <= -2.1e-146) {
tmp = 2.0 / ((Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l))) * (Math.tan(k) * (k * ((k / t) / t))));
} else if (t <= 2.35e-116) {
tmp = Math.pow(k, -4.0) * (Math.pow(l, 2.0) * (2.0 / t));
} else if (t <= 4.5e+89) {
tmp = (2.0 / (Math.tan(k) * ((Math.pow(t, 3.0) / l) * (Math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
} else {
tmp = (2.0 / t) * (Math.pow(l, 2.0) / Math.pow(k, 4.0));
}
return tmp;
}
k = abs(k) def code(t, l, k): tmp = 0 if t <= -8e+149: tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t * math.pow(k, 4.0))) elif t <= -2.1e-146: tmp = 2.0 / ((math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))) * (math.tan(k) * (k * ((k / t) / t)))) elif t <= 2.35e-116: tmp = math.pow(k, -4.0) * (math.pow(l, 2.0) * (2.0 / t)) elif t <= 4.5e+89: tmp = (2.0 / (math.tan(k) * ((math.pow(t, 3.0) / l) * (math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k))) else: tmp = (2.0 / t) * (math.pow(l, 2.0) / math.pow(k, 4.0)) return tmp
k = abs(k) function code(t, l, k) tmp = 0.0 if (t <= -8e+149) tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t * (k ^ 4.0)))); elseif (t <= -2.1e-146) tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t))))); elseif (t <= 2.35e-116) tmp = Float64((k ^ -4.0) * Float64((l ^ 2.0) * Float64(2.0 / t))); elseif (t <= 4.5e+89) tmp = Float64(Float64(2.0 / Float64(tan(k) * Float64(Float64((t ^ 3.0) / l) * Float64(sin(k) / l)))) / Float64(1.0 / Float64(Float64(t / k) * Float64(t / k)))); else tmp = Float64(Float64(2.0 / t) * Float64((l ^ 2.0) / (k ^ 4.0))); end return tmp end
k = abs(k) function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= -8e+149) tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t * (k ^ 4.0))); elseif (t <= -2.1e-146) tmp = 2.0 / ((sin(k) * (((t ^ 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t)))); elseif (t <= 2.35e-116) tmp = (k ^ -4.0) * ((l ^ 2.0) * (2.0 / t)); elseif (t <= 4.5e+89) tmp = (2.0 / (tan(k) * (((t ^ 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k))); else tmp = (2.0 / t) * ((l ^ 2.0) / (k ^ 4.0)); end tmp_2 = tmp; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := If[LessEqual[t, -8e+149], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.1e-146], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-116], N[(N[Power[k, -4.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+89], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(t / k), $MachinePrecision] * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-146}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-116}:\\
\;\;\;\;{k}^{-4} \cdot \left({\ell}^{2} \cdot \frac{2}{t}\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}\\
\end{array}
\end{array}
if t < -8.00000000000000039e149Initial program 13.2%
Simplified34.6%
Taylor expanded in t around 0 89.6%
Taylor expanded in k around 0 79.9%
if -8.00000000000000039e149 < t < -2.0999999999999999e-146Initial program 52.5%
Simplified58.3%
unpow358.3%
times-frac77.0%
pow277.0%
Applied egg-rr77.0%
unpow277.0%
clear-num77.0%
inv-pow77.0%
clear-num77.0%
inv-pow77.0%
unpow-prod-down77.1%
inv-pow77.1%
associate-/r*77.0%
clear-num77.0%
Applied egg-rr77.0%
associate-/r/77.1%
Applied egg-rr77.1%
if -2.0999999999999999e-146 < t < 2.34999999999999997e-116Initial program 35.5%
Simplified35.5%
Taylor expanded in k around 0 59.5%
associate-*r/59.5%
*-commutative59.5%
times-frac60.5%
Simplified60.5%
expm1-log1p-u30.1%
expm1-udef30.1%
*-commutative30.1%
div-inv30.1%
pow-flip31.5%
metadata-eval31.5%
Applied egg-rr31.5%
expm1-def31.4%
expm1-log1p61.8%
*-commutative61.8%
associate-*l*62.9%
Simplified62.9%
if 2.34999999999999997e-116 < t < 4.5e89Initial program 55.5%
associate-/r*55.4%
associate-*l/55.4%
associate--l+55.4%
Simplified55.4%
+-commutative55.4%
associate-+l-71.0%
metadata-eval71.0%
--rgt-identity71.0%
unpow271.0%
clear-num71.0%
clear-num71.0%
frac-times71.1%
metadata-eval71.1%
Applied egg-rr71.1%
times-frac77.8%
Applied egg-rr77.8%
if 4.5e89 < t Initial program 21.1%
Simplified31.9%
Taylor expanded in k around 0 69.8%
associate-*r/69.8%
*-commutative69.8%
times-frac69.9%
Simplified69.9%
Final simplification72.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t (pow k 4.0)))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * ((cos(k) * pow(l, 2.0)) / (t * pow(k, 4.0)));
}
NOTE: k should be positive before calling this function
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 * ((cos(k) * (l ** 2.0d0)) / (t * (k ** 4.0d0)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t * Math.pow(k, 4.0)));
}
k = abs(k) def code(t, l, k): return 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t * math.pow(k, 4.0)))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t * (k ^ 4.0)))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t * (k ^ 4.0))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}
\end{array}
Initial program 37.3%
Simplified45.6%
Taylor expanded in t around 0 74.9%
Taylor expanded in k around 0 65.3%
Final simplification65.3%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (* 2.0 (/ (pow l 2.0) (* t (pow k 4.0)))))
k = abs(k);
double code(double t, double l, double k) {
return 2.0 * (pow(l, 2.0) / (t * pow(k, 4.0)));
}
NOTE: k should be positive before calling this function
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 * ((l ** 2.0d0) / (t * (k ** 4.0d0)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return 2.0 * (Math.pow(l, 2.0) / (t * Math.pow(k, 4.0)));
}
k = abs(k) def code(t, l, k): return 2.0 * (math.pow(l, 2.0) / (t * math.pow(k, 4.0)))
k = abs(k) function code(t, l, k) return Float64(2.0 * Float64((l ^ 2.0) / Float64(t * (k ^ 4.0)))) end
k = abs(k) function tmp = code(t, l, k) tmp = 2.0 * ((l ^ 2.0) / (t * (k ^ 4.0))); end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}}
\end{array}
Initial program 37.3%
Simplified45.6%
Taylor expanded in k around 0 64.0%
Final simplification64.0%
NOTE: k should be positive before calling this function (FPCore (t l k) :precision binary64 (/ (* 2.0 (* (pow l 2.0) (pow k -4.0))) t))
k = abs(k);
double code(double t, double l, double k) {
return (2.0 * (pow(l, 2.0) * pow(k, -4.0))) / t;
}
NOTE: k should be positive before calling this function
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 * ((l ** 2.0d0) * (k ** (-4.0d0)))) / t
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
return (2.0 * (Math.pow(l, 2.0) * Math.pow(k, -4.0))) / t;
}
k = abs(k) def code(t, l, k): return (2.0 * (math.pow(l, 2.0) * math.pow(k, -4.0))) / t
k = abs(k) function code(t, l, k) return Float64(Float64(2.0 * Float64((l ^ 2.0) * (k ^ -4.0))) / t) end
k = abs(k) function tmp = code(t, l, k) tmp = (2.0 * ((l ^ 2.0) * (k ^ -4.0))) / t; end
NOTE: k should be positive before calling this function code[t_, l_, k_] := N[(N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2 \cdot \left({\ell}^{2} \cdot {k}^{-4}\right)}{t}
\end{array}
Initial program 37.3%
Simplified45.6%
Taylor expanded in k around 0 64.0%
associate-*r/64.0%
*-commutative64.0%
times-frac63.9%
Simplified63.9%
associate-*l/63.9%
div-inv63.9%
pow-flip64.3%
metadata-eval64.3%
Applied egg-rr64.3%
Final simplification64.3%
herbie shell --seed 2023311
(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))))