
(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 22 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)))
(if (<= k 4e-47)
t_0
(/
-1.0
(- (/ -1.0 t_0) (* k (/ (+ (/ 10.0 (pow k m)) (/ k (pow k m))) a)))))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (k <= 4e-47) {
tmp = t_0;
} else {
tmp = -1.0 / ((-1.0 / t_0) - (k * (((10.0 / pow(k, m)) + (k / 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) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (k <= 4d-47) then
tmp = t_0
else
tmp = (-1.0d0) / (((-1.0d0) / t_0) - (k * (((10.0d0 / (k ** m)) + (k / (k ** m))) / a)))
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 (k <= 4e-47) {
tmp = t_0;
} else {
tmp = -1.0 / ((-1.0 / t_0) - (k * (((10.0 / Math.pow(k, m)) + (k / Math.pow(k, m))) / a)));
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if k <= 4e-47: tmp = t_0 else: tmp = -1.0 / ((-1.0 / t_0) - (k * (((10.0 / math.pow(k, m)) + (k / math.pow(k, m))) / a))) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (k <= 4e-47) tmp = t_0; else tmp = Float64(-1.0 / Float64(Float64(-1.0 / t_0) - Float64(k * Float64(Float64(Float64(10.0 / (k ^ m)) + Float64(k / (k ^ m))) / a)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (k <= 4e-47) tmp = t_0; else tmp = -1.0 / ((-1.0 / t_0) - (k * (((10.0 / (k ^ m)) + (k / (k ^ m))) / a))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[k, 4e-47], t$95$0, N[(-1.0 / N[(N[(-1.0 / t$95$0), $MachinePrecision] - N[(k * N[(N[(N[(10.0 / N[Power[k, m], $MachinePrecision]), $MachinePrecision] + N[(k / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;k \leq 4 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{t\_0} - k \cdot \frac{\frac{10}{{k}^{m}} + \frac{k}{{k}^{m}}}{a}}\\
\end{array}
\end{array}
if k < 3.9999999999999999e-47Initial program 96.8%
associate-/l*96.8%
remove-double-neg96.8%
distribute-frac-neg296.8%
distribute-neg-frac296.8%
remove-double-neg96.8%
sqr-neg96.8%
associate-+l+96.8%
sqr-neg96.8%
distribute-rgt-out96.8%
Simplified96.8%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 3.9999999999999999e-47 < k Initial program 74.8%
associate-/l*74.8%
remove-double-neg74.8%
distribute-frac-neg274.8%
distribute-neg-frac274.8%
remove-double-neg74.8%
sqr-neg74.8%
associate-+l+74.8%
sqr-neg74.8%
distribute-rgt-out74.8%
Simplified74.8%
distribute-lft-in74.8%
associate-+l+74.8%
associate-*r/74.8%
clear-num74.7%
associate-+l+74.7%
distribute-lft-in74.7%
+-commutative74.7%
fma-define74.7%
+-commutative74.7%
*-commutative74.7%
Applied egg-rr74.7%
Taylor expanded in k around 0 99.2%
Taylor expanded in a around 0 88.9%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= k 1e-41)
t_0
(/ 1.0 (+ (/ 1.0 t_0) (* (/ 1.0 (* a (/ (pow k m) k))) (+ k 10.0)))))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (k <= 1e-41) {
tmp = t_0;
} else {
tmp = 1.0 / ((1.0 / t_0) + ((1.0 / (a * (pow(k, m) / 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) :: t_0
real(8) :: tmp
t_0 = (k ** m) * a
if (k <= 1d-41) then
tmp = t_0
else
tmp = 1.0d0 / ((1.0d0 / t_0) + ((1.0d0 / (a * ((k ** m) / k))) * (k + 10.0d0)))
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 (k <= 1e-41) {
tmp = t_0;
} else {
tmp = 1.0 / ((1.0 / t_0) + ((1.0 / (a * (Math.pow(k, m) / k))) * (k + 10.0)));
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if k <= 1e-41: tmp = t_0 else: tmp = 1.0 / ((1.0 / t_0) + ((1.0 / (a * (math.pow(k, m) / k))) * (k + 10.0))) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (k <= 1e-41) tmp = t_0; else tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + Float64(Float64(1.0 / Float64(a * Float64((k ^ m) / k))) * Float64(k + 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (k <= 1e-41) tmp = t_0; else tmp = 1.0 / ((1.0 / t_0) + ((1.0 / (a * ((k ^ m) / k))) * (k + 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[k, 1e-41], t$95$0, N[(1.0 / N[(N[(1.0 / t$95$0), $MachinePrecision] + N[(N[(1.0 / N[(a * N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;k \leq 10^{-41}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + \frac{1}{a \cdot \frac{{k}^{m}}{k}} \cdot \left(k + 10\right)}\\
\end{array}
\end{array}
if k < 1.00000000000000001e-41Initial program 96.8%
associate-/l*96.8%
remove-double-neg96.8%
distribute-frac-neg296.8%
distribute-neg-frac296.8%
remove-double-neg96.8%
sqr-neg96.8%
associate-+l+96.8%
sqr-neg96.8%
distribute-rgt-out96.8%
Simplified96.8%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.00000000000000001e-41 < k Initial program 74.8%
associate-/l*74.8%
remove-double-neg74.8%
distribute-frac-neg274.8%
distribute-neg-frac274.8%
remove-double-neg74.8%
sqr-neg74.8%
associate-+l+74.8%
sqr-neg74.8%
distribute-rgt-out74.8%
Simplified74.8%
distribute-lft-in74.8%
associate-+l+74.8%
associate-*r/74.8%
clear-num74.7%
associate-+l+74.7%
distribute-lft-in74.7%
+-commutative74.7%
fma-define74.7%
+-commutative74.7%
*-commutative74.7%
Applied egg-rr74.7%
Taylor expanded in k around 0 99.2%
*-un-lft-identity99.2%
fma-define99.2%
un-div-inv99.2%
associate-/r*95.1%
Applied egg-rr95.1%
*-lft-identity95.1%
fma-undefine95.1%
distribute-lft-in95.1%
*-commutative95.1%
associate-*l/95.1%
associate-*r/95.1%
associate-/r*95.1%
distribute-rgt-out95.1%
+-commutative95.1%
Simplified95.1%
clear-num95.2%
inv-pow95.2%
Applied egg-rr95.2%
unpow-195.2%
associate-/r/99.2%
Simplified99.2%
Final simplification99.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 2.5)
(/ -1.0 (- (/ -1.0 t_0) (/ (* (+ k 10.0) (/ k a)) (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.5) {
tmp = -1.0 / ((-1.0 / t_0) - (((k + 10.0) * (k / a)) / 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.5d0) then
tmp = (-1.0d0) / (((-1.0d0) / t_0) - (((k + 10.0d0) * (k / a)) / (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.5) {
tmp = -1.0 / ((-1.0 / t_0) - (((k + 10.0) * (k / a)) / 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.5: tmp = -1.0 / ((-1.0 / t_0) - (((k + 10.0) * (k / a)) / 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.5) tmp = Float64(-1.0 / Float64(Float64(-1.0 / t_0) - Float64(Float64(Float64(k + 10.0) * Float64(k / a)) / (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.5) tmp = -1.0 / ((-1.0 / t_0) - (((k + 10.0) * (k / a)) / (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.5], N[(-1.0 / N[(N[(-1.0 / t$95$0), $MachinePrecision] - N[(N[(N[(k + 10.0), $MachinePrecision] * N[(k / a), $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.5:\\
\;\;\;\;\frac{-1}{\frac{-1}{t\_0} - \frac{\left(k + 10\right) \cdot \frac{k}{a}}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 2.5Initial program 94.1%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
distribute-lft-in94.0%
associate-+l+94.0%
associate-*r/94.1%
clear-num93.9%
associate-+l+94.0%
distribute-lft-in94.0%
+-commutative94.0%
fma-define94.0%
+-commutative94.0%
*-commutative94.0%
Applied egg-rr94.0%
Taylor expanded in k around 0 84.3%
*-un-lft-identity84.3%
fma-define84.3%
un-div-inv84.3%
associate-/r*84.3%
Applied egg-rr84.3%
*-lft-identity84.3%
fma-undefine84.3%
distribute-lft-in78.3%
*-commutative78.3%
associate-*l/78.3%
associate-*r/78.3%
associate-/r*78.3%
distribute-rgt-out93.5%
+-commutative93.5%
Simplified93.5%
associate-*l/93.5%
Applied egg-rr93.5%
if 2.5 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification94.6%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 3.6)
(/ -1.0 (- (/ -1.0 t_0) (* (+ k 10.0) (/ (/ k a) (pow k m)))))
t_0)))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 3.6) {
tmp = -1.0 / ((-1.0 / t_0) - ((k + 10.0) * ((k / a) / 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 <= 3.6d0) then
tmp = (-1.0d0) / (((-1.0d0) / t_0) - ((k + 10.0d0) * ((k / a) / (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 <= 3.6) {
tmp = -1.0 / ((-1.0 / t_0) - ((k + 10.0) * ((k / a) / 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 <= 3.6: tmp = -1.0 / ((-1.0 / t_0) - ((k + 10.0) * ((k / a) / 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 <= 3.6) tmp = Float64(-1.0 / Float64(Float64(-1.0 / t_0) - Float64(Float64(k + 10.0) * Float64(Float64(k / a) / (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 <= 3.6) tmp = -1.0 / ((-1.0 / t_0) - ((k + 10.0) * ((k / a) / (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, 3.6], N[(-1.0 / N[(N[(-1.0 / t$95$0), $MachinePrecision] - N[(N[(k + 10.0), $MachinePrecision] * N[(N[(k / a), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 3.6:\\
\;\;\;\;\frac{-1}{\frac{-1}{t\_0} - \left(k + 10\right) \cdot \frac{\frac{k}{a}}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 3.60000000000000009Initial program 94.1%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
distribute-lft-in94.0%
associate-+l+94.0%
associate-*r/94.1%
clear-num93.9%
associate-+l+94.0%
distribute-lft-in94.0%
+-commutative94.0%
fma-define94.0%
+-commutative94.0%
*-commutative94.0%
Applied egg-rr94.0%
Taylor expanded in k around 0 84.3%
*-un-lft-identity84.3%
fma-define84.3%
un-div-inv84.3%
associate-/r*84.3%
Applied egg-rr84.3%
*-lft-identity84.3%
fma-undefine84.3%
distribute-lft-in78.3%
*-commutative78.3%
associate-*l/78.3%
associate-*r/78.3%
associate-/r*78.3%
distribute-rgt-out93.5%
+-commutative93.5%
Simplified93.5%
if 3.60000000000000009 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification94.6%
(FPCore (a k m)
:precision binary64
(if (<= m -4.4e-46)
(* a (/ (pow k m) (+ (* k (+ k 10.0)) 1.0)))
(if (<= m 0.016)
(/ 1.0 (+ (* (+ k 10.0) (/ (/ k a) (pow k m))) (/ 1.0 a)))
(* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4.4e-46) {
tmp = a * (pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else if (m <= 0.016) {
tmp = 1.0 / (((k + 10.0) * ((k / a) / pow(k, m))) + (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 <= (-4.4d-46)) then
tmp = a * ((k ** m) / ((k * (k + 10.0d0)) + 1.0d0))
else if (m <= 0.016d0) then
tmp = 1.0d0 / (((k + 10.0d0) * ((k / a) / (k ** m))) + (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 <= -4.4e-46) {
tmp = a * (Math.pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else if (m <= 0.016) {
tmp = 1.0 / (((k + 10.0) * ((k / a) / Math.pow(k, m))) + (1.0 / a));
} else {
tmp = Math.pow(k, m) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4.4e-46: tmp = a * (math.pow(k, m) / ((k * (k + 10.0)) + 1.0)) elif m <= 0.016: tmp = 1.0 / (((k + 10.0) * ((k / a) / math.pow(k, m))) + (1.0 / a)) else: tmp = math.pow(k, m) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4.4e-46) tmp = Float64(a * Float64((k ^ m) / Float64(Float64(k * Float64(k + 10.0)) + 1.0))); elseif (m <= 0.016) tmp = Float64(1.0 / Float64(Float64(Float64(k + 10.0) * Float64(Float64(k / a) / (k ^ m))) + 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 <= -4.4e-46) tmp = a * ((k ^ m) / ((k * (k + 10.0)) + 1.0)); elseif (m <= 0.016) tmp = 1.0 / (((k + 10.0) * ((k / a) / (k ^ m))) + (1.0 / a)); else tmp = (k ^ m) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4.4e-46], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.016], N[(1.0 / N[(N[(N[(k + 10.0), $MachinePrecision] * N[(N[(k / a), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $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 -4.4 \cdot 10^{-46}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{elif}\;m \leq 0.016:\\
\;\;\;\;\frac{1}{\left(k + 10\right) \cdot \frac{\frac{k}{a}}{{k}^{m}} + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -4.4000000000000002e-46Initial 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%
if -4.4000000000000002e-46 < m < 0.016Initial program 87.7%
associate-/l*87.7%
remove-double-neg87.7%
distribute-frac-neg287.7%
distribute-neg-frac287.7%
remove-double-neg87.7%
sqr-neg87.7%
associate-+l+87.7%
sqr-neg87.7%
distribute-rgt-out87.7%
Simplified87.7%
distribute-lft-in87.7%
associate-+l+87.7%
associate-*r/87.7%
clear-num87.5%
associate-+l+87.5%
distribute-lft-in87.5%
+-commutative87.5%
fma-define87.5%
+-commutative87.5%
*-commutative87.5%
Applied egg-rr87.5%
Taylor expanded in k around 0 99.0%
*-un-lft-identity99.0%
fma-define99.0%
un-div-inv99.0%
associate-/r*99.0%
Applied egg-rr99.0%
*-lft-identity99.0%
fma-undefine99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l/99.0%
associate-*r/99.0%
associate-/r*99.0%
distribute-rgt-out99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in m around 0 98.8%
if 0.016 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (a k m)
:precision binary64
(if (<= m -4.4e-46)
(* a (/ (pow k m) (+ (* k (+ k 10.0)) 1.0)))
(if (<= m 1.1e-5)
(/ 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 <= -4.4e-46) {
tmp = a * (pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else if (m <= 1.1e-5) {
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 <= (-4.4d-46)) then
tmp = a * ((k ** m) / ((k * (k + 10.0d0)) + 1.0d0))
else if (m <= 1.1d-5) 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 <= -4.4e-46) {
tmp = a * (Math.pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else if (m <= 1.1e-5) {
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 <= -4.4e-46: tmp = a * (math.pow(k, m) / ((k * (k + 10.0)) + 1.0)) elif m <= 1.1e-5: 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 <= -4.4e-46) tmp = Float64(a * Float64((k ^ m) / Float64(Float64(k * Float64(k + 10.0)) + 1.0))); elseif (m <= 1.1e-5) 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 <= -4.4e-46) tmp = a * ((k ^ m) / ((k * (k + 10.0)) + 1.0)); elseif (m <= 1.1e-5) 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, -4.4e-46], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.1e-5], 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 -4.4 \cdot 10^{-46}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{elif}\;m \leq 1.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -4.4000000000000002e-46Initial 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%
if -4.4000000000000002e-46 < m < 1.1e-5Initial program 87.7%
associate-/l*87.7%
remove-double-neg87.7%
distribute-frac-neg287.7%
distribute-neg-frac287.7%
remove-double-neg87.7%
sqr-neg87.7%
associate-+l+87.7%
sqr-neg87.7%
distribute-rgt-out87.7%
Simplified87.7%
distribute-lft-in87.7%
associate-+l+87.7%
associate-*r/87.7%
clear-num87.5%
associate-+l+87.5%
distribute-lft-in87.5%
+-commutative87.5%
fma-define87.5%
+-commutative87.5%
*-commutative87.5%
Applied egg-rr87.5%
Taylor expanded in k around 0 99.0%
*-un-lft-identity99.0%
fma-define99.0%
un-div-inv99.0%
associate-/r*99.0%
Applied egg-rr99.0%
*-lft-identity99.0%
fma-undefine99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l/99.0%
associate-*r/99.0%
associate-/r*99.0%
distribute-rgt-out99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in m around 0 87.3%
associate-/l*97.9%
+-commutative97.9%
Simplified97.9%
if 1.1e-5 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.0025) (not (<= m 5.6e-6))) (* (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 <= -0.0025) || !(m <= 5.6e-6)) {
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 <= (-0.0025d0)) .or. (.not. (m <= 5.6d-6))) 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 <= -0.0025) || !(m <= 5.6e-6)) {
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 <= -0.0025) or not (m <= 5.6e-6): 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 <= -0.0025) || !(m <= 5.6e-6)) 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 <= -0.0025) || ~((m <= 5.6e-6))) 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, -0.0025], N[Not[LessEqual[m, 5.6e-6]], $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 -0.0025 \lor \neg \left(m \leq 5.6 \cdot 10^{-6}\right):\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\end{array}
\end{array}
if m < -0.00250000000000000005 or 5.59999999999999975e-6 < m Initial program 88.1%
associate-/l*88.1%
remove-double-neg88.1%
distribute-frac-neg288.1%
distribute-neg-frac288.1%
remove-double-neg88.1%
sqr-neg88.1%
associate-+l+88.1%
sqr-neg88.1%
distribute-rgt-out88.1%
Simplified88.1%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -0.00250000000000000005 < m < 5.59999999999999975e-6Initial program 88.6%
associate-/l*88.6%
remove-double-neg88.6%
distribute-frac-neg288.6%
distribute-neg-frac288.6%
remove-double-neg88.6%
sqr-neg88.6%
associate-+l+88.6%
sqr-neg88.6%
distribute-rgt-out88.6%
Simplified88.6%
distribute-lft-in88.6%
associate-+l+88.6%
associate-*r/88.6%
clear-num88.4%
associate-+l+88.4%
distribute-lft-in88.4%
+-commutative88.4%
fma-define88.4%
+-commutative88.4%
*-commutative88.4%
Applied egg-rr88.4%
Taylor expanded in k around 0 99.0%
*-un-lft-identity99.0%
fma-define99.0%
un-div-inv99.0%
associate-/r*99.0%
Applied egg-rr99.0%
*-lft-identity99.0%
fma-undefine99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l/99.0%
associate-*r/99.0%
associate-/r*99.0%
distribute-rgt-out99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in m around 0 88.1%
associate-/l*97.9%
+-commutative97.9%
Simplified97.9%
Final simplification99.2%
(FPCore (a k m)
:precision binary64
(if (<= m -4e+243)
(/ (- (/ (- (* 0.001 (/ a k)) (* a 0.01)) k) (* a -0.1)) k)
(if (<= m -2.1e-29)
(/ 1.0 (/ (+ (* k (+ k 10.0)) 1.0) a))
(if (<= m 2.0)
(/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))
(+ a (* a (* k (- (* k 100.0) 10.0))))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4e+243) {
tmp = ((((0.001 * (a / k)) - (a * 0.01)) / k) - (a * -0.1)) / k;
} else if (m <= -2.1e-29) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else if (m <= 2.0) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a + (a * (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 <= (-4d+243)) then
tmp = ((((0.001d0 * (a / k)) - (a * 0.01d0)) / k) - (a * (-0.1d0))) / k
else if (m <= (-2.1d-29)) then
tmp = 1.0d0 / (((k * (k + 10.0d0)) + 1.0d0) / a)
else if (m <= 2.0d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / a)))
else
tmp = a + (a * (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 <= -4e+243) {
tmp = ((((0.001 * (a / k)) - (a * 0.01)) / k) - (a * -0.1)) / k;
} else if (m <= -2.1e-29) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else if (m <= 2.0) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4e+243: tmp = ((((0.001 * (a / k)) - (a * 0.01)) / k) - (a * -0.1)) / k elif m <= -2.1e-29: tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a) elif m <= 2.0: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4e+243) tmp = Float64(Float64(Float64(Float64(Float64(0.001 * Float64(a / k)) - Float64(a * 0.01)) / k) - Float64(a * -0.1)) / k); elseif (m <= -2.1e-29) tmp = Float64(1.0 / Float64(Float64(Float64(k * Float64(k + 10.0)) + 1.0) / a)); elseif (m <= 2.0) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k + 10.0) / a)))); else tmp = Float64(a + Float64(a * 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 <= -4e+243) tmp = ((((0.001 * (a / k)) - (a * 0.01)) / k) - (a * -0.1)) / k; elseif (m <= -2.1e-29) tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a); elseif (m <= 2.0) tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4e+243], N[(N[(N[(N[(N[(0.001 * N[(a / k), $MachinePrecision]), $MachinePrecision] - N[(a * 0.01), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] - N[(a * -0.1), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, -2.1e-29], N[(1.0 / N[(N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.0], 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[(a * N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4 \cdot 10^{+243}:\\
\;\;\;\;\frac{\frac{0.001 \cdot \frac{a}{k} - a \cdot 0.01}{k} - a \cdot -0.1}{k}\\
\mathbf{elif}\;m \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;\frac{1}{\frac{k \cdot \left(k + 10\right) + 1}{a}}\\
\mathbf{elif}\;m \leq 2:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -4.0000000000000003e243Initial 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 10.4%
Taylor expanded in k around 0 10.3%
*-commutative10.3%
Simplified10.3%
Taylor expanded in k around -inf 45.0%
if -4.0000000000000003e243 < m < -2.09999999999999989e-29Initial 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%
distribute-lft-in100.0%
associate-+l+100.0%
associate-*r/100.0%
clear-num100.0%
associate-+l+100.0%
distribute-lft-in100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 30.7%
if -2.09999999999999989e-29 < m < 2Initial program 88.1%
associate-/l*88.1%
remove-double-neg88.1%
distribute-frac-neg288.1%
distribute-neg-frac288.1%
remove-double-neg88.1%
sqr-neg88.1%
associate-+l+88.1%
sqr-neg88.1%
distribute-rgt-out88.1%
Simplified88.1%
distribute-lft-in88.1%
associate-+l+88.1%
associate-*r/88.1%
clear-num87.9%
associate-+l+87.9%
distribute-lft-in87.9%
+-commutative87.9%
fma-define87.9%
+-commutative87.9%
*-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in k around 0 99.0%
*-un-lft-identity99.0%
fma-define99.0%
un-div-inv99.0%
associate-/r*99.0%
Applied egg-rr99.0%
*-lft-identity99.0%
fma-undefine99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l/99.0%
associate-*r/99.0%
associate-/r*99.0%
distribute-rgt-out99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in m around 0 87.7%
associate-/l*98.0%
+-commutative98.0%
Simplified98.0%
if 2 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in a around 0 34.5%
Final simplification56.7%
(FPCore (a k m)
:precision binary64
(if (<= m -1.5e-29)
(/ 1.0 (/ (+ (* k (+ k 10.0)) 1.0) a))
(if (<= m 1.9)
(/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))
(+ a (* a (* k (- (* k 100.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.5e-29) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else if (m <= 1.9) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a + (a * (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.5d-29)) then
tmp = 1.0d0 / (((k * (k + 10.0d0)) + 1.0d0) / a)
else if (m <= 1.9d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / a)))
else
tmp = a + (a * (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.5e-29) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else if (m <= 1.9) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.5e-29: tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a) elif m <= 1.9: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.5e-29) tmp = Float64(1.0 / Float64(Float64(Float64(k * Float64(k + 10.0)) + 1.0) / a)); elseif (m <= 1.9) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k + 10.0) / a)))); else tmp = Float64(a + Float64(a * 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.5e-29) tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a); elseif (m <= 1.9) tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.5e-29], N[(1.0 / N[(N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.9], 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[(a * 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.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{1}{\frac{k \cdot \left(k + 10\right) + 1}{a}}\\
\mathbf{elif}\;m \leq 1.9:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -1.5000000000000001e-29Initial 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%
distribute-lft-in100.0%
associate-+l+100.0%
associate-*r/100.0%
clear-num100.0%
associate-+l+100.0%
distribute-lft-in100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 27.7%
if -1.5000000000000001e-29 < m < 1.8999999999999999Initial program 88.1%
associate-/l*88.1%
remove-double-neg88.1%
distribute-frac-neg288.1%
distribute-neg-frac288.1%
remove-double-neg88.1%
sqr-neg88.1%
associate-+l+88.1%
sqr-neg88.1%
distribute-rgt-out88.1%
Simplified88.1%
distribute-lft-in88.1%
associate-+l+88.1%
associate-*r/88.1%
clear-num87.9%
associate-+l+87.9%
distribute-lft-in87.9%
+-commutative87.9%
fma-define87.9%
+-commutative87.9%
*-commutative87.9%
Applied egg-rr87.9%
Taylor expanded in k around 0 99.0%
*-un-lft-identity99.0%
fma-define99.0%
un-div-inv99.0%
associate-/r*99.0%
Applied egg-rr99.0%
*-lft-identity99.0%
fma-undefine99.0%
distribute-lft-in99.0%
*-commutative99.0%
associate-*l/99.0%
associate-*r/99.0%
associate-/r*99.0%
distribute-rgt-out99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in m around 0 87.7%
associate-/l*98.0%
+-commutative98.0%
Simplified98.0%
if 1.8999999999999999 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in a around 0 34.5%
Final simplification54.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.85) (/ 1.0 (/ (+ (* k (+ k 10.0)) 1.0) a)) (+ a (* a (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else {
tmp = a + (a * (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.85d0) then
tmp = 1.0d0 / (((k * (k + 10.0d0)) + 1.0d0) / a)
else
tmp = a + (a * (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.85) {
tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a);
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.85: tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.85) tmp = Float64(1.0 / Float64(Float64(Float64(k * Float64(k + 10.0)) + 1.0) / a)); else tmp = Float64(a + Float64(a * 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.85) tmp = 1.0 / (((k * (k + 10.0)) + 1.0) / a); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.85], N[(1.0 / N[(N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * 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.85:\\
\;\;\;\;\frac{1}{\frac{k \cdot \left(k + 10\right) + 1}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.8500000000000001Initial program 94.1%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
distribute-lft-in94.0%
associate-+l+94.0%
associate-*r/94.1%
clear-num93.9%
associate-+l+94.0%
distribute-lft-in94.0%
+-commutative94.0%
fma-define94.0%
+-commutative94.0%
*-commutative94.0%
Applied egg-rr94.0%
Taylor expanded in m around 0 57.7%
if 1.8500000000000001 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in a around 0 34.5%
Final simplification51.2%
(FPCore (a k m) :precision binary64 (if (<= m 2.2) (/ a (+ (* k (+ k 10.0)) 1.0)) (+ a (* a (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.2) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (a * (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.2d0) then
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a + (a * (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.2) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.2: tmp = a / ((k * (k + 10.0)) + 1.0) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.2) tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a + Float64(a * 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.2) tmp = a / ((k * (k + 10.0)) + 1.0); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.2], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * 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.2:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 2.2000000000000002Initial program 94.1%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
Taylor expanded in m around 0 57.7%
if 2.2000000000000002 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in a around 0 34.5%
Final simplification51.1%
(FPCore (a k m) :precision binary64 (if (<= m 470000.0) (/ a (+ (* k (+ k 10.0)) 1.0)) (* a (+ (* k (- (* k 99.0) 10.0)) 1.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 470000.0) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a * ((k * ((k * 99.0) - 10.0)) + 1.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 <= 470000.0d0) then
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a * ((k * ((k * 99.0d0) - 10.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 470000.0) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a * ((k * ((k * 99.0) - 10.0)) + 1.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 470000.0: tmp = a / ((k * (k + 10.0)) + 1.0) else: tmp = a * ((k * ((k * 99.0) - 10.0)) + 1.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 470000.0) tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a * Float64(Float64(k * Float64(Float64(k * 99.0) - 10.0)) + 1.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 470000.0) tmp = a / ((k * (k + 10.0)) + 1.0); else tmp = a * ((k * ((k * 99.0) - 10.0)) + 1.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 470000.0], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 470000:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot \left(k \cdot 99 - 10\right) + 1\right)\\
\end{array}
\end{array}
if m < 4.7e5Initial program 94.1%
associate-/l*94.1%
remove-double-neg94.1%
distribute-frac-neg294.1%
distribute-neg-frac294.1%
remove-double-neg94.1%
sqr-neg94.1%
associate-+l+94.1%
sqr-neg94.1%
distribute-rgt-out94.1%
Simplified94.1%
Taylor expanded in m around 0 57.4%
if 4.7e5 < 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 34.9%
Final simplification51.1%
(FPCore (a k m) :precision binary64 (if (<= k -3.4e-284) (* k (* a -10.0)) (if (<= k 0.1) a (* (/ a k) 0.1))))
double code(double a, double k, double m) {
double tmp;
if (k <= -3.4e-284) {
tmp = k * (a * -10.0);
} else if (k <= 0.1) {
tmp = a;
} else {
tmp = (a / k) * 0.1;
}
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 <= (-3.4d-284)) then
tmp = k * (a * (-10.0d0))
else if (k <= 0.1d0) then
tmp = a
else
tmp = (a / k) * 0.1d0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -3.4e-284) {
tmp = k * (a * -10.0);
} else if (k <= 0.1) {
tmp = a;
} else {
tmp = (a / k) * 0.1;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -3.4e-284: tmp = k * (a * -10.0) elif k <= 0.1: tmp = a else: tmp = (a / k) * 0.1 return tmp
function code(a, k, m) tmp = 0.0 if (k <= -3.4e-284) tmp = Float64(k * Float64(a * -10.0)); elseif (k <= 0.1) tmp = a; else tmp = Float64(Float64(a / k) * 0.1); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -3.4e-284) tmp = k * (a * -10.0); elseif (k <= 0.1) tmp = a; else tmp = (a / k) * 0.1; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -3.4e-284], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.1], a, N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -3.4 \cdot 10^{-284}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\end{array}
\end{array}
if k < -3.39999999999999991e-284Initial program 93.2%
associate-/l*93.2%
remove-double-neg93.2%
distribute-frac-neg293.2%
distribute-neg-frac293.2%
remove-double-neg93.2%
sqr-neg93.2%
associate-+l+93.2%
sqr-neg93.2%
distribute-rgt-out93.2%
Simplified93.2%
Taylor expanded in m around 0 23.1%
Taylor expanded in k around 0 4.7%
Taylor expanded in k around inf 8.6%
associate-*r*9.8%
*-commutative9.8%
Simplified9.8%
if -3.39999999999999991e-284 < k < 0.10000000000000001Initial 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.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in m around 0 46.9%
if 0.10000000000000001 < k Initial program 70.7%
associate-/l*70.7%
remove-double-neg70.7%
distribute-frac-neg270.7%
distribute-neg-frac270.7%
remove-double-neg70.7%
sqr-neg70.7%
associate-+l+70.7%
sqr-neg70.7%
distribute-rgt-out70.7%
Simplified70.7%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in k around inf 20.6%
Final simplification27.6%
(FPCore (a k m) :precision binary64 (if (<= m 1.92) (/ a (+ (* k (+ k 10.0)) 1.0)) (+ a (* k (* 100.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.92) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (k * (100.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.92d0) then
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a + (k * (100.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.92) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (k * (100.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.92: tmp = a / ((k * (k + 10.0)) + 1.0) else: tmp = a + (k * (100.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.92) tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a + Float64(k * Float64(100.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.92) tmp = a / ((k * (k + 10.0)) + 1.0); else tmp = a + (k * (100.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.92], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(100.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.92:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(100 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 1.9199999999999999Initial program 94.1%
associate-/l*94.0%
remove-double-neg94.0%
distribute-frac-neg294.0%
distribute-neg-frac294.0%
remove-double-neg94.0%
sqr-neg94.0%
associate-+l+94.0%
sqr-neg94.0%
distribute-rgt-out94.0%
Simplified94.0%
Taylor expanded in m around 0 57.7%
if 1.9199999999999999 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in k around inf 28.0%
Final simplification49.3%
(FPCore (a k m) :precision binary64 (if (<= m 1.85) (/ a (+ (* k k) 1.0)) (+ a (* k (* 100.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
tmp = a / ((k * k) + 1.0);
} else {
tmp = a + (k * (100.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.85d0) then
tmp = a / ((k * k) + 1.0d0)
else
tmp = a + (k * (100.0d0 * (k * a)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
tmp = a / ((k * k) + 1.0);
} else {
tmp = a + (k * (100.0 * (k * a)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.85: tmp = a / ((k * k) + 1.0) else: tmp = a + (k * (100.0 * (k * a))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.85) tmp = Float64(a / Float64(Float64(k * k) + 1.0)); else tmp = Float64(a + Float64(k * Float64(100.0 * Float64(k * a)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.85) tmp = a / ((k * k) + 1.0); else tmp = a + (k * (100.0 * (k * a))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.85], N[(a / N[(N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(100.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.85:\\
\;\;\;\;\frac{a}{k \cdot k + 1}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(100 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 1.8500000000000001Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in m around 0 57.6%
Taylor expanded in k around 0 56.5%
if 1.8500000000000001 < m Initial program 73.6%
associate-/l*73.6%
remove-double-neg73.6%
distribute-frac-neg273.6%
distribute-neg-frac273.6%
remove-double-neg73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 2.9%
*-commutative2.9%
Simplified2.9%
Taylor expanded in k around 0 28.0%
Taylor expanded in k around inf 28.0%
Final simplification48.5%
(FPCore (a k m) :precision binary64 (if (<= m 2e+51) (/ a (+ (* k k) 1.0)) (* k (* a -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2e+51) {
tmp = a / ((k * k) + 1.0);
} else {
tmp = k * (a * -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 <= 2d+51) then
tmp = a / ((k * k) + 1.0d0)
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2e+51) {
tmp = a / ((k * k) + 1.0);
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2e+51: tmp = a / ((k * k) + 1.0) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2e+51) tmp = Float64(a / Float64(Float64(k * k) + 1.0)); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2e+51) tmp = a / ((k * k) + 1.0); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2e+51], N[(a / N[(N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\frac{a}{k \cdot k + 1}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < 2e51Initial program 91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in m around 0 54.3%
Taylor expanded in k around 0 53.2%
if 2e51 < m Initial program 76.7%
associate-/l*76.7%
remove-double-neg76.7%
distribute-frac-neg276.7%
distribute-neg-frac276.7%
remove-double-neg76.7%
sqr-neg76.7%
associate-+l+76.7%
sqr-neg76.7%
distribute-rgt-out76.7%
Simplified76.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 4.6%
Taylor expanded in k around inf 20.0%
associate-*r*20.0%
*-commutative20.0%
Simplified20.0%
Final simplification45.4%
(FPCore (a k m) :precision binary64 (if (<= m 2e+51) (/ a (+ (* k 10.0) 1.0)) (* k (* a -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2e+51) {
tmp = a / ((k * 10.0) + 1.0);
} else {
tmp = k * (a * -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 <= 2d+51) then
tmp = a / ((k * 10.0d0) + 1.0d0)
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2e+51) {
tmp = a / ((k * 10.0) + 1.0);
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2e+51: tmp = a / ((k * 10.0) + 1.0) else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2e+51) tmp = Float64(a / Float64(Float64(k * 10.0) + 1.0)); else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2e+51) tmp = a / ((k * 10.0) + 1.0); else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2e+51], N[(a / N[(N[(k * 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\frac{a}{k \cdot 10 + 1}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < 2e51Initial program 91.9%
associate-/l*91.8%
remove-double-neg91.8%
distribute-frac-neg291.8%
distribute-neg-frac291.8%
remove-double-neg91.8%
sqr-neg91.8%
associate-+l+91.9%
sqr-neg91.9%
distribute-rgt-out91.9%
Simplified91.9%
Taylor expanded in m around 0 54.3%
Taylor expanded in k around 0 34.3%
*-commutative34.3%
Simplified34.3%
if 2e51 < m Initial program 76.7%
associate-/l*76.7%
remove-double-neg76.7%
distribute-frac-neg276.7%
distribute-neg-frac276.7%
remove-double-neg76.7%
sqr-neg76.7%
associate-+l+76.7%
sqr-neg76.7%
distribute-rgt-out76.7%
Simplified76.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 4.6%
Taylor expanded in k around inf 20.0%
associate-*r*20.0%
*-commutative20.0%
Simplified20.0%
Final simplification31.0%
(FPCore (a k m) :precision binary64 (if (<= k 0.062) (+ a (* (* k a) -10.0)) (* (/ a k) 0.1)))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.062) {
tmp = a + ((k * a) * -10.0);
} else {
tmp = (a / k) * 0.1;
}
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.062d0) then
tmp = a + ((k * a) * (-10.0d0))
else
tmp = (a / k) * 0.1d0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.062) {
tmp = a + ((k * a) * -10.0);
} else {
tmp = (a / k) * 0.1;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.062: tmp = a + ((k * a) * -10.0) else: tmp = (a / k) * 0.1 return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.062) tmp = Float64(a + Float64(Float64(k * a) * -10.0)); else tmp = Float64(Float64(a / k) * 0.1); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.062) tmp = a + ((k * a) * -10.0); else tmp = (a / k) * 0.1; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.062], N[(a + N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.062:\\
\;\;\;\;a + \left(k \cdot a\right) \cdot -10\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\end{array}
\end{array}
if k < 0.062Initial program 97.1%
associate-/l*97.1%
remove-double-neg97.1%
distribute-frac-neg297.1%
distribute-neg-frac297.1%
remove-double-neg97.1%
sqr-neg97.1%
associate-+l+97.1%
sqr-neg97.1%
distribute-rgt-out97.1%
Simplified97.1%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around 0 29.1%
if 0.062 < k Initial program 70.7%
associate-/l*70.7%
remove-double-neg70.7%
distribute-frac-neg270.7%
distribute-neg-frac270.7%
remove-double-neg70.7%
sqr-neg70.7%
associate-+l+70.7%
sqr-neg70.7%
distribute-rgt-out70.7%
Simplified70.7%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in k around inf 20.6%
Final simplification26.3%
(FPCore (a k m) :precision binary64 (if (<= k 0.075) (* a (+ (* k -10.0) 1.0)) (* (/ a k) 0.1)))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.075) {
tmp = a * ((k * -10.0) + 1.0);
} else {
tmp = (a / k) * 0.1;
}
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.075d0) then
tmp = a * ((k * (-10.0d0)) + 1.0d0)
else
tmp = (a / k) * 0.1d0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.075) {
tmp = a * ((k * -10.0) + 1.0);
} else {
tmp = (a / k) * 0.1;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.075: tmp = a * ((k * -10.0) + 1.0) else: tmp = (a / k) * 0.1 return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.075) tmp = Float64(a * Float64(Float64(k * -10.0) + 1.0)); else tmp = Float64(Float64(a / k) * 0.1); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.075) tmp = a * ((k * -10.0) + 1.0); else tmp = (a / k) * 0.1; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.075], N[(a * N[(N[(k * -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.075:\\
\;\;\;\;a \cdot \left(k \cdot -10 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\end{array}
\end{array}
if k < 0.0749999999999999972Initial program 97.1%
associate-/l*97.1%
remove-double-neg97.1%
distribute-frac-neg297.1%
distribute-neg-frac297.1%
remove-double-neg97.1%
sqr-neg97.1%
associate-+l+97.1%
sqr-neg97.1%
distribute-rgt-out97.1%
Simplified97.1%
Taylor expanded in m around 0 37.0%
Taylor expanded in k around 0 29.1%
*-commutative29.1%
Simplified29.1%
if 0.0749999999999999972 < k Initial program 70.7%
associate-/l*70.7%
remove-double-neg70.7%
distribute-frac-neg270.7%
distribute-neg-frac270.7%
remove-double-neg70.7%
sqr-neg70.7%
associate-+l+70.7%
sqr-neg70.7%
distribute-rgt-out70.7%
Simplified70.7%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in k around inf 20.6%
Final simplification26.3%
(FPCore (a k m) :precision binary64 (if (<= k 0.1) a (* (/ a k) 0.1)))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.1) {
tmp = a;
} else {
tmp = (a / k) * 0.1;
}
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.1d0) then
tmp = a
else
tmp = (a / k) * 0.1d0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.1) {
tmp = a;
} else {
tmp = (a / k) * 0.1;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.1: tmp = a else: tmp = (a / k) * 0.1 return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.1) tmp = a; else tmp = Float64(Float64(a / k) * 0.1); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.1) tmp = a; else tmp = (a / k) * 0.1; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.1], a, N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\end{array}
\end{array}
if k < 0.10000000000000001Initial program 97.1%
associate-/l*97.1%
remove-double-neg97.1%
distribute-frac-neg297.1%
distribute-neg-frac297.1%
remove-double-neg97.1%
sqr-neg97.1%
associate-+l+97.1%
sqr-neg97.1%
distribute-rgt-out97.1%
Simplified97.1%
Taylor expanded in k around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in m around 0 28.4%
if 0.10000000000000001 < k Initial program 70.7%
associate-/l*70.7%
remove-double-neg70.7%
distribute-frac-neg270.7%
distribute-neg-frac270.7%
remove-double-neg70.7%
sqr-neg70.7%
associate-+l+70.7%
sqr-neg70.7%
distribute-rgt-out70.7%
Simplified70.7%
Taylor expanded in m around 0 52.7%
Taylor expanded in k around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in k around inf 20.6%
Final simplification25.8%
(FPCore (a k m) :precision binary64 (if (<= m 9.5e+53) a (* (* k a) -10.0)))
double code(double a, double k, double m) {
double tmp;
if (m <= 9.5e+53) {
tmp = a;
} else {
tmp = (k * a) * -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.5d+53) then
tmp = a
else
tmp = (k * a) * (-10.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 9.5e+53) {
tmp = a;
} else {
tmp = (k * a) * -10.0;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 9.5e+53: tmp = a else: tmp = (k * a) * -10.0 return tmp
function code(a, k, m) tmp = 0.0 if (m <= 9.5e+53) tmp = a; else tmp = Float64(Float64(k * a) * -10.0); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 9.5e+53) tmp = a; else tmp = (k * a) * -10.0; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 9.5e+53], a, N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 9.5 \cdot 10^{+53}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot a\right) \cdot -10\\
\end{array}
\end{array}
if m < 9.5000000000000006e53Initial program 91.9%
associate-/l*91.8%
remove-double-neg91.8%
distribute-frac-neg291.8%
distribute-neg-frac291.8%
remove-double-neg91.8%
sqr-neg91.8%
associate-+l+91.9%
sqr-neg91.9%
distribute-rgt-out91.9%
Simplified91.9%
Taylor expanded in k around 0 74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in m around 0 25.5%
if 9.5000000000000006e53 < m Initial program 76.7%
associate-/l*76.7%
remove-double-neg76.7%
distribute-frac-neg276.7%
distribute-neg-frac276.7%
remove-double-neg76.7%
sqr-neg76.7%
associate-+l+76.7%
sqr-neg76.7%
distribute-rgt-out76.7%
Simplified76.7%
Taylor expanded in m around 0 2.9%
Taylor expanded in k around 0 4.6%
Taylor expanded in k around inf 20.0%
Final simplification24.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 88.3%
associate-/l*88.3%
remove-double-neg88.3%
distribute-frac-neg288.3%
distribute-neg-frac288.3%
remove-double-neg88.3%
sqr-neg88.3%
associate-+l+88.3%
sqr-neg88.3%
distribute-rgt-out88.3%
Simplified88.3%
Taylor expanded in k around 0 80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in m around 0 20.4%
herbie shell --seed 2024097
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))