
(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 (<= k -2.6e+160)
(* a (pow k m))
(if (<= k 1.05e+18)
(* a (/ (pow k m) (+ (* k (+ k 10.0)) 1.0)))
(/ (/ (pow k m) k) (/ k a)))))
double code(double a, double k, double m) {
double tmp;
if (k <= -2.6e+160) {
tmp = a * pow(k, m);
} else if (k <= 1.05e+18) {
tmp = a * (pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else {
tmp = (pow(k, m) / k) / (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 (k <= (-2.6d+160)) then
tmp = a * (k ** m)
else if (k <= 1.05d+18) then
tmp = a * ((k ** m) / ((k * (k + 10.0d0)) + 1.0d0))
else
tmp = ((k ** m) / k) / (k / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -2.6e+160) {
tmp = a * Math.pow(k, m);
} else if (k <= 1.05e+18) {
tmp = a * (Math.pow(k, m) / ((k * (k + 10.0)) + 1.0));
} else {
tmp = (Math.pow(k, m) / k) / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -2.6e+160: tmp = a * math.pow(k, m) elif k <= 1.05e+18: tmp = a * (math.pow(k, m) / ((k * (k + 10.0)) + 1.0)) else: tmp = (math.pow(k, m) / k) / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -2.6e+160) tmp = Float64(a * (k ^ m)); elseif (k <= 1.05e+18) tmp = Float64(a * Float64((k ^ m) / Float64(Float64(k * Float64(k + 10.0)) + 1.0))); else tmp = Float64(Float64((k ^ m) / k) / Float64(k / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -2.6e+160) tmp = a * (k ^ m); elseif (k <= 1.05e+18) tmp = a * ((k ^ m) / ((k * (k + 10.0)) + 1.0)); else tmp = ((k ^ m) / k) / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -2.6e+160], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.05e+18], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] / N[(k / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -2.6 \cdot 10^{+160}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{elif}\;k \leq 1.05 \cdot 10^{+18}:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{k}^{m}}{k}}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < -2.6e160Initial program 33.3%
associate-*r/33.3%
associate-+l+33.3%
+-commutative33.3%
distribute-rgt-out33.3%
fma-def33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in k around 0 0.0%
exp-to-pow100.0%
Simplified100.0%
if -2.6e160 < k < 1.05e18Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
if 1.05e18 < k Initial program 81.7%
associate-*r/81.7%
associate-+l+81.7%
+-commutative81.7%
distribute-rgt-out81.7%
fma-def81.7%
+-commutative81.7%
Simplified81.7%
Taylor expanded in k around inf 81.7%
*-commutative81.7%
unpow281.7%
associate-/l*79.1%
mul-1-neg79.1%
distribute-rgt-neg-in79.1%
log-rec79.1%
associate-/l*88.5%
Simplified88.5%
add-sqr-sqrt88.5%
associate-/r/88.5%
times-frac98.6%
Applied egg-rr98.6%
associate-*l/98.6%
associate-*r/98.6%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
Final simplification99.6%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* a (pow k m)) (/ (/ (pow k m) k) (/ k a))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = a * pow(k, m);
} else {
tmp = (pow(k, m) / k) / (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 (k <= 1.0d0) then
tmp = a * (k ** m)
else
tmp = ((k ** m) / k) / (k / a)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = a * Math.pow(k, m);
} else {
tmp = (Math.pow(k, m) / k) / (k / a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = a * math.pow(k, m) else: tmp = (math.pow(k, m) / k) / (k / a) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64(a * (k ^ m)); else tmp = Float64(Float64((k ^ m) / k) / Float64(k / a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = a * (k ^ m); else tmp = ((k ^ m) / k) / (k / a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] / N[(k / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{k}^{m}}{k}}{\frac{k}{a}}\\
\end{array}
\end{array}
if k < 1Initial program 94.1%
associate-*r/94.1%
associate-+l+94.1%
+-commutative94.1%
distribute-rgt-out94.1%
fma-def94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in k around 0 53.4%
exp-to-pow99.6%
Simplified99.6%
if 1 < k Initial program 83.2%
associate-*r/83.2%
associate-+l+83.2%
+-commutative83.2%
distribute-rgt-out83.2%
fma-def83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in k around inf 78.9%
*-commutative78.9%
unpow278.9%
associate-/l*76.5%
mul-1-neg76.5%
distribute-rgt-neg-in76.5%
log-rec76.5%
associate-/l*85.1%
Simplified85.1%
add-sqr-sqrt85.1%
associate-/r/85.1%
times-frac94.4%
Applied egg-rr94.4%
associate-*l/94.4%
associate-*r/94.4%
add-sqr-sqrt94.4%
Applied egg-rr94.4%
Final simplification97.8%
(FPCore (a k m) :precision binary64 (if (or (<= m -7.6e-7) (not (<= m 3e-16))) (* a (pow k m)) (/ a (+ (* k (+ k 10.0)) 1.0))))
double code(double a, double k, double m) {
double tmp;
if ((m <= -7.6e-7) || !(m <= 3e-16)) {
tmp = a * pow(k, m);
} else {
tmp = a / ((k * (k + 10.0)) + 1.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 <= (-7.6d-7)) .or. (.not. (m <= 3d-16))) then
tmp = a * (k ** m)
else
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if ((m <= -7.6e-7) || !(m <= 3e-16)) {
tmp = a * Math.pow(k, m);
} else {
tmp = a / ((k * (k + 10.0)) + 1.0);
}
return tmp;
}
def code(a, k, m): tmp = 0 if (m <= -7.6e-7) or not (m <= 3e-16): tmp = a * math.pow(k, m) else: tmp = a / ((k * (k + 10.0)) + 1.0) return tmp
function code(a, k, m) tmp = 0.0 if ((m <= -7.6e-7) || !(m <= 3e-16)) tmp = Float64(a * (k ^ m)); else tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if ((m <= -7.6e-7) || ~((m <= 3e-16))) tmp = a * (k ^ m); else tmp = a / ((k * (k + 10.0)) + 1.0); end tmp_2 = tmp; end
code[a_, k_, m_] := If[Or[LessEqual[m, -7.6e-7], N[Not[LessEqual[m, 3e-16]], $MachinePrecision]], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7.6 \cdot 10^{-7} \lor \neg \left(m \leq 3 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\end{array}
\end{array}
if m < -7.60000000000000029e-7 or 2.99999999999999994e-16 < m Initial program 88.2%
associate-*r/88.2%
associate-+l+88.2%
+-commutative88.2%
distribute-rgt-out88.2%
fma-def88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in k around 0 47.9%
exp-to-pow98.9%
Simplified98.9%
if -7.60000000000000029e-7 < m < 2.99999999999999994e-16Initial program 93.5%
associate-*r/93.5%
associate-+l+93.5%
+-commutative93.5%
distribute-rgt-out93.5%
fma-def93.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in m around 0 93.0%
Final simplification96.5%
(FPCore (a k m)
:precision binary64
(if (<= m -3.7e+20)
(* a (/ 1.0 (* k k)))
(if (<= m 4.2e-5)
(/ a (+ (* k (+ k 10.0)) 1.0))
(+ a (* a (* k (- (* k 100.0) 10.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 4.2e-5) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (a * (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 <= (-3.7d+20)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 4.2d-5) then
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
else
tmp = a + (a * (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 <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 4.2e-5) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = a + (a * (k * ((k * 100.0) - 10.0)));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.7e+20: tmp = a * (1.0 / (k * k)) elif m <= 4.2e-5: tmp = a / ((k * (k + 10.0)) + 1.0) else: tmp = a + (a * (k * ((k * 100.0) - 10.0))) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.7e+20) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 4.2e-5) tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(a + Float64(a * 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 <= -3.7e+20) tmp = a * (1.0 / (k * k)); elseif (m <= 4.2e-5) tmp = a / ((k * (k + 10.0)) + 1.0); else tmp = a + (a * (k * ((k * 100.0) - 10.0))); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.7e+20], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.2e-5], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a + N[(a * N[(k * N[(N[(k * 100.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 4.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;a + a \cdot \left(k \cdot \left(k \cdot 100 - 10\right)\right)\\
\end{array}
\end{array}
if m < -3.7e20Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.9%
Taylor expanded in k around inf 61.2%
unpow261.2%
Simplified61.2%
if -3.7e20 < m < 4.19999999999999977e-5Initial program 94.0%
associate-*r/94.0%
associate-+l+94.0%
+-commutative94.0%
distribute-rgt-out94.0%
fma-def94.0%
+-commutative94.0%
Simplified94.0%
Taylor expanded in m around 0 88.5%
if 4.19999999999999977e-5 < m Initial program 79.5%
associate-*r/79.5%
associate-+l+79.5%
+-commutative79.5%
distribute-rgt-out79.5%
fma-def79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in m around 0 3.3%
Taylor expanded in k around 0 3.1%
*-commutative3.1%
Simplified3.1%
Taylor expanded in k around 0 26.8%
+-commutative26.8%
unpow226.8%
associate-*r*26.8%
*-commutative26.8%
associate-*r*26.8%
metadata-eval26.8%
distribute-lft-neg-in26.8%
*-commutative26.8%
distribute-rgt-out31.3%
sub-neg31.3%
associate-*l*31.3%
distribute-lft-out--32.4%
Simplified32.4%
Final simplification63.2%
(FPCore (a k m)
:precision binary64
(if (<= k -8.5e-171)
(* a (/ 1.0 (* k k)))
(if (<= k 1.1e-308)
(* -10.0 (* k a))
(if (<= k 1.0) a (/ 1.0 (* k (/ k a)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -8.5e-171) {
tmp = a * (1.0 / (k * k));
} else if (k <= 1.1e-308) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = 1.0 / (k * (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 (k <= (-8.5d-171)) then
tmp = a * (1.0d0 / (k * k))
else if (k <= 1.1d-308) then
tmp = (-10.0d0) * (k * a)
else if (k <= 1.0d0) then
tmp = a
else
tmp = 1.0d0 / (k * (k / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -8.5e-171) {
tmp = a * (1.0 / (k * k));
} else if (k <= 1.1e-308) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -8.5e-171: tmp = a * (1.0 / (k * k)) elif k <= 1.1e-308: tmp = -10.0 * (k * a) elif k <= 1.0: tmp = a else: tmp = 1.0 / (k * (k / a)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -8.5e-171) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (k <= 1.1e-308) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 1.0) tmp = a; else tmp = Float64(1.0 / Float64(k * Float64(k / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -8.5e-171) tmp = a * (1.0 / (k * k)); elseif (k <= 1.1e-308) tmp = -10.0 * (k * a); elseif (k <= 1.0) tmp = a; else tmp = 1.0 / (k * (k / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -8.5e-171], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.1e-308], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], a, N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -8.5 \cdot 10^{-171}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;k \leq 1.1 \cdot 10^{-308}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\end{array}
\end{array}
if k < -8.50000000000000032e-171Initial program 84.4%
associate-*r/84.4%
associate-+l+84.4%
+-commutative84.4%
distribute-rgt-out84.4%
fma-def84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in m around 0 15.2%
Taylor expanded in k around inf 19.5%
unpow219.5%
Simplified19.5%
if -8.50000000000000032e-171 < k < 1.1000000000000001e-308Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.3%
Taylor expanded in k around 0 4.3%
Taylor expanded in k around inf 51.8%
if 1.1000000000000001e-308 < k < 1Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around 0 63.4%
if 1 < k Initial program 83.2%
associate-*r/83.2%
associate-+l+83.2%
+-commutative83.2%
distribute-rgt-out83.2%
fma-def83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in m around 0 64.9%
Taylor expanded in k around inf 60.6%
unpow260.6%
Simplified60.6%
un-div-inv60.6%
clear-num60.8%
associate-*l/65.1%
*-commutative65.1%
Applied egg-rr65.1%
Final simplification52.4%
(FPCore (a k m)
:precision binary64
(if (<= k -2.1e-172)
(* a (/ 1.0 (* k k)))
(if (<= k 1.1e-308)
(* -10.0 (* k a))
(if (<= k 10.2) (/ a (+ 1.0 (* k 10.0))) (/ 1.0 (* k (/ k a)))))))
double code(double a, double k, double m) {
double tmp;
if (k <= -2.1e-172) {
tmp = a * (1.0 / (k * k));
} else if (k <= 1.1e-308) {
tmp = -10.0 * (k * a);
} else if (k <= 10.2) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / (k * (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 (k <= (-2.1d-172)) then
tmp = a * (1.0d0 / (k * k))
else if (k <= 1.1d-308) then
tmp = (-10.0d0) * (k * a)
else if (k <= 10.2d0) then
tmp = a / (1.0d0 + (k * 10.0d0))
else
tmp = 1.0d0 / (k * (k / a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -2.1e-172) {
tmp = a * (1.0 / (k * k));
} else if (k <= 1.1e-308) {
tmp = -10.0 * (k * a);
} else if (k <= 10.2) {
tmp = a / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / (k * (k / a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -2.1e-172: tmp = a * (1.0 / (k * k)) elif k <= 1.1e-308: tmp = -10.0 * (k * a) elif k <= 10.2: tmp = a / (1.0 + (k * 10.0)) else: tmp = 1.0 / (k * (k / a)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -2.1e-172) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (k <= 1.1e-308) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 10.2) tmp = Float64(a / Float64(1.0 + Float64(k * 10.0))); else tmp = Float64(1.0 / Float64(k * Float64(k / a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -2.1e-172) tmp = a * (1.0 / (k * k)); elseif (k <= 1.1e-308) tmp = -10.0 * (k * a); elseif (k <= 10.2) tmp = a / (1.0 + (k * 10.0)); else tmp = 1.0 / (k * (k / a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -2.1e-172], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.1e-308], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 10.2], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k * N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -2.1 \cdot 10^{-172}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;k \leq 1.1 \cdot 10^{-308}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 10.2:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k \cdot \frac{k}{a}}\\
\end{array}
\end{array}
if k < -2.0999999999999999e-172Initial program 84.4%
associate-*r/84.4%
associate-+l+84.4%
+-commutative84.4%
distribute-rgt-out84.4%
fma-def84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in m around 0 15.2%
Taylor expanded in k around inf 19.5%
unpow219.5%
Simplified19.5%
if -2.0999999999999999e-172 < k < 1.1000000000000001e-308Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.3%
Taylor expanded in k around 0 4.3%
Taylor expanded in k around inf 51.8%
if 1.1000000000000001e-308 < k < 10.199999999999999Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 63.8%
Taylor expanded in k around 0 62.9%
*-commutative62.9%
Simplified62.9%
if 10.199999999999999 < k Initial program 83.0%
associate-*r/83.0%
associate-+l+83.0%
+-commutative83.0%
distribute-rgt-out83.0%
fma-def83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in m around 0 64.5%
Taylor expanded in k around inf 61.1%
unpow261.1%
Simplified61.1%
un-div-inv61.1%
clear-num61.3%
associate-*l/65.7%
*-commutative65.7%
Applied egg-rr65.7%
Final simplification52.4%
(FPCore (a k m) :precision binary64 (if (<= m -3.7e+20) (* a (/ 1.0 (* k k))) (if (<= m 980.0) (/ a (+ (* k (+ k 10.0)) 1.0)) (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 980.0) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} 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 <= (-3.7d+20)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 980.0d0) then
tmp = a / ((k * (k + 10.0d0)) + 1.0d0)
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 <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 980.0) {
tmp = a / ((k * (k + 10.0)) + 1.0);
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.7e+20: tmp = a * (1.0 / (k * k)) elif m <= 980.0: tmp = a / ((k * (k + 10.0)) + 1.0) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.7e+20) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 980.0) tmp = Float64(a / Float64(Float64(k * Float64(k + 10.0)) + 1.0)); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.7e+20) tmp = a * (1.0 / (k * k)); elseif (m <= 980.0) tmp = a / ((k * (k + 10.0)) + 1.0); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.7e+20], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 980.0], N[(a / N[(N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 980:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.7e20Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.9%
Taylor expanded in k around inf 61.2%
unpow261.2%
Simplified61.2%
if -3.7e20 < m < 980Initial program 94.1%
associate-*r/94.1%
associate-+l+94.1%
+-commutative94.1%
distribute-rgt-out94.1%
fma-def94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in m around 0 87.2%
if 980 < m Initial program 79.1%
associate-*r/79.1%
associate-+l+79.1%
+-commutative79.1%
distribute-rgt-out79.1%
fma-def79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 10.0%
Taylor expanded in k around inf 24.1%
Final simplification60.2%
(FPCore (a k m) :precision binary64 (if (<= k -3.15e-173) (* a (/ 1.0 (* k k))) (if (<= k -5e-311) (* -10.0 (* k a)) (if (<= k 1.0) a (/ (/ a k) k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= -3.15e-173) {
tmp = a * (1.0 / (k * k));
} else if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / 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 <= (-3.15d-173)) then
tmp = a * (1.0d0 / (k * k))
else if (k <= (-5d-311)) then
tmp = (-10.0d0) * (k * a)
else if (k <= 1.0d0) then
tmp = a
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -3.15e-173) {
tmp = a * (1.0 / (k * k));
} else if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -3.15e-173: tmp = a * (1.0 / (k * k)) elif k <= -5e-311: tmp = -10.0 * (k * a) elif k <= 1.0: tmp = a else: tmp = (a / k) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= -3.15e-173) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (k <= -5e-311) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 1.0) tmp = a; else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -3.15e-173) tmp = a * (1.0 / (k * k)); elseif (k <= -5e-311) tmp = -10.0 * (k * a); elseif (k <= 1.0) tmp = a; else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -3.15e-173], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, -5e-311], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -3.15 \cdot 10^{-173}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;k \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < -3.14999999999999984e-173Initial program 84.4%
associate-*r/84.4%
associate-+l+84.4%
+-commutative84.4%
distribute-rgt-out84.4%
fma-def84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in m around 0 15.2%
Taylor expanded in k around inf 19.5%
unpow219.5%
Simplified19.5%
if -3.14999999999999984e-173 < k < -5.00000000000023e-311Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 4.3%
Taylor expanded in k around 0 4.3%
Taylor expanded in k around inf 51.8%
if -5.00000000000023e-311 < k < 1Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around 0 63.4%
if 1 < k Initial program 83.2%
associate-*r/83.2%
associate-+l+83.2%
+-commutative83.2%
distribute-rgt-out83.2%
fma-def83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in m around 0 64.9%
Taylor expanded in k around inf 60.6%
unpow260.6%
Simplified60.6%
un-div-inv60.6%
associate-/r*64.9%
Applied egg-rr64.9%
Final simplification52.3%
(FPCore (a k m) :precision binary64 (if (<= m -3.7e+20) (* a (/ 1.0 (* k k))) (if (<= m 4200000.0) (/ a (+ 1.0 (* k k))) (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 4200000.0) {
tmp = a / (1.0 + (k * k));
} 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 <= (-3.7d+20)) then
tmp = a * (1.0d0 / (k * k))
else if (m <= 4200000.0d0) then
tmp = a / (1.0d0 + (k * k))
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 <= -3.7e+20) {
tmp = a * (1.0 / (k * k));
} else if (m <= 4200000.0) {
tmp = a / (1.0 + (k * k));
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.7e+20: tmp = a * (1.0 / (k * k)) elif m <= 4200000.0: tmp = a / (1.0 + (k * k)) else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.7e+20) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 4200000.0) tmp = Float64(a / Float64(1.0 + Float64(k * k))); else tmp = Float64(-10.0 * Float64(k * a)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -3.7e+20) tmp = a * (1.0 / (k * k)); elseif (m <= 4200000.0) tmp = a / (1.0 + (k * k)); else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.7e+20], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4200000.0], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 4200000:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.7e20Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 40.9%
Taylor expanded in k around inf 61.2%
unpow261.2%
Simplified61.2%
if -3.7e20 < m < 4.2e6Initial program 94.1%
associate-*r/94.1%
associate-+l+94.1%
+-commutative94.1%
distribute-rgt-out94.1%
fma-def94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in m around 0 87.2%
Taylor expanded in k around inf 83.9%
unpow283.9%
Simplified83.9%
if 4.2e6 < m Initial program 79.1%
associate-*r/79.1%
associate-+l+79.1%
+-commutative79.1%
distribute-rgt-out79.1%
fma-def79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 10.0%
Taylor expanded in k around inf 24.1%
Final simplification58.8%
(FPCore (a k m) :precision binary64 (if (<= m -3.4e-44) (/ a (* k 10.0)) (if (<= m 1000.0) a (* -10.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.4e-44) {
tmp = a / (k * 10.0);
} else if (m <= 1000.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 <= (-3.4d-44)) then
tmp = a / (k * 10.0d0)
else if (m <= 1000.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 <= -3.4e-44) {
tmp = a / (k * 10.0);
} else if (m <= 1000.0) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -3.4e-44: tmp = a / (k * 10.0) elif m <= 1000.0: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -3.4e-44) tmp = Float64(a / Float64(k * 10.0)); elseif (m <= 1000.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 <= -3.4e-44) tmp = a / (k * 10.0); elseif (m <= 1000.0) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -3.4e-44], N[(a / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1000.0], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{a}{k \cdot 10}\\
\mathbf{elif}\;m \leq 1000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < -3.40000000000000016e-44Initial program 97.4%
associate-*r/97.4%
associate-+l+97.4%
+-commutative97.4%
distribute-rgt-out97.4%
fma-def97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in m around 0 40.1%
Taylor expanded in k around 0 15.8%
*-commutative15.8%
Simplified15.8%
Taylor expanded in k around inf 20.3%
*-commutative20.3%
Simplified20.3%
if -3.40000000000000016e-44 < m < 1e3Initial program 95.2%
associate-*r/95.2%
associate-+l+95.2%
+-commutative95.2%
distribute-rgt-out95.2%
fma-def95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in m around 0 92.2%
Taylor expanded in k around 0 56.5%
if 1e3 < m Initial program 79.1%
associate-*r/79.1%
associate-+l+79.1%
+-commutative79.1%
distribute-rgt-out79.1%
fma-def79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 10.0%
Taylor expanded in k around inf 24.1%
Final simplification36.1%
(FPCore (a k m) :precision binary64 (if (<= k -5e-311) (* -10.0 (* k a)) (if (<= k 1.0) a (/ a (* k k)))))
double code(double a, double k, double m) {
double tmp;
if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = a / (k * 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 <= (-5d-311)) then
tmp = (-10.0d0) * (k * a)
else if (k <= 1.0d0) then
tmp = a
else
tmp = a / (k * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = a / (k * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -5e-311: tmp = -10.0 * (k * a) elif k <= 1.0: tmp = a else: tmp = a / (k * k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= -5e-311) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 1.0) tmp = a; else tmp = Float64(a / Float64(k * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -5e-311) tmp = -10.0 * (k * a); elseif (k <= 1.0) tmp = a; else tmp = a / (k * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -5e-311], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], a, N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\end{array}
\end{array}
if k < -5.00000000000023e-311Initial program 87.2%
associate-*r/87.2%
associate-+l+87.2%
+-commutative87.2%
distribute-rgt-out87.2%
fma-def87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in m around 0 13.2%
Taylor expanded in k around 0 11.0%
Taylor expanded in k around inf 20.1%
if -5.00000000000023e-311 < k < 1Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around 0 63.4%
if 1 < k Initial program 83.2%
associate-*r/83.2%
associate-+l+83.2%
+-commutative83.2%
distribute-rgt-out83.2%
fma-def83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in m around 0 64.9%
Taylor expanded in k around inf 60.6%
unpow260.6%
Simplified60.6%
Final simplification49.3%
(FPCore (a k m) :precision binary64 (if (<= k -5e-311) (* -10.0 (* k a)) (if (<= k 1.0) a (/ (/ a k) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / 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 <= (-5d-311)) then
tmp = (-10.0d0) * (k * a)
else if (k <= 1.0d0) then
tmp = a
else
tmp = (a / k) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= -5e-311) {
tmp = -10.0 * (k * a);
} else if (k <= 1.0) {
tmp = a;
} else {
tmp = (a / k) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= -5e-311: tmp = -10.0 * (k * a) elif k <= 1.0: tmp = a else: tmp = (a / k) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= -5e-311) tmp = Float64(-10.0 * Float64(k * a)); elseif (k <= 1.0) tmp = a; else tmp = Float64(Float64(a / k) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= -5e-311) tmp = -10.0 * (k * a); elseif (k <= 1.0) tmp = a; else tmp = (a / k) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, -5e-311], N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.0], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\
\end{array}
\end{array}
if k < -5.00000000000023e-311Initial program 87.2%
associate-*r/87.2%
associate-+l+87.2%
+-commutative87.2%
distribute-rgt-out87.2%
fma-def87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in m around 0 13.2%
Taylor expanded in k around 0 11.0%
Taylor expanded in k around inf 20.1%
if -5.00000000000023e-311 < k < 1Initial program 100.0%
associate-*r/100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 63.4%
Taylor expanded in k around 0 63.4%
if 1 < k Initial program 83.2%
associate-*r/83.2%
associate-+l+83.2%
+-commutative83.2%
distribute-rgt-out83.2%
fma-def83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in m around 0 64.9%
Taylor expanded in k around inf 60.6%
unpow260.6%
Simplified60.6%
un-div-inv60.6%
associate-/r*64.9%
Applied egg-rr64.9%
Final simplification50.7%
(FPCore (a k m) :precision binary64 (if (<= m 1300.0) a (* -10.0 (* k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= 1300.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 <= 1300.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 <= 1300.0) {
tmp = a;
} else {
tmp = -10.0 * (k * a);
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 1300.0: tmp = a else: tmp = -10.0 * (k * a) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 1300.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 <= 1300.0) tmp = a; else tmp = -10.0 * (k * a); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 1300.0], a, N[(-10.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1300:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;-10 \cdot \left(k \cdot a\right)\\
\end{array}
\end{array}
if m < 1300Initial program 96.1%
associate-*r/96.1%
associate-+l+96.1%
+-commutative96.1%
distribute-rgt-out96.1%
fma-def96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in m around 0 71.7%
Taylor expanded in k around 0 36.0%
if 1300 < m Initial program 79.1%
associate-*r/79.1%
associate-+l+79.1%
+-commutative79.1%
distribute-rgt-out79.1%
fma-def79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in m around 0 3.1%
Taylor expanded in k around 0 10.0%
Taylor expanded in k around inf 24.1%
Final simplification32.0%
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
return a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a
end function
public static double code(double a, double k, double m) {
return a;
}
def code(a, k, m): return a
function code(a, k, m) return a end
function tmp = code(a, k, m) tmp = a; end
code[a_, k_, m_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 90.4%
associate-*r/90.4%
associate-+l+90.4%
+-commutative90.4%
distribute-rgt-out90.4%
fma-def90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in m around 0 48.6%
Taylor expanded in k around 0 25.2%
Final simplification25.2%
herbie shell --seed 2023196
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))