
(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 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 2e-48) t_0 (/ 1.0 (+ t_1 (* k (+ (* 10.0 t_1) (/ k t_0))))))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-48) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (k ** m) * a
t_1 = 1.0d0 / t_0
if (k <= 2d-48) then
tmp = t_0
else
tmp = 1.0d0 / (t_1 + (k * ((10.0d0 * t_1) + (k / t_0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, m) * a;
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 2e-48) {
tmp = t_0;
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0))));
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a t_1 = 1.0 / t_0 tmp = 0 if k <= 2e-48: tmp = t_0 else: tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (k <= 2e-48) tmp = t_0; else tmp = Float64(1.0 / Float64(t_1 + Float64(k * Float64(Float64(10.0 * t_1) + Float64(k / t_0))))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; t_1 = 1.0 / t_0; tmp = 0.0; if (k <= 2e-48) tmp = t_0; else tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[k, 2e-48], t$95$0, N[(1.0 / N[(t$95$1 + N[(k * N[(N[(10.0 * t$95$1), $MachinePrecision] + N[(k / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
t_1 := \frac{1}{t\_0}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-48}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + k \cdot \left(10 \cdot t\_1 + \frac{k}{t\_0}\right)}\\
\end{array}
\end{array}
if k < 1.9999999999999999e-48Initial program 94.2%
associate-/l*94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
distribute-neg-frac294.2%
remove-double-neg94.2%
sqr-neg94.2%
associate-+l+94.2%
sqr-neg94.2%
distribute-rgt-out94.2%
Simplified94.2%
Taylor expanded in k around 0 99.4%
*-commutative99.4%
Simplified99.4%
if 1.9999999999999999e-48 < k Initial program 82.7%
associate-/l*82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-neg-frac282.7%
remove-double-neg82.7%
sqr-neg82.7%
associate-+l+82.7%
sqr-neg82.7%
distribute-rgt-out82.7%
Simplified82.7%
distribute-lft-in82.7%
associate-+l+82.7%
associate-*r/82.7%
clear-num82.5%
associate-+l+82.5%
distribute-lft-in82.5%
+-commutative82.5%
fma-define82.5%
+-commutative82.5%
*-commutative82.5%
Applied egg-rr82.5%
Taylor expanded in k around 0 99.0%
Final simplification99.2%
(FPCore (a k m) :precision binary64 (let* ((t_0 (sqrt (* (pow k m) a)))) (* (* t_0 (/ t_0 (hypot 1.0 k))) (/ 1.0 (hypot 1.0 k)))))
double code(double a, double k, double m) {
double t_0 = sqrt((pow(k, m) * a));
return (t_0 * (t_0 / hypot(1.0, k))) * (1.0 / hypot(1.0, k));
}
public static double code(double a, double k, double m) {
double t_0 = Math.sqrt((Math.pow(k, m) * a));
return (t_0 * (t_0 / Math.hypot(1.0, k))) * (1.0 / Math.hypot(1.0, k));
}
def code(a, k, m): t_0 = math.sqrt((math.pow(k, m) * a)) return (t_0 * (t_0 / math.hypot(1.0, k))) * (1.0 / math.hypot(1.0, k))
function code(a, k, m) t_0 = sqrt(Float64((k ^ m) * a)) return Float64(Float64(t_0 * Float64(t_0 / hypot(1.0, k))) * Float64(1.0 / hypot(1.0, k))) end
function tmp = code(a, k, m) t_0 = sqrt(((k ^ m) * a)); tmp = (t_0 * (t_0 / hypot(1.0, k))) * (1.0 / hypot(1.0, k)); end
code[a_, k_, m_] := Block[{t$95$0 = N[Sqrt[N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]}, N[(N[(t$95$0 * N[(t$95$0 / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{k}^{m} \cdot a}\\
\left(t\_0 \cdot \frac{t\_0}{\mathsf{hypot}\left(1, k\right)}\right) \cdot \frac{1}{\mathsf{hypot}\left(1, k\right)}
\end{array}
\end{array}
Initial program 89.7%
associate-/l*89.7%
remove-double-neg89.7%
distribute-frac-neg289.7%
distribute-neg-frac289.7%
remove-double-neg89.7%
sqr-neg89.7%
associate-+l+89.7%
sqr-neg89.7%
distribute-rgt-out89.7%
Simplified89.7%
Taylor expanded in k around inf 88.0%
add-sqr-sqrt69.2%
pow269.2%
associate-*r/69.2%
sqrt-div65.4%
hypot-1-def71.2%
Applied egg-rr71.2%
*-commutative71.2%
Simplified71.2%
unpow271.2%
div-inv71.2%
associate-*r*71.2%
Applied egg-rr71.2%
Final simplification71.2%
(FPCore (a k m) :precision binary64 (pow (/ (sqrt (* (pow k m) a)) (hypot 1.0 k)) 2.0))
double code(double a, double k, double m) {
return pow((sqrt((pow(k, m) * a)) / hypot(1.0, k)), 2.0);
}
public static double code(double a, double k, double m) {
return Math.pow((Math.sqrt((Math.pow(k, m) * a)) / Math.hypot(1.0, k)), 2.0);
}
def code(a, k, m): return math.pow((math.sqrt((math.pow(k, m) * a)) / math.hypot(1.0, k)), 2.0)
function code(a, k, m) return Float64(sqrt(Float64((k ^ m) * a)) / hypot(1.0, k)) ^ 2.0 end
function tmp = code(a, k, m) tmp = (sqrt(((k ^ m) * a)) / hypot(1.0, k)) ^ 2.0; end
code[a_, k_, m_] := N[Power[N[(N[Sqrt[N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{\sqrt{{k}^{m} \cdot a}}{\mathsf{hypot}\left(1, k\right)}\right)}^{2}
\end{array}
Initial program 89.7%
associate-/l*89.7%
remove-double-neg89.7%
distribute-frac-neg289.7%
distribute-neg-frac289.7%
remove-double-neg89.7%
sqr-neg89.7%
associate-+l+89.7%
sqr-neg89.7%
distribute-rgt-out89.7%
Simplified89.7%
Taylor expanded in k around inf 88.0%
add-sqr-sqrt69.2%
pow269.2%
associate-*r/69.2%
sqrt-div65.4%
hypot-1-def71.2%
Applied egg-rr71.2%
*-commutative71.2%
Simplified71.2%
(FPCore (a k m) :precision binary64 (if (<= m 4.5) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 4.5) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} 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 <= 4.5d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
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 <= 4.5) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 4.5: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 4.5) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 4.5) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 4.5], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.5:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 4.5Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
if 4.5 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.5%
(FPCore (a k m) :precision binary64 (if (<= m 2.7) (* a (/ (pow k m) (+ 1.0 (* k k)))) (* (pow k m) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.7) {
tmp = a * (pow(k, m) / (1.0 + (k * k)));
} 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 <= 2.7d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * k)))
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 <= 2.7) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * k)));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.7: tmp = a * (math.pow(k, m) / (1.0 + (k * k))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.7) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * k)))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.7) tmp = a * ((k ^ m) / (1.0 + (k * k))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.7], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.7:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < 2.7000000000000002Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in k around inf 93.5%
if 2.7000000000000002 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
(FPCore (a k m) :precision binary64 (if (<= m -2.2e-9) (* a (/ (pow k m) (+ 1.0 (* k 10.0)))) (if (<= m 0.35) (/ a (+ 1.0 (* k (+ k 10.0)))) (* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.2e-9) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.35) {
tmp = a / (1.0 + (k * (k + 10.0)));
} 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 <= (-2.2d-9)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 0.35d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
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 <= -2.2e-9) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.35) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.2e-9: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 0.35: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.2e-9) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 0.35) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.2e-9) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 0.35) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.2e-9], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.35], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.2 \cdot 10^{-9}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 0.35:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -2.1999999999999998e-9Initial 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 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.1999999999999998e-9 < m < 0.34999999999999998Initial 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 m around 0 89.9%
if 0.34999999999999998 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification96.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.000235) (not (<= m 0.00195))) (* (pow k m) a) (/ a (+ 1.0 (* k (+ k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.000235) || !(m <= 0.00195)) {
tmp = pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 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 <= (-0.000235d0)) .or. (.not. (m <= 0.00195d0))) then
tmp = (k ** m) * a
else
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -0.000235) || !(m <= 0.00195)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = a / (1.0 + (k * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -0.000235) or not (m <= 0.00195): tmp = math.pow(k, m) * a else: tmp = a / (1.0 + (k * (k + 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -0.000235) || !(m <= 0.00195)) tmp = Float64((k ^ m) * a); else tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -0.000235) || ~((m <= 0.00195))) tmp = (k ^ m) * a; else tmp = a / (1.0 + (k * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -0.000235], N[Not[LessEqual[m, 0.00195]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.000235 \lor \neg \left(m \leq 0.00195\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if m < -2.34999999999999993e-4 or 0.0019499999999999999 < m Initial program 88.4%
associate-/l*88.4%
remove-double-neg88.4%
distribute-frac-neg288.4%
distribute-neg-frac288.4%
remove-double-neg88.4%
sqr-neg88.4%
associate-+l+88.4%
sqr-neg88.4%
distribute-rgt-out88.4%
Simplified88.4%
Taylor expanded in k around 0 99.4%
*-commutative99.4%
Simplified99.4%
if -2.34999999999999993e-4 < m < 0.0019499999999999999Initial 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 m around 0 89.9%
Final simplification96.3%
(FPCore (a k m) :precision binary64 (if (<= m -2.8e+46) (/ 0.1 (/ k a)) (if (<= m 2.5e+37) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.8e+46) {
tmp = 0.1 / (k / a);
} else if (m <= 2.5e+37) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -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.8d+46)) then
tmp = 0.1d0 / (k / a)
else if (m <= 2.5d+37) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.8e+46) {
tmp = 0.1 / (k / a);
} else if (m <= 2.5e+37) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.8e+46: tmp = 0.1 / (k / a) elif m <= 2.5e+37: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.8e+46) tmp = Float64(0.1 / Float64(k / a)); elseif (m <= 2.5e+37) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.8e+46) tmp = 0.1 / (k / a); elseif (m <= 2.5e+37) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.8e+46], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.5e+37], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{elif}\;m \leq 2.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -2.80000000000000018e46Initial 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 49.5%
+-commutative49.5%
+-commutative49.5%
fma-undefine49.5%
Simplified49.5%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in k around inf 34.9%
clear-num36.5%
un-div-inv36.5%
Applied egg-rr36.5%
if -2.80000000000000018e46 < m < 2.49999999999999994e37Initial program 92.9%
associate-/l*92.9%
remove-double-neg92.9%
distribute-frac-neg292.9%
distribute-neg-frac292.9%
remove-double-neg92.9%
sqr-neg92.9%
associate-+l+92.9%
sqr-neg92.9%
distribute-rgt-out92.9%
Simplified92.9%
Taylor expanded in m around 0 78.6%
+-commutative78.6%
+-commutative78.6%
fma-undefine78.6%
Simplified78.6%
Taylor expanded in k around 0 47.7%
*-commutative47.7%
Simplified47.7%
if 2.49999999999999994e37 < m Initial program 77.1%
associate-/l*77.1%
remove-double-neg77.1%
distribute-frac-neg277.1%
distribute-neg-frac277.1%
remove-double-neg77.1%
sqr-neg77.1%
associate-+l+77.1%
sqr-neg77.1%
distribute-rgt-out77.1%
Simplified77.1%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 10.0%
*-commutative10.0%
Simplified10.0%
(FPCore (a k m) :precision binary64 (if (<= m 7e+16) (/ 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 <= 7e+16) {
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 <= 7d+16) 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 <= 7e+16) {
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 <= 7e+16: 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 <= 7e+16) 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 <= 7e+16) 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, 7e+16], 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 7 \cdot 10^{+16}:\\
\;\;\;\;\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 < 7e16Initial program 96.3%
associate-/l*96.3%
remove-double-neg96.3%
distribute-frac-neg296.3%
distribute-neg-frac296.3%
remove-double-neg96.3%
sqr-neg96.3%
associate-+l+96.3%
sqr-neg96.3%
distribute-rgt-out96.3%
Simplified96.3%
Taylor expanded in m around 0 68.2%
if 7e16 < m Initial program 77.0%
associate-/l*77.0%
remove-double-neg77.0%
distribute-frac-neg277.0%
distribute-neg-frac277.0%
remove-double-neg77.0%
sqr-neg77.0%
associate-+l+77.0%
sqr-neg77.0%
distribute-rgt-out77.0%
Simplified77.0%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 32.6%
Final simplification56.1%
(FPCore (a k m) :precision binary64 (if (<= m 2.0) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (k * 99.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 = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.0: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.0) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.0) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.0], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in m around 0 69.0%
if 2 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 32.0%
Taylor expanded in k around inf 32.0%
*-commutative32.0%
Simplified32.0%
Final simplification56.1%
(FPCore (a k m) :precision binary64 (if (<= m 2.2) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.2) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (k * 99.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.2d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.2) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.2: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.2) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.2) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.2], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.2:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2.2000000000000002Initial program 96.2%
associate-/l*96.2%
remove-double-neg96.2%
distribute-frac-neg296.2%
distribute-neg-frac296.2%
remove-double-neg96.2%
sqr-neg96.2%
associate-+l+96.2%
sqr-neg96.2%
distribute-rgt-out96.2%
Simplified96.2%
Taylor expanded in m around 0 69.0%
Taylor expanded in k around inf 67.0%
if 2.2000000000000002 < m Initial program 77.5%
associate-/l*77.5%
remove-double-neg77.5%
distribute-frac-neg277.5%
distribute-neg-frac277.5%
remove-double-neg77.5%
sqr-neg77.5%
associate-+l+77.5%
sqr-neg77.5%
distribute-rgt-out77.5%
Simplified77.5%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 32.0%
Taylor expanded in k around inf 32.0%
*-commutative32.0%
Simplified32.0%
(FPCore (a k m) :precision binary64 (if (<= m 1.2e+38) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.2e+38) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -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.2d+38) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.2e+38) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.2e+38: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.2e+38) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.2e+38) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.2e+38], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.2 \cdot 10^{+38}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 1.20000000000000009e38Initial program 95.8%
associate-/l*95.8%
remove-double-neg95.8%
distribute-frac-neg295.8%
distribute-neg-frac295.8%
remove-double-neg95.8%
sqr-neg95.8%
associate-+l+95.8%
sqr-neg95.8%
distribute-rgt-out95.8%
Simplified95.8%
Taylor expanded in m around 0 66.7%
Taylor expanded in k around inf 64.8%
if 1.20000000000000009e38 < m Initial program 77.1%
associate-/l*77.1%
remove-double-neg77.1%
distribute-frac-neg277.1%
distribute-neg-frac277.1%
remove-double-neg77.1%
sqr-neg77.1%
associate-+l+77.1%
sqr-neg77.1%
distribute-rgt-out77.1%
Simplified77.1%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 10.0%
*-commutative10.0%
Simplified10.0%
(FPCore (a k m) :precision binary64 (if (<= m -2.6e+37) (/ 0.1 (/ k a)) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 / (k / a);
} else {
tmp = a * (1.0 + (k * -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.6d+37)) then
tmp = 0.1d0 / (k / a)
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 / (k / a);
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.6e+37: tmp = 0.1 / (k / a) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.6e+37) tmp = Float64(0.1 / Float64(k / a)); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.6e+37) tmp = 0.1 / (k / a); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.6e+37], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.6 \cdot 10^{+37}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -2.5999999999999999e37Initial 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 50.2%
+-commutative50.2%
+-commutative50.2%
fma-undefine50.2%
Simplified50.2%
Taylor expanded in k around 0 30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in k around inf 35.8%
clear-num37.4%
un-div-inv37.4%
Applied egg-rr37.4%
if -2.5999999999999999e37 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in m around 0 44.3%
Taylor expanded in k around 0 25.5%
*-commutative25.5%
Simplified25.5%
(FPCore (a k m) :precision binary64 (if (<= m -2.6e+37) (/ 0.1 (/ k a)) a))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 / (k / a);
} else {
tmp = 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 <= (-2.6d+37)) then
tmp = 0.1d0 / (k / a)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 / (k / a);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.6e+37: tmp = 0.1 / (k / a) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.6e+37) tmp = Float64(0.1 / Float64(k / a)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.6e+37) tmp = 0.1 / (k / a); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.6e+37], N[(0.1 / N[(k / a), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.6 \cdot 10^{+37}:\\
\;\;\;\;\frac{0.1}{\frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if m < -2.5999999999999999e37Initial 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 50.2%
+-commutative50.2%
+-commutative50.2%
fma-undefine50.2%
Simplified50.2%
Taylor expanded in k around 0 30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in k around inf 35.8%
clear-num37.4%
un-div-inv37.4%
Applied egg-rr37.4%
if -2.5999999999999999e37 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in k around 0 76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in m around 0 23.2%
(FPCore (a k m) :precision binary64 (if (<= m -2.6e+37) (* 0.1 (/ a k)) a))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 * (a / k);
} else {
tmp = 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 <= (-2.6d+37)) then
tmp = 0.1d0 * (a / k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.6e+37) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.6e+37: tmp = 0.1 * (a / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.6e+37) tmp = Float64(0.1 * Float64(a / k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.6e+37) tmp = 0.1 * (a / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.6e+37], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.6 \cdot 10^{+37}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if m < -2.5999999999999999e37Initial 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 50.2%
+-commutative50.2%
+-commutative50.2%
fma-undefine50.2%
Simplified50.2%
Taylor expanded in k around 0 30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in k around inf 35.8%
if -2.5999999999999999e37 < m Initial program 85.7%
associate-/l*85.7%
remove-double-neg85.7%
distribute-frac-neg285.7%
distribute-neg-frac285.7%
remove-double-neg85.7%
sqr-neg85.7%
associate-+l+85.7%
sqr-neg85.7%
distribute-rgt-out85.7%
Simplified85.7%
Taylor expanded in k around 0 76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in m around 0 23.2%
(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 89.7%
associate-/l*89.7%
remove-double-neg89.7%
distribute-frac-neg289.7%
distribute-neg-frac289.7%
remove-double-neg89.7%
sqr-neg89.7%
associate-+l+89.7%
sqr-neg89.7%
distribute-rgt-out89.7%
Simplified89.7%
Taylor expanded in k around 0 82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in m around 0 17.9%
herbie shell --seed 2024131
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))