
(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 12 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 (- (- (fabs (- n m)) l) (pow (- (/ (+ m n) 2.0) M) 2.0)))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp(((fabs((n - m)) - l) - pow((((m + n) / 2.0) - 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(((abs((n - m)) - l) - ((((m + n) / 2.0d0) - 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(((Math.abs((n - m)) - l) - Math.pow((((m + n) / 2.0) - M), 2.0)));
}
def code(K, m, n, M, l): return math.cos(M) * math.exp(((math.fabs((n - m)) - l) - math.pow((((m + n) / 2.0) - M), 2.0)))
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(Float64(abs(Float64(n - m)) - l) - (Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(((abs((n - m)) - l) - ((((m + n) / 2.0) - M) ^ 2.0))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left(\left|n - m\right| - \ell\right) - {\left(\frac{m + n}{2} - M\right)}^{2}}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (* K (* m 0.5)) M)))
(if (<= m -5.5e-10)
(* (cos M) (exp (* (pow m 2.0) -0.25)))
(if (<= m -9.2e-58)
(* (+ (cos t_0) (* -0.5 (* (* n K) (sin t_0)))) (exp (- l)))
(if (<= m 2.7e-301)
(* (cos M) (exp (- (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 t_0 = (K * (m * 0.5)) - M;
double tmp;
if (m <= -5.5e-10) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else if (m <= -9.2e-58) {
tmp = (cos(t_0) + (-0.5 * ((n * K) * sin(t_0)))) * exp(-l);
} else if (m <= 2.7e-301) {
tmp = cos(M) * exp(-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) :: t_0
real(8) :: tmp
t_0 = (k * (m * 0.5d0)) - m_1
if (m <= (-5.5d-10)) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-9.2d-58)) then
tmp = (cos(t_0) + ((-0.5d0) * ((n * k) * sin(t_0)))) * exp(-l)
else if (m <= 2.7d-301) then
tmp = cos(m_1) * exp(-(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 t_0 = (K * (m * 0.5)) - M;
double tmp;
if (m <= -5.5e-10) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -9.2e-58) {
tmp = (Math.cos(t_0) + (-0.5 * ((n * K) * Math.sin(t_0)))) * Math.exp(-l);
} else if (m <= 2.7e-301) {
tmp = Math.cos(M) * Math.exp(-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): t_0 = (K * (m * 0.5)) - M tmp = 0 if m <= -5.5e-10: tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -9.2e-58: tmp = (math.cos(t_0) + (-0.5 * ((n * K) * math.sin(t_0)))) * math.exp(-l) elif m <= 2.7e-301: tmp = math.cos(M) * math.exp(-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) t_0 = Float64(Float64(K * Float64(m * 0.5)) - M) tmp = 0.0 if (m <= -5.5e-10) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); elseif (m <= -9.2e-58) tmp = Float64(Float64(cos(t_0) + Float64(-0.5 * Float64(Float64(n * K) * sin(t_0)))) * exp(Float64(-l))); elseif (m <= 2.7e-301) tmp = Float64(cos(M) * exp(Float64(-(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) t_0 = (K * (m * 0.5)) - M; tmp = 0.0; if (m <= -5.5e-10) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); elseif (m <= -9.2e-58) tmp = (cos(t_0) + (-0.5 * ((n * K) * sin(t_0)))) * exp(-l); elseif (m <= 2.7e-301) tmp = cos(M) * exp(-(M ^ 2.0)); else tmp = cos(M) * exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(K * N[(m * 0.5), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, If[LessEqual[m, -5.5e-10], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -9.2e-58], N[(N[(N[Cos[t$95$0], $MachinePrecision] + N[(-0.5 * N[(N[(n * K), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.7e-301], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $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}
t_0 := K \cdot \left(m \cdot 0.5\right) - M\\
\mathbf{if}\;m \leq -5.5 \cdot 10^{-10}:\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -9.2 \cdot 10^{-58}:\\
\;\;\;\;\left(\cos t_0 + -0.5 \cdot \left(\left(n \cdot K\right) \cdot \sin t_0\right)\right) \cdot e^{-\ell}\\
\mathbf{elif}\;m \leq 2.7 \cdot 10^{-301}:\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(if (<= m -0.35)
(* (cos M) (exp (* (pow m 2.0) -0.25)))
(if (<= m -3.3e-69)
(* (exp (- l)) (cos (- (/ K (/ 2.0 n)) M)))
(if (<= m 3.4e-298)
(* (cos M) (exp (- (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 (m <= -0.35) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else if (m <= -3.3e-69) {
tmp = exp(-l) * cos(((K / (2.0 / n)) - M));
} else if (m <= 3.4e-298) {
tmp = cos(M) * exp(-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 (m <= (-0.35d0)) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-3.3d-69)) then
tmp = exp(-l) * cos(((k / (2.0d0 / n)) - m_1))
else if (m <= 3.4d-298) then
tmp = cos(m_1) * exp(-(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 (m <= -0.35) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -3.3e-69) {
tmp = Math.exp(-l) * Math.cos(((K / (2.0 / n)) - M));
} else if (m <= 3.4e-298) {
tmp = Math.cos(M) * Math.exp(-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 m <= -0.35: tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -3.3e-69: tmp = math.exp(-l) * math.cos(((K / (2.0 / n)) - M)) elif m <= 3.4e-298: tmp = math.cos(M) * math.exp(-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 (m <= -0.35) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); elseif (m <= -3.3e-69) tmp = Float64(exp(Float64(-l)) * cos(Float64(Float64(K / Float64(2.0 / n)) - M))); elseif (m <= 3.4e-298) tmp = Float64(cos(M) * exp(Float64(-(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 (m <= -0.35) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); elseif (m <= -3.3e-69) tmp = exp(-l) * cos(((K / (2.0 / n)) - M)); elseif (m <= 3.4e-298) tmp = cos(M) * exp(-(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[m, -0.35], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -3.3e-69], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[N[(N[(K / N[(2.0 / n), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3.4e-298], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $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}\;m \leq -0.35:\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -3.3 \cdot 10^{-69}:\\
\;\;\;\;e^{-\ell} \cdot \cos \left(\frac{K}{\frac{2}{n}} - M\right)\\
\mathbf{elif}\;m \leq 3.4 \cdot 10^{-298}:\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(if (<= m -0.35)
(exp (* (pow m 2.0) -0.25))
(if (<= m -4e-69)
(* (exp (- l)) (cos (- (/ K (/ 2.0 n)) M)))
(if (<= m 1e-296)
(* (cos M) (exp (- (pow M 2.0))))
(exp (* -0.25 (pow n 2.0)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.35) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if (m <= -4e-69) {
tmp = exp(-l) * cos(((K / (2.0 / n)) - M));
} else if (m <= 1e-296) {
tmp = cos(M) * exp(-pow(M, 2.0));
} else {
tmp = 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 (m <= (-0.35d0)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-4d-69)) then
tmp = exp(-l) * cos(((k / (2.0d0 / n)) - m_1))
else if (m <= 1d-296) then
tmp = cos(m_1) * exp(-(m_1 ** 2.0d0))
else
tmp = 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 (m <= -0.35) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -4e-69) {
tmp = Math.exp(-l) * Math.cos(((K / (2.0 / n)) - M));
} else if (m <= 1e-296) {
tmp = Math.cos(M) * Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -0.35: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -4e-69: tmp = math.exp(-l) * math.cos(((K / (2.0 / n)) - M)) elif m <= 1e-296: tmp = math.cos(M) * math.exp(-math.pow(M, 2.0)) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -0.35) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif (m <= -4e-69) tmp = Float64(exp(Float64(-l)) * cos(Float64(Float64(K / Float64(2.0 / n)) - M))); elseif (m <= 1e-296) tmp = Float64(cos(M) * exp(Float64(-(M ^ 2.0)))); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -0.35) tmp = exp(((m ^ 2.0) * -0.25)); elseif (m <= -4e-69) tmp = exp(-l) * cos(((K / (2.0 / n)) - M)); elseif (m <= 1e-296) tmp = cos(M) * exp(-(M ^ 2.0)); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -0.35], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -4e-69], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[N[(N[(K / N[(2.0 / n), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1e-296], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.35:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -4 \cdot 10^{-69}:\\
\;\;\;\;e^{-\ell} \cdot \cos \left(\frac{K}{\frac{2}{n}} - M\right)\\
\mathbf{elif}\;m \leq 10^{-296}:\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(if (<= m -0.35)
(* (cos M) (exp (* (pow m 2.0) -0.25)))
(if (<= m -4.4e-69)
(* (exp (- l)) (cos (- (/ K (/ 2.0 n)) M)))
(if (<= m 4e-303)
(* (cos M) (exp (- (pow M 2.0))))
(exp (* -0.25 (pow n 2.0)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.35) {
tmp = cos(M) * exp((pow(m, 2.0) * -0.25));
} else if (m <= -4.4e-69) {
tmp = exp(-l) * cos(((K / (2.0 / n)) - M));
} else if (m <= 4e-303) {
tmp = cos(M) * exp(-pow(M, 2.0));
} else {
tmp = 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 (m <= (-0.35d0)) then
tmp = cos(m_1) * exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-4.4d-69)) then
tmp = exp(-l) * cos(((k / (2.0d0 / n)) - m_1))
else if (m <= 4d-303) then
tmp = cos(m_1) * exp(-(m_1 ** 2.0d0))
else
tmp = 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 (m <= -0.35) {
tmp = Math.cos(M) * Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -4.4e-69) {
tmp = Math.exp(-l) * Math.cos(((K / (2.0 / n)) - M));
} else if (m <= 4e-303) {
tmp = Math.cos(M) * Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -0.35: tmp = math.cos(M) * math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -4.4e-69: tmp = math.exp(-l) * math.cos(((K / (2.0 / n)) - M)) elif m <= 4e-303: tmp = math.cos(M) * math.exp(-math.pow(M, 2.0)) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -0.35) tmp = Float64(cos(M) * exp(Float64((m ^ 2.0) * -0.25))); elseif (m <= -4.4e-69) tmp = Float64(exp(Float64(-l)) * cos(Float64(Float64(K / Float64(2.0 / n)) - M))); elseif (m <= 4e-303) tmp = Float64(cos(M) * exp(Float64(-(M ^ 2.0)))); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -0.35) tmp = cos(M) * exp(((m ^ 2.0) * -0.25)); elseif (m <= -4.4e-69) tmp = exp(-l) * cos(((K / (2.0 / n)) - M)); elseif (m <= 4e-303) tmp = cos(M) * exp(-(M ^ 2.0)); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -0.35], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -4.4e-69], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[N[(N[(K / N[(2.0 / n), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4e-303], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.35:\\
\;\;\;\;\cos M \cdot e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -4.4 \cdot 10^{-69}:\\
\;\;\;\;e^{-\ell} \cdot \cos \left(\frac{K}{\frac{2}{n}} - M\right)\\
\mathbf{elif}\;m \leq 4 \cdot 10^{-303}:\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(if (<= m -0.35)
(exp (* (pow m 2.0) -0.25))
(if (<= m -7.4e-106)
(* (exp (- l)) (cos (- (/ K (/ 2.0 n)) M)))
(exp (* -0.25 (pow n 2.0))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.35) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if (m <= -7.4e-106) {
tmp = exp(-l) * cos(((K / (2.0 / n)) - M));
} else {
tmp = 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 (m <= (-0.35d0)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-7.4d-106)) then
tmp = exp(-l) * cos(((k / (2.0d0 / n)) - m_1))
else
tmp = 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 (m <= -0.35) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -7.4e-106) {
tmp = Math.exp(-l) * Math.cos(((K / (2.0 / n)) - M));
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -0.35: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -7.4e-106: tmp = math.exp(-l) * math.cos(((K / (2.0 / n)) - M)) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -0.35) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif (m <= -7.4e-106) tmp = Float64(exp(Float64(-l)) * cos(Float64(Float64(K / Float64(2.0 / n)) - M))); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -0.35) tmp = exp(((m ^ 2.0) * -0.25)); elseif (m <= -7.4e-106) tmp = exp(-l) * cos(((K / (2.0 / n)) - M)); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -0.35], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -7.4e-106], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[N[(N[(K / N[(2.0 / n), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.35:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -7.4 \cdot 10^{-106}:\\
\;\;\;\;e^{-\ell} \cdot \cos \left(\frac{K}{\frac{2}{n}} - M\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l) :precision binary64 (if (or (<= m -0.35) (not (<= m 9.5e-34))) (exp (* (pow m 2.0) -0.25)) (* (cos M) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -0.35) || !(m <= 9.5e-34)) {
tmp = exp((pow(m, 2.0) * -0.25));
} 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 ((m <= (-0.35d0)) .or. (.not. (m <= 9.5d-34))) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
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 ((m <= -0.35) || !(m <= 9.5e-34)) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (m <= -0.35) or not (m <= 9.5e-34): tmp = math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((m <= -0.35) || !(m <= 9.5e-34)) tmp = exp(Float64((m ^ 2.0) * -0.25)); 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 ((m <= -0.35) || ~((m <= 9.5e-34))) tmp = exp(((m ^ 2.0) * -0.25)); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[m, -0.35], N[Not[LessEqual[m, 9.5e-34]], $MachinePrecision]], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.35 \lor \neg \left(m \leq 9.5 \cdot 10^{-34}\right):\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
(FPCore (K m n M l) :precision binary64 (if (<= m -0.35) (exp (* (pow m 2.0) -0.25)) (if (<= m -6e-100) (* (cos M) (exp (- l))) (exp (* -0.25 (pow n 2.0))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -0.35) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if (m <= -6e-100) {
tmp = cos(M) * exp(-l);
} else {
tmp = 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 (m <= (-0.35d0)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if (m <= (-6d-100)) then
tmp = cos(m_1) * exp(-l)
else
tmp = 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 (m <= -0.35) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (m <= -6e-100) {
tmp = Math.cos(M) * Math.exp(-l);
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -0.35: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif m <= -6e-100: tmp = math.cos(M) * math.exp(-l) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -0.35) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif (m <= -6e-100) tmp = Float64(cos(M) * exp(Float64(-l))); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -0.35) tmp = exp(((m ^ 2.0) * -0.25)); elseif (m <= -6e-100) tmp = cos(M) * exp(-l); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -0.35], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -6e-100], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.35:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -6 \cdot 10^{-100}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp(-l);
}
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)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp(-l);
}
def code(K, m, n, M, l): return math.cos(M) * math.exp(-l)
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(-l))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(-l); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{-\ell}
\end{array}
(FPCore (K m n M l) :precision binary64 (exp (- l)))
double code(double K, double m, double n, double M, double l) {
return exp(-l);
}
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(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(-l);
}
def code(K, m, n, M, l): return math.exp(-l)
function code(K, m, n, M, l) return exp(Float64(-l)) end
function tmp = code(K, m, n, M, l) tmp = exp(-l); end
code[K_, m_, n_, M_, l_] := N[Exp[(-l)], $MachinePrecision]
\begin{array}{l}
\\
e^{-\ell}
\end{array}
(FPCore (K m n M l) :precision binary64 (cos M))
double code(double K, double m, double n, double M, double l) {
return cos(M);
}
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)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M);
}
def code(K, m, n, M, l): return math.cos(M)
function code(K, m, n, M, l) return cos(M) end
function tmp = code(K, m, n, M, l) tmp = cos(M); end
code[K_, m_, n_, M_, l_] := N[Cos[M], $MachinePrecision]
\begin{array}{l}
\\
\cos M
\end{array}
(FPCore (K m n M l) :precision binary64 1.0)
double code(double K, double m, double n, double M, double l) {
return 1.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 = 1.0d0
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0;
}
def code(K, m, n, M, l): return 1.0
function code(K, m, n, M, l) return 1.0 end
function tmp = code(K, m, n, M, l) tmp = 1.0; end
code[K_, m_, n_, M_, l_] := 1.0
\begin{array}{l}
\\
1
\end{array}
herbie shell --seed 2023350
(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)))))))