
(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 (or (<= m -3e-10) (not (<= m 0.00023))) (/ a (pow k (- m))) (/ 1.0 (+ (* (/ k a) (+ k 10.0)) (/ 1.0 a)))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3e-10) || !(m <= 0.00023)) {
tmp = a / pow(k, -m);
} else {
tmp = 1.0 / (((k / a) * (k + 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 <= (-3d-10)) .or. (.not. (m <= 0.00023d0))) then
tmp = a / (k ** -m)
else
tmp = 1.0d0 / (((k / a) * (k + 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 <= -3e-10) || !(m <= 0.00023)) {
tmp = a / Math.pow(k, -m);
} else {
tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3e-10) or not (m <= 0.00023): tmp = a / math.pow(k, -m) else: tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3e-10) || !(m <= 0.00023)) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(1.0 / Float64(Float64(Float64(k / a) * Float64(k + 10.0)) + Float64(1.0 / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3e-10) || ~((m <= 0.00023))) tmp = a / (k ^ -m); else tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3e-10], N[Not[LessEqual[m, 0.00023]], $MachinePrecision]], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(k / a), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3 \cdot 10^{-10} \lor \neg \left(m \leq 0.00023\right):\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{k}{a} \cdot \left(k + 10\right) + \frac{1}{a}}\\
\end{array}
\end{array}
if m < -3e-10 or 2.3000000000000001e-4 < m Initial program 89.9%
associate-/l*89.9%
sqr-neg89.9%
associate-+l+89.9%
+-commutative89.9%
sqr-neg89.9%
distribute-rgt-out90.5%
fma-def90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 56.8%
mul-1-neg56.8%
log-rec56.8%
distribute-rgt-neg-in56.8%
remove-double-neg56.8%
*-rgt-identity56.8%
exp-neg56.8%
distribute-lft-neg-out56.8%
neg-mul-156.8%
*-rgt-identity56.8%
neg-mul-156.8%
distribute-lft-neg-in56.8%
*-commutative56.8%
exp-to-pow100.0%
Simplified100.0%
if -3e-10 < m < 2.3000000000000001e-4Initial program 88.7%
associate-*l/88.7%
sqr-neg88.7%
associate-+l+88.7%
sqr-neg88.7%
distribute-rgt-out88.7%
Simplified88.7%
+-commutative88.7%
+-commutative88.7%
fma-udef88.7%
associate-/r/88.7%
clear-num88.7%
frac-2neg88.7%
metadata-eval88.7%
Applied egg-rr88.7%
associate-/l/88.7%
distribute-neg-frac88.7%
neg-sub088.7%
metadata-eval88.7%
fma-udef88.7%
+-commutative88.7%
associate--r+88.7%
metadata-eval88.7%
metadata-eval88.7%
Simplified88.7%
div-sub88.6%
sub-neg88.6%
times-frac99.5%
Applied egg-rr99.5%
sub-neg99.5%
Simplified99.5%
Taylor expanded in m around 0 88.6%
+-commutative88.6%
+-commutative88.6%
associate-*l/98.6%
+-commutative98.6%
Simplified98.6%
Final simplification99.5%
(FPCore (a k m) :precision binary64 (if (<= k 2e-55) (/ 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 <= 2e-55) {
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 <= 2d-55) 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 <= 2e-55) {
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 <= 2e-55: 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 <= 2e-55) 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 <= 2e-55) 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, 2e-55], 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 2 \cdot 10^{-55}:\\
\;\;\;\;\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.99999999999999999e-55Initial program 95.2%
associate-/l*95.3%
sqr-neg95.3%
associate-+l+95.3%
+-commutative95.3%
sqr-neg95.3%
distribute-rgt-out95.9%
fma-def95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in k around 0 100.0%
Taylor expanded in k around inf 50.7%
mul-1-neg50.7%
log-rec50.7%
distribute-rgt-neg-in50.7%
remove-double-neg50.7%
*-rgt-identity50.7%
exp-neg50.7%
distribute-lft-neg-out50.7%
neg-mul-150.7%
*-rgt-identity50.7%
neg-mul-150.7%
distribute-lft-neg-in50.7%
*-commutative50.7%
exp-to-pow100.0%
Simplified100.0%
if 1.99999999999999999e-55 < k Initial program 81.7%
associate-*l/80.7%
sqr-neg80.7%
associate-+l+80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
Simplified80.7%
+-commutative80.7%
+-commutative80.7%
fma-udef80.7%
associate-/r/81.7%
clear-num81.7%
frac-2neg81.7%
metadata-eval81.7%
Applied egg-rr81.7%
associate-/l/81.7%
distribute-neg-frac81.7%
neg-sub081.7%
metadata-eval81.7%
fma-udef81.7%
+-commutative81.7%
associate--r+81.7%
metadata-eval81.7%
metadata-eval81.7%
Simplified81.7%
div-sub81.7%
sub-neg81.7%
times-frac96.9%
Applied egg-rr96.9%
sub-neg96.9%
Simplified96.9%
Final simplification98.7%
(FPCore (a k m) :precision binary64 (if (or (<= m -3e-10) (not (<= m 3.7e-7))) (* a (pow k m)) (/ 1.0 (+ (* (/ k a) (+ k 10.0)) (/ 1.0 a)))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -3e-10) || !(m <= 3.7e-7)) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / (((k / a) * (k + 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 <= (-3d-10)) .or. (.not. (m <= 3.7d-7))) then
tmp = a * (k ** m)
else
tmp = 1.0d0 / (((k / a) * (k + 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 <= -3e-10) || !(m <= 3.7e-7)) {
tmp = a * Math.pow(k, m);
} else {
tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -3e-10) or not (m <= 3.7e-7): tmp = a * math.pow(k, m) else: tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -3e-10) || !(m <= 3.7e-7)) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / Float64(Float64(Float64(k / a) * Float64(k + 10.0)) + Float64(1.0 / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -3e-10) || ~((m <= 3.7e-7))) tmp = a * (k ^ m); else tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -3e-10], N[Not[LessEqual[m, 3.7e-7]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(k / a), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3 \cdot 10^{-10} \lor \neg \left(m \leq 3.7 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{k}{a} \cdot \left(k + 10\right) + \frac{1}{a}}\\
\end{array}
\end{array}
if m < -3e-10 or 3.70000000000000004e-7 < m Initial program 89.9%
associate-*l/88.7%
sqr-neg88.7%
associate-+l+88.7%
sqr-neg88.7%
distribute-rgt-out89.3%
Simplified89.3%
Taylor expanded in k around 0 100.0%
if -3e-10 < m < 3.70000000000000004e-7Initial program 88.7%
associate-*l/88.7%
sqr-neg88.7%
associate-+l+88.7%
sqr-neg88.7%
distribute-rgt-out88.7%
Simplified88.7%
+-commutative88.7%
+-commutative88.7%
fma-udef88.7%
associate-/r/88.7%
clear-num88.7%
frac-2neg88.7%
metadata-eval88.7%
Applied egg-rr88.7%
associate-/l/88.7%
distribute-neg-frac88.7%
neg-sub088.7%
metadata-eval88.7%
fma-udef88.7%
+-commutative88.7%
associate--r+88.7%
metadata-eval88.7%
metadata-eval88.7%
Simplified88.7%
div-sub88.6%
sub-neg88.6%
times-frac99.5%
Applied egg-rr99.5%
sub-neg99.5%
Simplified99.5%
Taylor expanded in m around 0 88.6%
+-commutative88.6%
+-commutative88.6%
associate-*l/98.6%
+-commutative98.6%
Simplified98.6%
Final simplification99.5%
(FPCore (a k m)
:precision binary64
(if (<= m -3.4e+157)
(/ a (+ 1.0 (* k (+ k 10.0))))
(if (<= m -8e+14)
(* (+ 1.0 (/ -10.0 k)) (* (/ 1.0 k) (/ a k)))
(if (<= m 0.007)
(/ 1.0 (+ (* (/ k a) (+ k 10.0)) (/ 1.0 a)))
(* a (+ 1.0 (* k (+ -10.0 (* k 99.0)))))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.4e+157) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= -8e+14) {
tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k));
} else if (m <= 0.007) {
tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a));
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-3.4d+157)) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else if (m <= (-8d+14)) then
tmp = (1.0d0 + ((-10.0d0) / k)) * ((1.0d0 / k) * (a / k))
else if (m <= 0.007d0) then
tmp = 1.0d0 / (((k / a) * (k + 10.0d0)) + (1.0d0 / a))
else
tmp = a * (1.0d0 + (k * ((-10.0d0) + (k * 99.0d0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3.4e+157) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else if (m <= -8e+14) {
tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k));
} else if (m <= 0.007) {
tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a));
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.4e+157: tmp = a / (1.0 + (k * (k + 10.0))) elif m <= -8e+14: tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k)) elif m <= 0.007: tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)) else: tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.4e+157) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); elseif (m <= -8e+14) tmp = Float64(Float64(1.0 + Float64(-10.0 / k)) * Float64(Float64(1.0 / k) * Float64(a / k))); elseif (m <= 0.007) tmp = Float64(1.0 / Float64(Float64(Float64(k / a) * Float64(k + 10.0)) + Float64(1.0 / a))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(-10.0 + Float64(k * 99.0))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.4e+157) tmp = a / (1.0 + (k * (k + 10.0))); elseif (m <= -8e+14) tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k)); elseif (m <= 0.007) tmp = 1.0 / (((k / a) * (k + 10.0)) + (1.0 / a)); else tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.4e+157], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -8e+14], N[(N[(1.0 + N[(-10.0 / k), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.007], N[(1.0 / N[(N[(N[(k / a), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(-10.0 + N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.4 \cdot 10^{+157}:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{elif}\;m \leq -8 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \frac{-10}{k}\right) \cdot \left(\frac{1}{k} \cdot \frac{a}{k}\right)\\
\mathbf{elif}\;m \leq 0.007:\\
\;\;\;\;\frac{1}{\frac{k}{a} \cdot \left(k + 10\right) + \frac{1}{a}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(-10 + k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < -3.39999999999999979e157Initial 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 47.6%
if -3.39999999999999979e157 < m < -8e14Initial program 97.4%
associate-/l*97.4%
sqr-neg97.4%
associate-+l+97.4%
+-commutative97.4%
sqr-neg97.4%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
clear-num100.0%
associate-/r/100.0%
clear-num100.0%
remove-double-div100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 29.4%
Taylor expanded in k around inf 63.7%
associate-*r/63.7%
cube-mult63.7%
unpow263.7%
times-frac63.7%
distribute-lft1-in63.7%
Simplified63.7%
*-un-lft-identity63.7%
unpow263.7%
times-frac61.2%
Applied egg-rr61.2%
if -8e14 < m < 0.00700000000000000015Initial program 89.4%
associate-*l/89.4%
sqr-neg89.4%
associate-+l+89.4%
sqr-neg89.4%
distribute-rgt-out89.4%
Simplified89.4%
+-commutative89.4%
+-commutative89.4%
fma-udef89.4%
associate-/r/89.4%
clear-num89.4%
frac-2neg89.4%
metadata-eval89.4%
Applied egg-rr89.4%
associate-/l/89.4%
distribute-neg-frac89.4%
neg-sub089.4%
metadata-eval89.4%
fma-udef89.4%
+-commutative89.4%
associate--r+89.4%
metadata-eval89.4%
metadata-eval89.4%
Simplified89.4%
div-sub89.3%
sub-neg89.3%
times-frac99.5%
Applied egg-rr99.5%
sub-neg99.5%
Simplified99.5%
Taylor expanded in m around 0 85.3%
+-commutative85.3%
+-commutative85.3%
associate-*l/93.6%
+-commutative93.6%
Simplified93.6%
if 0.00700000000000000015 < m Initial program 80.7%
associate-/l*80.7%
sqr-neg80.7%
associate-+l+80.7%
+-commutative80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
fma-def80.7%
+-commutative80.7%
Simplified80.7%
clear-num80.7%
associate-/r/80.7%
clear-num80.7%
remove-double-div80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
*-commutative29.7%
unpow229.7%
associate-*l*29.7%
distribute-lft-out29.7%
Simplified29.7%
Final simplification60.5%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (+ 1.0 (* k (+ k 10.0))))))
(if (<= m -4.8e+157)
t_0
(if (<= m -1.82e+15)
(* (+ 1.0 (/ -10.0 k)) (* (/ 1.0 k) (/ a k)))
(if (<= m 0.007) t_0 (* a (+ 1.0 (* k (+ -10.0 (* k 99.0))))))))))
double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * (k + 10.0)));
double tmp;
if (m <= -4.8e+157) {
tmp = t_0;
} else if (m <= -1.82e+15) {
tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k));
} else if (m <= 0.007) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = a / (1.0d0 + (k * (k + 10.0d0)))
if (m <= (-4.8d+157)) then
tmp = t_0
else if (m <= (-1.82d+15)) then
tmp = (1.0d0 + ((-10.0d0) / k)) * ((1.0d0 / k) * (a / k))
else if (m <= 0.007d0) then
tmp = t_0
else
tmp = a * (1.0d0 + (k * ((-10.0d0) + (k * 99.0d0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a / (1.0 + (k * (k + 10.0)));
double tmp;
if (m <= -4.8e+157) {
tmp = t_0;
} else if (m <= -1.82e+15) {
tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k));
} else if (m <= 0.007) {
tmp = t_0;
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
def code(a, k, m): t_0 = a / (1.0 + (k * (k + 10.0))) tmp = 0 if m <= -4.8e+157: tmp = t_0 elif m <= -1.82e+15: tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k)) elif m <= 0.007: tmp = t_0 else: tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))) return tmp
function code(a, k, m) t_0 = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))) tmp = 0.0 if (m <= -4.8e+157) tmp = t_0; elseif (m <= -1.82e+15) tmp = Float64(Float64(1.0 + Float64(-10.0 / k)) * Float64(Float64(1.0 / k) * Float64(a / k))); elseif (m <= 0.007) tmp = t_0; else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(-10.0 + Float64(k * 99.0))))); end return tmp end
function tmp_2 = code(a, k, m) t_0 = a / (1.0 + (k * (k + 10.0))); tmp = 0.0; if (m <= -4.8e+157) tmp = t_0; elseif (m <= -1.82e+15) tmp = (1.0 + (-10.0 / k)) * ((1.0 / k) * (a / k)); elseif (m <= 0.007) tmp = t_0; else tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -4.8e+157], t$95$0, If[LessEqual[m, -1.82e+15], N[(N[(1.0 + N[(-10.0 / k), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.007], t$95$0, N[(a * N[(1.0 + N[(k * N[(-10.0 + N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{if}\;m \leq -4.8 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq -1.82 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \frac{-10}{k}\right) \cdot \left(\frac{1}{k} \cdot \frac{a}{k}\right)\\
\mathbf{elif}\;m \leq 0.007:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(-10 + k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < -4.7999999999999999e157 or -1.82e15 < m < 0.00700000000000000015Initial program 92.7%
associate-*l/92.7%
sqr-neg92.7%
associate-+l+92.7%
sqr-neg92.7%
distribute-rgt-out92.7%
Simplified92.7%
Taylor expanded in m around 0 73.7%
if -4.7999999999999999e157 < m < -1.82e15Initial program 97.4%
associate-/l*97.4%
sqr-neg97.4%
associate-+l+97.4%
+-commutative97.4%
sqr-neg97.4%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
clear-num100.0%
associate-/r/100.0%
clear-num100.0%
remove-double-div100.0%
Applied egg-rr100.0%
Taylor expanded in m around 0 29.4%
Taylor expanded in k around inf 63.7%
associate-*r/63.7%
cube-mult63.7%
unpow263.7%
times-frac63.7%
distribute-lft1-in63.7%
Simplified63.7%
*-un-lft-identity63.7%
unpow263.7%
times-frac61.2%
Applied egg-rr61.2%
if 0.00700000000000000015 < m Initial program 80.7%
associate-/l*80.7%
sqr-neg80.7%
associate-+l+80.7%
+-commutative80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
fma-def80.7%
+-commutative80.7%
Simplified80.7%
clear-num80.7%
associate-/r/80.7%
clear-num80.7%
remove-double-div80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
*-commutative29.7%
unpow229.7%
associate-*l*29.7%
distribute-lft-out29.7%
Simplified29.7%
Final simplification57.5%
(FPCore (a k m) :precision binary64 (if (<= m -3.6e+26) (* (/ a k) 0.1) (if (<= m 0.39) (* a (+ 1.0 (* k -10.0))) (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 0.39) {
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 <= (-3.6d+26)) then
tmp = (a / k) * 0.1d0
else if (m <= 0.39d0) 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 <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 0.39) {
tmp = a * (1.0 + (k * -10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.6e+26: tmp = (a / k) * 0.1 elif m <= 0.39: 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 <= -3.6e+26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 0.39) 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 <= -3.6e+26) tmp = (a / k) * 0.1; elseif (m <= 0.39) 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, -3.6e+26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 0.39], 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 -3.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 0.39:\\
\;\;\;\;a \cdot \left(1 + k \cdot -10\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -3.60000000000000024e26Initial program 98.7%
associate-*l/98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 22.7%
*-commutative22.7%
Simplified22.7%
Taylor expanded in k around inf 30.5%
if -3.60000000000000024e26 < m < 0.39000000000000001Initial program 89.7%
associate-/l*89.8%
sqr-neg89.8%
associate-+l+89.8%
+-commutative89.8%
sqr-neg89.8%
distribute-rgt-out89.8%
fma-def89.8%
+-commutative89.8%
Simplified89.8%
clear-num89.7%
associate-/r/89.7%
clear-num89.7%
remove-double-div89.7%
Applied egg-rr89.7%
Taylor expanded in m around 0 82.9%
Taylor expanded in k around 0 41.3%
if 0.39000000000000001 < m Initial program 80.5%
associate-/l*80.5%
sqr-neg80.5%
associate-+l+80.5%
+-commutative80.5%
sqr-neg80.5%
distribute-rgt-out80.5%
fma-def80.5%
+-commutative80.5%
Simplified80.5%
clear-num80.5%
associate-/r/80.5%
clear-num80.5%
remove-double-div80.5%
Applied egg-rr80.5%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 7.7%
Taylor expanded in k around inf 21.8%
*-commutative21.8%
Simplified21.8%
Final simplification31.8%
(FPCore (a k m) :precision binary64 (if (<= m -3.6e+26) (* (/ a k) 0.1) (if (<= m 62000000000000.0) (/ a (+ 1.0 (* k 10.0))) (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 62000000000000.0) {
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 <= (-3.6d+26)) then
tmp = (a / k) * 0.1d0
else if (m <= 62000000000000.0d0) 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 <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 62000000000000.0) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.6e+26: tmp = (a / k) * 0.1 elif m <= 62000000000000.0: 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 <= -3.6e+26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 62000000000000.0) 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 <= -3.6e+26) tmp = (a / k) * 0.1; elseif (m <= 62000000000000.0) 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, -3.6e+26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 62000000000000.0], 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 -3.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 62000000000000:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -3.60000000000000024e26Initial program 98.7%
associate-*l/98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 22.7%
*-commutative22.7%
Simplified22.7%
Taylor expanded in k around inf 30.5%
if -3.60000000000000024e26 < m < 6.2e13Initial program 87.9%
associate-*l/87.9%
sqr-neg87.9%
associate-+l+87.9%
sqr-neg87.9%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in m around 0 81.3%
Taylor expanded in k around 0 52.3%
*-commutative52.3%
Simplified52.3%
if 6.2e13 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 22.3%
*-commutative22.3%
Simplified22.3%
Final simplification36.3%
(FPCore (a k m) :precision binary64 (if (<= m 0.007) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (+ 1.0 (* k (+ -10.0 (* k 99.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.007) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 0.007d0) then
tmp = a / (1.0d0 + (k * (k + 10.0d0)))
else
tmp = a * (1.0d0 + (k * ((-10.0d0) + (k * 99.0d0))))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.007) {
tmp = a / (1.0 + (k * (k + 10.0)));
} else {
tmp = a * (1.0 + (k * (-10.0 + (k * 99.0))));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.007: tmp = a / (1.0 + (k * (k + 10.0))) else: tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.007) tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0)))); else tmp = Float64(a * Float64(1.0 + Float64(k * Float64(-10.0 + Float64(k * 99.0))))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.007) tmp = a / (1.0 + (k * (k + 10.0))); else tmp = a * (1.0 + (k * (-10.0 + (k * 99.0)))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.007], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(1.0 + N[(k * N[(-10.0 + N[(k * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.007:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 + k \cdot \left(-10 + k \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 0.00700000000000000015Initial program 93.7%
associate-*l/93.7%
sqr-neg93.7%
associate-+l+93.7%
sqr-neg93.7%
distribute-rgt-out94.3%
Simplified94.3%
Taylor expanded in m around 0 63.9%
if 0.00700000000000000015 < m Initial program 80.7%
associate-/l*80.7%
sqr-neg80.7%
associate-+l+80.7%
+-commutative80.7%
sqr-neg80.7%
distribute-rgt-out80.7%
fma-def80.7%
+-commutative80.7%
Simplified80.7%
clear-num80.7%
associate-/r/80.7%
clear-num80.7%
remove-double-div80.7%
Applied egg-rr80.7%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 29.7%
*-commutative29.7%
*-commutative29.7%
unpow229.7%
associate-*l*29.7%
distribute-lft-out29.7%
Simplified29.7%
Final simplification52.8%
(FPCore (a k m) :precision binary64 (if (<= m -5.2e+26) (* (/ a k) 0.1) (if (<= m 780000000.0) a (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -5.2e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 780000000.0) {
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 <= (-5.2d+26)) then
tmp = (a / k) * 0.1d0
else if (m <= 780000000.0d0) 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 <= -5.2e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 780000000.0) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -5.2e+26: tmp = (a / k) * 0.1 elif m <= 780000000.0: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -5.2e+26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 780000000.0) 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 <= -5.2e+26) tmp = (a / k) * 0.1; elseif (m <= 780000000.0) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -5.2e+26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 780000000.0], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -5.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 780000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -5.20000000000000004e26Initial program 98.7%
associate-*l/98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 22.7%
*-commutative22.7%
Simplified22.7%
Taylor expanded in k around inf 30.5%
if -5.20000000000000004e26 < m < 7.8e8Initial program 87.9%
associate-*l/87.9%
sqr-neg87.9%
associate-+l+87.9%
sqr-neg87.9%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in m around 0 81.3%
Taylor expanded in k around 0 40.5%
if 7.8e8 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 21.1%
*-commutative21.1%
Simplified21.1%
Final simplification31.4%
(FPCore (a k m) :precision binary64 (if (<= m -3.6e+26) (* (/ a k) 0.1) (if (<= m 6800000.0) a (* k (* a -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 6800000.0) {
tmp = a;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= (-3.6d+26)) then
tmp = (a / k) * 0.1d0
else if (m <= 6800000.0d0) then
tmp = a
else
tmp = k * (a * (-10.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 6800000.0) {
tmp = a;
} else {
tmp = k * (a * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.6e+26: tmp = (a / k) * 0.1 elif m <= 6800000.0: tmp = a else: tmp = k * (a * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.6e+26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 6800000.0) tmp = a; else tmp = Float64(k * Float64(a * -10.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.6e+26) tmp = (a / k) * 0.1; elseif (m <= 6800000.0) tmp = a; else tmp = k * (a * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.6e+26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 6800000.0], a, N[(k * N[(a * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 6800000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(a \cdot -10\right)\\
\end{array}
\end{array}
if m < -3.60000000000000024e26Initial program 98.7%
associate-*l/98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 22.7%
*-commutative22.7%
Simplified22.7%
Taylor expanded in k around inf 30.5%
if -3.60000000000000024e26 < m < 6.8e6Initial program 87.9%
associate-*l/87.9%
sqr-neg87.9%
associate-+l+87.9%
sqr-neg87.9%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in m around 0 81.3%
Taylor expanded in k around 0 40.5%
if 6.8e6 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 21.1%
*-commutative21.1%
associate-*r*22.3%
*-commutative22.3%
associate-*l*21.1%
Simplified21.1%
Final simplification31.4%
(FPCore (a k m) :precision binary64 (if (<= m -3.6e+26) (* (/ a k) 0.1) (if (<= m 360000000.0) a (* a (* k -10.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 360000000.0) {
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 <= (-3.6d+26)) then
tmp = (a / k) * 0.1d0
else if (m <= 360000000.0d0) 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 <= -3.6e+26) {
tmp = (a / k) * 0.1;
} else if (m <= 360000000.0) {
tmp = a;
} else {
tmp = a * (k * -10.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.6e+26: tmp = (a / k) * 0.1 elif m <= 360000000.0: tmp = a else: tmp = a * (k * -10.0) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.6e+26) tmp = Float64(Float64(a / k) * 0.1); elseif (m <= 360000000.0) 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 <= -3.6e+26) tmp = (a / k) * 0.1; elseif (m <= 360000000.0) tmp = a; else tmp = a * (k * -10.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.6e+26], N[(N[(a / k), $MachinePrecision] * 0.1), $MachinePrecision], If[LessEqual[m, 360000000.0], a, N[(a * N[(k * -10.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k} \cdot 0.1\\
\mathbf{elif}\;m \leq 360000000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < -3.60000000000000024e26Initial program 98.7%
associate-*l/98.7%
sqr-neg98.7%
associate-+l+98.7%
sqr-neg98.7%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in m around 0 39.9%
Taylor expanded in k around 0 22.7%
*-commutative22.7%
Simplified22.7%
Taylor expanded in k around inf 30.5%
if -3.60000000000000024e26 < m < 3.6e8Initial program 87.9%
associate-*l/87.9%
sqr-neg87.9%
associate-+l+87.9%
sqr-neg87.9%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in m around 0 81.3%
Taylor expanded in k around 0 40.5%
if 3.6e8 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 22.3%
*-commutative22.3%
Simplified22.3%
Final simplification31.7%
(FPCore (a k m) :precision binary64 (if (<= m 450000000.0) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* k -10.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= 450000000.0) {
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 <= 450000000.0d0) 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 <= 450000000.0) {
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 <= 450000000.0: 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 <= 450000000.0) 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 <= 450000000.0) 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, 450000000.0], 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 450000000:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot -10\right)\\
\end{array}
\end{array}
if m < 4.5e8Initial program 92.7%
associate-*l/92.7%
sqr-neg92.7%
associate-+l+92.7%
sqr-neg92.7%
distribute-rgt-out93.3%
Simplified93.3%
Taylor expanded in m around 0 63.0%
if 4.5e8 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 22.3%
*-commutative22.3%
Simplified22.3%
Final simplification50.3%
(FPCore (a k m) :precision binary64 (if (<= m 6800000.0) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 6800000.0) {
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 <= 6800000.0d0) 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 <= 6800000.0) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 6800000.0: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 6800000.0) 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 <= 6800000.0) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 6800000.0], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 6800000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 6.8e6Initial program 92.7%
associate-*l/92.7%
sqr-neg92.7%
associate-+l+92.7%
sqr-neg92.7%
distribute-rgt-out93.3%
Simplified93.3%
Taylor expanded in m around 0 63.0%
Taylor expanded in k around 0 24.4%
if 6.8e6 < m Initial program 82.5%
associate-/l*82.5%
sqr-neg82.5%
associate-+l+82.5%
+-commutative82.5%
sqr-neg82.5%
distribute-rgt-out82.5%
fma-def82.5%
+-commutative82.5%
Simplified82.5%
clear-num82.5%
associate-/r/82.5%
clear-num82.5%
remove-double-div82.5%
Applied egg-rr82.5%
Taylor expanded in m around 0 3.2%
Taylor expanded in k around 0 7.9%
Taylor expanded in k around inf 21.1%
*-commutative21.1%
Simplified21.1%
Final simplification23.4%
(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.5%
associate-*l/88.7%
sqr-neg88.7%
associate-+l+88.7%
sqr-neg88.7%
distribute-rgt-out89.1%
Simplified89.1%
Taylor expanded in m around 0 44.3%
Taylor expanded in k around 0 18.0%
Final simplification18.0%
herbie shell --seed 2024020
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))