
(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 15 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 -4.2e-94) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (if (<= m 7.5e-5) (/ (/ a (hypot 1.0 k)) (hypot 1.0 k)) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4.2e-94) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 7.5e-5) {
tmp = (a / hypot(1.0, k)) / hypot(1.0, k);
} else {
tmp = a * pow(k, m);
}
return tmp;
}
public static double code(double a, double k, double m) {
double tmp;
if (m <= -4.2e-94) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 7.5e-5) {
tmp = (a / Math.hypot(1.0, k)) / Math.hypot(1.0, k);
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -4.2e-94: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) elif m <= 7.5e-5: tmp = (a / math.hypot(1.0, k)) / math.hypot(1.0, k) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -4.2e-94) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 7.5e-5) tmp = Float64(Float64(a / hypot(1.0, k)) / hypot(1.0, k)); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -4.2e-94) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); elseif (m <= 7.5e-5) tmp = (a / hypot(1.0, k)) / hypot(1.0, k); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -4.2e-94], 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, 7.5e-5], N[(N[(a / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + k ^ 2], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.2 \cdot 10^{-94}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 7.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{a}{\mathsf{hypot}\left(1, k\right)}}{\mathsf{hypot}\left(1, k\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -4.2000000000000002e-94Initial 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.2000000000000002e-94 < m < 7.49999999999999934e-5Initial program 91.3%
associate-/l*91.3%
remove-double-neg91.3%
distribute-frac-neg291.3%
distribute-neg-frac291.3%
remove-double-neg91.3%
sqr-neg91.3%
associate-+l+91.3%
sqr-neg91.3%
distribute-rgt-out91.3%
Simplified91.3%
Taylor expanded in m around 0 91.3%
Taylor expanded in k around inf 91.3%
*-un-lft-identity91.3%
add-sqr-sqrt91.3%
times-frac91.3%
hypot-1-def91.3%
hypot-1-def99.9%
Applied egg-rr99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
if 7.49999999999999934e-5 < m Initial program 74.1%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in k around 0 99.8%
Final simplification99.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))) (t_1 (/ 1.0 t_0)))
(if (<= k 1.9e-14)
(* a (* (pow k m) (+ 1.0 (* k -10.0))))
(/ 1.0 (+ t_1 (* k (+ (* 10.0 t_1) (/ k t_0))))))))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 1.9e-14) {
tmp = a * (pow(k, m) * (1.0 + (k * -10.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 = a * (k ** m)
t_1 = 1.0d0 / t_0
if (k <= 1.9d-14) then
tmp = a * ((k ** m) * (1.0d0 + (k * (-10.0d0))))
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 = a * Math.pow(k, m);
double t_1 = 1.0 / t_0;
double tmp;
if (k <= 1.9e-14) {
tmp = a * (Math.pow(k, m) * (1.0 + (k * -10.0)));
} else {
tmp = 1.0 / (t_1 + (k * ((10.0 * t_1) + (k / t_0))));
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) t_1 = 1.0 / t_0 tmp = 0 if k <= 1.9e-14: tmp = a * (math.pow(k, m) * (1.0 + (k * -10.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(a * (k ^ m)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (k <= 1.9e-14) tmp = Float64(a * Float64((k ^ m) * Float64(1.0 + Float64(k * -10.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 = a * (k ^ m); t_1 = 1.0 / t_0; tmp = 0.0; if (k <= 1.9e-14) tmp = a * ((k ^ m) * (1.0 + (k * -10.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[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[k, 1.9e-14], N[(a * N[(N[Power[k, m], $MachinePrecision] * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := a \cdot {k}^{m}\\
t_1 := \frac{1}{t\_0}\\
\mathbf{if}\;k \leq 1.9 \cdot 10^{-14}:\\
\;\;\;\;a \cdot \left({k}^{m} \cdot \left(1 + k \cdot -10\right)\right)\\
\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.9000000000000001e-14Initial program 92.6%
associate-/l*92.6%
remove-double-neg92.6%
distribute-frac-neg292.6%
distribute-neg-frac292.6%
remove-double-neg92.6%
sqr-neg92.6%
associate-+l+92.6%
sqr-neg92.6%
distribute-rgt-out92.6%
Simplified92.6%
Taylor expanded in k around 0 84.0%
+-commutative84.0%
*-lft-identity84.0%
associate-*r*84.0%
metadata-eval84.0%
distribute-lft-neg-in84.0%
*-commutative84.0%
distribute-rgt-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
if 1.9000000000000001e-14 < k Initial program 82.0%
associate-/l*82.1%
remove-double-neg82.1%
distribute-frac-neg282.1%
distribute-neg-frac282.1%
remove-double-neg82.1%
sqr-neg82.1%
associate-+l+82.1%
sqr-neg82.1%
distribute-rgt-out82.1%
Simplified82.1%
associate-*r/82.0%
clear-num82.0%
+-commutative82.0%
fma-define82.0%
+-commutative82.0%
*-commutative82.0%
Applied egg-rr82.0%
Taylor expanded in k around 0 99.9%
Final simplification99.6%
(FPCore (a k m) :precision binary64 (if (<= m -1.25e-96) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (if (<= m 3e-10) (/ 1.0 (+ (* k (/ k a)) (/ 1.0 a))) (* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.25e-96) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 3e-10) {
tmp = 1.0 / ((k * (k / a)) + (1.0 / a));
} else {
tmp = a * pow(k, m);
}
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.25d-96)) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
else if (m <= 3d-10) then
tmp = 1.0d0 / ((k * (k / a)) + (1.0d0 / a))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.25e-96) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else if (m <= 3e-10) {
tmp = 1.0 / ((k * (k / a)) + (1.0 / a));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.25e-96: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) elif m <= 3e-10: tmp = 1.0 / ((k * (k / a)) + (1.0 / a)) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.25e-96) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 3e-10) tmp = Float64(1.0 / Float64(Float64(k * Float64(k / a)) + Float64(1.0 / a))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.25e-96) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); elseif (m <= 3e-10) tmp = 1.0 / ((k * (k / a)) + (1.0 / a)); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.25e-96], 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, 3e-10], N[(1.0 / N[(N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.25 \cdot 10^{-96}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 3 \cdot 10^{-10}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a} + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -1.24999999999999999e-96Initial 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.24999999999999999e-96 < m < 3e-10Initial program 91.3%
associate-/l*91.3%
remove-double-neg91.3%
distribute-frac-neg291.3%
distribute-neg-frac291.3%
remove-double-neg91.3%
sqr-neg91.3%
associate-+l+91.3%
sqr-neg91.3%
distribute-rgt-out91.3%
Simplified91.3%
associate-*r/91.3%
clear-num91.2%
+-commutative91.2%
fma-define91.2%
+-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
Taylor expanded in k around 0 99.8%
Taylor expanded in m around 0 99.8%
Taylor expanded in k around inf 99.8%
if 3e-10 < m Initial program 74.1%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in k around 0 99.8%
Final simplification99.9%
(FPCore (a k m)
:precision binary64
(if (<= m -8.8e-6)
(* a (/ (pow k m) (+ 1.0 (* k 10.0))))
(if (<= m 8e-6)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (/ k a) (* 10.0 (/ 1.0 a))))))
(* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8.8e-6) {
tmp = a * (pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 8e-6) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-8.8d-6)) then
tmp = a * ((k ** m) / (1.0d0 + (k * 10.0d0)))
else if (m <= 8d-6) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k / a) + (10.0d0 * (1.0d0 / a)))))
else
tmp = a * (k ** m)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -8.8e-6) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * 10.0)));
} else if (m <= 8e-6) {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8.8e-6: tmp = a * (math.pow(k, m) / (1.0 + (k * 10.0))) elif m <= 8e-6: tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8.8e-6) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * 10.0)))); elseif (m <= 8e-6) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k / a) + Float64(10.0 * Float64(1.0 / a)))))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -8.8e-6) tmp = a * ((k ^ m) / (1.0 + (k * 10.0))); elseif (m <= 8e-6) tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8.8e-6], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 8e-6], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -8.8 \cdot 10^{-6}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot 10}\\
\mathbf{elif}\;m \leq 8 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(\frac{k}{a} + 10 \cdot \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -8.8000000000000004e-6Initial 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 -8.8000000000000004e-6 < m < 7.99999999999999964e-6Initial program 93.0%
associate-/l*93.1%
remove-double-neg93.1%
distribute-frac-neg293.1%
distribute-neg-frac293.1%
remove-double-neg93.1%
sqr-neg93.1%
associate-+l+93.1%
sqr-neg93.1%
distribute-rgt-out93.1%
Simplified93.1%
associate-*r/93.0%
clear-num92.9%
+-commutative92.9%
fma-define92.9%
+-commutative92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in k around 0 99.8%
Taylor expanded in m around 0 99.4%
if 7.99999999999999964e-6 < m Initial program 74.1%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in k around 0 99.8%
Final simplification99.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -0.00155) (not (<= m 6.5e-8))) (* a (pow k m)) (/ 1.0 (+ (/ 1.0 a) (* k (+ (/ k a) (* 10.0 (/ 1.0 a))))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -0.00155) || !(m <= 6.5e-8)) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.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.00155d0)) .or. (.not. (m <= 6.5d-8))) then
tmp = a * (k ** m)
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((k / a) + (10.0d0 * (1.0d0 / a)))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -0.00155) || !(m <= 6.5e-8)) {
tmp = a * Math.pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a)))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -0.00155) or not (m <= 6.5e-8): tmp = a * math.pow(k, m) else: tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -0.00155) || !(m <= 6.5e-8)) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(k / a) + Float64(10.0 * Float64(1.0 / a)))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -0.00155) || ~((m <= 6.5e-8))) tmp = a * (k ^ m); else tmp = 1.0 / ((1.0 / a) + (k * ((k / a) + (10.0 * (1.0 / a))))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -0.00155], N[Not[LessEqual[m, 6.5e-8]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.00155 \lor \neg \left(m \leq 6.5 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(\frac{k}{a} + 10 \cdot \frac{1}{a}\right)}\\
\end{array}
\end{array}
if m < -0.00154999999999999995 or 6.49999999999999997e-8 < m Initial program 86.8%
associate-/l*86.8%
remove-double-neg86.8%
distribute-frac-neg286.8%
distribute-neg-frac286.8%
remove-double-neg86.8%
sqr-neg86.8%
associate-+l+86.8%
sqr-neg86.8%
distribute-rgt-out86.8%
Simplified86.8%
Taylor expanded in k around 0 99.3%
if -0.00154999999999999995 < m < 6.49999999999999997e-8Initial program 93.0%
associate-/l*93.1%
remove-double-neg93.1%
distribute-frac-neg293.1%
distribute-neg-frac293.1%
remove-double-neg93.1%
sqr-neg93.1%
associate-+l+93.1%
sqr-neg93.1%
distribute-rgt-out93.1%
Simplified93.1%
associate-*r/93.0%
clear-num92.9%
+-commutative92.9%
fma-define92.9%
+-commutative92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in k around 0 99.8%
Taylor expanded in m around 0 99.4%
Final simplification99.4%
(FPCore (a k m)
:precision binary64
(if (<= m -6.8e-91)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 0.0045)
(/ 1.0 (+ (* k (/ k a)) (/ 1.0 a)))
(+ a (* a (* k (- (* k 99.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -6.8e-91) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 0.0045) {
tmp = 1.0 / ((k * (k / a)) + (1.0 / a));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-6.8d-91)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 0.0045d0) then
tmp = 1.0d0 / ((k * (k / a)) + (1.0d0 / a))
else
tmp = a + (a * (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -6.8e-91) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 0.0045) {
tmp = 1.0 / ((k * (k / a)) + (1.0 / a));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -6.8e-91: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 0.0045: tmp = 1.0 / ((k * (k / a)) + (1.0 / a)) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -6.8e-91) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 0.0045) tmp = Float64(1.0 / Float64(Float64(k * Float64(k / a)) + Float64(1.0 / a))); else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -6.8e-91) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 0.0045) tmp = 1.0 / ((k * (k / a)) + (1.0 / a)); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -6.8e-91], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0045], N[(1.0 / N[(N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 0.0045:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a} + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < -6.80000000000000053e-91Initial 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 48.7%
if -6.80000000000000053e-91 < m < 0.00449999999999999966Initial program 91.3%
associate-/l*91.3%
remove-double-neg91.3%
distribute-frac-neg291.3%
distribute-neg-frac291.3%
remove-double-neg91.3%
sqr-neg91.3%
associate-+l+91.3%
sqr-neg91.3%
distribute-rgt-out91.3%
Simplified91.3%
associate-*r/91.3%
clear-num91.2%
+-commutative91.2%
fma-define91.2%
+-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
Taylor expanded in k around 0 99.8%
Taylor expanded in m around 0 99.8%
Taylor expanded in k around inf 99.8%
if 0.00449999999999999966 < m Initial program 74.1%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 29.2%
Taylor expanded in a around 0 35.5%
Final simplification57.1%
(FPCore (a k m) :precision binary64 (if (<= m 0.0045) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0))))) (+ a (* a (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.0045) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.0045d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a + (a * (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.0045) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a + (a * (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.0045: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a + (a * (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.0045) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a + Float64(a * Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.0045) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a + (a * (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.0045], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.0045:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 0.00449999999999999966Initial 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 m around 0 65.3%
if 0.00449999999999999966 < m Initial program 74.1%
associate-/l*74.2%
remove-double-neg74.2%
distribute-frac-neg274.2%
distribute-neg-frac274.2%
remove-double-neg74.2%
sqr-neg74.2%
associate-+l+74.2%
sqr-neg74.2%
distribute-rgt-out74.2%
Simplified74.2%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 29.2%
Taylor expanded in a around 0 35.5%
Final simplification54.9%
(FPCore (a k m) :precision binary64 (if (<= m 0.98) (* a (/ 1.0 (+ 1.0 (* k (+ k 10.0))))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.98) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.98d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * (k + 10.0d0))))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.98) {
tmp = a * (1.0 / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.98: tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.98) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.98) tmp = a * (1.0 / (1.0 + (k * (k + 10.0)))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.98], N[(a * N[(1.0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.98:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.97999999999999998Initial 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 m around 0 65.0%
if 0.97999999999999998 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
Final simplification47.9%
(FPCore (a k m) :precision binary64 (if (<= m 1.3) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.3) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.3d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.3) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.3: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.3) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.3) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.3], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.3:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 1.30000000000000004Initial 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 m around 0 65.0%
if 1.30000000000000004 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
Final simplification47.9%
(FPCore (a k m) :precision binary64 (if (<= m 0.41) (* a (/ 1.0 (+ 1.0 (* k k)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.41) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.41d0) then
tmp = a * (1.0d0 / (1.0d0 + (k * k)))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.41) {
tmp = a * (1.0 / (1.0 + (k * k)));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.41: tmp = a * (1.0 / (1.0 + (k * k))) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.41) tmp = Float64(a * Float64(1.0 / Float64(1.0 + Float64(k * k)))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.41) tmp = a * (1.0 / (1.0 + (k * k))); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.41], N[(a * N[(1.0 / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.41:\\
\;\;\;\;a \cdot \frac{1}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.409999999999999976Initial 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 m around 0 65.0%
Taylor expanded in k around inf 64.9%
if 0.409999999999999976 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.64) (/ a (+ 1.0 (* k k))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.64) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.64d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.64) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.64: tmp = a / (1.0 + (k * k)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.64) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.64) tmp = a / (1.0 + (k * k)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.64], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.64:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.640000000000000013Initial 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 m around 0 65.0%
Taylor expanded in k around inf 64.9%
if 0.640000000000000013 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.94) (/ a (+ 1.0 (* k 10.0))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.94) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.94d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.94) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.94: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.94) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.94) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.94], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.94:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.93999999999999995Initial 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 m around 0 65.0%
Taylor expanded in k around 0 39.8%
*-commutative83.6%
Simplified39.8%
if 0.93999999999999995 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.22) a (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.22) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.22d0) then
tmp = a
else
tmp = a * (k * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.22) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.22: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.22) tmp = a; else tmp = Float64(a * Float64(k * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.22) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.22], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.22:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 0.220000000000000001Initial 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 m around 0 65.0%
Taylor expanded in k around 0 29.8%
if 0.220000000000000001 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
*-commutative15.2%
*-commutative15.2%
associate-*r*15.2%
Simplified15.2%
(FPCore (a k m) :precision binary64 (if (<= m 0.56) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.56) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.56d0) then
tmp = a
else
tmp = (-10.0d0) * (k * a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.56) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.56: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.56) tmp = a; else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.56) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.56], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.56:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 0.56000000000000005Initial 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 m around 0 65.0%
Taylor expanded in k around 0 29.8%
if 0.56000000000000005 < m Initial program 73.9%
associate-/l*73.9%
remove-double-neg73.9%
distribute-frac-neg273.9%
distribute-neg-frac273.9%
remove-double-neg73.9%
sqr-neg73.9%
associate-+l+73.9%
sqr-neg73.9%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in m around 0 3.0%
Taylor expanded in k around 0 6.3%
Taylor expanded in k around inf 15.2%
*-commutative15.2%
Simplified15.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.8%
associate-/l*88.8%
remove-double-neg88.8%
distribute-frac-neg288.8%
distribute-neg-frac288.8%
remove-double-neg88.8%
sqr-neg88.8%
associate-+l+88.8%
sqr-neg88.8%
distribute-rgt-out88.8%
Simplified88.8%
Taylor expanded in m around 0 43.7%
Taylor expanded in k around 0 20.8%
herbie shell --seed 2024152
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))