
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l): return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l) return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n)))))) end
function tmp = code(K, m, n, M, l) tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l): return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l) return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n)))))) end
function tmp = code(K, m, n, M, l) tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (/ (+ n m) 2.0) M)))
(if (<= m -5.4e-35)
(exp (- (- (fabs (- n m)) (* 0.25 (* (+ n m) (+ n m)))) l))
(/
(cos (- (/ 1.0 (/ (+ (/ (/ (* n -2.0) m) K) (/ 2.0 K)) m)) M))
(exp (+ l (* t_0 t_0)))))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double t_0 = ((n + m) / 2.0) - M;
double tmp;
if (m <= -5.4e-35) {
tmp = exp(((fabs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
} else {
tmp = cos(((1.0 / (((((n * -2.0) / m) / K) + (2.0 / K)) / m)) - M)) / exp((l + (t_0 * t_0)));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = ((n + m) / 2.0d0) - m_1
if (m <= (-5.4d-35)) then
tmp = exp(((abs((n - m)) - (0.25d0 * ((n + m) * (n + m)))) - l))
else
tmp = cos(((1.0d0 / (((((n * (-2.0d0)) / m) / k) + (2.0d0 / k)) / m)) - m_1)) / exp((l + (t_0 * t_0)))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double t_0 = ((n + m) / 2.0) - M;
double tmp;
if (m <= -5.4e-35) {
tmp = Math.exp(((Math.abs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
} else {
tmp = Math.cos(((1.0 / (((((n * -2.0) / m) / K) + (2.0 / K)) / m)) - M)) / Math.exp((l + (t_0 * t_0)));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): t_0 = ((n + m) / 2.0) - M tmp = 0 if m <= -5.4e-35: tmp = math.exp(((math.fabs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l)) else: tmp = math.cos(((1.0 / (((((n * -2.0) / m) / K) + (2.0 / K)) / m)) - M)) / math.exp((l + (t_0 * t_0))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) t_0 = Float64(Float64(Float64(n + m) / 2.0) - M) tmp = 0.0 if (m <= -5.4e-35) tmp = exp(Float64(Float64(abs(Float64(n - m)) - Float64(0.25 * Float64(Float64(n + m) * Float64(n + m)))) - l)); else tmp = Float64(cos(Float64(Float64(1.0 / Float64(Float64(Float64(Float64(Float64(n * -2.0) / m) / K) + Float64(2.0 / K)) / m)) - M)) / exp(Float64(l + Float64(t_0 * t_0)))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
t_0 = ((n + m) / 2.0) - M;
tmp = 0.0;
if (m <= -5.4e-35)
tmp = exp(((abs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
else
tmp = cos(((1.0 / (((((n * -2.0) / m) / K) + (2.0 / K)) / m)) - M)) / exp((l + (t_0 * t_0)));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(N[(n + m), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]}, If[LessEqual[m, -5.4e-35], N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(0.25 * N[(N[(n + m), $MachinePrecision] * N[(n + m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(N[(1.0 / N[(N[(N[(N[(N[(n * -2.0), $MachinePrecision] / m), $MachinePrecision] / K), $MachinePrecision] + N[(2.0 / K), $MachinePrecision]), $MachinePrecision] / m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(l + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
t_0 := \frac{n + m}{2} - M\\
\mathbf{if}\;m \leq -5.4 \cdot 10^{-35}:\\
\;\;\;\;e^{\left(\left|n - m\right| - 0.25 \cdot \left(\left(n + m\right) \cdot \left(n + m\right)\right)\right) - \ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(\frac{1}{\frac{\frac{\frac{n \cdot -2}{m}}{K} + \frac{2}{K}}{m}} - M\right)}{e^{\ell + t\_0 \cdot t\_0}}\\
\end{array}
\end{array}
if m < -5.3999999999999995e-35Initial program 71.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified71.8%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified97.6%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6497.6%
Simplified97.6%
if -5.3999999999999995e-35 < m Initial program 72.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6471.8%
Applied egg-rr71.8%
Taylor expanded in l around inf
Simplified71.5%
Taylor expanded in m around inf
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6486.2%
Simplified86.2%
Final simplification89.7%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (let* ((t_0 (- (* 0.5 (+ n m)) M))) (/ (cos M) (exp (- (+ l (* t_0 t_0)) (fabs (- n m)))))))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
return cos(M) / exp(((l + (t_0 * t_0)) - fabs((n - m))));
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
t_0 = (0.5d0 * (n + m)) - m_1
code = cos(m_1) / exp(((l + (t_0 * t_0)) - abs((n - m))))
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
return Math.cos(M) / Math.exp(((l + (t_0 * t_0)) - Math.abs((n - m))));
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): t_0 = (0.5 * (n + m)) - M return math.cos(M) / math.exp(((l + (t_0 * t_0)) - math.fabs((n - m))))
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) t_0 = Float64(Float64(0.5 * Float64(n + m)) - M) return Float64(cos(M) / exp(Float64(Float64(l + Float64(t_0 * t_0)) - abs(Float64(n - m))))) end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp = code(K, m, n, M, l)
t_0 = (0.5 * (n + m)) - M;
tmp = cos(M) / exp(((l + (t_0 * t_0)) - abs((n - m))));
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(l + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right) - M\\
\frac{\cos M}{e^{\left(\ell + t\_0 \cdot t\_0\right) - \left|n - m\right|}}
\end{array}
\end{array}
Initial program 72.5%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.5%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified96.0%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (/ (cos M) (exp (* M M)))))
(if (<= M -5.2e+17)
t_0
(if (<= M 8.5e+76)
(exp (- (- (fabs (- n m)) (* 0.25 (* (+ n m) (+ n m)))) l))
t_0))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double t_0 = cos(M) / exp((M * M));
double tmp;
if (M <= -5.2e+17) {
tmp = t_0;
} else if (M <= 8.5e+76) {
tmp = exp(((fabs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = cos(m_1) / exp((m_1 * m_1))
if (m_1 <= (-5.2d+17)) then
tmp = t_0
else if (m_1 <= 8.5d+76) then
tmp = exp(((abs((n - m)) - (0.25d0 * ((n + m) * (n + m)))) - l))
else
tmp = t_0
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.cos(M) / Math.exp((M * M));
double tmp;
if (M <= -5.2e+17) {
tmp = t_0;
} else if (M <= 8.5e+76) {
tmp = Math.exp(((Math.abs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
} else {
tmp = t_0;
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): t_0 = math.cos(M) / math.exp((M * M)) tmp = 0 if M <= -5.2e+17: tmp = t_0 elif M <= 8.5e+76: tmp = math.exp(((math.fabs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l)) else: tmp = t_0 return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) t_0 = Float64(cos(M) / exp(Float64(M * M))) tmp = 0.0 if (M <= -5.2e+17) tmp = t_0; elseif (M <= 8.5e+76) tmp = exp(Float64(Float64(abs(Float64(n - m)) - Float64(0.25 * Float64(Float64(n + m) * Float64(n + m)))) - l)); else tmp = t_0; end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
t_0 = cos(M) / exp((M * M));
tmp = 0.0;
if (M <= -5.2e+17)
tmp = t_0;
elseif (M <= 8.5e+76)
tmp = exp(((abs((n - m)) - (0.25 * ((n + m) * (n + m)))) - l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(M * M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -5.2e+17], t$95$0, If[LessEqual[M, 8.5e+76], N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(0.25 * N[(N[(n + m), $MachinePrecision] * N[(n + m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
t_0 := \frac{\cos M}{e^{M \cdot M}}\\
\mathbf{if}\;M \leq -5.2 \cdot 10^{+17}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 8.5 \cdot 10^{+76}:\\
\;\;\;\;e^{\left(\left|n - m\right| - 0.25 \cdot \left(\left(n + m\right) \cdot \left(n + m\right)\right)\right) - \ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if M < -5.2e17 or 8.49999999999999992e76 < M Initial program 77.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified77.3%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified100.0%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6497.3%
Simplified97.3%
if -5.2e17 < M < 8.49999999999999992e76Initial program 68.9%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified68.9%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified93.1%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6493.7%
Simplified93.7%
Final simplification95.3%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (if (<= m -56.0) (exp (* -0.25 (* m m))) (exp (- (fabs (- n m)) (+ l (* 0.25 (* n n)))))))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -56.0) {
tmp = exp((-0.25 * (m * m)));
} else {
tmp = exp((fabs((n - m)) - (l + (0.25 * (n * n)))));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-56.0d0)) then
tmp = exp(((-0.25d0) * (m * m)))
else
tmp = exp((abs((n - m)) - (l + (0.25d0 * (n * n)))))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -56.0) {
tmp = Math.exp((-0.25 * (m * m)));
} else {
tmp = Math.exp((Math.abs((n - m)) - (l + (0.25 * (n * n)))));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): tmp = 0 if m <= -56.0: tmp = math.exp((-0.25 * (m * m))) else: tmp = math.exp((math.fabs((n - m)) - (l + (0.25 * (n * n))))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) tmp = 0.0 if (m <= -56.0) tmp = exp(Float64(-0.25 * Float64(m * m))); else tmp = exp(Float64(abs(Float64(n - m)) - Float64(l + Float64(0.25 * Float64(n * n))))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
tmp = 0.0;
if (m <= -56.0)
tmp = exp((-0.25 * (m * m)));
else
tmp = exp((abs((n - m)) - (l + (0.25 * (n * n)))));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := If[LessEqual[m, -56.0], N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(l + N[(0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
\mathbf{if}\;m \leq -56:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\left|n - m\right| - \left(\ell + 0.25 \cdot \left(n \cdot n\right)\right)}\\
\end{array}
\end{array}
if m < -56Initial program 70.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified70.8%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified98.6%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6498.6%
Simplified98.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.3%
Simplified97.3%
if -56 < m Initial program 73.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.2%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified95.0%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6484.4%
Simplified84.4%
Taylor expanded in m around 0
--lowering--.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.0%
Simplified63.0%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(if (<= n -1.4e-192)
(/ (cos M) (exp (* m (* m 0.25))))
(if (<= n 1.52e-74)
(/ (cos M) (exp (* M M)))
(if (<= n 0.0005) (exp (* -0.25 (* m m))) (exp (* -0.25 (* n n)))))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -1.4e-192) {
tmp = cos(M) / exp((m * (m * 0.25)));
} else if (n <= 1.52e-74) {
tmp = cos(M) / exp((M * M));
} else if (n <= 0.0005) {
tmp = exp((-0.25 * (m * m)));
} else {
tmp = exp((-0.25 * (n * n)));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= (-1.4d-192)) then
tmp = cos(m_1) / exp((m * (m * 0.25d0)))
else if (n <= 1.52d-74) then
tmp = cos(m_1) / exp((m_1 * m_1))
else if (n <= 0.0005d0) then
tmp = exp(((-0.25d0) * (m * m)))
else
tmp = exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -1.4e-192) {
tmp = Math.cos(M) / Math.exp((m * (m * 0.25)));
} else if (n <= 1.52e-74) {
tmp = Math.cos(M) / Math.exp((M * M));
} else if (n <= 0.0005) {
tmp = Math.exp((-0.25 * (m * m)));
} else {
tmp = Math.exp((-0.25 * (n * n)));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): tmp = 0 if n <= -1.4e-192: tmp = math.cos(M) / math.exp((m * (m * 0.25))) elif n <= 1.52e-74: tmp = math.cos(M) / math.exp((M * M)) elif n <= 0.0005: tmp = math.exp((-0.25 * (m * m))) else: tmp = math.exp((-0.25 * (n * n))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) tmp = 0.0 if (n <= -1.4e-192) tmp = Float64(cos(M) / exp(Float64(m * Float64(m * 0.25)))); elseif (n <= 1.52e-74) tmp = Float64(cos(M) / exp(Float64(M * M))); elseif (n <= 0.0005) tmp = exp(Float64(-0.25 * Float64(m * m))); else tmp = exp(Float64(-0.25 * Float64(n * n))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
tmp = 0.0;
if (n <= -1.4e-192)
tmp = cos(M) / exp((m * (m * 0.25)));
elseif (n <= 1.52e-74)
tmp = cos(M) / exp((M * M));
elseif (n <= 0.0005)
tmp = exp((-0.25 * (m * m)));
else
tmp = exp((-0.25 * (n * n)));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := If[LessEqual[n, -1.4e-192], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(m * N[(m * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.52e-74], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(M * M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.0005], N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.4 \cdot 10^{-192}:\\
\;\;\;\;\frac{\cos M}{e^{m \cdot \left(m \cdot 0.25\right)}}\\
\mathbf{elif}\;n \leq 1.52 \cdot 10^{-74}:\\
\;\;\;\;\frac{\cos M}{e^{M \cdot M}}\\
\mathbf{elif}\;n \leq 0.0005:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < -1.40000000000000002e-192Initial program 75.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.2%
Taylor expanded in m around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6439.7%
Simplified39.7%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6457.1%
Simplified57.1%
if -1.40000000000000002e-192 < n < 1.51999999999999997e-74Initial program 85.1%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified85.0%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified94.1%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6463.5%
Simplified63.5%
if 1.51999999999999997e-74 < n < 5.0000000000000001e-4Initial program 64.1%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified64.1%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified90.3%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6490.3%
Simplified90.3%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.2%
Simplified78.2%
if 5.0000000000000001e-4 < n Initial program 52.7%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified52.7%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified98.3%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6496.5%
Simplified96.5%
Taylor expanded in n around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.5%
Simplified96.5%
Final simplification69.2%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (* -0.25 (* m m)))))
(if (<= n -5e-186)
t_0
(if (<= n 2e-79)
(/ (cos M) (exp (* M M)))
(if (<= n 0.0005) t_0 (exp (* -0.25 (* n n))))))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((-0.25 * (m * m)));
double tmp;
if (n <= -5e-186) {
tmp = t_0;
} else if (n <= 2e-79) {
tmp = cos(M) / exp((M * M));
} else if (n <= 0.0005) {
tmp = t_0;
} else {
tmp = exp((-0.25 * (n * n)));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = exp(((-0.25d0) * (m * m)))
if (n <= (-5d-186)) then
tmp = t_0
else if (n <= 2d-79) then
tmp = cos(m_1) / exp((m_1 * m_1))
else if (n <= 0.0005d0) then
tmp = t_0
else
tmp = exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.exp((-0.25 * (m * m)));
double tmp;
if (n <= -5e-186) {
tmp = t_0;
} else if (n <= 2e-79) {
tmp = Math.cos(M) / Math.exp((M * M));
} else if (n <= 0.0005) {
tmp = t_0;
} else {
tmp = Math.exp((-0.25 * (n * n)));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): t_0 = math.exp((-0.25 * (m * m))) tmp = 0 if n <= -5e-186: tmp = t_0 elif n <= 2e-79: tmp = math.cos(M) / math.exp((M * M)) elif n <= 0.0005: tmp = t_0 else: tmp = math.exp((-0.25 * (n * n))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) t_0 = exp(Float64(-0.25 * Float64(m * m))) tmp = 0.0 if (n <= -5e-186) tmp = t_0; elseif (n <= 2e-79) tmp = Float64(cos(M) / exp(Float64(M * M))); elseif (n <= 0.0005) tmp = t_0; else tmp = exp(Float64(-0.25 * Float64(n * n))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
t_0 = exp((-0.25 * (m * m)));
tmp = 0.0;
if (n <= -5e-186)
tmp = t_0;
elseif (n <= 2e-79)
tmp = cos(M) / exp((M * M));
elseif (n <= 0.0005)
tmp = t_0;
else
tmp = exp((-0.25 * (n * n)));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -5e-186], t$95$0, If[LessEqual[n, 2e-79], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(M * M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.0005], t$95$0, N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
t_0 := e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{if}\;n \leq -5 \cdot 10^{-186}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2 \cdot 10^{-79}:\\
\;\;\;\;\frac{\cos M}{e^{M \cdot M}}\\
\mathbf{elif}\;n \leq 0.0005:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < -5e-186 or 2e-79 < n < 5.0000000000000001e-4Initial program 73.9%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.9%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified96.3%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6492.2%
Simplified92.2%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.2%
Simplified60.2%
if -5e-186 < n < 2e-79Initial program 84.9%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified84.9%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified94.1%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6463.0%
Simplified63.0%
if 5.0000000000000001e-4 < n Initial program 52.7%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified52.7%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified98.3%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6496.5%
Simplified96.5%
Taylor expanded in n around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.5%
Simplified96.5%
Final simplification69.1%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (if (<= m -54.0) (exp (* -0.25 (* m m))) (if (<= m -7.5e-88) (/ (cos M) (exp l)) (exp (* -0.25 (* n n))))))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -54.0) {
tmp = exp((-0.25 * (m * m)));
} else if (m <= -7.5e-88) {
tmp = cos(M) / exp(l);
} else {
tmp = exp((-0.25 * (n * n)));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-54.0d0)) then
tmp = exp(((-0.25d0) * (m * m)))
else if (m <= (-7.5d-88)) then
tmp = cos(m_1) / exp(l)
else
tmp = exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -54.0) {
tmp = Math.exp((-0.25 * (m * m)));
} else if (m <= -7.5e-88) {
tmp = Math.cos(M) / Math.exp(l);
} else {
tmp = Math.exp((-0.25 * (n * n)));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): tmp = 0 if m <= -54.0: tmp = math.exp((-0.25 * (m * m))) elif m <= -7.5e-88: tmp = math.cos(M) / math.exp(l) else: tmp = math.exp((-0.25 * (n * n))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) tmp = 0.0 if (m <= -54.0) tmp = exp(Float64(-0.25 * Float64(m * m))); elseif (m <= -7.5e-88) tmp = Float64(cos(M) / exp(l)); else tmp = exp(Float64(-0.25 * Float64(n * n))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
tmp = 0.0;
if (m <= -54.0)
tmp = exp((-0.25 * (m * m)));
elseif (m <= -7.5e-88)
tmp = cos(M) / exp(l);
else
tmp = exp((-0.25 * (n * n)));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := If[LessEqual[m, -54.0], N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -7.5e-88], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
\mathbf{if}\;m \leq -54:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -7.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if m < -54Initial program 70.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified70.8%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified98.6%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6498.6%
Simplified98.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.3%
Simplified97.3%
if -54 < m < -7.50000000000000041e-88Initial program 86.7%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified86.6%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified89.0%
Taylor expanded in l around inf
Simplified56.5%
if -7.50000000000000041e-88 < m Initial program 72.0%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.0%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified95.6%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6484.6%
Simplified84.6%
Taylor expanded in n around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.6%
Simplified52.6%
Final simplification65.4%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(if (<= m -54.0)
(exp (* -0.25 (* m m)))
(if (<= m -2.25e-261)
(exp (- 0.0 l))
(/
(+ (* (* M M) -0.5) 1.0)
(+
(*
(* n n)
(+ 0.25 (* n (* n (+ 0.03125 (* (* n n) 0.0026041666666666665))))))
1.0)))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -54.0) {
tmp = exp((-0.25 * (m * m)));
} else if (m <= -2.25e-261) {
tmp = exp((0.0 - l));
} else {
tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-54.0d0)) then
tmp = exp(((-0.25d0) * (m * m)))
else if (m <= (-2.25d-261)) then
tmp = exp((0.0d0 - l))
else
tmp = (((m_1 * m_1) * (-0.5d0)) + 1.0d0) / (((n * n) * (0.25d0 + (n * (n * (0.03125d0 + ((n * n) * 0.0026041666666666665d0)))))) + 1.0d0)
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -54.0) {
tmp = Math.exp((-0.25 * (m * m)));
} else if (m <= -2.25e-261) {
tmp = Math.exp((0.0 - l));
} else {
tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): tmp = 0 if m <= -54.0: tmp = math.exp((-0.25 * (m * m))) elif m <= -2.25e-261: tmp = math.exp((0.0 - l)) else: tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) tmp = 0.0 if (m <= -54.0) tmp = exp(Float64(-0.25 * Float64(m * m))); elseif (m <= -2.25e-261) tmp = exp(Float64(0.0 - l)); else tmp = Float64(Float64(Float64(Float64(M * M) * -0.5) + 1.0) / Float64(Float64(Float64(n * n) * Float64(0.25 + Float64(n * Float64(n * Float64(0.03125 + Float64(Float64(n * n) * 0.0026041666666666665)))))) + 1.0)); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
tmp = 0.0;
if (m <= -54.0)
tmp = exp((-0.25 * (m * m)));
elseif (m <= -2.25e-261)
tmp = exp((0.0 - l));
else
tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := If[LessEqual[m, -54.0], N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -2.25e-261], N[Exp[N[(0.0 - l), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(N[(n * n), $MachinePrecision] * N[(0.25 + N[(n * N[(n * N[(0.03125 + N[(N[(n * n), $MachinePrecision] * 0.0026041666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
\mathbf{if}\;m \leq -54:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -2.25 \cdot 10^{-261}:\\
\;\;\;\;e^{0 - \ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(M \cdot M\right) \cdot -0.5 + 1}{\left(n \cdot n\right) \cdot \left(0.25 + n \cdot \left(n \cdot \left(0.03125 + \left(n \cdot n\right) \cdot 0.0026041666666666665\right)\right)\right) + 1}\\
\end{array}
\end{array}
if m < -54Initial program 70.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified70.8%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified98.6%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6498.6%
Simplified98.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.3%
Simplified97.3%
if -54 < m < -2.25e-261Initial program 73.9%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.9%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified89.2%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6482.6%
Simplified82.6%
Taylor expanded in l around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6449.7%
Simplified49.7%
if -2.25e-261 < m Initial program 72.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.8%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified97.8%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6451.3%
Simplified51.3%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.8%
Simplified39.8%
Taylor expanded in n around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6438.3%
Simplified38.3%
Final simplification57.5%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(let* ((t_0
(/
(+ (* (* M M) -0.5) 1.0)
(+
(*
(* n n)
(+ 0.25 (* n (* n (+ 0.03125 (* (* n n) 0.0026041666666666665))))))
1.0))))
(if (<= n -350.0) t_0 (if (<= n 6.4e+51) (exp (- 0.0 l)) t_0))))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double t_0 = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
double tmp;
if (n <= -350.0) {
tmp = t_0;
} else if (n <= 6.4e+51) {
tmp = exp((0.0 - l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = (((m_1 * m_1) * (-0.5d0)) + 1.0d0) / (((n * n) * (0.25d0 + (n * (n * (0.03125d0 + ((n * n) * 0.0026041666666666665d0)))))) + 1.0d0)
if (n <= (-350.0d0)) then
tmp = t_0
else if (n <= 6.4d+51) then
tmp = exp((0.0d0 - l))
else
tmp = t_0
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
double tmp;
if (n <= -350.0) {
tmp = t_0;
} else if (n <= 6.4e+51) {
tmp = Math.exp((0.0 - l));
} else {
tmp = t_0;
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): t_0 = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0) tmp = 0 if n <= -350.0: tmp = t_0 elif n <= 6.4e+51: tmp = math.exp((0.0 - l)) else: tmp = t_0 return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) t_0 = Float64(Float64(Float64(Float64(M * M) * -0.5) + 1.0) / Float64(Float64(Float64(n * n) * Float64(0.25 + Float64(n * Float64(n * Float64(0.03125 + Float64(Float64(n * n) * 0.0026041666666666665)))))) + 1.0)) tmp = 0.0 if (n <= -350.0) tmp = t_0; elseif (n <= 6.4e+51) tmp = exp(Float64(0.0 - l)); else tmp = t_0; end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
t_0 = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
tmp = 0.0;
if (n <= -350.0)
tmp = t_0;
elseif (n <= 6.4e+51)
tmp = exp((0.0 - l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(N[(n * n), $MachinePrecision] * N[(0.25 + N[(n * N[(n * N[(0.03125 + N[(N[(n * n), $MachinePrecision] * 0.0026041666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -350.0], t$95$0, If[LessEqual[n, 6.4e+51], N[Exp[N[(0.0 - l), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot M\right) \cdot -0.5 + 1}{\left(n \cdot n\right) \cdot \left(0.25 + n \cdot \left(n \cdot \left(0.03125 + \left(n \cdot n\right) \cdot 0.0026041666666666665\right)\right)\right) + 1}\\
\mathbf{if}\;n \leq -350:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 6.4 \cdot 10^{+51}:\\
\;\;\;\;e^{0 - \ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -350 or 6.4000000000000005e51 < n Initial program 61.7%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified61.7%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified99.1%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.3%
Simplified98.3%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
Taylor expanded in n around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6472.5%
Simplified72.5%
if -350 < n < 6.4000000000000005e51Initial program 81.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified81.3%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified93.5%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6480.4%
Simplified80.4%
Taylor expanded in l around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6446.3%
Simplified46.3%
Final simplification58.0%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (if (<= m -0.0031) (exp (* -0.25 (* m m))) (exp (* -0.25 (* n n)))))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.0031) {
tmp = exp((-0.25 * (m * m)));
} else {
tmp = exp((-0.25 * (n * n)));
}
return tmp;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-0.0031d0)) then
tmp = exp(((-0.25d0) * (m * m)))
else
tmp = exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.0031) {
tmp = Math.exp((-0.25 * (m * m)));
} else {
tmp = Math.exp((-0.25 * (n * n)));
}
return tmp;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): tmp = 0 if m <= -0.0031: tmp = math.exp((-0.25 * (m * m))) else: tmp = math.exp((-0.25 * (n * n))) return tmp
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) tmp = 0.0 if (m <= -0.0031) tmp = exp(Float64(-0.25 * Float64(m * m))); else tmp = exp(Float64(-0.25 * Float64(n * n))); end return tmp end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp_2 = code(K, m, n, M, l)
tmp = 0.0;
if (m <= -0.0031)
tmp = exp((-0.25 * (m * m)));
else
tmp = exp((-0.25 * (n * n)));
end
tmp_2 = tmp;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := If[LessEqual[m, -0.0031], N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.0031:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if m < -0.00309999999999999989Initial program 70.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified70.3%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified97.5%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6497.5%
Simplified97.5%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.9%
Simplified94.9%
if -0.00309999999999999989 < m Initial program 73.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.4%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified95.4%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
fabs-subN/A
sub-negN/A
mul-1-negN/A
fabs-lowering-fabs.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6484.7%
Simplified84.7%
Taylor expanded in n around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.4%
Simplified53.4%
Final simplification65.4%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
(FPCore (K m n M l)
:precision binary64
(/
(+ (* (* M M) -0.5) 1.0)
(+
(*
(* n n)
(+ 0.25 (* n (* n (+ 0.03125 (* (* n n) 0.0026041666666666665))))))
1.0)))assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = (((m_1 * m_1) * (-0.5d0)) + 1.0d0) / (((n * n) * (0.25d0 + (n * (n * (0.03125d0 + ((n * n) * 0.0026041666666666665d0)))))) + 1.0d0)
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0)
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) return Float64(Float64(Float64(Float64(M * M) * -0.5) + 1.0) / Float64(Float64(Float64(n * n) * Float64(0.25 + Float64(n * Float64(n * Float64(0.03125 + Float64(Float64(n * n) * 0.0026041666666666665)))))) + 1.0)) end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp = code(K, m, n, M, l)
tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + (n * (n * (0.03125 + ((n * n) * 0.0026041666666666665)))))) + 1.0);
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := N[(N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(N[(n * n), $MachinePrecision] * N[(0.25 + N[(n * N[(n * N[(0.03125 + N[(N[(n * n), $MachinePrecision] * 0.0026041666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\frac{\left(M \cdot M\right) \cdot -0.5 + 1}{\left(n \cdot n\right) \cdot \left(0.25 + n \cdot \left(n \cdot \left(0.03125 + \left(n \cdot n\right) \cdot 0.0026041666666666665\right)\right)\right) + 1}
\end{array}
Initial program 72.5%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.5%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified96.0%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.5%
Simplified52.5%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.3%
Simplified41.3%
Taylor expanded in n around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.1%
Simplified39.1%
Final simplification39.1%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (/ (+ (* (* M M) -0.5) 1.0) (+ (* (* n n) (+ 0.25 (* (* n n) 0.03125))) 1.0)))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + ((n * n) * 0.03125))) + 1.0);
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = (((m_1 * m_1) * (-0.5d0)) + 1.0d0) / (((n * n) * (0.25d0 + ((n * n) * 0.03125d0))) + 1.0d0)
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + ((n * n) * 0.03125))) + 1.0);
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): return (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + ((n * n) * 0.03125))) + 1.0)
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) return Float64(Float64(Float64(Float64(M * M) * -0.5) + 1.0) / Float64(Float64(Float64(n * n) * Float64(0.25 + Float64(Float64(n * n) * 0.03125))) + 1.0)) end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp = code(K, m, n, M, l)
tmp = (((M * M) * -0.5) + 1.0) / (((n * n) * (0.25 + ((n * n) * 0.03125))) + 1.0);
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := N[(N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(N[(n * n), $MachinePrecision] * N[(0.25 + N[(N[(n * n), $MachinePrecision] * 0.03125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\frac{\left(M \cdot M\right) \cdot -0.5 + 1}{\left(n \cdot n\right) \cdot \left(0.25 + \left(n \cdot n\right) \cdot 0.03125\right) + 1}
\end{array}
Initial program 72.5%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.5%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified96.0%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.5%
Simplified52.5%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.3%
Simplified41.3%
Taylor expanded in n around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.1%
Simplified35.1%
Final simplification35.1%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 (/ (+ (* (* M M) -0.5) 1.0) (+ (* 0.25 (* n n)) 1.0)))
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / ((0.25 * (n * n)) + 1.0);
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = (((m_1 * m_1) * (-0.5d0)) + 1.0d0) / ((0.25d0 * (n * n)) + 1.0d0)
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
return (((M * M) * -0.5) + 1.0) / ((0.25 * (n * n)) + 1.0);
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): return (((M * M) * -0.5) + 1.0) / ((0.25 * (n * n)) + 1.0)
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) return Float64(Float64(Float64(Float64(M * M) * -0.5) + 1.0) / Float64(Float64(0.25 * Float64(n * n)) + 1.0)) end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp = code(K, m, n, M, l)
tmp = (((M * M) * -0.5) + 1.0) / ((0.25 * (n * n)) + 1.0);
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := N[(N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
\frac{\left(M \cdot M\right) \cdot -0.5 + 1}{0.25 \cdot \left(n \cdot n\right) + 1}
\end{array}
Initial program 72.5%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.5%
Taylor expanded in K around 0
/-lowering-/.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
fabs-subN/A
Simplified96.0%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.5%
Simplified52.5%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.3%
Simplified41.3%
Taylor expanded in n around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.1%
Simplified26.1%
Final simplification26.1%
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. (FPCore (K m n M l) :precision binary64 1.0)
assert(K < m && m < n && n < M && M < l);
double code(double K, double m, double n, double M, double l) {
return 1.0;
}
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function.
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = 1.0d0
end function
assert K < m && m < n && n < M && M < l;
public static double code(double K, double m, double n, double M, double l) {
return 1.0;
}
[K, m, n, M, l] = sort([K, m, n, M, l]) def code(K, m, n, M, l): return 1.0
K, m, n, M, l = sort([K, m, n, M, l]) function code(K, m, n, M, l) return 1.0 end
K, m, n, M, l = num2cell(sort([K, m, n, M, l])){:}
function tmp = code(K, m, n, M, l)
tmp = 1.0;
end
NOTE: K, m, n, M, and l should be sorted in increasing order before calling this function. code[K_, m_, n_, M_, l_] := 1.0
\begin{array}{l}
[K, m, n, M, l] = \mathsf{sort}([K, m, n, M, l])\\
\\
1
\end{array}
Initial program 72.5%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified72.5%
Taylor expanded in m around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6440.2%
Simplified40.2%
Taylor expanded in m around 0
cos-lowering-cos.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f647.8%
Simplified7.8%
Taylor expanded in n around 0
cos-negN/A
cos-lowering-cos.f648.3%
Simplified8.3%
Taylor expanded in M around 0
Simplified8.2%
herbie shell --seed 2024191
(FPCore (K m n M l)
:name "Maksimov and Kolovsky, Equation (32)"
:precision binary64
(* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))