
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (/ (* (/ (pow k m) (hypot 1.0 k)) a) (hypot 1.0 k)))
double code(double a, double k, double m) {
return ((pow(k, m) / hypot(1.0, k)) * a) / hypot(1.0, k);
}
public static double code(double a, double k, double m) {
return ((Math.pow(k, m) / Math.hypot(1.0, k)) * a) / Math.hypot(1.0, k);
}
def code(a, k, m): return ((math.pow(k, m) / math.hypot(1.0, k)) * a) / math.hypot(1.0, k)
function code(a, k, m) return Float64(Float64(Float64((k ^ m) / hypot(1.0, k)) * a) / hypot(1.0, k)) end
function tmp = code(a, k, m) tmp = (((k ^ m) / hypot(1.0, k)) * a) / hypot(1.0, k); end
code[a_, k_, m_] := N[(N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)} \cdot a}{\mathsf{hypot}\left(1, k\right)}
\end{array}
Initial program 86.0%
associate-/l*85.9%
remove-double-neg85.9%
distribute-frac-neg285.9%
distribute-neg-frac285.9%
remove-double-neg85.9%
sqr-neg85.9%
associate-+l+85.9%
sqr-neg85.9%
distribute-rgt-out85.9%
Simplified85.9%
Taylor expanded in k around inf 85.9%
associate-*r/86.0%
add-sqr-sqrt86.0%
associate-/r*86.0%
hypot-1-def86.0%
hypot-1-def100.0%
Applied egg-rr100.0%
associate-/l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m -5e-76)
(/ t_0 (+ 1.0 (* k k)))
(if (<= m 2.25e-8) (/ (/ a (hypot 1.0 k)) (hypot 1.0 k)) t_0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= -5e-76) {
tmp = t_0 / (1.0 + (k * k));
} else if (m <= 2.25e-8) {
tmp = (a / hypot(1.0, k)) / hypot(1.0, k);
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double tmp;
if (m <= -5e-76) {
tmp = t_0 / (1.0 + (k * k));
} else if (m <= 2.25e-8) {
tmp = (a / Math.hypot(1.0, k)) / Math.hypot(1.0, k);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= -5e-76: tmp = t_0 / (1.0 + (k * k)) elif m <= 2.25e-8: tmp = (a / math.hypot(1.0, k)) / math.hypot(1.0, k) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= -5e-76) tmp = Float64(t_0 / Float64(1.0 + Float64(k * k))); elseif (m <= 2.25e-8) tmp = Float64(Float64(a / hypot(1.0, k)) / hypot(1.0, k)); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= -5e-76) tmp = t_0 / (1.0 + (k * k)); elseif (m <= 2.25e-8) tmp = (a / hypot(1.0, k)) / hypot(1.0, k); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, -5e-76], N[(t$95$0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.25e-8], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq -5 \cdot 10^{-76}:\\
\;\;\;\;\frac{t\_0}{1 + k \cdot k}\\
\mathbf{elif}\;m \leq 2.25 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{a}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -4.9999999999999998e-76Initial program 100.0%
associate-/l*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac299.9%
remove-double-neg99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in a around 0 100.0%
Taylor expanded in k around inf 100.0%
if -4.9999999999999998e-76 < m < 2.24999999999999996e-8Initial program 89.5%
associate-/l*89.5%
remove-double-neg89.5%
distribute-frac-neg289.5%
distribute-neg-frac289.5%
remove-double-neg89.5%
sqr-neg89.5%
associate-+l+89.5%
sqr-neg89.5%
distribute-rgt-out89.5%
Simplified89.5%
Taylor expanded in k around inf 89.5%
associate-*r/89.5%
add-sqr-sqrt89.5%
associate-/r*89.6%
hypot-1-def89.6%
hypot-1-def99.9%
Applied egg-rr99.9%
Taylor expanded in m around 0 99.9%
if 2.24999999999999996e-8 < m Initial program 71.9%
associate-/l*71.9%
remove-double-neg71.9%
distribute-frac-neg271.9%
distribute-neg-frac271.9%
remove-double-neg71.9%
sqr-neg71.9%
associate-+l+71.9%
sqr-neg71.9%
distribute-rgt-out71.9%
Simplified71.9%
Taylor expanded in k around 0 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification99.2%
(FPCore (a k m) :precision binary64 (if (<= k 6.2e-19) (* (pow k m) a) (/ (* (/ (pow k m) (hypot 1.0 k)) a) k)))
double code(double a, double k, double m) {
double tmp;
if (k <= 6.2e-19) {
tmp = pow(k, m) * a;
} else {
tmp = ((pow(k, m) / hypot(1.0, k)) * a) / k;
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (k <= 6.2e-19) {
tmp = Math.pow(k, m) * a;
} else {
tmp = ((Math.pow(k, m) / Math.hypot(1.0, k)) * a) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 6.2e-19: tmp = math.pow(k, m) * a else: tmp = ((math.pow(k, m) / math.hypot(1.0, k)) * a) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 6.2e-19) tmp = Float64((k ^ m) * a); else tmp = Float64(Float64(Float64((k ^ m) / hypot(1.0, k)) * a) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 6.2e-19) tmp = (k ^ m) * a; else tmp = (((k ^ m) / hypot(1.0, k)) * a) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 6.2e-19], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(N[Power[k, m], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.2 \cdot 10^{-19}:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{k}^{m}}{\mathsf{hypot}\left(1, k\right)} \cdot a}{k}\\
\end{array}
\end{array}
if k < 6.1999999999999998e-19Initial program 92.4%
associate-/l*92.4%
remove-double-neg92.4%
distribute-frac-neg292.4%
distribute-neg-frac292.4%
remove-double-neg92.4%
sqr-neg92.4%
associate-+l+92.4%
sqr-neg92.4%
distribute-rgt-out92.4%
Simplified92.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 6.1999999999999998e-19 < k Initial program 75.4%
associate-/l*75.3%
remove-double-neg75.3%
distribute-frac-neg275.3%
distribute-neg-frac275.3%
remove-double-neg75.3%
sqr-neg75.3%
associate-+l+75.3%
sqr-neg75.3%
distribute-rgt-out75.3%
Simplified75.3%
Taylor expanded in k around inf 75.3%
associate-*r/75.4%
add-sqr-sqrt75.4%
associate-/r*75.4%
hypot-1-def75.4%
hypot-1-def99.9%
Applied egg-rr99.9%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in k around inf 99.9%
(FPCore (a k m)
:precision binary64
(if (<= m -4e-25)
(* a (/ (pow k m) (+ 1.0 (* k k))))
(if (<= m 5e-9)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4e-25) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} else if (m <= 5e-9) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-4d-25)) then
tmp = a * ((k ** m) / (1.0d0 + (k * k)))
else if (m <= 5d-9) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = (k ** m) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -4e-25) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else if (m <= 5e-9) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4e-25: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) elif m <= 5e-9: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4e-25) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); elseif (m <= 5e-9) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -4e-25) tmp = a * ((k ^ m) / (1.0 + (k * k))); elseif (m <= 5e-9) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4e-25], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5e-9], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{elif}\;m \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -4.00000000000000015e-25Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in k around inf 100.0%
if -4.00000000000000015e-25 < m < 5.0000000000000001e-9Initial program 89.9%
associate-/l*89.9%
remove-double-neg89.9%
distribute-frac-neg289.9%
distribute-neg-frac289.9%
remove-double-neg89.9%
sqr-neg89.9%
associate-+l+89.9%
sqr-neg89.9%
distribute-rgt-out89.9%
Simplified89.9%
Taylor expanded in m around 0 89.9%
un-div-inv89.9%
clear-num89.7%
+-commutative89.7%
+-commutative89.7%
fma-undefine89.7%
Applied egg-rr89.7%
Taylor expanded in k around 0 99.1%
if 5.0000000000000001e-9 < m Initial program 71.9%
associate-/l*71.9%
remove-double-neg71.9%
distribute-frac-neg271.9%
distribute-neg-frac271.9%
remove-double-neg71.9%
sqr-neg71.9%
associate-+l+71.9%
sqr-neg71.9%
distribute-rgt-out71.9%
Simplified71.9%
Taylor expanded in k around 0 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification99.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -3.7e-10) (not (<= m 9.6e-10))) (* (pow k m) a) (/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3.7e-10) || !(m <= 9.6e-10)) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((m <= (-3.7d-10)) .or. (.not. (m <= 9.6d-10))) then
tmp = (k ** m) * a
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -3.7e-10) || !(m <= 9.6e-10)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3.7e-10) or not (m <= 9.6e-10): tmp = math.pow(k, m) * a else: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3.7e-10) || !(m <= 9.6e-10)) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3.7e-10) || ~((m <= 9.6e-10))) tmp = (k ^ m) * a; else tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3.7e-10], N[Not[LessEqual[m, 9.6e-10]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.7 \cdot 10^{-10} \lor \neg \left(m \leq 9.6 \cdot 10^{-10}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\end{array}
\end{array}
if m < -3.70000000000000015e-10 or 9.5999999999999999e-10 < m Initial program 84.2%
associate-/l*84.2%
remove-double-neg84.2%
distribute-frac-neg284.2%
distribute-neg-frac284.2%
remove-double-neg84.2%
sqr-neg84.2%
associate-+l+84.2%
sqr-neg84.2%
distribute-rgt-out84.2%
Simplified84.2%
Taylor expanded in k around 0 98.9%
*-commutative98.9%
Simplified98.9%
if -3.70000000000000015e-10 < m < 9.5999999999999999e-10Initial program 90.5%
associate-/l*90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
distribute-neg-frac290.4%
remove-double-neg90.4%
sqr-neg90.4%
associate-+l+90.4%
sqr-neg90.4%
distribute-rgt-out90.4%
Simplified90.4%
Taylor expanded in m around 0 89.3%
un-div-inv89.4%
clear-num89.1%
+-commutative89.1%
+-commutative89.1%
fma-undefine89.1%
Applied egg-rr89.1%
Taylor expanded in k around 0 98.0%
Final simplification98.7%
(FPCore (a k m)
:precision binary64
(if (<= m -1.8)
(* a (/ (+ (/ (- (* 0.001 (/ 1.0 k)) 0.01) k) 0.1) k))
(if (<= m 1.66)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(* a (+ 1.0 (* k (- (* k 100.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.8) {
tmp = a * (((((0.001 * (1.0 / k)) - 0.01) / k) + 0.1) / k);
} else if (m <= 1.66) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1.8d0)) then
tmp = a * (((((0.001d0 * (1.0d0 / k)) - 0.01d0) / k) + 0.1d0) / k)
else if (m <= 1.66d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.8) {
tmp = a * (((((0.001 * (1.0 / k)) - 0.01) / k) + 0.1) / k);
} else if (m <= 1.66) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.8: tmp = a * (((((0.001 * (1.0 / k)) - 0.01) / k) + 0.1) / k) elif m <= 1.66: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.8) tmp = Float64(a * Float64(Float64(Float64(Float64(Float64(0.001 * Float64(1.0 / k)) - 0.01) / k) + 0.1) / k)); elseif (m <= 1.66) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.8) tmp = a * (((((0.001 * (1.0 / k)) - 0.01) / k) + 0.1) / k); elseif (m <= 1.66) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.8], N[(a * N[(N[(N[(N[(N[(0.001 * N[(1.0 / k), $MachinePrecision]), $MachinePrecision] - 0.01), $MachinePrecision] / k), $MachinePrecision] + 0.1), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.66], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.8:\\
\;\;\;\;a \cdot \frac{\frac{0.001 \cdot \frac{1}{k} - 0.01}{k} + 0.1}{k}\\
\mathbf{elif}\;m \leq 1.66:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -1.80000000000000004Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 30.2%
Taylor expanded in k around 0 13.4%
*-commutative13.4%
Simplified13.4%
Taylor expanded in k around -inf 42.1%
if -1.80000000000000004 < m < 1.65999999999999992Initial program 89.9%
associate-/l*89.8%
remove-double-neg89.8%
distribute-frac-neg289.8%
distribute-neg-frac289.8%
remove-double-neg89.8%
sqr-neg89.8%
associate-+l+89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
Simplified89.8%
Taylor expanded in m around 0 85.5%
un-div-inv85.6%
clear-num85.4%
+-commutative85.4%
+-commutative85.4%
fma-undefine85.4%
Applied egg-rr85.4%
Taylor expanded in k around 0 93.8%
if 1.65999999999999992 < m Initial program 71.7%
associate-/l*71.7%
remove-double-neg71.7%
distribute-frac-neg271.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
sqr-neg71.7%
associate-+l+71.7%
sqr-neg71.7%
distribute-rgt-out71.7%
Simplified71.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in k around 0 37.1%
Final simplification55.9%
(FPCore (a k m) :precision binary64 (if (<= m 1.52) (/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a))))) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.52) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.52d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.52) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.52: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.52) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.52) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.52], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.52:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.52Initial program 95.0%
associate-/l*94.9%
remove-double-neg94.9%
distribute-frac-neg294.9%
distribute-neg-frac294.9%
remove-double-neg94.9%
sqr-neg94.9%
associate-+l+94.9%
sqr-neg94.9%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in m around 0 57.7%
un-div-inv57.7%
clear-num57.8%
+-commutative57.8%
+-commutative57.8%
fma-undefine57.8%
Applied egg-rr57.8%
Taylor expanded in k around 0 59.6%
if 1.52 < m Initial program 71.7%
associate-/l*71.7%
remove-double-neg71.7%
distribute-frac-neg271.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
sqr-neg71.7%
associate-+l+71.7%
sqr-neg71.7%
distribute-rgt-out71.7%
Simplified71.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in k around 0 37.1%
Final simplification50.9%
(FPCore (a k m) :precision binary64 (if (<= m -0.242) (* a (/ 0.1 k)) (if (<= m 1.9e+20) (/ a (+ 1.0 (* k 10.0))) (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.242) {
tmp = a * (0.1 / k);
} else if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.242d0)) then
tmp = a * (0.1d0 / k)
else if (m <= 1.9d+20) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.242) {
tmp = a * (0.1 / k);
} else if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.242: tmp = a * (0.1 / k) elif m <= 1.9e+20: tmp = a / (1.0 + (k * 10.0)) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.242) tmp = Float64(a * Float64(0.1 / k)); elseif (m <= 1.9e+20) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.242) tmp = a * (0.1 / k); elseif (m <= 1.9e+20) tmp = a / (1.0 + (k * 10.0)); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.242], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.9e+20], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.242:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\mathbf{elif}\;m \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -0.242Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 30.2%
Taylor expanded in k around 0 13.4%
*-commutative13.4%
Simplified13.4%
Taylor expanded in k around inf 21.5%
if -0.242 < m < 1.9e20Initial program 87.6%
associate-/l*87.5%
remove-double-neg87.5%
distribute-frac-neg287.5%
distribute-neg-frac287.5%
remove-double-neg87.5%
sqr-neg87.5%
associate-+l+87.5%
sqr-neg87.5%
distribute-rgt-out87.5%
Simplified87.5%
Taylor expanded in m around 0 83.5%
Taylor expanded in k around 0 55.3%
*-commutative55.3%
Simplified55.3%
if 1.9e20 < m Initial program 73.2%
associate-/l*73.2%
remove-double-neg73.2%
distribute-frac-neg273.2%
distribute-neg-frac273.2%
remove-double-neg73.2%
sqr-neg73.2%
associate-+l+73.2%
sqr-neg73.2%
distribute-rgt-out73.2%
Simplified73.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around inf 22.7%
Final simplification32.5%
(FPCore (a k m) :precision binary64 (if (<= m 2.0) (/ 1.0 (/ (+ 1.0 (* k (+ k 10.0))) a)) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.0d0) then
tmp = 1.0d0 / ((1.0d0 + (k * (k + 10.0d0))) / a)
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.0: tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.0) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.0) tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.0], N[(1.0 / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2:\\
\;\;\;\;\frac{1}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 2Initial program 95.0%
associate-/l*94.9%
remove-double-neg94.9%
distribute-frac-neg294.9%
distribute-neg-frac294.9%
remove-double-neg94.9%
sqr-neg94.9%
associate-+l+94.9%
sqr-neg94.9%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in m around 0 57.7%
un-div-inv57.7%
clear-num57.8%
+-commutative57.8%
+-commutative57.8%
fma-undefine57.8%
Applied egg-rr57.8%
fma-undefine57.8%
Applied egg-rr57.8%
if 2 < m Initial program 71.7%
associate-/l*71.7%
remove-double-neg71.7%
distribute-frac-neg271.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
sqr-neg71.7%
associate-+l+71.7%
sqr-neg71.7%
distribute-rgt-out71.7%
Simplified71.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in k around 0 37.1%
Final simplification49.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.9) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.9) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.9d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * ((k * 100.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.9) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.9: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.9) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 100.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.9) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.9], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.9:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.8999999999999999Initial program 95.0%
associate-/l*94.9%
remove-double-neg94.9%
distribute-frac-neg294.9%
distribute-neg-frac294.9%
remove-double-neg94.9%
sqr-neg94.9%
associate-+l+94.9%
sqr-neg94.9%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in m around 0 57.7%
if 1.8999999999999999 < m Initial program 71.7%
associate-/l*71.7%
remove-double-neg71.7%
distribute-frac-neg271.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
sqr-neg71.7%
associate-+l+71.7%
sqr-neg71.7%
distribute-rgt-out71.7%
Simplified71.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in k around 0 37.1%
Final simplification49.7%
(FPCore (a k m) :precision binary64 (if (<= m 2.05) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.05) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.05d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.05) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.05: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.05) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.05) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.05], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.05:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 2.0499999999999998Initial program 95.0%
associate-/l*94.9%
remove-double-neg94.9%
distribute-frac-neg294.9%
distribute-neg-frac294.9%
remove-double-neg94.9%
sqr-neg94.9%
associate-+l+94.9%
sqr-neg94.9%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in m around 0 57.7%
if 2.0499999999999998 < m Initial program 71.7%
associate-/l*71.7%
remove-double-neg71.7%
distribute-frac-neg271.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
sqr-neg71.7%
associate-+l+71.7%
sqr-neg71.7%
distribute-rgt-out71.7%
Simplified71.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 37.1%
Final simplification49.7%
(FPCore (a k m) :precision binary64 (if (<= m -0.0058) (* a (/ 0.1 k)) (if (<= m 3e+20) a (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.0058) {
tmp = a * (0.1 / k);
} else if (m <= 3e+20) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-0.0058d0)) then
tmp = a * (0.1d0 / k)
else if (m <= 3d+20) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -0.0058) {
tmp = a * (0.1 / k);
} else if (m <= 3e+20) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -0.0058: tmp = a * (0.1 / k) elif m <= 3e+20: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -0.0058) tmp = Float64(a * Float64(0.1 / k)); elseif (m <= 3e+20) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -0.0058) tmp = a * (0.1 / k); elseif (m <= 3e+20) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -0.0058], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 3e+20], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.0058:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\mathbf{elif}\;m \leq 3 \cdot 10^{+20}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -0.0058Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 30.2%
Taylor expanded in k around 0 13.4%
*-commutative13.4%
Simplified13.4%
Taylor expanded in k around inf 21.5%
if -0.0058 < m < 3e20Initial program 87.6%
associate-/l*87.5%
remove-double-neg87.5%
distribute-frac-neg287.5%
distribute-neg-frac287.5%
remove-double-neg87.5%
sqr-neg87.5%
associate-+l+87.5%
sqr-neg87.5%
distribute-rgt-out87.5%
Simplified87.5%
Taylor expanded in m around 0 83.5%
Taylor expanded in k around 0 41.7%
if 3e20 < m Initial program 73.2%
associate-/l*73.2%
remove-double-neg73.2%
distribute-frac-neg273.2%
distribute-neg-frac273.2%
remove-double-neg73.2%
sqr-neg73.2%
associate-+l+73.2%
sqr-neg73.2%
distribute-rgt-out73.2%
Simplified73.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around inf 22.7%
Final simplification28.2%
(FPCore (a k m) :precision binary64 (if (<= m 1.9e+20) (/ a (+ 1.0 (* k (+ k 10.0)))) (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.9d+20) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.9e+20: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.9e+20) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.9e+20) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.9e+20], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 1.9e20Initial program 93.8%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in m around 0 57.0%
if 1.9e20 < m Initial program 73.2%
associate-/l*73.2%
remove-double-neg73.2%
distribute-frac-neg273.2%
distribute-neg-frac273.2%
remove-double-neg73.2%
sqr-neg73.2%
associate-+l+73.2%
sqr-neg73.2%
distribute-rgt-out73.2%
Simplified73.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around inf 22.7%
Final simplification44.0%
(FPCore (a k m) :precision binary64 (if (<= m 1.9e+20) (/ a (+ 1.0 (* k k))) (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.9d+20) then
tmp = a / (1.0d0 + (k * k))
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.9e+20: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.9e+20) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.9e+20) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.9e+20], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 1.9e20Initial program 93.8%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in m around 0 57.0%
Taylor expanded in k around inf 57.0%
if 1.9e20 < m Initial program 73.2%
associate-/l*73.2%
remove-double-neg73.2%
distribute-frac-neg273.2%
distribute-neg-frac273.2%
remove-double-neg73.2%
sqr-neg73.2%
associate-+l+73.2%
sqr-neg73.2%
distribute-rgt-out73.2%
Simplified73.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around inf 22.7%
Final simplification44.0%
(FPCore (a k m) :precision binary64 (if (<= m 1.9e+20) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.9d+20) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.9e+20) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.9e+20: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.9e+20) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.9e+20) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.9e+20], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 1.9e20Initial program 93.8%
associate-/l*93.7%
remove-double-neg93.7%
distribute-frac-neg293.7%
distribute-neg-frac293.7%
remove-double-neg93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out93.7%
Simplified93.7%
Taylor expanded in m around 0 57.0%
Taylor expanded in k around 0 22.7%
if 1.9e20 < m Initial program 73.2%
associate-/l*73.2%
remove-double-neg73.2%
distribute-frac-neg273.2%
distribute-neg-frac273.2%
remove-double-neg73.2%
sqr-neg73.2%
associate-+l+73.2%
sqr-neg73.2%
distribute-rgt-out73.2%
Simplified73.2%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 7.9%
*-commutative7.9%
Simplified7.9%
Taylor expanded in k around inf 22.7%
Final simplification22.7%
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
return a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a
end function
public static double code(double a, double k, double m) {
return a;
}
def code(a, k, m): return a
function code(a, k, m) return a end
function tmp = code(a, k, m) tmp = a; end
code[a_, k_, m_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 86.0%
associate-/l*85.9%
remove-double-neg85.9%
distribute-frac-neg285.9%
distribute-neg-frac285.9%
remove-double-neg85.9%
sqr-neg85.9%
associate-+l+85.9%
sqr-neg85.9%
distribute-rgt-out85.9%
Simplified85.9%
Taylor expanded in m around 0 36.5%
Taylor expanded in k around 0 15.6%
herbie shell --seed 2024114
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))