
(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 9 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}
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- (- l) (pow (- (* (+ m n) 0.5) M) 2.0)))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp((-l - pow((((m + n) * 0.5) - M), 2.0)));
}
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(m_1) * exp((-l - ((((m + n) * 0.5d0) - m_1) ** 2.0d0)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp((-l - Math.pow((((m + n) * 0.5) - M), 2.0)));
}
def code(K, m, n, M, l): return math.cos(M) * math.exp((-l - math.pow((((m + n) * 0.5) - M), 2.0)))
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(Float64(-l) - (Float64(Float64(Float64(m + n) * 0.5) - M) ^ 2.0)))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp((-l - ((((m + n) * 0.5) - M) ^ 2.0))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[N[((-l) - N[Power[N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left(-\ell\right) - {\left(\left(m + n\right) \cdot 0.5 - M\right)}^{2}}
\end{array}
Initial program 74.8%
Taylor expanded in K around 0 95.9%
cos-neg95.9%
sub-neg95.9%
+-commutative95.9%
neg-mul-195.9%
associate--r+95.9%
neg-mul-195.9%
+-commutative95.9%
*-commutative95.9%
sub-neg95.9%
Simplified95.9%
Taylor expanded in l around inf 95.9%
neg-mul-195.9%
Simplified95.9%
Final simplification95.9%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -4.6e+39) (not (<= M 720.0))) (* (cos M) (exp (- (pow M 2.0)))) (* (cos M) (exp (+ (pow M 2.0) (- (- m l) n))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -4.6e+39) || !(M <= 720.0)) {
tmp = cos(M) * exp(-pow(M, 2.0));
} else {
tmp = cos(M) * exp((pow(M, 2.0) + ((m - l) - n)));
}
return tmp;
}
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_1 <= (-4.6d+39)) .or. (.not. (m_1 <= 720.0d0))) then
tmp = cos(m_1) * exp(-(m_1 ** 2.0d0))
else
tmp = cos(m_1) * exp(((m_1 ** 2.0d0) + ((m - l) - n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -4.6e+39) || !(M <= 720.0)) {
tmp = Math.cos(M) * Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.cos(M) * Math.exp((Math.pow(M, 2.0) + ((m - l) - n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (M <= -4.6e+39) or not (M <= 720.0): tmp = math.cos(M) * math.exp(-math.pow(M, 2.0)) else: tmp = math.cos(M) * math.exp((math.pow(M, 2.0) + ((m - l) - n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -4.6e+39) || !(M <= 720.0)) tmp = Float64(cos(M) * exp(Float64(-(M ^ 2.0)))); else tmp = Float64(cos(M) * exp(Float64((M ^ 2.0) + Float64(Float64(m - l) - n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((M <= -4.6e+39) || ~((M <= 720.0))) tmp = cos(M) * exp(-(M ^ 2.0)); else tmp = cos(M) * exp(((M ^ 2.0) + ((m - l) - n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -4.6e+39], N[Not[LessEqual[M, 720.0]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[M, 2.0], $MachinePrecision] + N[(N[(m - l), $MachinePrecision] - n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -4.6 \cdot 10^{+39} \lor \neg \left(M \leq 720\right):\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{{M}^{2} + \left(\left(m - \ell\right) - n\right)}\\
\end{array}
\end{array}
if M < -4.60000000000000024e39 or 720 < M Initial program 72.6%
Taylor expanded in K around 0 99.1%
cos-neg99.1%
sub-neg99.1%
+-commutative99.1%
neg-mul-199.1%
associate--r+99.1%
neg-mul-199.1%
+-commutative99.1%
*-commutative99.1%
sub-neg99.1%
Simplified99.1%
Taylor expanded in M around inf 99.1%
mul-1-neg99.1%
Simplified99.1%
if -4.60000000000000024e39 < M < 720Initial program 76.3%
Applied egg-rr17.2%
expm1-def17.2%
expm1-log1p20.2%
associate-+l-20.2%
associate--r-20.2%
+-commutative20.2%
Simplified20.2%
Taylor expanded in K around 0 19.9%
cos-neg19.9%
Simplified19.9%
Taylor expanded in M around inf 54.8%
Final simplification73.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (pow m 2.0) 0.25)) (t_1 (* (cos M) (exp (- (pow M 2.0))))))
(if (<= M -4.6e+39)
t_1
(if (<= M -1e-88)
(exp (- (+ t_0 (* m (+ (* n 0.5) 1.0))) (+ l n)))
(if (<= M 4.3e-144)
(exp (- (+ m (* 0.25 (pow n 2.0))) (+ l n)))
(if (<= M 27.0) (exp (- t_0 (+ l n))) t_1))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = pow(m, 2.0) * 0.25;
double t_1 = cos(M) * exp(-pow(M, 2.0));
double tmp;
if (M <= -4.6e+39) {
tmp = t_1;
} else if (M <= -1e-88) {
tmp = exp(((t_0 + (m * ((n * 0.5) + 1.0))) - (l + n)));
} else if (M <= 4.3e-144) {
tmp = exp(((m + (0.25 * pow(n, 2.0))) - (l + n)));
} else if (M <= 27.0) {
tmp = exp((t_0 - (l + n)));
} else {
tmp = t_1;
}
return tmp;
}
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) :: t_1
real(8) :: tmp
t_0 = (m ** 2.0d0) * 0.25d0
t_1 = cos(m_1) * exp(-(m_1 ** 2.0d0))
if (m_1 <= (-4.6d+39)) then
tmp = t_1
else if (m_1 <= (-1d-88)) then
tmp = exp(((t_0 + (m * ((n * 0.5d0) + 1.0d0))) - (l + n)))
else if (m_1 <= 4.3d-144) then
tmp = exp(((m + (0.25d0 * (n ** 2.0d0))) - (l + n)))
else if (m_1 <= 27.0d0) then
tmp = exp((t_0 - (l + n)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.pow(m, 2.0) * 0.25;
double t_1 = Math.cos(M) * Math.exp(-Math.pow(M, 2.0));
double tmp;
if (M <= -4.6e+39) {
tmp = t_1;
} else if (M <= -1e-88) {
tmp = Math.exp(((t_0 + (m * ((n * 0.5) + 1.0))) - (l + n)));
} else if (M <= 4.3e-144) {
tmp = Math.exp(((m + (0.25 * Math.pow(n, 2.0))) - (l + n)));
} else if (M <= 27.0) {
tmp = Math.exp((t_0 - (l + n)));
} else {
tmp = t_1;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.pow(m, 2.0) * 0.25 t_1 = math.cos(M) * math.exp(-math.pow(M, 2.0)) tmp = 0 if M <= -4.6e+39: tmp = t_1 elif M <= -1e-88: tmp = math.exp(((t_0 + (m * ((n * 0.5) + 1.0))) - (l + n))) elif M <= 4.3e-144: tmp = math.exp(((m + (0.25 * math.pow(n, 2.0))) - (l + n))) elif M <= 27.0: tmp = math.exp((t_0 - (l + n))) else: tmp = t_1 return tmp
function code(K, m, n, M, l) t_0 = Float64((m ^ 2.0) * 0.25) t_1 = Float64(cos(M) * exp(Float64(-(M ^ 2.0)))) tmp = 0.0 if (M <= -4.6e+39) tmp = t_1; elseif (M <= -1e-88) tmp = exp(Float64(Float64(t_0 + Float64(m * Float64(Float64(n * 0.5) + 1.0))) - Float64(l + n))); elseif (M <= 4.3e-144) tmp = exp(Float64(Float64(m + Float64(0.25 * (n ^ 2.0))) - Float64(l + n))); elseif (M <= 27.0) tmp = exp(Float64(t_0 - Float64(l + n))); else tmp = t_1; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (m ^ 2.0) * 0.25; t_1 = cos(M) * exp(-(M ^ 2.0)); tmp = 0.0; if (M <= -4.6e+39) tmp = t_1; elseif (M <= -1e-88) tmp = exp(((t_0 + (m * ((n * 0.5) + 1.0))) - (l + n))); elseif (M <= 4.3e-144) tmp = exp(((m + (0.25 * (n ^ 2.0))) - (l + n))); elseif (M <= 27.0) tmp = exp((t_0 - (l + n))); else tmp = t_1; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Power[m, 2.0], $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -4.6e+39], t$95$1, If[LessEqual[M, -1e-88], N[Exp[N[(N[(t$95$0 + N[(m * N[(N[(n * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[M, 4.3e-144], N[Exp[N[(N[(m + N[(0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[M, 27.0], N[Exp[N[(t$95$0 - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {m}^{2} \cdot 0.25\\
t_1 := \cos M \cdot e^{-{M}^{2}}\\
\mathbf{if}\;M \leq -4.6 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \leq -1 \cdot 10^{-88}:\\
\;\;\;\;e^{\left(t_0 + m \cdot \left(n \cdot 0.5 + 1\right)\right) - \left(\ell + n\right)}\\
\mathbf{elif}\;M \leq 4.3 \cdot 10^{-144}:\\
\;\;\;\;e^{\left(m + 0.25 \cdot {n}^{2}\right) - \left(\ell + n\right)}\\
\mathbf{elif}\;M \leq 27:\\
\;\;\;\;e^{t_0 - \left(\ell + n\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if M < -4.60000000000000024e39 or 27 < M Initial program 72.0%
Taylor expanded in K around 0 99.1%
cos-neg99.1%
sub-neg99.1%
+-commutative99.1%
neg-mul-199.1%
associate--r+99.1%
neg-mul-199.1%
+-commutative99.1%
*-commutative99.1%
sub-neg99.1%
Simplified99.1%
Taylor expanded in M around inf 98.2%
mul-1-neg98.2%
Simplified98.2%
if -4.60000000000000024e39 < M < -9.99999999999999934e-89Initial program 74.8%
Applied egg-rr18.8%
expm1-def18.8%
expm1-log1p19.1%
associate-+l-19.1%
associate--r-19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in K around 0 23.7%
cos-neg23.7%
Simplified23.7%
Taylor expanded in M around 0 23.7%
+-commutative23.7%
Simplified23.7%
Taylor expanded in m around inf 56.5%
if -9.99999999999999934e-89 < M < 4.2999999999999999e-144Initial program 76.5%
Applied egg-rr14.2%
expm1-def14.2%
expm1-log1p17.6%
associate-+l-17.6%
associate--r-17.6%
+-commutative17.6%
Simplified17.6%
Taylor expanded in K around 0 15.9%
cos-neg15.9%
Simplified15.9%
Taylor expanded in M around 0 15.9%
+-commutative15.9%
Simplified15.9%
Taylor expanded in m around 0 36.2%
if 4.2999999999999999e-144 < M < 27Initial program 80.0%
Applied egg-rr27.7%
expm1-def27.7%
expm1-log1p32.1%
associate-+l-32.1%
associate--r-32.1%
+-commutative32.1%
Simplified32.1%
Taylor expanded in K around 0 28.4%
cos-neg28.4%
Simplified28.4%
Taylor expanded in M around 0 28.4%
+-commutative28.4%
Simplified28.4%
Taylor expanded in m around inf 40.2%
Final simplification64.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n -4.5e-87)
(* (cos M) (exp (* (pow m 2.0) -0.25)))
(if (<= n 9.5e-264)
(exp (- (+ m (* 0.25 (pow n 2.0))) (+ l n)))
(if (<= n 54.0)
(* (cos M) (exp (- (- l) (pow M 2.0))))
(* (cos M) (exp (* -0.25 (pow n 2.0))))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -4.5e-87) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else if (n <= 9.5e-264) {
tmp = exp(((m + (0.25 * pow(n, 2.0))) - (l + n)));
} else if (n <= 54.0) {
tmp = cos(M) * exp((-l - pow(M, 2.0)));
} else {
tmp = cos(M) * exp((-0.25 * pow(n, 2.0)));
}
return tmp;
}
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 <= (-4.5d-87)) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else if (n <= 9.5d-264) then
tmp = exp(((m + (0.25d0 * (n ** 2.0d0))) - (l + n)))
else if (n <= 54.0d0) then
tmp = cos(m_1) * exp((-l - (m_1 ** 2.0d0)))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n ** 2.0d0)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -4.5e-87) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (n <= 9.5e-264) {
tmp = Math.exp(((m + (0.25 * Math.pow(n, 2.0))) - (l + n)));
} else if (n <= 54.0) {
tmp = Math.cos(M) * Math.exp((-l - Math.pow(M, 2.0)));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -4.5e-87: tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) elif n <= 9.5e-264: tmp = math.exp(((m + (0.25 * math.pow(n, 2.0))) - (l + n))) elif n <= 54.0: tmp = math.cos(M) * math.exp((-l - math.pow(M, 2.0))) else: tmp = math.cos(M) * math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -4.5e-87) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); elseif (n <= 9.5e-264) tmp = exp(Float64(Float64(m + Float64(0.25 * (n ^ 2.0))) - Float64(l + n))); elseif (n <= 54.0) tmp = Float64(cos(M) * exp(Float64(Float64(-l) - (M ^ 2.0)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * (n ^ 2.0)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -4.5e-87) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); elseif (n <= 9.5e-264) tmp = exp(((m + (0.25 * (n ^ 2.0))) - (l + n))); elseif (n <= 54.0) tmp = cos(M) * exp((-l - (M ^ 2.0))); else tmp = cos(M) * exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -4.5e-87], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9.5e-264], N[Exp[N[(N[(m + N[(0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 54.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[((-l) - N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.5 \cdot 10^{-87}:\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-264}:\\
\;\;\;\;e^{\left(m + 0.25 \cdot {n}^{2}\right) - \left(\ell + n\right)}\\
\mathbf{elif}\;n \leq 54:\\
\;\;\;\;\cos M \cdot e^{\left(-\ell\right) - {M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
if n < -4.49999999999999958e-87Initial program 70.5%
Taylor expanded in K around 0 98.1%
cos-neg98.1%
sub-neg98.1%
+-commutative98.1%
neg-mul-198.1%
associate--r+98.1%
neg-mul-198.1%
+-commutative98.1%
*-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in m around inf 57.0%
*-commutative57.0%
Simplified57.0%
if -4.49999999999999958e-87 < n < 9.50000000000000012e-264Initial program 85.7%
Applied egg-rr21.4%
expm1-def21.4%
expm1-log1p26.5%
associate-+l-26.5%
associate--r-26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in K around 0 21.9%
cos-neg21.9%
Simplified21.9%
Taylor expanded in M around 0 29.0%
+-commutative29.0%
Simplified29.0%
Taylor expanded in m around 0 50.1%
if 9.50000000000000012e-264 < n < 54Initial program 84.4%
Taylor expanded in K around 0 92.9%
cos-neg92.9%
sub-neg92.9%
+-commutative92.9%
neg-mul-192.9%
associate--r+92.9%
neg-mul-192.9%
+-commutative92.9%
*-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in l around inf 92.9%
neg-mul-192.9%
Simplified92.9%
Taylor expanded in M around inf 79.6%
if 54 < n Initial program 66.7%
Taylor expanded in K around 0 98.5%
cos-neg98.5%
sub-neg98.5%
+-commutative98.5%
neg-mul-198.5%
associate--r+98.5%
neg-mul-198.5%
+-commutative98.5%
*-commutative98.5%
sub-neg98.5%
Simplified98.5%
Taylor expanded in n around inf 97.0%
*-commutative97.0%
Simplified97.0%
Final simplification70.7%
(FPCore (K m n M l) :precision binary64 (if (or (<= m -55.0) (not (<= m 54.0))) (* (cos M) (exp (* (pow m 2.0) -0.25))) (exp (- (* (pow m 2.0) 0.25) (+ l n)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -55.0) || !(m <= 54.0)) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else {
tmp = exp(((pow(m, 2.0) * 0.25) - (l + n)));
}
return tmp;
}
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 <= (-55.0d0)) .or. (.not. (m <= 54.0d0))) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else
tmp = exp((((m ** 2.0d0) * 0.25d0) - (l + n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -55.0) || !(m <= 54.0)) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.exp(((Math.pow(m, 2.0) * 0.25) - (l + n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (m <= -55.0) or not (m <= 54.0): tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.exp(((math.pow(m, 2.0) * 0.25) - (l + n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((m <= -55.0) || !(m <= 54.0)) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); else tmp = exp(Float64(Float64((m ^ 2.0) * 0.25) - Float64(l + n))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((m <= -55.0) || ~((m <= 54.0))) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); else tmp = exp((((m ^ 2.0) * 0.25) - (l + n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[m, -55.0], N[Not[LessEqual[m, 54.0]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(N[Power[m, 2.0], $MachinePrecision] * 0.25), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -55 \lor \neg \left(m \leq 54\right):\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;e^{{m}^{2} \cdot 0.25 - \left(\ell + n\right)}\\
\end{array}
\end{array}
if m < -55 or 54 < m Initial program 67.7%
Taylor expanded in K around 0 97.7%
cos-neg97.7%
sub-neg97.7%
+-commutative97.7%
neg-mul-197.7%
associate--r+97.7%
neg-mul-197.7%
+-commutative97.7%
*-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in m around inf 97.0%
*-commutative97.0%
Simplified97.0%
if -55 < m < 54Initial program 82.4%
Applied egg-rr21.7%
expm1-def21.7%
expm1-log1p23.7%
associate-+l-23.7%
associate--r-23.7%
+-commutative23.7%
Simplified23.7%
Taylor expanded in K around 0 23.2%
cos-neg23.2%
Simplified23.2%
Taylor expanded in M around 0 25.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in m around inf 48.2%
Final simplification73.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n -6e-91)
(* (cos M) (exp (* (pow m 2.0) -0.25)))
(if (<= n 2.4e-6)
(exp (- (+ m (* 0.25 (pow n 2.0))) (+ l n)))
(* (cos M) (exp (* -0.25 (pow n 2.0)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -6e-91) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else if (n <= 2.4e-6) {
tmp = exp(((m + (0.25 * pow(n, 2.0))) - (l + n)));
} else {
tmp = cos(M) * exp((-0.25 * pow(n, 2.0)));
}
return tmp;
}
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 <= (-6d-91)) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else if (n <= 2.4d-6) then
tmp = exp(((m + (0.25d0 * (n ** 2.0d0))) - (l + n)))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n ** 2.0d0)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -6e-91) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (n <= 2.4e-6) {
tmp = Math.exp(((m + (0.25 * Math.pow(n, 2.0))) - (l + n)));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -6e-91: tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) elif n <= 2.4e-6: tmp = math.exp(((m + (0.25 * math.pow(n, 2.0))) - (l + n))) else: tmp = math.cos(M) * math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -6e-91) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); elseif (n <= 2.4e-6) tmp = exp(Float64(Float64(m + Float64(0.25 * (n ^ 2.0))) - Float64(l + n))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * (n ^ 2.0)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -6e-91) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); elseif (n <= 2.4e-6) tmp = exp(((m + (0.25 * (n ^ 2.0))) - (l + n))); else tmp = cos(M) * exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -6e-91], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.4e-6], N[Exp[N[(N[(m + N[(0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6 \cdot 10^{-91}:\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;n \leq 2.4 \cdot 10^{-6}:\\
\;\;\;\;e^{\left(m + 0.25 \cdot {n}^{2}\right) - \left(\ell + n\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
if n < -6.0000000000000004e-91Initial program 70.5%
Taylor expanded in K around 0 98.1%
cos-neg98.1%
sub-neg98.1%
+-commutative98.1%
neg-mul-198.1%
associate--r+98.1%
neg-mul-198.1%
+-commutative98.1%
*-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in m around inf 57.0%
*-commutative57.0%
Simplified57.0%
if -6.0000000000000004e-91 < n < 2.3999999999999999e-6Initial program 85.0%
Applied egg-rr21.7%
expm1-def21.7%
expm1-log1p26.5%
associate-+l-26.5%
associate--r-26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in K around 0 23.8%
cos-neg23.8%
Simplified23.8%
Taylor expanded in M around 0 27.2%
+-commutative27.2%
Simplified27.2%
Taylor expanded in m around 0 49.4%
if 2.3999999999999999e-6 < n Initial program 66.7%
Taylor expanded in K around 0 98.5%
cos-neg98.5%
sub-neg98.5%
+-commutative98.5%
neg-mul-198.5%
associate--r+98.5%
neg-mul-198.5%
+-commutative98.5%
*-commutative98.5%
sub-neg98.5%
Simplified98.5%
Taylor expanded in n around inf 97.0%
*-commutative97.0%
Simplified97.0%
Final simplification64.6%
(FPCore (K m n M l) :precision binary64 (if (<= m -20000.0) (exp (- (+ m (* 0.25 (* n (+ n (* m 2.0))))) (+ l n))) (exp (- (* (pow m 2.0) 0.25) (+ l n)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -20000.0) {
tmp = exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)));
} else {
tmp = exp(((pow(m, 2.0) * 0.25) - (l + n)));
}
return tmp;
}
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 <= (-20000.0d0)) then
tmp = exp(((m + (0.25d0 * (n * (n + (m * 2.0d0))))) - (l + n)))
else
tmp = exp((((m ** 2.0d0) * 0.25d0) - (l + n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -20000.0) {
tmp = Math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)));
} else {
tmp = Math.exp(((Math.pow(m, 2.0) * 0.25) - (l + n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -20000.0: tmp = math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n))) else: tmp = math.exp(((math.pow(m, 2.0) * 0.25) - (l + n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -20000.0) tmp = exp(Float64(Float64(m + Float64(0.25 * Float64(n * Float64(n + Float64(m * 2.0))))) - Float64(l + n))); else tmp = exp(Float64(Float64((m ^ 2.0) * 0.25) - Float64(l + n))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -20000.0) tmp = exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n))); else tmp = exp((((m ^ 2.0) * 0.25) - (l + n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -20000.0], N[Exp[N[(N[(m + N[(0.25 * N[(n * N[(n + N[(m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(N[Power[m, 2.0], $MachinePrecision] * 0.25), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -20000:\\
\;\;\;\;e^{\left(m + 0.25 \cdot \left(n \cdot \left(n + m \cdot 2\right)\right)\right) - \left(\ell + n\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{{m}^{2} \cdot 0.25 - \left(\ell + n\right)}\\
\end{array}
\end{array}
if m < -2e4Initial program 70.1%
Applied egg-rr0.7%
expm1-def0.7%
expm1-log1p4.0%
associate-+l-4.0%
associate--r-4.0%
+-commutative4.0%
Simplified4.0%
Taylor expanded in K around 0 4.4%
cos-neg4.4%
Simplified4.4%
Taylor expanded in M around 0 5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in m around 0 52.8%
+-commutative52.8%
unpow252.8%
associate-*r*52.8%
distribute-rgt-out55.9%
Simplified55.9%
if -2e4 < m Initial program 76.4%
Applied egg-rr14.3%
expm1-def14.3%
expm1-log1p15.8%
associate-+l-15.8%
associate--r-15.8%
+-commutative15.8%
Simplified15.8%
Taylor expanded in K around 0 15.6%
cos-neg15.6%
Simplified15.6%
Taylor expanded in M around 0 18.9%
+-commutative18.9%
Simplified18.9%
Taylor expanded in m around inf 35.1%
Final simplification40.5%
(FPCore (K m n M l) :precision binary64 (if (<= l 0.004) (exp (- (+ m (* 0.25 (* n (+ n (* m 2.0))))) (+ l n))) (* (cos M) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.004) {
tmp = exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)));
} else {
tmp = cos(M) * exp(-l);
}
return tmp;
}
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 (l <= 0.004d0) then
tmp = exp(((m + (0.25d0 * (n * (n + (m * 2.0d0))))) - (l + n)))
else
tmp = cos(m_1) * exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.004) {
tmp = Math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.004: tmp = math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n))) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.004) tmp = exp(Float64(Float64(m + Float64(0.25 * Float64(n * Float64(n + Float64(m * 2.0))))) - Float64(l + n))); else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 0.004) tmp = exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n))); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.004], N[Exp[N[(N[(m + N[(0.25 * N[(n * N[(n + N[(m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.004:\\
\;\;\;\;e^{\left(m + 0.25 \cdot \left(n \cdot \left(n + m \cdot 2\right)\right)\right) - \left(\ell + n\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < 0.0040000000000000001Initial program 75.7%
Applied egg-rr8.7%
expm1-def8.7%
expm1-log1p11.2%
associate-+l-11.2%
associate--r-11.2%
+-commutative11.2%
Simplified11.2%
Taylor expanded in K around 0 10.6%
cos-neg10.6%
Simplified10.6%
Taylor expanded in M around 0 10.2%
+-commutative10.2%
Simplified10.2%
Taylor expanded in m around 0 23.2%
+-commutative23.2%
unpow223.2%
associate-*r*23.2%
distribute-rgt-out24.8%
Simplified24.8%
if 0.0040000000000000001 < l Initial program 71.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
+-commutative100.0%
neg-mul-1100.0%
associate--r+100.0%
neg-mul-1100.0%
+-commutative100.0%
*-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in M around inf 98.4%
Taylor expanded in l around inf 96.8%
neg-mul-196.8%
Simplified96.8%
Final simplification41.6%
(FPCore (K m n M l) :precision binary64 (exp (- (+ m (* 0.25 (* n (+ n (* m 2.0))))) (+ l n))))
double code(double K, double m, double n, double M, double l) {
return exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + 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 = exp(((m + (0.25d0 * (n * (n + (m * 2.0d0))))) - (l + n)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)));
}
def code(K, m, n, M, l): return math.exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n)))
function code(K, m, n, M, l) return exp(Float64(Float64(m + Float64(0.25 * Float64(n * Float64(n + Float64(m * 2.0))))) - Float64(l + n))) end
function tmp = code(K, m, n, M, l) tmp = exp(((m + (0.25 * (n * (n + (m * 2.0))))) - (l + n))); end
code[K_, m_, n_, M_, l_] := N[Exp[N[(N[(m + N[(0.25 * N[(n * N[(n + N[(m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(m + 0.25 \cdot \left(n \cdot \left(n + m \cdot 2\right)\right)\right) - \left(\ell + n\right)}
\end{array}
Initial program 74.8%
Applied egg-rr10.7%
expm1-def10.7%
expm1-log1p12.7%
associate-+l-12.7%
associate--r-12.7%
+-commutative12.7%
Simplified12.7%
Taylor expanded in K around 0 12.7%
cos-neg12.7%
Simplified12.7%
Taylor expanded in M around 0 15.5%
+-commutative15.5%
Simplified15.5%
Taylor expanded in m around 0 30.0%
+-commutative30.0%
unpow230.0%
associate-*r*30.0%
distribute-rgt-out31.2%
Simplified31.2%
Final simplification31.2%
herbie shell --seed 2023326
(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)))))))