
(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 -8.5e-65)
(* (pow k m) (/ a (+ 1.0 (* k (+ k 10.0)))))
(if (<= m 1.8e-7)
(/ 1.0 (+ (/ 1.0 a) (/ k (/ a (+ k 10.0)))))
(* a (pow k m)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -8.5e-65) {
tmp = pow(k, m) * (a / (1.0 + (k * (k + 10.0))));
} else if (m <= 1.8e-7) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (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 <= (-8.5d-65)) then
tmp = (k ** m) * (a / (1.0d0 + (k * (k + 10.0d0))))
else if (m <= 1.8d-7) then
tmp = 1.0d0 / ((1.0d0 / a) + (k / (a / (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 <= -8.5e-65) {
tmp = Math.pow(k, m) * (a / (1.0 + (k * (k + 10.0))));
} else if (m <= 1.8e-7) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
} else {
tmp = a * Math.pow(k, m);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -8.5e-65: tmp = math.pow(k, m) * (a / (1.0 + (k * (k + 10.0)))) elif m <= 1.8e-7: tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))) else: tmp = a * math.pow(k, m) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -8.5e-65) tmp = Float64((k ^ m) * Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0))))); elseif (m <= 1.8e-7) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k / Float64(a / 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 <= -8.5e-65) tmp = (k ^ m) * (a / (1.0 + (k * (k + 10.0)))); elseif (m <= 1.8e-7) tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))); else tmp = a * (k ^ m); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -8.5e-65], N[(N[Power[k, m], $MachinePrecision] * N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.8e-7], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k / N[(a / 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 -8.5 \cdot 10^{-65}:\\
\;\;\;\;{k}^{m} \cdot \frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + \frac{k}{\frac{a}{k + 10}}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < -8.5000000000000003e-65Initial program 100.0%
associate-*l/100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
if -8.5000000000000003e-65 < m < 1.79999999999999997e-7Initial program 91.0%
associate-*l/91.0%
sqr-neg91.0%
associate-+l+91.0%
sqr-neg91.0%
distribute-rgt-out91.0%
Simplified91.0%
+-commutative91.0%
+-commutative91.0%
fma-udef91.0%
associate-/r/91.0%
clear-num90.9%
frac-2neg90.9%
metadata-eval90.9%
Applied egg-rr90.9%
associate-/l/90.9%
distribute-neg-frac90.9%
neg-sub090.9%
metadata-eval90.9%
fma-udef90.9%
+-commutative90.9%
associate--r+90.9%
metadata-eval90.9%
metadata-eval90.9%
Simplified90.9%
div-sub90.9%
times-frac99.5%
Applied egg-rr99.5%
clear-num99.4%
frac-times99.5%
*-un-lft-identity99.5%
Applied egg-rr99.5%
Taylor expanded in m around 0 89.9%
associate-/l*98.6%
+-commutative98.6%
Simplified98.6%
if 1.79999999999999997e-7 < m Initial program 79.3%
associate-*l/73.6%
sqr-neg73.6%
associate-+l+73.6%
sqr-neg73.6%
distribute-rgt-out73.6%
Simplified73.6%
Taylor expanded in k around 0 100.0%
Final simplification99.5%
(FPCore (a k m) :precision binary64 (if (<= k 1.45e-18) (/ a (pow k (- m))) (/ -1.0 (- (/ -1.0 (* a (pow k m))) (/ (+ k 10.0) (* (pow k m) (/ a k)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.45e-18) {
tmp = a / pow(k, -m);
} else {
tmp = -1.0 / ((-1.0 / (a * pow(k, m))) - ((k + 10.0) / (pow(k, m) * (a / k))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 1.45d-18) then
tmp = a / (k ** -m)
else
tmp = (-1.0d0) / (((-1.0d0) / (a * (k ** m))) - ((k + 10.0d0) / ((k ** m) * (a / k))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.45e-18) {
tmp = a / Math.pow(k, -m);
} else {
tmp = -1.0 / ((-1.0 / (a * Math.pow(k, m))) - ((k + 10.0) / (Math.pow(k, m) * (a / k))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.45e-18: tmp = a / math.pow(k, -m) else: tmp = -1.0 / ((-1.0 / (a * math.pow(k, m))) - ((k + 10.0) / (math.pow(k, m) * (a / k)))) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.45e-18) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / Float64(a * (k ^ m))) - Float64(Float64(k + 10.0) / Float64((k ^ m) * Float64(a / k))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.45e-18) tmp = a / (k ^ -m); else tmp = -1.0 / ((-1.0 / (a * (k ^ m))) - ((k + 10.0) / ((k ^ m) * (a / k)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.45e-18], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(k + 10.0), $MachinePrecision] / N[(N[Power[k, m], $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{a \cdot {k}^{m}} - \frac{k + 10}{{k}^{m} \cdot \frac{a}{k}}}\\
\end{array}
\end{array}
if k < 1.45e-18Initial program 94.2%
associate-/l*94.2%
sqr-neg94.2%
associate-+l+94.2%
+-commutative94.2%
sqr-neg94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 53.2%
rec-exp53.2%
mul-1-neg53.2%
remove-double-neg53.2%
*-commutative53.2%
log-rec53.2%
distribute-lft-neg-in53.2%
distribute-rgt-neg-out53.2%
exp-to-pow100.0%
Simplified100.0%
if 1.45e-18 < k Initial program 83.3%
associate-*l/79.3%
sqr-neg79.3%
associate-+l+79.3%
sqr-neg79.3%
distribute-rgt-out79.3%
Simplified79.3%
+-commutative79.3%
+-commutative79.3%
fma-udef79.3%
associate-/r/83.3%
clear-num83.3%
frac-2neg83.3%
metadata-eval83.3%
Applied egg-rr83.3%
associate-/l/83.3%
distribute-neg-frac83.3%
neg-sub083.3%
metadata-eval83.3%
fma-udef83.3%
+-commutative83.3%
associate--r+83.3%
metadata-eval83.3%
metadata-eval83.3%
Simplified83.3%
div-sub83.3%
times-frac96.7%
Applied egg-rr96.7%
clear-num96.6%
frac-times97.7%
*-un-lft-identity97.7%
Applied egg-rr97.7%
Final simplification99.1%
(FPCore (a k m) :precision binary64 (if (<= k 1.45e-18) (/ a (pow k (- m))) (/ -1.0 (- (/ -1.0 (* a (pow k m))) (* (/ k a) (/ (+ k 10.0) (pow k m)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.45e-18) {
tmp = a / pow(k, -m);
} else {
tmp = -1.0 / ((-1.0 / (a * pow(k, m))) - ((k / a) * ((k + 10.0) / 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 (k <= 1.45d-18) then
tmp = a / (k ** -m)
else
tmp = (-1.0d0) / (((-1.0d0) / (a * (k ** m))) - ((k / a) * ((k + 10.0d0) / (k ** m))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.45e-18) {
tmp = a / Math.pow(k, -m);
} else {
tmp = -1.0 / ((-1.0 / (a * Math.pow(k, m))) - ((k / a) * ((k + 10.0) / Math.pow(k, m))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.45e-18: tmp = a / math.pow(k, -m) else: tmp = -1.0 / ((-1.0 / (a * math.pow(k, m))) - ((k / a) * ((k + 10.0) / math.pow(k, m)))) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.45e-18) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / Float64(a * (k ^ m))) - Float64(Float64(k / a) * Float64(Float64(k + 10.0) / (k ^ m))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.45e-18) tmp = a / (k ^ -m); else tmp = -1.0 / ((-1.0 / (a * (k ^ m))) - ((k / a) * ((k + 10.0) / (k ^ m)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.45e-18], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(k / a), $MachinePrecision] * N[(N[(k + 10.0), $MachinePrecision] / N[Power[k, m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{a \cdot {k}^{m}} - \frac{k}{a} \cdot \frac{k + 10}{{k}^{m}}}\\
\end{array}
\end{array}
if k < 1.45e-18Initial program 94.2%
associate-/l*94.2%
sqr-neg94.2%
associate-+l+94.2%
+-commutative94.2%
sqr-neg94.2%
distribute-rgt-out94.2%
fma-def94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 53.2%
rec-exp53.2%
mul-1-neg53.2%
remove-double-neg53.2%
*-commutative53.2%
log-rec53.2%
distribute-lft-neg-in53.2%
distribute-rgt-neg-out53.2%
exp-to-pow100.0%
Simplified100.0%
if 1.45e-18 < k Initial program 83.3%
associate-*l/79.3%
sqr-neg79.3%
associate-+l+79.3%
sqr-neg79.3%
distribute-rgt-out79.3%
Simplified79.3%
+-commutative79.3%
+-commutative79.3%
fma-udef79.3%
associate-/r/83.3%
clear-num83.3%
frac-2neg83.3%
metadata-eval83.3%
Applied egg-rr83.3%
associate-/l/83.3%
distribute-neg-frac83.3%
neg-sub083.3%
metadata-eval83.3%
fma-udef83.3%
+-commutative83.3%
associate--r+83.3%
metadata-eval83.3%
metadata-eval83.3%
Simplified83.3%
div-sub83.3%
times-frac96.7%
Applied egg-rr96.7%
Final simplification98.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -102.0) (not (<= m 6.3e-7))) (* a (pow k m)) (/ 1.0 (+ (/ 1.0 a) (/ k (/ a (+ k 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -102.0) || !(m <= 6.3e-7)) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k / (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 <= (-102.0d0)) .or. (.not. (m <= 6.3d-7))) then
tmp = a * (k ** m)
else
tmp = 1.0d0 / ((1.0d0 / a) + (k / (a / (k + 10.0d0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -102.0) || !(m <= 6.3e-7)) {
tmp = a * Math.pow(k, m);
} else {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -102.0) or not (m <= 6.3e-7): tmp = a * math.pow(k, m) else: tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -102.0) || !(m <= 6.3e-7)) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k / Float64(a / Float64(k + 10.0))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -102.0) || ~((m <= 6.3e-7))) tmp = a * (k ^ m); else tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -102.0], N[Not[LessEqual[m, 6.3e-7]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k / N[(a / N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -102 \lor \neg \left(m \leq 6.3 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a} + \frac{k}{\frac{a}{k + 10}}}\\
\end{array}
\end{array}
if m < -102 or 6.30000000000000003e-7 < m Initial program 88.9%
associate-*l/85.8%
sqr-neg85.8%
associate-+l+85.8%
sqr-neg85.8%
distribute-rgt-out85.8%
Simplified85.8%
Taylor expanded in k around 0 100.0%
if -102 < m < 6.30000000000000003e-7Initial program 91.8%
associate-*l/91.8%
sqr-neg91.8%
associate-+l+91.8%
sqr-neg91.8%
distribute-rgt-out91.8%
Simplified91.8%
+-commutative91.8%
+-commutative91.8%
fma-udef91.8%
associate-/r/91.8%
clear-num91.6%
frac-2neg91.6%
metadata-eval91.6%
Applied egg-rr91.6%
associate-/l/91.6%
distribute-neg-frac91.6%
neg-sub091.6%
metadata-eval91.6%
fma-udef91.6%
+-commutative91.6%
associate--r+91.6%
metadata-eval91.6%
metadata-eval91.6%
Simplified91.6%
div-sub91.6%
times-frac99.5%
Applied egg-rr99.5%
clear-num99.5%
frac-times99.5%
*-un-lft-identity99.5%
Applied egg-rr99.5%
Taylor expanded in m around 0 90.0%
associate-/l*97.9%
+-commutative97.9%
Simplified97.9%
Final simplification99.2%
(FPCore (a k m)
:precision binary64
(if (<= m -2.8e-64)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 5200.0)
(/ 1.0 (+ (/ 1.0 a) (* (+ k 10.0) (/ k a))))
(- (* 10.0 (* k a)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.8e-64) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + ((k + 10.0) * (k / a)));
} else {
tmp = (10.0 * (k * a)) - 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 <= (-2.8d-64)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 5200.0d0) then
tmp = 1.0d0 / ((1.0d0 / a) + ((k + 10.0d0) * (k / a)))
else
tmp = (10.0d0 * (k * a)) - a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.8e-64) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + ((k + 10.0) * (k / a)));
} else {
tmp = (10.0 * (k * a)) - a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.8e-64: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 5200.0: tmp = 1.0 / ((1.0 / a) + ((k + 10.0) * (k / a))) else: tmp = (10.0 * (k * a)) - a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.8e-64) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 5200.0) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(Float64(k + 10.0) * Float64(k / a)))); else tmp = Float64(Float64(10.0 * Float64(k * a)) - a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.8e-64) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 5200.0) tmp = 1.0 / ((1.0 / a) + ((k + 10.0) * (k / a))); else tmp = (10.0 * (k * a)) - a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.8e-64], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5200.0], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(N[(k + 10.0), $MachinePrecision] * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.8 \cdot 10^{-64}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 5200:\\
\;\;\;\;\frac{1}{\frac{1}{a} + \left(k + 10\right) \cdot \frac{k}{a}}\\
\mathbf{else}:\\
\;\;\;\;10 \cdot \left(k \cdot a\right) - a\\
\end{array}
\end{array}
if m < -2.80000000000000004e-64Initial program 100.0%
associate-*l/100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 41.3%
if -2.80000000000000004e-64 < m < 5200Initial program 91.2%
associate-*l/91.2%
sqr-neg91.2%
associate-+l+91.2%
sqr-neg91.2%
distribute-rgt-out91.2%
Simplified91.2%
+-commutative91.2%
+-commutative91.2%
fma-udef91.2%
associate-/r/91.2%
clear-num91.1%
frac-2neg91.1%
metadata-eval91.1%
Applied egg-rr91.1%
associate-/l/91.1%
distribute-neg-frac91.1%
neg-sub091.1%
metadata-eval91.1%
fma-udef91.1%
+-commutative91.1%
associate--r+91.1%
metadata-eval91.1%
metadata-eval91.1%
Simplified91.1%
div-sub91.1%
times-frac98.4%
Applied egg-rr98.4%
Taylor expanded in m around 0 88.1%
+-commutative88.1%
associate-*l/96.6%
+-commutative96.6%
Simplified96.6%
if 5200 < m Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.4%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.2%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 12.0%
Final simplification50.6%
(FPCore (a k m)
:precision binary64
(if (<= m -2.4e-64)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m 5200.0)
(/ 1.0 (+ (/ 1.0 a) (/ k (/ a (+ k 10.0)))))
(- (* 10.0 (* k a)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.4e-64) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
} else {
tmp = (10.0 * (k * a)) - 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 <= (-2.4d-64)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= 5200.0d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k / (a / (k + 10.0d0))))
else
tmp = (10.0d0 * (k * a)) - a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -2.4e-64) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
} else {
tmp = (10.0 * (k * a)) - a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -2.4e-64: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= 5200.0: tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))) else: tmp = (10.0 * (k * a)) - a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -2.4e-64) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= 5200.0) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k / Float64(a / Float64(k + 10.0))))); else tmp = Float64(Float64(10.0 * Float64(k * a)) - a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -2.4e-64) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= 5200.0) tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))); else tmp = (10.0 * (k * a)) - a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -2.4e-64], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5200.0], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k / N[(a / N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.4 \cdot 10^{-64}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq 5200:\\
\;\;\;\;\frac{1}{\frac{1}{a} + \frac{k}{\frac{a}{k + 10}}}\\
\mathbf{else}:\\
\;\;\;\;10 \cdot \left(k \cdot a\right) - a\\
\end{array}
\end{array}
if m < -2.39999999999999998e-64Initial program 100.0%
associate-*l/100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 41.3%
if -2.39999999999999998e-64 < m < 5200Initial program 91.2%
associate-*l/91.2%
sqr-neg91.2%
associate-+l+91.2%
sqr-neg91.2%
distribute-rgt-out91.2%
Simplified91.2%
+-commutative91.2%
+-commutative91.2%
fma-udef91.2%
associate-/r/91.2%
clear-num91.1%
frac-2neg91.1%
metadata-eval91.1%
Applied egg-rr91.1%
associate-/l/91.1%
distribute-neg-frac91.1%
neg-sub091.1%
metadata-eval91.1%
fma-udef91.1%
+-commutative91.1%
associate--r+91.1%
metadata-eval91.1%
metadata-eval91.1%
Simplified91.1%
div-sub91.1%
times-frac98.4%
Applied egg-rr98.4%
clear-num98.3%
frac-times98.4%
*-un-lft-identity98.4%
Applied egg-rr98.4%
Taylor expanded in m around 0 88.1%
associate-/l*96.6%
+-commutative96.6%
Simplified96.6%
if 5200 < m Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.4%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.2%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 12.0%
Final simplification50.6%
(FPCore (a k m)
:precision binary64
(if (<= m -15200000.0)
(/ 1.0 (/ (- (* (* k (+ k 10.0)) (- a)) a) (* a (- a))))
(if (<= m 5200.0)
(/ 1.0 (+ (/ 1.0 a) (/ k (/ a (+ k 10.0)))))
(- (* 10.0 (* k a)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -15200000.0) {
tmp = 1.0 / ((((k * (k + 10.0)) * -a) - a) / (a * -a));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
} else {
tmp = (10.0 * (k * a)) - 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 <= (-15200000.0d0)) then
tmp = 1.0d0 / ((((k * (k + 10.0d0)) * -a) - a) / (a * -a))
else if (m <= 5200.0d0) then
tmp = 1.0d0 / ((1.0d0 / a) + (k / (a / (k + 10.0d0))))
else
tmp = (10.0d0 * (k * a)) - a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -15200000.0) {
tmp = 1.0 / ((((k * (k + 10.0)) * -a) - a) / (a * -a));
} else if (m <= 5200.0) {
tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0))));
} else {
tmp = (10.0 * (k * a)) - a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -15200000.0: tmp = 1.0 / ((((k * (k + 10.0)) * -a) - a) / (a * -a)) elif m <= 5200.0: tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))) else: tmp = (10.0 * (k * a)) - a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -15200000.0) tmp = Float64(1.0 / Float64(Float64(Float64(Float64(k * Float64(k + 10.0)) * Float64(-a)) - a) / Float64(a * Float64(-a)))); elseif (m <= 5200.0) tmp = Float64(1.0 / Float64(Float64(1.0 / a) + Float64(k / Float64(a / Float64(k + 10.0))))); else tmp = Float64(Float64(10.0 * Float64(k * a)) - a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -15200000.0) tmp = 1.0 / ((((k * (k + 10.0)) * -a) - a) / (a * -a)); elseif (m <= 5200.0) tmp = 1.0 / ((1.0 / a) + (k / (a / (k + 10.0)))); else tmp = (10.0 * (k * a)) - a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -15200000.0], N[(1.0 / N[(N[(N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision] - a), $MachinePrecision] / N[(a * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5200.0], N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] + N[(k / N[(a / N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -15200000:\\
\;\;\;\;\frac{1}{\frac{\left(k \cdot \left(k + 10\right)\right) \cdot \left(-a\right) - a}{a \cdot \left(-a\right)}}\\
\mathbf{elif}\;m \leq 5200:\\
\;\;\;\;\frac{1}{\frac{1}{a} + \frac{k}{\frac{a}{k + 10}}}\\
\mathbf{else}:\\
\;\;\;\;10 \cdot \left(k \cdot a\right) - a\\
\end{array}
\end{array}
if m < -1.52e7Initial program 100.0%
associate-*l/100.0%
sqr-neg100.0%
associate-+l+100.0%
sqr-neg100.0%
distribute-rgt-out100.0%
Simplified100.0%
+-commutative100.0%
+-commutative100.0%
fma-udef100.0%
associate-/r/100.0%
clear-num100.0%
frac-2neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
associate-/l/100.0%
distribute-neg-frac100.0%
neg-sub0100.0%
metadata-eval100.0%
fma-udef100.0%
+-commutative100.0%
associate--r+100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
div-sub90.5%
times-frac90.5%
Applied egg-rr90.5%
Taylor expanded in m around 0 36.5%
+-commutative36.5%
associate-*l/27.6%
+-commutative27.6%
Simplified27.6%
+-commutative27.6%
associate-*l/36.5%
frac-2neg36.5%
metadata-eval36.5%
frac-add48.4%
+-commutative48.4%
Applied egg-rr48.4%
if -1.52e7 < m < 5200Initial program 92.0%
associate-*l/92.0%
sqr-neg92.0%
associate-+l+92.0%
sqr-neg92.0%
distribute-rgt-out92.0%
Simplified92.0%
+-commutative92.0%
+-commutative92.0%
fma-udef92.0%
associate-/r/92.0%
clear-num91.9%
frac-2neg91.9%
metadata-eval91.9%
Applied egg-rr91.9%
associate-/l/91.9%
distribute-neg-frac91.9%
neg-sub091.9%
metadata-eval91.9%
fma-udef91.9%
+-commutative91.9%
associate--r+91.9%
metadata-eval91.9%
metadata-eval91.9%
Simplified91.9%
div-sub91.9%
times-frac98.5%
Applied egg-rr98.5%
clear-num98.4%
frac-times98.5%
*-un-lft-identity98.5%
Applied egg-rr98.5%
Taylor expanded in m around 0 87.5%
associate-/l*95.1%
+-commutative95.1%
Simplified95.1%
if 5200 < m Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.4%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.2%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 12.0%
Final simplification54.0%
(FPCore (a k m)
:precision binary64
(if (<= m -1.32e-5)
(* (/ a k) 0.1)
(if (or (<= m 9.6e+26) (not (<= m 9.5e+250)))
(* a (+ 1.0 (* k -10.0)))
(* a (+ -1.0 (* k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.32e-5) {
tmp = (a / k) * 0.1;
} else if ((m <= 9.6e+26) || !(m <= 9.5e+250)) {
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 <= (-1.32d-5)) then
tmp = (a / k) * 0.1d0
else if ((m <= 9.6d+26) .or. (.not. (m <= 9.5d+250))) 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 <= -1.32e-5) {
tmp = (a / k) * 0.1;
} else if ((m <= 9.6e+26) || !(m <= 9.5e+250)) {
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 <= -1.32e-5: tmp = (a / k) * 0.1 elif (m <= 9.6e+26) or not (m <= 9.5e+250): 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 <= -1.32e-5) tmp = Float64(Float64(a / k) * 0.1); elseif ((m <= 9.6e+26) || !(m <= 9.5e+250)) 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 <= -1.32e-5) tmp = (a / k) * 0.1; elseif ((m <= 9.6e+26) || ~((m <= 9.5e+250))) 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, -1.32e-5], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[Or[LessEqual[m, 9.6e+26], N[Not[LessEqual[m, 9.5e+250]], $MachinePrecision]], 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 -1.32 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 9.6 \cdot 10^{+26} \lor \neg \left(m \leq 9.5 \cdot 10^{+250}\right):\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-1 + k \cdot 10\right)\\
\end{array}
\end{array}
if m < -1.32000000000000007e-5Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.6%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.5%
if -1.32000000000000007e-5 < m < 9.60000000000000018e26 or 9.49999999999999957e250 < m Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in m around 0 67.9%
Taylor expanded in k around 0 42.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in k around 0 40.6%
*-commutative40.6%
Simplified40.6%
Taylor expanded in a around 0 42.2%
*-commutative42.2%
Simplified42.2%
if 9.60000000000000018e26 < m < 9.49999999999999957e250Initial program 76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in m around 0 2.7%
frac-2neg2.7%
unpow22.7%
distribute-rgt-in2.7%
div-inv2.7%
distribute-neg-in2.7%
metadata-eval2.7%
+-commutative2.7%
sub-neg2.7%
Applied egg-rr2.7%
un-div-inv2.7%
clear-num2.7%
add-sqr-sqrt1.4%
sqrt-unprod12.5%
sqr-neg12.5%
sqrt-unprod1.1%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 15.4%
Final simplification30.4%
(FPCore (a k m) :precision binary64 (if (<= m -1.5e-5) (* (/ a k) 0.1) (if (<= m 5200.0) (/ a (+ 1.0 (* k 10.0))) (* a (+ -1.0 (* k 10.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.5e-5) {
tmp = (a / k) * 0.1;
} else if (m <= 5200.0) {
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 <= (-1.5d-5)) then
tmp = (a / k) * 0.1d0
else if (m <= 5200.0d0) 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 <= -1.5e-5) {
tmp = (a / k) * 0.1;
} else if (m <= 5200.0) {
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 <= -1.5e-5: tmp = (a / k) * 0.1 elif m <= 5200.0: 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 <= -1.5e-5) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 5200.0) 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 <= -1.5e-5) tmp = (a / k) * 0.1; elseif (m <= 5200.0) 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, -1.5e-5], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 5200.0], 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 -1.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 5200:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-1 + k \cdot 10\right)\\
\end{array}
\end{array}
if m < -1.50000000000000004e-5Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.6%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.5%
if -1.50000000000000004e-5 < m < 5200Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in m around 0 88.9%
Taylor expanded in k around 0 55.9%
*-commutative55.9%
Simplified55.9%
if 5200 < m Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.4%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.2%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 12.0%
Final simplification31.2%
(FPCore (a k m) :precision binary64 (if (<= m -1.5e-5) (* (/ a k) 0.1) (if (<= m 5200.0) (/ a (+ 1.0 (* k 10.0))) (- (* 10.0 (* k a)) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.5e-5) {
tmp = (a / k) * 0.1;
} else if (m <= 5200.0) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (10.0 * (k * a)) - 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-5)) then
tmp = (a / k) * 0.1d0
else if (m <= 5200.0d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = (10.0d0 * (k * a)) - a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.5e-5) {
tmp = (a / k) * 0.1;
} else if (m <= 5200.0) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = (10.0 * (k * a)) - a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.5e-5: tmp = (a / k) * 0.1 elif m <= 5200.0: tmp = a / (1.0 + (k * 10.0)) else: tmp = (10.0 * (k * a)) - a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.5e-5) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 5200.0) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(Float64(10.0 * Float64(k * a)) - a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.5e-5) tmp = (a / k) * 0.1; elseif (m <= 5200.0) tmp = a / (1.0 + (k * 10.0)); else tmp = (10.0 * (k * a)) - a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.5e-5], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 5200.0], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 5200:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;10 \cdot \left(k \cdot a\right) - a\\
\end{array}
\end{array}
if m < -1.50000000000000004e-5Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.6%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.5%
if -1.50000000000000004e-5 < m < 5200Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in m around 0 88.9%
Taylor expanded in k around 0 55.9%
*-commutative55.9%
Simplified55.9%
if 5200 < m Initial program 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.4%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.2%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 12.0%
Final simplification31.2%
(FPCore (a k m) :precision binary64 (if (<= m 1.6) (/ a (+ 1.0 (* k (+ k 10.0)))) (- (* 10.0 (* k a)) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 1.6) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = (10.0 * (k * a)) - 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.6d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = (10.0d0 * (k * a)) - a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 1.6) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = (10.0 * (k * a)) - a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1.6: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = (10.0 * (k * a)) - a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1.6) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(Float64(10.0 * Float64(k * a)) - a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 1.6) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = (10.0 * (k * a)) - a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1.6], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.6:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;10 \cdot \left(k \cdot a\right) - a\\
\end{array}
\end{array}
if m < 1.6000000000000001Initial program 95.5%
associate-*l/95.4%
sqr-neg95.4%
associate-+l+95.4%
sqr-neg95.4%
distribute-rgt-out95.4%
Simplified95.4%
Taylor expanded in m around 0 65.9%
if 1.6000000000000001 < m Initial program 79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in m around 0 2.8%
frac-2neg2.8%
unpow22.8%
distribute-rgt-in2.8%
div-inv2.8%
distribute-neg-in2.8%
metadata-eval2.8%
+-commutative2.8%
sub-neg2.8%
Applied egg-rr2.8%
un-div-inv2.8%
clear-num2.8%
add-sqr-sqrt1.3%
sqrt-unprod13.3%
sqr-neg13.3%
sqrt-unprod1.3%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
sub-neg2.4%
distribute-rgt-neg-in2.4%
+-commutative2.4%
distribute-neg-in2.4%
metadata-eval2.4%
unsub-neg2.4%
Simplified2.4%
Taylor expanded in k around 0 11.9%
Final simplification47.7%
(FPCore (a k m) :precision binary64 (if (<= m -5.8e-8) (* (/ a k) 0.1) (* a (+ 1.0 (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.8e-8) {
tmp = (a / k) * 0.1;
} 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 <= (-5.8d-8)) then
tmp = (a / k) * 0.1d0
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 <= -5.8e-8) {
tmp = (a / k) * 0.1;
} else {
tmp = a * (1.0 + (k * -10.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.8e-8: tmp = (a / k) * 0.1 else: tmp = a * (1.0 + (k * -10.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.8e-8) tmp = Float64(Float64(a / k) * 0.1); 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 <= -5.8e-8) tmp = (a / k) * 0.1; else tmp = a * (1.0 + (k * -10.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.8e-8], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], N[(a * N[(1.0 + N[(k * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\end{array}
\end{array}
if m < -5.8000000000000003e-8Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.6%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.5%
if -5.8000000000000003e-8 < m Initial program 85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in m around 0 47.8%
Taylor expanded in k around 0 30.5%
*-commutative30.5%
Simplified30.5%
Taylor expanded in k around 0 29.9%
*-commutative29.9%
Simplified29.9%
Taylor expanded in a around 0 31.0%
*-commutative31.0%
Simplified31.0%
Final simplification28.4%
(FPCore (a k m) :precision binary64 (if (<= m -1.05e-5) (* (/ a k) 0.1) a))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.05e-5) {
tmp = (a / k) * 0.1;
} 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 (m <= (-1.05d-5)) then
tmp = (a / k) * 0.1d0
else
tmp = a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.05e-5) {
tmp = (a / k) * 0.1;
} else {
tmp = a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.05e-5: tmp = (a / k) * 0.1 else: tmp = a return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.05e-5) tmp = Float64(Float64(a / k) * 0.1); else tmp = a; end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.05e-5) tmp = (a / k) * 0.1; else tmp = a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.05e-5], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.05 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if m < -1.04999999999999994e-5Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 37.6%
Taylor expanded in k around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in k around inf 22.5%
if -1.04999999999999994e-5 < m Initial program 85.5%
associate-/l*85.5%
sqr-neg85.5%
associate-+l+85.5%
+-commutative85.5%
sqr-neg85.5%
distribute-rgt-out85.5%
fma-def85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in k around 0 75.0%
Taylor expanded in m around 0 28.0%
Final simplification26.3%
(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 89.9%
associate-/l*89.9%
sqr-neg89.9%
associate-+l+89.9%
+-commutative89.9%
sqr-neg89.9%
distribute-rgt-out89.9%
fma-def89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in k around 0 81.9%
Taylor expanded in m around 0 20.6%
Final simplification20.6%
herbie shell --seed 2024029
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))