
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))) (t_1 (/ 1.0 t_0)))
(if (<= k 1e-107)
(/ a (pow k (- m)))
(/ 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 <= 1e-107) {
tmp = a / pow(k, -m);
} 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 <= 1d-107) then
tmp = a / (k ** -m)
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 <= 1e-107) {
tmp = a / Math.pow(k, -m);
} 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 <= 1e-107: tmp = a / math.pow(k, -m) 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 <= 1e-107) tmp = Float64(a / (k ^ Float64(-m))); 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 <= 1e-107) tmp = a / (k ^ -m); 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, 1e-107], N[(a / N[Power[k, (-m)], $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 10^{-107}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\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 < 1e-107Initial program 94.3%
associate-/l*94.3%
remove-double-neg94.3%
distribute-frac-neg294.3%
distribute-neg-frac294.3%
remove-double-neg94.3%
sqr-neg94.3%
associate-+l+94.3%
sqr-neg94.3%
distribute-rgt-out94.3%
Simplified94.3%
clear-num94.3%
un-div-inv94.3%
+-commutative94.3%
fma-define94.3%
+-commutative94.3%
Applied egg-rr94.3%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 39.9%
rec-exp39.9%
mul-1-neg39.9%
remove-double-neg39.9%
log-rec39.9%
*-commutative39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
exp-to-pow100.0%
Simplified100.0%
if 1e-107 < k Initial program 89.0%
associate-/l*88.9%
remove-double-neg88.9%
distribute-frac-neg288.9%
distribute-neg-frac288.9%
remove-double-neg88.9%
sqr-neg88.9%
associate-+l+88.9%
sqr-neg88.9%
distribute-rgt-out88.9%
Simplified88.9%
distribute-lft-in88.9%
associate-+l+88.9%
associate-*r/89.0%
clear-num89.0%
associate-+l+89.0%
distribute-lft-in89.0%
+-commutative89.0%
fma-define89.0%
+-commutative89.0%
*-commutative89.0%
Applied egg-rr89.0%
Taylor expanded in k around 0 99.9%
Final simplification100.0%
(FPCore (a k m) :precision binary64 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))))) (if (<= t_0 INFINITY) t_0 (* a (+ 1.0 (* k (* k 99.0)))))))
double code(double a, double k, double m) {
double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
public static double code(double a, double k, double m) {
double t_0 = (a * Math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): t_0 = (a * math.pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k)) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = (a * (k ^ m)) / ((1.0 + (k * 10.0)) + (k * k)); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0Initial program 98.0%
if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 0.0%
associate-/l*0.0%
remove-double-neg0.0%
distribute-frac-neg20.0%
distribute-neg-frac20.0%
remove-double-neg0.0%
sqr-neg0.0%
associate-+l+0.0%
sqr-neg0.0%
distribute-rgt-out0.0%
Simplified0.0%
Taylor expanded in m around 0 1.6%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.1%
(FPCore (a k m) :precision binary64 (if (<= m 1.65) (/ a (/ (fma k (+ k 10.0) 1.0) (pow k m))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.65) {
tmp = a / (fma(k, (k + 10.0), 1.0) / pow(k, m));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 1.65) tmp = Float64(a / Float64(fma(k, Float64(k + 10.0), 1.0) / (k ^ m))); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 1.65], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.65:\\
\;\;\;\;\frac{a}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{{k}^{m}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 1.6499999999999999Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
clear-num97.2%
un-div-inv97.3%
+-commutative97.3%
fma-define97.3%
+-commutative97.3%
Applied egg-rr97.3%
if 1.6499999999999999 < m Initial program 80.5%
associate-/l*80.5%
remove-double-neg80.5%
distribute-frac-neg280.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
sqr-neg80.5%
associate-+l+80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
Simplified80.5%
Taylor expanded in k around 0 100.0%
(FPCore (a k m) :precision binary64 (if (<= m 1.65) (* a (/ (pow k m) (+ 1.0 (* k (+ k 10.0))))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.65) {
tmp = a * (pow(k, m) / (1.0 + (k * (k + 10.0))));
} 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.65d0) then
tmp = a * ((k ** m) / (1.0d0 + (k * (k + 10.0d0))))
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.65) {
tmp = a * (Math.pow(k, m) / (1.0 + (k * (k + 10.0))));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.65: tmp = a * (math.pow(k, m) / (1.0 + (k * (k + 10.0)))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.65) tmp = Float64(a * Float64((k ^ m) / Float64(1.0 + Float64(k * Float64(k + 10.0))))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.65) tmp = a * ((k ^ m) / (1.0 + (k * (k + 10.0)))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.65], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.65:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 1.6499999999999999Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
if 1.6499999999999999 < m Initial program 80.5%
associate-/l*80.5%
remove-double-neg80.5%
distribute-frac-neg280.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
sqr-neg80.5%
associate-+l+80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
Simplified80.5%
Taylor expanded in k around 0 100.0%
Final simplification98.1%
(FPCore (a k m) :precision binary64 (if (or (<= m -3.2e-27) (not (<= m 0.00078))) (* a (pow k m)) (/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3.2e-27) || !(m <= 0.00078)) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (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 <= (-3.2d-27)) .or. (.not. (m <= 0.00078d0))) then
tmp = a * (k ** m)
else
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -3.2e-27) || !(m <= 0.00078)) {
tmp = a * Math.pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3.2e-27) or not (m <= 0.00078): tmp = a * math.pow(k, m) else: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3.2e-27) || !(m <= 0.00078)) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3.2e-27) || ~((m <= 0.00078))) tmp = a * (k ^ m); else tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3.2e-27], N[Not[LessEqual[m, 0.00078]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.2 \cdot 10^{-27} \lor \neg \left(m \leq 0.00078\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\end{array}
\end{array}
if m < -3.19999999999999991e-27 or 7.79999999999999986e-4 < m Initial program 90.8%
associate-/l*90.8%
remove-double-neg90.8%
distribute-frac-neg290.8%
distribute-neg-frac290.8%
remove-double-neg90.8%
sqr-neg90.8%
associate-+l+90.8%
sqr-neg90.8%
distribute-rgt-out90.8%
Simplified90.8%
Taylor expanded in k around 0 100.0%
if -3.19999999999999991e-27 < m < 7.79999999999999986e-4Initial program 94.2%
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%
distribute-lft-in94.1%
associate-+l+94.1%
associate-*r/94.2%
clear-num94.0%
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 93.2%
Taylor expanded in k around 0 98.9%
Final simplification99.6%
(FPCore (a k m)
:precision binary64
(if (<= m -3.2e-27)
(/ a (pow k (- m)))
(if (<= m 0.059)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.2e-27) {
tmp = a / pow(k, -m);
} else if (m <= 0.059) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / 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 <= (-3.2d-27)) then
tmp = a / (k ** -m)
else if (m <= 0.059d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / 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 <= -3.2e-27) {
tmp = a / Math.pow(k, -m);
} else if (m <= 0.059) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.2e-27: tmp = a / math.pow(k, -m) elif m <= 0.059: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.2e-27) tmp = Float64(a / (k ^ Float64(-m))); elseif (m <= 0.059) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(a * (k ^ m)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.2e-27) tmp = a / (k ^ -m); elseif (m <= 0.059) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.2e-27], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.059], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.2 \cdot 10^{-27}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{elif}\;m \leq 0.059:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -3.19999999999999991e-27Initial 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%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 55.3%
rec-exp55.3%
mul-1-neg55.3%
remove-double-neg55.3%
log-rec55.3%
*-commutative55.3%
distribute-lft-neg-in55.3%
distribute-rgt-neg-out55.3%
exp-to-pow100.0%
Simplified100.0%
if -3.19999999999999991e-27 < m < 0.058999999999999997Initial program 94.2%
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%
distribute-lft-in94.1%
associate-+l+94.1%
associate-*r/94.2%
clear-num94.0%
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 93.2%
Taylor expanded in k around 0 98.9%
if 0.058999999999999997 < m Initial program 80.5%
associate-/l*80.5%
remove-double-neg80.5%
distribute-frac-neg280.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
sqr-neg80.5%
associate-+l+80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
Simplified80.5%
Taylor expanded in k around 0 100.0%
Final simplification99.6%
(FPCore (a k m)
:precision binary64
(if (<= m -2.15e-134)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 1.65)
(/ 1.0 (+ (/ 1.0 a) (* k (+ (* 10.0 (/ 1.0 a)) (/ k a)))))
(* a (+ 1.0 (* k (- (* k 100.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.15e-134) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 1.65) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (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.15d-134)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 1.65d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k * ((10.0d0 * (1.0d0 / a)) + (k / a))))
else
tmp = a * (1.0d0 + (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.15e-134) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 1.65) {
tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a))));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.15e-134: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 1.65: tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.15e-134) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 1.65) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k * Float64(Float64(10.0 * Float64(1.0 / a)) + Float64(k / a))))); else tmp = Float64(a * Float64(1.0 + 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.15e-134) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 1.65) tmp = 1.0 / ((1.0 / a) + (k * ((10.0 * (1.0 / a)) + (k / a)))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.15e-134], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.65], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k * N[(N[(10.0 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + 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.15 \cdot 10^{-134}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 1.65:\\
\;\;\;\;\frac{1}{\frac{1}{a} + k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -2.14999999999999993e-134Initial program 100.0%
associate-/l*99.9%
remove-double-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac299.9%
remove-double-neg99.9%
sqr-neg99.9%
associate-+l+99.9%
sqr-neg99.9%
distribute-rgt-out99.9%
Simplified99.9%
Taylor expanded in m around 0 49.2%
if -2.14999999999999993e-134 < m < 1.6499999999999999Initial program 93.1%
associate-/l*93.0%
remove-double-neg93.0%
distribute-frac-neg293.0%
distribute-neg-frac293.0%
remove-double-neg93.0%
sqr-neg93.0%
associate-+l+93.0%
sqr-neg93.0%
distribute-rgt-out93.0%
Simplified93.0%
distribute-lft-in93.0%
associate-+l+93.0%
associate-*r/93.1%
clear-num93.0%
associate-+l+93.0%
distribute-lft-in93.0%
+-commutative93.0%
fma-define93.0%
+-commutative93.0%
*-commutative93.0%
Applied egg-rr93.0%
Taylor expanded in m around 0 92.0%
Taylor expanded in k around 0 98.8%
if 1.6499999999999999 < m Initial program 80.5%
associate-/l*80.5%
remove-double-neg80.5%
distribute-frac-neg280.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
sqr-neg80.5%
associate-+l+80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
Simplified80.5%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in k around 0 31.1%
Final simplification56.8%
(FPCore (a k m) :precision binary64 (if (<= m -39000.0) (* a (/ 0.1 k)) (if (<= m 2.5e+58) (/ a (+ 1.0 (* k 10.0))) (* a (+ 1.0 (* k -10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -39000.0) {
tmp = a * (0.1 / k);
} else if (m <= 2.5e+58) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-39000.0d0)) then
tmp = a * (0.1d0 / k)
else if (m <= 2.5d+58) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -39000.0) {
tmp = a * (0.1 / k);
} else if (m <= 2.5e+58) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -39000.0: tmp = a * (0.1 / k) elif m <= 2.5e+58: tmp = a / (1.0 + (k * 10.0)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -39000.0) tmp = Float64(a * Float64(0.1 / k)); elseif (m <= 2.5e+58) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -39000.0) tmp = a * (0.1 / k); elseif (m <= 2.5e+58) tmp = a / (1.0 + (k * 10.0)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -39000.0], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.5e+58], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -39000:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\mathbf{elif}\;m \leq 2.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -39000Initial 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 40.3%
Taylor expanded in k around 0 17.7%
*-commutative17.7%
Simplified17.7%
Taylor expanded in k around inf 22.6%
if -39000 < m < 2.49999999999999993e58Initial program 93.4%
associate-/l*93.3%
remove-double-neg93.3%
distribute-frac-neg293.3%
distribute-neg-frac293.3%
remove-double-neg93.3%
sqr-neg93.3%
associate-+l+93.3%
sqr-neg93.3%
distribute-rgt-out93.3%
Simplified93.3%
Taylor expanded in m around 0 78.4%
Taylor expanded in k around 0 54.6%
*-commutative54.6%
Simplified54.6%
if 2.49999999999999993e58 < m Initial program 78.8%
associate-/l*78.8%
remove-double-neg78.8%
distribute-frac-neg278.8%
distribute-neg-frac278.8%
remove-double-neg78.8%
sqr-neg78.8%
associate-+l+78.8%
sqr-neg78.8%
distribute-rgt-out78.8%
Simplified78.8%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 15.2%
*-commutative15.2%
Simplified15.2%
(FPCore (a k m) :precision binary64 (if (<= m 1.65) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (- (* k 100.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.65) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (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.65d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (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.65) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.65: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.65) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + 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.65) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.65], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.65:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.6499999999999999Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
Taylor expanded in m around 0 66.2%
if 1.6499999999999999 < m Initial program 80.5%
associate-/l*80.5%
remove-double-neg80.5%
distribute-frac-neg280.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
sqr-neg80.5%
associate-+l+80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
Simplified80.5%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in k around 0 31.1%
Final simplification55.0%
(FPCore (a k m) :precision binary64 (if (<= m 180000.0) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (- (* k 99.0) 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 180000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 180000.0d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * ((k * 99.0d0) - 10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 180000.0) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * ((k * 99.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 180000.0: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 180000.0) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(Float64(k * 99.0) - 10.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 180000.0) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * ((k * 99.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 180000.0], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(N[(k * 99.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 180000:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99 - 10\right)\right)\\
\end{array}
\end{array}
if m < 1.8e5Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
Taylor expanded in m around 0 65.6%
if 1.8e5 < m Initial program 80.0%
associate-/l*80.0%
remove-double-neg80.0%
distribute-frac-neg280.0%
distribute-neg-frac280.0%
remove-double-neg80.0%
sqr-neg80.0%
associate-+l+80.0%
sqr-neg80.0%
distribute-rgt-out80.0%
Simplified80.0%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 31.7%
Final simplification55.0%
(FPCore (a k m) :precision binary64 (if (or (<= k 6.1e-307) (not (<= k 0.00047))) (* a (/ 0.1 k)) a))
double code(double a, double k, double m) {
double tmp;
if ((k <= 6.1e-307) || !(k <= 0.00047)) {
tmp = a * (0.1 / k);
} else {
tmp = a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if ((k <= 6.1d-307) .or. (.not. (k <= 0.00047d0))) then
tmp = a * (0.1d0 / k)
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((k <= 6.1e-307) || !(k <= 0.00047)) {
tmp = a * (0.1 / k);
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if (k <= 6.1e-307) or not (k <= 0.00047): tmp = a * (0.1 / k) else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if ((k <= 6.1e-307) || !(k <= 0.00047)) tmp = Float64(a * Float64(0.1 / k)); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((k <= 6.1e-307) || ~((k <= 0.00047))) tmp = a * (0.1 / k); else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[k, 6.1e-307], N[Not[LessEqual[k, 0.00047]], $MachinePrecision]], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.1 \cdot 10^{-307} \lor \neg \left(k \leq 0.00047\right):\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if k < 6.09999999999999974e-307 or 4.69999999999999986e-4 < k Initial program 88.1%
associate-/l*88.0%
remove-double-neg88.0%
distribute-frac-neg288.0%
distribute-neg-frac288.0%
remove-double-neg88.0%
sqr-neg88.0%
associate-+l+88.0%
sqr-neg88.0%
distribute-rgt-out88.0%
Simplified88.0%
Taylor expanded in m around 0 44.4%
Taylor expanded in k around 0 19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in k around inf 19.0%
if 6.09999999999999974e-307 < k < 4.69999999999999986e-4Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
distribute-frac-neg2100.0%
distribute-neg-frac2100.0%
remove-double-neg100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 49.6%
Taylor expanded in k around 0 49.6%
Final simplification28.8%
(FPCore (a k m) :precision binary64 (if (<= m 1.85) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 1.85d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.85) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.85: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.85) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.85) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.85], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.85:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 1.8500000000000001Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
Taylor expanded in m around 0 65.9%
if 1.8500000000000001 < m Initial program 80.2%
associate-/l*80.2%
remove-double-neg80.2%
distribute-frac-neg280.2%
distribute-neg-frac280.2%
remove-double-neg80.2%
sqr-neg80.2%
associate-+l+80.2%
sqr-neg80.2%
distribute-rgt-out80.2%
Simplified80.2%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 31.4%
Taylor expanded in k around inf 31.4%
*-commutative31.4%
Simplified31.4%
Final simplification55.0%
(FPCore (a k m) :precision binary64 (if (<= m 2.05) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k (* k 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 2.05) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 2.05d0) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (k * 99.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 2.05) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * (k * 99.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 2.05: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * (k * 99.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 2.05) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(k * 99.0)))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 2.05) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * (k * 99.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 2.05], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.05:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 2.0499999999999998Initial program 97.3%
associate-/l*97.2%
remove-double-neg97.2%
distribute-frac-neg297.2%
distribute-neg-frac297.2%
remove-double-neg97.2%
sqr-neg97.2%
associate-+l+97.2%
sqr-neg97.2%
distribute-rgt-out97.2%
Simplified97.2%
Taylor expanded in m around 0 65.9%
Taylor expanded in k around inf 65.2%
if 2.0499999999999998 < m Initial program 80.2%
associate-/l*80.2%
remove-double-neg80.2%
distribute-frac-neg280.2%
distribute-neg-frac280.2%
remove-double-neg80.2%
sqr-neg80.2%
associate-+l+80.2%
sqr-neg80.2%
distribute-rgt-out80.2%
Simplified80.2%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 31.4%
Taylor expanded in k around inf 31.4%
*-commutative31.4%
Simplified31.4%
(FPCore (a k m) :precision binary64 (if (<= m 5e+60) (/ a (+ 1.0 (* k k))) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 5e+60) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 5d+60) then
tmp = a / (1.0d0 + (k * k))
else
tmp = a * (1.0d0 + (k * (-10.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 5e+60) {
tmp = a / (1.0 + (k * k));
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 5e+60: tmp = a / (1.0 + (k * k)) else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 5e+60) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 5e+60) tmp = a / (1.0 + (k * k)); else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 5e+60], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 5 \cdot 10^{+60}:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < 4.99999999999999975e60Initial program 96.5%
associate-/l*96.4%
remove-double-neg96.4%
distribute-frac-neg296.4%
distribute-neg-frac296.4%
remove-double-neg96.4%
sqr-neg96.4%
associate-+l+96.4%
sqr-neg96.4%
distribute-rgt-out96.4%
Simplified96.4%
Taylor expanded in m around 0 60.7%
Taylor expanded in k around inf 60.1%
if 4.99999999999999975e60 < m Initial program 78.5%
associate-/l*78.5%
remove-double-neg78.5%
distribute-frac-neg278.5%
distribute-neg-frac278.5%
remove-double-neg78.5%
sqr-neg78.5%
associate-+l+78.5%
sqr-neg78.5%
distribute-rgt-out78.5%
Simplified78.5%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 15.4%
*-commutative15.4%
Simplified15.4%
(FPCore (a k m) :precision binary64 (if (<= k 0.00047) (* a (+ 1.0 (* k -10.0))) (* a (/ 0.1 k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00047) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = a * (0.1 / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 0.00047d0) then
tmp = a * (1.0d0 + (k * (-10.0d0)))
else
tmp = a * (0.1d0 / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00047) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = a * (0.1 / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00047: tmp = a * (1.0 + (k * -10.0)) else: tmp = a * (0.1 / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00047) tmp = Float64(a * Float64(1.0 + Float64(k * -10.0))); else tmp = Float64(a * Float64(0.1 / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00047) tmp = a * (1.0 + (k * -10.0)); else tmp = a * (0.1 / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00047], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(0.1 / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00047:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{0.1}{k}\\
\end{array}
\end{array}
if k < 4.69999999999999986e-4Initial program 95.2%
associate-/l*95.2%
remove-double-neg95.2%
distribute-frac-neg295.2%
distribute-neg-frac295.2%
remove-double-neg95.2%
sqr-neg95.2%
associate-+l+95.2%
sqr-neg95.2%
distribute-rgt-out95.2%
Simplified95.2%
Taylor expanded in m around 0 35.1%
Taylor expanded in k around 0 30.6%
*-commutative30.6%
Simplified30.6%
if 4.69999999999999986e-4 < k Initial program 85.5%
associate-/l*85.4%
remove-double-neg85.4%
distribute-frac-neg285.4%
distribute-neg-frac285.4%
remove-double-neg85.4%
sqr-neg85.4%
associate-+l+85.4%
sqr-neg85.4%
distribute-rgt-out85.4%
Simplified85.4%
Taylor expanded in m around 0 66.9%
Taylor expanded in k around 0 27.2%
*-commutative27.2%
Simplified27.2%
Taylor expanded in k around inf 27.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 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.8%
sqr-neg91.8%
distribute-rgt-out91.8%
Simplified91.8%
Taylor expanded in m around 0 46.1%
Taylor expanded in k around 0 18.8%
herbie shell --seed 2024137
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))