
(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 14 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
(if (<= m -1.5e-97)
(* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0)))))
(if (<= m 0.052)
(/ 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.5e-97) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.052) {
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.5d-97)) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else if (m <= 0.052d0) 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.5e-97) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.052) {
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.5e-97: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) elif m <= 0.052: 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.5e-97) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 0.052) 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.5e-97) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); elseif (m <= 0.052) 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.5e-97], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.052], 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.5 \cdot 10^{-97}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 0.052:\\
\;\;\;\;\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.50000000000000012e-97Initial 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 -1.50000000000000012e-97 < m < 0.0519999999999999976Initial program 90.7%
associate-/l*90.6%
remove-double-neg90.6%
distribute-frac-neg290.6%
distribute-neg-frac290.6%
remove-double-neg90.6%
sqr-neg90.6%
associate-+l+90.6%
sqr-neg90.6%
distribute-rgt-out90.6%
Simplified90.6%
distribute-lft-in90.6%
associate-+l+90.6%
associate-*r/90.7%
clear-num90.5%
associate-+l+90.5%
distribute-lft-in90.5%
+-commutative90.5%
fma-define90.5%
+-commutative90.5%
*-commutative90.5%
Applied egg-rr90.5%
Taylor expanded in k around 0 99.6%
*-un-lft-identity99.6%
fma-define99.6%
un-div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
fma-undefine99.6%
distribute-rgt-in99.6%
associate-*l/99.6%
associate-*r/99.6%
associate-/r*99.6%
*-commutative99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in m around 0 99.4%
if 0.0519999999999999976 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* (pow k m) a)) (t_1 (/ 1.0 t_0))) (if (<= k 1e-68) 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 <= 1e-68) {
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 <= 1d-68) 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 <= 1e-68) {
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 <= 1e-68: 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 <= 1e-68) 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 <= 1e-68) 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, 1e-68], 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 10^{-68}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + k \cdot \left(10 \cdot t\_1 + \frac{k}{t\_0}\right)}\\
\end{array}
\end{array}
if k < 1.00000000000000007e-68Initial program 96.6%
associate-/l*96.6%
remove-double-neg96.6%
distribute-frac-neg296.6%
distribute-neg-frac296.6%
remove-double-neg96.6%
sqr-neg96.6%
associate-+l+96.6%
sqr-neg96.6%
distribute-rgt-out96.6%
Simplified96.6%
Taylor expanded in k around 0 99.3%
*-commutative99.3%
Simplified99.3%
if 1.00000000000000007e-68 < k Initial program 82.0%
associate-/l*81.9%
remove-double-neg81.9%
distribute-frac-neg281.9%
distribute-neg-frac281.9%
remove-double-neg81.9%
sqr-neg81.9%
associate-+l+81.9%
sqr-neg81.9%
distribute-rgt-out81.9%
Simplified81.9%
distribute-lft-in81.9%
associate-+l+81.9%
associate-*r/82.0%
clear-num81.9%
associate-+l+81.9%
distribute-lft-in81.9%
+-commutative81.9%
fma-define81.9%
+-commutative81.9%
*-commutative81.9%
Applied egg-rr81.9%
Taylor expanded in k around 0 99.8%
Final simplification99.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 0.26)
(/ 1.0 (+ (/ 1.0 t_0) (* (/ (/ k a) (pow k m)) (+ k 10.0))))
(pow (sqrt t_0) 2.0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= 0.26) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / pow(k, m)) * (k + 10.0)));
} else {
tmp = pow(sqrt(t_0), 2.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 <= 0.26d0) then
tmp = 1.0d0 / ((1.0d0 / t_0) + (((k / a) / (k ** m)) * (k + 10.0d0)))
else
tmp = sqrt(t_0) ** 2.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 (m <= 0.26) {
tmp = 1.0 / ((1.0 / t_0) + (((k / a) / Math.pow(k, m)) * (k + 10.0)));
} else {
tmp = Math.pow(Math.sqrt(t_0), 2.0);
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, m) * a tmp = 0 if m <= 0.26: tmp = 1.0 / ((1.0 / t_0) + (((k / a) / math.pow(k, m)) * (k + 10.0))) else: tmp = math.pow(math.sqrt(t_0), 2.0) return tmp
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= 0.26) tmp = Float64(1.0 / Float64(Float64(1.0 / t_0) + Float64(Float64(Float64(k / a) / (k ^ m)) * Float64(k + 10.0)))); else tmp = sqrt(t_0) ^ 2.0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = (k ^ m) * a; tmp = 0.0; if (m <= 0.26) tmp = 1.0 / ((1.0 / t_0) + (((k / a) / (k ^ m)) * (k + 10.0))); else tmp = sqrt(t_0) ^ 2.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, 0.26], 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], N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq 0.26:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0} + \frac{\frac{k}{a}}{{k}^{m}} \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_0}\right)}^{2}\\
\end{array}
\end{array}
if m < 0.26000000000000001Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
distribute-lft-in95.1%
associate-+l+95.1%
associate-*r/95.1%
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 84.8%
*-un-lft-identity84.8%
fma-define84.8%
un-div-inv84.8%
associate-/r*84.8%
Applied egg-rr84.8%
*-lft-identity84.8%
fma-undefine84.8%
distribute-rgt-in81.9%
associate-*l/81.9%
associate-*r/81.9%
associate-/r*81.9%
*-commutative81.9%
distribute-lft-out96.3%
Simplified96.3%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
add-sqr-sqrt81.9%
pow281.9%
*-commutative81.9%
Applied egg-rr81.9%
Final simplification91.7%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m 0.26)
(/ 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 <= 0.26) {
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 <= 0.26d0) 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 <= 0.26) {
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 <= 0.26: 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 <= 0.26) 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 <= 0.26) 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, 0.26], 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 0.26:\\
\;\;\;\;\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 < 0.26000000000000001Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
distribute-lft-in95.1%
associate-+l+95.1%
associate-*r/95.1%
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 84.8%
*-un-lft-identity84.8%
fma-define84.8%
un-div-inv84.8%
associate-/r*84.8%
Applied egg-rr84.8%
*-lft-identity84.8%
fma-undefine84.8%
distribute-rgt-in81.9%
associate-*l/81.9%
associate-*r/81.9%
associate-/r*81.9%
*-commutative81.9%
distribute-lft-out96.3%
Simplified96.3%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.5%
(FPCore (a k m)
:precision binary64
(if (<= m -1.1e-105)
(* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0)))))
(if (<= m 0.0054)
(/ 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 <= -1.1e-105) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.0054) {
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 <= (-1.1d-105)) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else if (m <= 0.0054d0) 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 <= -1.1e-105) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 0.0054) {
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 <= -1.1e-105: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) elif m <= 0.0054: 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 <= -1.1e-105) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 0.0054) 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 <= -1.1e-105) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); elseif (m <= 0.0054) 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, -1.1e-105], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0054], 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 -1.1 \cdot 10^{-105}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 0.0054:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -1.10000000000000002e-105Initial 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 -1.10000000000000002e-105 < m < 0.0054000000000000003Initial program 90.7%
associate-/l*90.6%
remove-double-neg90.6%
distribute-frac-neg290.6%
distribute-neg-frac290.6%
remove-double-neg90.6%
sqr-neg90.6%
associate-+l+90.6%
sqr-neg90.6%
distribute-rgt-out90.6%
Simplified90.6%
distribute-lft-in90.6%
associate-+l+90.6%
associate-*r/90.7%
clear-num90.5%
associate-+l+90.5%
distribute-lft-in90.5%
+-commutative90.5%
fma-define90.5%
+-commutative90.5%
*-commutative90.5%
Applied egg-rr90.5%
Taylor expanded in k around 0 99.6%
*-un-lft-identity99.6%
fma-define99.6%
un-div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
fma-undefine99.6%
distribute-rgt-in99.6%
associate-*l/99.6%
associate-*r/99.6%
associate-/r*99.6%
*-commutative99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in m around 0 90.3%
associate-/l*98.3%
+-commutative98.3%
Simplified98.3%
if 0.0054000000000000003 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (a k m)
:precision binary64
(if (<= m -1.35e-18)
(* a (/ (pow k m) (+ 1.0 (* k 10.0))))
(if (<= m 0.00155)
(/ 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 <= -1.35e-18) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.00155) {
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 <= (-1.35d-18)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 0.00155d0) 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 <= -1.35e-18) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 0.00155) {
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 <= -1.35e-18: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 0.00155: 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 <= -1.35e-18) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 0.00155) 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 <= -1.35e-18) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 0.00155) 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, -1.35e-18], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.00155], 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 -1.35 \cdot 10^{-18}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 0.00155:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -1.34999999999999994e-18Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1.34999999999999994e-18 < m < 0.00154999999999999995Initial program 91.4%
associate-/l*91.4%
remove-double-neg91.4%
distribute-frac-neg291.4%
distribute-neg-frac291.4%
remove-double-neg91.4%
sqr-neg91.4%
associate-+l+91.4%
sqr-neg91.4%
distribute-rgt-out91.4%
Simplified91.4%
distribute-lft-in91.4%
associate-+l+91.4%
associate-*r/91.4%
clear-num91.2%
associate-+l+91.2%
distribute-lft-in91.2%
+-commutative91.2%
fma-define91.2%
+-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
Taylor expanded in k around 0 99.6%
*-un-lft-identity99.6%
fma-define99.6%
un-div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
fma-undefine99.6%
distribute-rgt-in99.6%
associate-*l/99.6%
associate-*r/99.6%
associate-/r*99.6%
*-commutative99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in m around 0 91.1%
associate-/l*98.4%
+-commutative98.4%
Simplified98.4%
if 0.00154999999999999995 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
Taylor expanded in k around 0 100.0%
*-commutative100.0%
Simplified100.0%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.074) (not (<= m 0.00165))) (* (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.074) || !(m <= 0.00165)) {
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.074d0)) .or. (.not. (m <= 0.00165d0))) 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.074) || !(m <= 0.00165)) {
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.074) or not (m <= 0.00165): 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.074) || !(m <= 0.00165)) 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.074) || ~((m <= 0.00165))) 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.074], N[Not[LessEqual[m, 0.00165]], $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.074 \lor \neg \left(m \leq 0.00165\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.0739999999999999963 or 0.00165 < m Initial program 89.6%
associate-/l*89.6%
remove-double-neg89.6%
distribute-frac-neg289.6%
distribute-neg-frac289.6%
remove-double-neg89.6%
sqr-neg89.6%
associate-+l+89.6%
sqr-neg89.6%
distribute-rgt-out89.6%
Simplified89.6%
Taylor expanded in k around 0 99.3%
*-commutative99.3%
Simplified99.3%
if -0.0739999999999999963 < m < 0.00165Initial program 91.7%
associate-/l*91.6%
remove-double-neg91.6%
distribute-frac-neg291.6%
distribute-neg-frac291.6%
remove-double-neg91.6%
sqr-neg91.6%
associate-+l+91.6%
sqr-neg91.6%
distribute-rgt-out91.6%
Simplified91.6%
distribute-lft-in91.6%
associate-+l+91.6%
associate-*r/91.7%
clear-num91.5%
associate-+l+91.5%
distribute-lft-in91.5%
+-commutative91.5%
fma-define91.5%
+-commutative91.5%
*-commutative91.5%
Applied egg-rr91.5%
Taylor expanded in k around 0 99.6%
*-un-lft-identity99.6%
fma-define99.6%
un-div-inv99.6%
associate-/r*99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
fma-undefine99.6%
distribute-rgt-in99.6%
associate-*l/99.6%
associate-*r/99.6%
associate-/r*99.6%
*-commutative99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in m around 0 91.0%
associate-/l*98.1%
+-commutative98.1%
Simplified98.1%
Final simplification98.8%
(FPCore (a k m)
:precision binary64
(if (<= m -1e+33)
(/ 1.0 (/ (+ 1.0 (* k (+ k 10.0))) a))
(if (<= m 0.26)
(/ 1.0 (+ (/ 1.0 a) (* k (/ (+ k 10.0) a))))
(- a (* a (* k (+ 10.0 (* k -99.0))))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1e+33) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 0.26) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a - (a * (k * (10.0 + (k * -99.0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-1d+33)) then
tmp = 1.0d0 / ((1.0d0 + (k * (k + 10.0d0))) / a)
else if (m <= 0.26d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k + 10.0d0) / a)))
else
tmp = a - (a * (k * (10.0d0 + (k * (-99.0d0)))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1e+33) {
tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a);
} else if (m <= 0.26) {
tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a)));
} else {
tmp = a - (a * (k * (10.0 + (k * -99.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1e+33: tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a) elif m <= 0.26: tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))) else: tmp = a - (a * (k * (10.0 + (k * -99.0)))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1e+33) tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(k * Float64(k + 10.0))) / a)); elseif (m <= 0.26) 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(10.0 + Float64(k * -99.0))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1e+33) tmp = 1.0 / ((1.0 + (k * (k + 10.0))) / a); elseif (m <= 0.26) tmp = 1.0 / ((1.0 / a) + (k * ((k + 10.0) / a))); else tmp = a - (a * (k * (10.0 + (k * -99.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1e+33], N[(1.0 / N[(N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.26], 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[(10.0 + N[(k * -99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1 \cdot 10^{+33}:\\
\;\;\;\;\frac{1}{\frac{1 + k \cdot \left(k + 10\right)}{a}}\\
\mathbf{elif}\;m \leq 0.26:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \frac{k + 10}{a}}\\
\mathbf{else}:\\
\;\;\;\;a - a \cdot \left(k \cdot \left(10 + k \cdot -99\right)\right)\\
\end{array}
\end{array}
if m < -9.9999999999999995e32Initial 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 43.7%
if -9.9999999999999995e32 < m < 0.26000000000000001Initial program 92.1%
associate-/l*92.1%
remove-double-neg92.1%
distribute-frac-neg292.1%
distribute-neg-frac292.1%
remove-double-neg92.1%
sqr-neg92.1%
associate-+l+92.1%
sqr-neg92.1%
distribute-rgt-out92.1%
Simplified92.1%
distribute-lft-in92.1%
associate-+l+92.1%
associate-*r/92.1%
clear-num92.0%
associate-+l+92.0%
distribute-lft-in92.0%
+-commutative92.0%
fma-define92.0%
+-commutative92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in k around 0 98.7%
*-un-lft-identity98.7%
fma-define98.7%
un-div-inv98.7%
associate-/r*98.7%
Applied egg-rr98.7%
*-lft-identity98.7%
fma-undefine98.7%
distribute-rgt-in97.8%
associate-*l/97.8%
associate-*r/97.8%
associate-/r*97.8%
*-commutative97.8%
distribute-lft-out98.7%
Simplified98.7%
Taylor expanded in m around 0 86.1%
associate-/l*92.8%
+-commutative92.8%
Simplified92.8%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
distribute-lft-in80.7%
associate-+l+80.7%
associate-*r/80.7%
clear-num80.7%
associate-+l+80.7%
distribute-lft-in80.7%
+-commutative80.7%
fma-define80.7%
+-commutative80.7%
*-commutative80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 24.7%
cancel-sign-sub-inv24.7%
metadata-eval24.7%
*-commutative24.7%
mul-1-neg24.7%
distribute-rgt1-in24.7%
metadata-eval24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in a around 0 29.2%
mul-1-neg29.2%
*-commutative29.2%
Simplified29.2%
Final simplification59.7%
(FPCore (a k m) :precision binary64 (if (<= m 0.26) (/ a (+ 1.0 (* k (+ k 10.0)))) (- a (* a (* k (+ 10.0 (* k -99.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a - (a * (k * (10.0 + (k * -99.0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.26d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a - (a * (k * (10.0d0 + (k * (-99.0d0)))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a - (a * (k * (10.0 + (k * -99.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.26: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a - (a * (k * (10.0 + (k * -99.0)))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.26) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a - Float64(a * Float64(k * Float64(10.0 + Float64(k * -99.0))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.26) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a - (a * (k * (10.0 + (k * -99.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.26], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a - N[(a * N[(k * N[(10.0 + N[(k * -99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.26:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a - a \cdot \left(k \cdot \left(10 + k \cdot -99\right)\right)\\
\end{array}
\end{array}
if m < 0.26000000000000001Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 70.2%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
distribute-lft-in80.7%
associate-+l+80.7%
associate-*r/80.7%
clear-num80.7%
associate-+l+80.7%
distribute-lft-in80.7%
+-commutative80.7%
fma-define80.7%
+-commutative80.7%
*-commutative80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 24.7%
cancel-sign-sub-inv24.7%
metadata-eval24.7%
*-commutative24.7%
mul-1-neg24.7%
distribute-rgt1-in24.7%
metadata-eval24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in a around 0 29.2%
mul-1-neg29.2%
*-commutative29.2%
Simplified29.2%
Final simplification56.9%
(FPCore (a k m) :precision binary64 (if (<= m 0.26) (/ a (+ 1.0 (* k (+ k 10.0)))) (+ a (* k (* a (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.26d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a + (k * (a * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.26: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a + (k * (a * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.26) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a + Float64(k * Float64(a * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.26) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a + (k * (a * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.26], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(a * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.26:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(a \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 0.26000000000000001Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 70.2%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
distribute-lft-in80.7%
associate-+l+80.7%
associate-*r/80.7%
clear-num80.7%
associate-+l+80.7%
distribute-lft-in80.7%
+-commutative80.7%
fma-define80.7%
+-commutative80.7%
*-commutative80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 24.7%
cancel-sign-sub-inv24.7%
metadata-eval24.7%
*-commutative24.7%
mul-1-neg24.7%
distribute-rgt1-in24.7%
metadata-eval24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in k around inf 24.7%
*-commutative24.7%
associate-*l*24.7%
Simplified24.7%
Final simplification55.5%
(FPCore (a k m) :precision binary64 (if (<= m 0.26) (/ a (+ 1.0 (* k 10.0))) (+ a (* k (* a (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.26d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a + (k * (a * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.26) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a + (k * (a * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.26: tmp = a / (1.0 + (k * 10.0)) else: tmp = a + (k * (a * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.26) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a + Float64(k * Float64(a * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.26) tmp = a / (1.0 + (k * 10.0)); else tmp = a + (k * (a * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.26], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(a * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.26:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a + k \cdot \left(a \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 0.26000000000000001Initial program 95.1%
associate-/l*95.1%
remove-double-neg95.1%
distribute-frac-neg295.1%
distribute-neg-frac295.1%
remove-double-neg95.1%
sqr-neg95.1%
associate-+l+95.1%
sqr-neg95.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in m around 0 70.2%
Taylor expanded in k around 0 41.9%
*-commutative77.0%
Simplified41.9%
if 0.26000000000000001 < m Initial program 80.7%
associate-/l*80.7%
remove-double-neg80.7%
distribute-frac-neg280.7%
distribute-neg-frac280.7%
remove-double-neg80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
distribute-lft-in80.7%
associate-+l+80.7%
associate-*r/80.7%
clear-num80.7%
associate-+l+80.7%
distribute-lft-in80.7%
+-commutative80.7%
fma-define80.7%
+-commutative80.7%
*-commutative80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 2.7%
Taylor expanded in k around 0 24.7%
cancel-sign-sub-inv24.7%
metadata-eval24.7%
*-commutative24.7%
mul-1-neg24.7%
distribute-rgt1-in24.7%
metadata-eval24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in k around inf 24.7%
*-commutative24.7%
associate-*l*24.7%
Simplified24.7%
(FPCore (a k m) :precision binary64 (/ a (+ 1.0 (* k 10.0))))
double code(double a, double k, double m) {
return a / (1.0 + (k * 10.0));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a / (1.0d0 + (k * 10.0d0))
end function
public static double code(double a, double k, double m) {
return a / (1.0 + (k * 10.0));
}
def code(a, k, m): return a / (1.0 + (k * 10.0))
function code(a, k, m) return Float64(a / Float64(1.0 + Float64(k * 10.0))) end
function tmp = code(a, k, m) tmp = a / (1.0 + (k * 10.0)); end
code[a_, k_, m_] := N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a}{1 + k \cdot 10}
\end{array}
Initial program 90.4%
associate-/l*90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
distribute-neg-frac290.4%
remove-double-neg90.4%
sqr-neg90.4%
associate-+l+90.4%
sqr-neg90.4%
distribute-rgt-out90.4%
Simplified90.4%
Taylor expanded in m around 0 48.3%
Taylor expanded in k around 0 29.1%
*-commutative75.8%
Simplified29.1%
(FPCore (a k m) :precision binary64 (+ a (* -10.0 (* k a))))
double code(double a, double k, double m) {
return a + (-10.0 * (k * 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 + ((-10.0d0) * (k * a))
end function
public static double code(double a, double k, double m) {
return a + (-10.0 * (k * a));
}
def code(a, k, m): return a + (-10.0 * (k * a))
function code(a, k, m) return Float64(a + Float64(-10.0 * Float64(k * a))) end
function tmp = code(a, k, m) tmp = a + (-10.0 * (k * a)); end
code[a_, k_, m_] := N[(a + N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + -10 \cdot \left(k \cdot a\right)
\end{array}
Initial program 90.4%
associate-/l*90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
distribute-neg-frac290.4%
remove-double-neg90.4%
sqr-neg90.4%
associate-+l+90.4%
sqr-neg90.4%
distribute-rgt-out90.4%
Simplified90.4%
Taylor expanded in m around 0 48.3%
Taylor expanded in k around 0 21.9%
Final simplification21.9%
(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.4%
associate-/l*90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
distribute-neg-frac290.4%
remove-double-neg90.4%
sqr-neg90.4%
associate-+l+90.4%
sqr-neg90.4%
distribute-rgt-out90.4%
Simplified90.4%
Taylor expanded in m around 0 48.3%
Taylor expanded in k around 0 21.8%
herbie shell --seed 2024096
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))