
(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 18 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 5e-57) 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 <= 5e-57) {
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 <= 5d-57) 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 <= 5e-57) {
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 <= 5e-57: 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 <= 5e-57) 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 <= 5e-57) 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, 5e-57], 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 5 \cdot 10^{-57}:\\
\;\;\;\;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 < 5.0000000000000002e-57Initial program 94.9%
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 k around 0 99.4%
*-commutative99.4%
Simplified99.4%
if 5.0000000000000002e-57 < k Initial program 83.3%
associate-/l*83.3%
remove-double-neg83.3%
distribute-frac-neg283.3%
distribute-neg-frac283.3%
remove-double-neg83.3%
sqr-neg83.3%
associate-+l+83.3%
sqr-neg83.3%
distribute-rgt-out83.3%
Simplified83.3%
distribute-lft-in83.3%
associate-+l+83.3%
associate-*r/83.3%
clear-num83.3%
associate-+l+83.3%
distribute-lft-in83.3%
+-commutative83.3%
fma-define83.3%
+-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
Taylor expanded in k around 0 99.9%
Final simplification99.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+178)
(* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0)))))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+178) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = 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) :: tmp
t_0 = (k ** m) * a
if ((t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))) <= 1d+178) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = 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 tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+178) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+178: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 1e+178) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+178) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); 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[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+178], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+178}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.0000000000000001e178Initial program 97.2%
associate-/l*97.3%
remove-double-neg97.3%
distribute-frac-neg297.3%
distribute-neg-frac297.3%
remove-double-neg97.3%
sqr-neg97.3%
associate-+l+97.3%
sqr-neg97.3%
distribute-rgt-out97.3%
Simplified97.3%
if 1.0000000000000001e178 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 61.2%
associate-/l*61.2%
remove-double-neg61.2%
distribute-frac-neg261.2%
distribute-neg-frac261.2%
remove-double-neg61.2%
sqr-neg61.2%
associate-+l+61.2%
sqr-neg61.2%
distribute-rgt-out61.2%
Simplified61.2%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.8%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 3.45)
(/ 1.0 (+ (/ 1.0 t_0) (* (/ (/ k a) (pow k m)) (+ k 10.0))))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 3.45) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / pow(k, m)) * (k + 10.0)));
} else {
tmp = 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) :: tmp
t_0 = (k ** m) * a
if (m <= 3.45d0) then
tmp = 1.0d0 / ((1.0d0 / t_0) + (((k / a) / (k ** m)) * (k + 10.0d0)))
else
tmp = 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 tmp;
if (m <= 3.45) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / Math.pow(k, m)) * (k + 10.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 3.45: tmp = 1.0 / ((1.0 / t_0) + (((k / a) / math.pow(k, m)) * (k + 10.0))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 3.45) tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + Float64(Float64(Float64(k / a) / (k ^ m)) * Float64(k + 10.0)))); 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 <= 3.45) tmp = 1.0 / ((1.0 / t_0) + (((k / a) / (k ^ m)) * (k + 10.0))); 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, 3.45], N[(1.0 / N[(N[(1.0 / t$95$0), $MachinePrecision] + N[(N[(N[(k / a), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 3.45:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + \frac{\frac{k}{a}}{{k}^{m}} \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 3.4500000000000002Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
distribute-lft-in96.7%
associate-+l+96.7%
associate-*r/96.7%
clear-num96.6%
associate-+l+96.6%
distribute-lft-in96.6%
+-commutative96.6%
fma-define96.6%
+-commutative96.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in k around 0 86.5%
distribute-lft-in84.7%
un-div-inv84.7%
associate-/r*84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-*l/84.7%
associate-*r/84.7%
associate-/r*84.7%
distribute-rgt-out97.5%
Simplified97.5%
if 3.4500000000000002 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 2.7)
(/ 1.0 (+ (/ 1.0 t_0) (/ (* (/ k a) (+ k 10.0)) (pow k m))))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 2.7) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) * (k + 10.0)) / pow(k, m)));
} else {
tmp = 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) :: tmp
t_0 = (k ** m) * a
if (m <= 2.7d0) then
tmp = 1.0d0 / ((1.0d0 / t_0) + (((k / a) * (k + 10.0d0)) / (k ** m)))
else
tmp = 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 tmp;
if (m <= 2.7) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) * (k + 10.0)) / Math.pow(k, m)));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 2.7: tmp = 1.0 / ((1.0 / t_0) + (((k / a) * (k + 10.0)) / math.pow(k, m))) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 2.7) tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + Float64(Float64(Float64(k / a) * Float64(k + 10.0)) / (k ^ m)))); 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 <= 2.7) tmp = 1.0 / ((1.0 / t_0) + (((k / a) * (k + 10.0)) / (k ^ m))); 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, 2.7], N[(1.0 / N[(N[(1.0 / t$95$0), $MachinePrecision] + N[(N[(N[(k / a), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 2.7:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + \frac{\frac{k}{a} \cdot \left(k + 10\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 2.7000000000000002Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
distribute-lft-in96.7%
associate-+l+96.7%
associate-*r/96.7%
clear-num96.6%
associate-+l+96.6%
distribute-lft-in96.6%
+-commutative96.6%
fma-define96.6%
+-commutative96.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in k around 0 86.5%
distribute-lft-in84.7%
un-div-inv84.7%
associate-/r*84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-*l/84.7%
associate-*r/84.7%
associate-/r*84.7%
distribute-rgt-out97.5%
Simplified97.5%
associate-*l/97.5%
+-commutative97.5%
Applied egg-rr97.5%
if 2.7000000000000002 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (a k m)
:precision binary64
(if (<= m -1.6e+22)
(* a (/ (pow k m) (+ 1.0 (* k 10.0))))
(if (<= m 1.42)
(/ 1.0 (+ (* (/ (/ k a) (pow k m)) (+ k 10.0)) (/ 1.0 a)))
(* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.6e+22) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 1.42) {
tmp = 1.0 / ((((k / a) / pow(k, m)) * (k + 10.0)) + (1.0 / 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 <= (-1.6d+22)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 1.42d0) then
tmp = 1.0d0 / ((((k / a) / (k ** m)) * (k + 10.0d0)) + (1.0d0 / 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 <= -1.6e+22) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 1.42) {
tmp = 1.0 / ((((k / a) / Math.pow(k, m)) * (k + 10.0)) + (1.0 / a));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.6e+22: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 1.42: tmp = 1.0 / ((((k / a) / math.pow(k, m)) * (k + 10.0)) + (1.0 / a)) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.6e+22) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 1.42) tmp = Float64(1.0 / Float64(Float64(Float64(Float64(k / a) / (k ^ m)) * Float64(k + 10.0)) + Float64(1.0 / a))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.6e+22) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 1.42) tmp = 1.0 / ((((k / a) / (k ^ m)) * (k + 10.0)) + (1.0 / a)); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.6e+22], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.42], N[(1.0 / N[(N[(N[(N[(k / a), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.6 \cdot 10^{+22}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 1.42:\\
\;\;\;\;\frac{1}{\frac{\frac{k}{a}}{{k}^{m}} \cdot \left(k + 10\right) + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -1.6e22Initial 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%
*-commutative15.7%
Simplified100.0%
if -1.6e22 < m < 1.4199999999999999Initial program 94.6%
associate-/l*94.6%
remove-double-neg94.6%
distribute-frac-neg294.6%
distribute-neg-frac294.6%
remove-double-neg94.6%
sqr-neg94.6%
associate-+l+94.6%
sqr-neg94.6%
distribute-rgt-out94.6%
Simplified94.6%
distribute-lft-in94.6%
associate-+l+94.6%
associate-*r/94.6%
clear-num94.5%
associate-+l+94.5%
distribute-lft-in94.5%
+-commutative94.5%
fma-define94.5%
+-commutative94.5%
*-commutative94.5%
Applied egg-rr94.5%
Taylor expanded in k around 0 97.9%
distribute-lft-in97.8%
un-div-inv97.8%
associate-/r*97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-*l/97.8%
associate-*r/97.8%
associate-/r*97.8%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in m around 0 98.7%
if 1.4199999999999999 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (a k m)
:precision binary64
(if (<= m -9e-14)
(* a (/ (pow k m) (+ 1.0 (* k 10.0))))
(if (<= m 0.0088)
(/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))
(* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e-14) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.0088) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / 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 <= (-9d-14)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 0.0088d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / 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 <= -9e-14) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.0088) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -9e-14: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 0.0088: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -9e-14) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 0.0088) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k + 10.0) / a)))); else tmp = Float64((k ^ m) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -9e-14) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 0.0088) tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -9e-14], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0088], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{-14}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 0.0088:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -8.9999999999999995e-14Initial program 98.7%
associate-/l*98.7%
remove-double-neg98.7%
distribute-frac-neg298.7%
distribute-neg-frac298.7%
remove-double-neg98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out98.7%
Simplified98.7%
Taylor expanded in k around 0 98.7%
*-commutative16.4%
Simplified98.7%
if -8.9999999999999995e-14 < m < 0.00880000000000000053Initial program 95.2%
associate-/l*95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-neg-frac295.2%
remove-double-neg95.2%
sqr-neg95.2%
associate-+l+95.2%
sqr-neg95.2%
distribute-rgt-out95.2%
Simplified95.2%
distribute-lft-in95.2%
associate-+l+95.2%
associate-*r/95.2%
clear-num95.0%
associate-+l+95.0%
distribute-lft-in95.0%
+-commutative95.0%
fma-define95.0%
+-commutative95.0%
*-commutative95.0%
Applied egg-rr95.0%
Taylor expanded in k around 0 99.7%
distribute-lft-in99.7%
un-div-inv99.7%
associate-/r*99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
associate-/r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in m around 0 94.5%
associate-/l*99.2%
Simplified99.2%
if 0.00880000000000000053 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (a k m) :precision binary64 (if (or (<= m -8.5e-14) (not (<= m 0.0088))) (* (pow k m) a) (/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -8.5e-14) || !(m <= 0.0088)) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / 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 <= (-8.5d-14)) .or. (.not. (m <= 0.0088d0))) then
tmp = (k ** m) * a
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -8.5e-14) || !(m <= 0.0088)) {
tmp = Math.pow(k, m) * a;
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -8.5e-14) or not (m <= 0.0088): tmp = math.pow(k, m) * a else: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -8.5e-14) || !(m <= 0.0088)) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k + 10.0) / a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -8.5e-14) || ~((m <= 0.0088))) tmp = (k ^ m) * a; else tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -8.5e-14], N[Not[LessEqual[m, 0.0088]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8.5 \cdot 10^{-14} \lor \neg \left(m \leq 0.0088\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\end{array}
\end{array}
if m < -8.50000000000000038e-14 or 0.00880000000000000053 < m Initial program 87.3%
associate-/l*87.3%
remove-double-neg87.3%
distribute-frac-neg287.3%
distribute-neg-frac287.3%
remove-double-neg87.3%
sqr-neg87.3%
associate-+l+87.3%
sqr-neg87.3%
distribute-rgt-out87.3%
Simplified87.3%
Taylor expanded in k around 0 98.7%
*-commutative98.7%
Simplified98.7%
if -8.50000000000000038e-14 < m < 0.00880000000000000053Initial program 95.2%
associate-/l*95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-neg-frac295.2%
remove-double-neg95.2%
sqr-neg95.2%
associate-+l+95.2%
sqr-neg95.2%
distribute-rgt-out95.2%
Simplified95.2%
distribute-lft-in95.2%
associate-+l+95.2%
associate-*r/95.2%
clear-num95.0%
associate-+l+95.0%
distribute-lft-in95.0%
+-commutative95.0%
fma-define95.0%
+-commutative95.0%
*-commutative95.0%
Applied egg-rr95.0%
Taylor expanded in k around 0 99.7%
distribute-lft-in99.7%
un-div-inv99.7%
associate-/r*99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
associate-/r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in m around 0 94.5%
associate-/l*99.2%
Simplified99.2%
Final simplification98.9%
(FPCore (a k m)
:precision binary64
(if (<= m -4800000000000.0)
(/ a (+ (* k 10.0) (* k k)))
(if (<= m 1.8)
(/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))
(* a (+ 1.0 (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4800000000000.0) {
tmp = a / ((k * 10.0) + (k * k));
} else if (m <= 1.8) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} 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 <= (-4800000000000.0d0)) then
tmp = a / ((k * 10.0d0) + (k * k))
else if (m <= 1.8d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / a)))
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 <= -4800000000000.0) {
tmp = a / ((k * 10.0) + (k * k));
} else if (m <= 1.8) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4800000000000.0: tmp = a / ((k * 10.0) + (k * k)) elif m <= 1.8: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4800000000000.0) tmp = Float64(a / Float64(Float64(k * 10.0) + Float64(k * k))); elseif (m <= 1.8) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k + 10.0) / a)))); 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 <= -4800000000000.0) tmp = a / ((k * 10.0) + (k * k)); elseif (m <= 1.8) tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4800000000000.0], N[(a / N[(N[(k * 10.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.8], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k + 10.0), $MachinePrecision] / a), $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 -4800000000000:\\
\;\;\;\;\frac{a}{k \cdot 10 + k \cdot k}\\
\mathbf{elif}\;m \leq 1.8:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -4.8e12Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 33.6%
Taylor expanded in k around inf 33.6%
Taylor expanded in k around inf 39.3%
if -4.8e12 < m < 1.80000000000000004Initial program 94.5%
associate-/l*94.5%
remove-double-neg94.5%
distribute-frac-neg294.5%
distribute-neg-frac294.5%
remove-double-neg94.5%
sqr-neg94.5%
associate-+l+94.5%
sqr-neg94.5%
distribute-rgt-out94.5%
Simplified94.5%
distribute-lft-in94.5%
associate-+l+94.5%
associate-*r/94.5%
clear-num94.4%
associate-+l+94.4%
distribute-lft-in94.4%
+-commutative94.4%
fma-define94.4%
+-commutative94.4%
*-commutative94.4%
Applied egg-rr94.4%
Taylor expanded in k around 0 99.7%
distribute-lft-in99.7%
un-div-inv99.7%
associate-/r*99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
associate-/r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in m around 0 93.3%
associate-/l*97.8%
Simplified97.8%
if 1.80000000000000004 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 34.1%
Final simplification61.4%
(FPCore (a k m) :precision binary64 (if (<= m 1.8) (/ 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 <= 1.8) {
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 <= 1.8d0) 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 <= 1.8) {
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 <= 1.8: 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 <= 1.8) 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 <= 1.8) 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, 1.8], 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 1.8:\\
\;\;\;\;\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 < 1.80000000000000004Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 69.8%
if 1.80000000000000004 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 34.1%
Final simplification58.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.95) (* a (/ 1.0 (+ 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 <= 1.95) {
tmp = a * (1.0 / (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 <= 1.95d0) then
tmp = a * (1.0d0 / (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 <= 1.95) {
tmp = a * (1.0 / (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 <= 1.95: tmp = a * (1.0 / (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 <= 1.95) tmp = Float64(a * Float64(1.0 / 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 <= 1.95) tmp = a * (1.0 / (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, 1.95], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $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 1.95:\\
\;\;\;\;a \cdot \frac{1}{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 < 1.94999999999999996Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 69.8%
if 1.94999999999999996 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 34.1%
Final simplification58.1%
(FPCore (a k m) :precision binary64 (if (or (<= k -0.102) (not (<= k 0.0275))) (* 0.1 (/ a k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= -0.102) || !(k <= 0.0275)) {
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 ((k <= (-0.102d0)) .or. (.not. (k <= 0.0275d0))) 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 ((k <= -0.102) || !(k <= 0.0275)) {
tmp = 0.1 * (a / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= -0.102) or not (k <= 0.0275): tmp = 0.1 * (a / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= -0.102) || !(k <= 0.0275)) 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 ((k <= -0.102) || ~((k <= 0.0275))) tmp = 0.1 * (a / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, -0.102], N[Not[LessEqual[k, 0.0275]], $MachinePrecision]], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -0.102 \lor \neg \left(k \leq 0.0275\right):\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < -0.101999999999999993 or 0.0275000000000000001 < k Initial program 80.5%
associate-/l*80.6%
remove-double-neg80.6%
distribute-frac-neg280.6%
distribute-neg-frac280.6%
remove-double-neg80.6%
sqr-neg80.6%
associate-+l+80.6%
sqr-neg80.6%
distribute-rgt-out80.6%
Simplified80.6%
Taylor expanded in m around 0 53.4%
Taylor expanded in k around 0 19.1%
*-commutative19.1%
Simplified19.1%
Taylor expanded in k around inf 19.1%
if -0.101999999999999993 < k < 0.0275000000000000001Initial 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 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in m around 0 41.9%
Final simplification30.6%
(FPCore (a k m) :precision binary64 (if (<= m 1.8) (/ a (+ 1.0 (* k k))) (+ a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.8) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (99.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.8d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a + (k * (99.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.8) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a + (k * (99.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.8: tmp = a / (1.0 + (k * k)) else: tmp = a + (k * (99.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.8) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a + Float64(k * Float64(99.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.8) tmp = a / (1.0 + (k * k)); else tmp = a + (k * (99.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.8], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.8:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 1.80000000000000004Initial program 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in m around 0 69.8%
Taylor expanded in k around inf 69.7%
Taylor expanded in k around 0 68.6%
if 1.80000000000000004 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 26.3%
Taylor expanded in k around inf 26.3%
mul-1-neg26.3%
distribute-rgt1-in26.3%
metadata-eval26.3%
distribute-rgt-neg-in26.3%
*-commutative26.3%
distribute-rgt-neg-in26.3%
metadata-eval26.3%
Simplified26.3%
Taylor expanded in k around 0 26.3%
Final simplification54.7%
(FPCore (a k m) :precision binary64 (if (<= m 1.9) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* k (* 99.0 (* k a))))))
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 + (k * (99.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.9d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (99.0d0 * (k * a)))
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 + (k * (99.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.9: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (99.0 * (k * a))) 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(k * Float64(99.0 * Float64(k * a)))); 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 + (k * (99.0 * (k * a))); 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[(k * N[(99.0 * N[(k * a), $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 + k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 1.8999999999999999Initial program 96.7%
associate-/l*96.7%
remove-double-neg96.7%
distribute-frac-neg296.7%
distribute-neg-frac296.7%
remove-double-neg96.7%
sqr-neg96.7%
associate-+l+96.7%
sqr-neg96.7%
distribute-rgt-out96.7%
Simplified96.7%
Taylor expanded in m around 0 69.8%
if 1.8999999999999999 < m Initial program 77.4%
associate-/l*77.4%
remove-double-neg77.4%
distribute-frac-neg277.4%
distribute-neg-frac277.4%
remove-double-neg77.4%
sqr-neg77.4%
associate-+l+77.4%
sqr-neg77.4%
distribute-rgt-out77.4%
Simplified77.4%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 26.3%
Taylor expanded in k around inf 26.3%
mul-1-neg26.3%
distribute-rgt1-in26.3%
metadata-eval26.3%
distribute-rgt-neg-in26.3%
*-commutative26.3%
distribute-rgt-neg-in26.3%
metadata-eval26.3%
Simplified26.3%
Taylor expanded in k around 0 26.3%
Final simplification55.5%
(FPCore (a k m) :precision binary64 (if (<= k 0.0275) (* a (+ 1.0 (* k -10.0))) (* 0.1 (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.0275) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 * (a / k);
}
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 (k <= 0.0275d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = 0.1d0 * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.0275) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.0275: tmp = a * (1.0 + (k * -10.0)) else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.0275) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(0.1 * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.0275) tmp = a * (1.0 + (k * -10.0)); else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.0275], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.0275:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 0.0275000000000000001Initial program 95.3%
associate-/l*95.3%
remove-double-neg95.3%
distribute-frac-neg295.3%
distribute-neg-frac295.3%
remove-double-neg95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
Taylor expanded in m around 0 41.8%
Taylor expanded in k around 0 35.6%
*-commutative35.6%
Simplified35.6%
if 0.0275000000000000001 < k Initial program 80.8%
associate-/l*80.8%
remove-double-neg80.8%
distribute-frac-neg280.8%
distribute-neg-frac280.8%
remove-double-neg80.8%
sqr-neg80.8%
associate-+l+80.8%
sqr-neg80.8%
distribute-rgt-out80.8%
Simplified80.8%
Taylor expanded in m around 0 59.9%
Taylor expanded in k around 0 18.6%
*-commutative18.6%
Simplified18.6%
Taylor expanded in k around inf 18.6%
Final simplification29.9%
(FPCore (a k m) :precision binary64 (if (<= k 0.0275) (+ a (* (* k a) -10.0)) (* 0.1 (/ a k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.0275) {
tmp = a + ((k * a) * -10.0);
} else {
tmp = 0.1 * (a / k);
}
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 (k <= 0.0275d0) then
tmp = a + ((k * a) * (-10.0d0))
else
tmp = 0.1d0 * (a / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.0275) {
tmp = a + ((k * a) * -10.0);
} else {
tmp = 0.1 * (a / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.0275: tmp = a + ((k * a) * -10.0) else: tmp = 0.1 * (a / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.0275) tmp = Float64(a + Float64(Float64(k * a) * -10.0)); else tmp = Float64(0.1 * Float64(a / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.0275) tmp = a + ((k * a) * -10.0); else tmp = 0.1 * (a / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.0275], N[(a + N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]), $MachinePrecision], N[(0.1 * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.0275:\\
\;\;\;\;a + \left(k \cdot a\right) \cdot -10\\
\mathbf{else}:\\
\;\;\;\;0.1 \cdot \frac{a}{k}\\
\end{array}
\end{array}
if k < 0.0275000000000000001Initial program 95.3%
associate-/l*95.3%
remove-double-neg95.3%
distribute-frac-neg295.3%
distribute-neg-frac295.3%
remove-double-neg95.3%
sqr-neg95.3%
associate-+l+95.3%
sqr-neg95.3%
distribute-rgt-out95.3%
Simplified95.3%
Taylor expanded in m around 0 41.8%
Taylor expanded in k around 0 35.7%
if 0.0275000000000000001 < k Initial program 80.8%
associate-/l*80.8%
remove-double-neg80.8%
distribute-frac-neg280.8%
distribute-neg-frac280.8%
remove-double-neg80.8%
sqr-neg80.8%
associate-+l+80.8%
sqr-neg80.8%
distribute-rgt-out80.8%
Simplified80.8%
Taylor expanded in m around 0 59.9%
Taylor expanded in k around 0 18.6%
*-commutative18.6%
Simplified18.6%
Taylor expanded in k around inf 18.6%
Final simplification29.9%
(FPCore (a k m) :precision binary64 (if (<= m 9.2e+29) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 9.2e+29) {
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 <= 9.2d+29) 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 <= 9.2e+29) {
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 <= 9.2e+29: 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 <= 9.2e+29) 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 <= 9.2e+29) 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, 9.2e+29], 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 9.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 9.2000000000000004e29Initial program 94.6%
associate-/l*94.6%
remove-double-neg94.6%
distribute-frac-neg294.6%
distribute-neg-frac294.6%
remove-double-neg94.6%
sqr-neg94.6%
associate-+l+94.6%
sqr-neg94.6%
distribute-rgt-out94.6%
Simplified94.6%
Taylor expanded in m around 0 66.8%
Taylor expanded in k around 0 42.3%
*-commutative42.3%
Simplified42.3%
if 9.2000000000000004e29 < m Initial program 80.3%
associate-/l*80.3%
remove-double-neg80.3%
distribute-frac-neg280.3%
distribute-neg-frac280.3%
remove-double-neg80.3%
sqr-neg80.3%
associate-+l+80.3%
sqr-neg80.3%
distribute-rgt-out80.3%
Simplified80.3%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 9.6%
*-commutative9.6%
Simplified9.6%
Final simplification32.6%
(FPCore (a k m) :precision binary64 (if (<= m 7.8e+34) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 7.8e+34) {
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 <= 7.8d+34) 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 <= 7.8e+34) {
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 <= 7.8e+34: 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 <= 7.8e+34) 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 <= 7.8e+34) 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, 7.8e+34], 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 7.8 \cdot 10^{+34}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 7.80000000000000038e34Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in m around 0 66.8%
Taylor expanded in k around inf 66.8%
Taylor expanded in k around 0 65.7%
if 7.80000000000000038e34 < m Initial program 80.3%
associate-/l*80.3%
remove-double-neg80.3%
distribute-frac-neg280.3%
distribute-neg-frac280.3%
remove-double-neg80.3%
sqr-neg80.3%
associate-+l+80.3%
sqr-neg80.3%
distribute-rgt-out80.3%
Simplified80.3%
Taylor expanded in m around 0 3.4%
Taylor expanded in k around 0 9.6%
*-commutative9.6%
Simplified9.6%
Final simplification49.0%
(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 90.3%
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 k around 0 81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in m around 0 23.2%
Final simplification23.2%
herbie shell --seed 2024112
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))