
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m) :precision binary64 (let* ((t_0 (pow k (- m)))) (if (<= k 0.00082) (/ a t_0) (/ (/ a k) (* k t_0)))))
double code(double a, double k, double m) {
double t_0 = pow(k, -m);
double tmp;
if (k <= 0.00082) {
tmp = a / t_0;
} else {
tmp = (a / k) / (k * t_0);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = k ** -m
if (k <= 0.00082d0) then
tmp = a / t_0
else
tmp = (a / k) / (k * t_0)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = Math.pow(k, -m);
double tmp;
if (k <= 0.00082) {
tmp = a / t_0;
} else {
tmp = (a / k) / (k * t_0);
}
return tmp;
}
def code(a, k, m): t_0 = math.pow(k, -m) tmp = 0 if k <= 0.00082: tmp = a / t_0 else: tmp = (a / k) / (k * t_0) return tmp
function code(a, k, m) t_0 = k ^ Float64(-m) tmp = 0.0 if (k <= 0.00082) tmp = Float64(a / t_0); else tmp = Float64(Float64(a / k) / Float64(k * t_0)); end return tmp end
function tmp_2 = code(a, k, m) t_0 = k ^ -m; tmp = 0.0; if (k <= 0.00082) tmp = a / t_0; else tmp = (a / k) / (k * t_0); end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[Power[k, (-m)], $MachinePrecision]}, If[LessEqual[k, 0.00082], N[(a / t$95$0), $MachinePrecision], N[(N[(a / k), $MachinePrecision] / N[(k * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{\left(-m\right)}\\
\mathbf{if}\;k \leq 0.00082:\\
\;\;\;\;\frac{a}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k \cdot t\_0}\\
\end{array}
\end{array}
if k < 8.1999999999999998e-4Initial program 93.5%
lift-pow.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6493.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
mul-1-negN/A
lower-neg.f6499.4
Applied rewrites99.4%
if 8.1999999999999998e-4 < k Initial program 79.1%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
lift-pow.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
lower-neg.f6494.2
Applied rewrites94.2%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (/ a (* k k)))
(t_1 (/ (* a (pow k m)) (+ (* k k) (+ 1.0 (* k 10.0))))))
(if (<= t_1 5e-29) t_0 (if (<= t_1 1e+294) (* a (fma k -10.0 1.0)) t_0))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double t_1 = (a * pow(k, m)) / ((k * k) + (1.0 + (k * 10.0)));
double tmp;
if (t_1 <= 5e-29) {
tmp = t_0;
} else if (t_1 <= 1e+294) {
tmp = a * fma(k, -10.0, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) t_1 = Float64(Float64(a * (k ^ m)) / Float64(Float64(k * k) + Float64(1.0 + Float64(k * 10.0)))) tmp = 0.0 if (t_1 <= 5e-29) tmp = t_0; elseif (t_1 <= 1e+294) tmp = Float64(a * fma(k, -10.0, 1.0)); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] + N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-29], t$95$0, If[LessEqual[t$95$1, 1e+294], N[(a * N[(k * -10.0 + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
t_1 := \frac{a \cdot {k}^{m}}{k \cdot k + \left(1 + k \cdot 10\right)}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{+294}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, -10, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 4.99999999999999986e-29 or 1.00000000000000007e294 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 87.8%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6435.3
Applied rewrites35.3%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6437.0
Applied rewrites37.0%
if 4.99999999999999986e-29 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.00000000000000007e294Initial program 99.8%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6492.2
Applied rewrites92.2%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6492.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.2
Applied rewrites92.2%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6486.3
Applied rewrites86.3%
Final simplification40.3%
(FPCore (a k m) :precision binary64 (if (<= k 0.00082) (/ a (pow k (- m))) (/ (* (/ a k) (pow k m)) k)))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / pow(k, -m);
} else {
tmp = ((a / k) * pow(k, m)) / k;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 0.00082d0) then
tmp = a / (k ** -m)
else
tmp = ((a / k) * (k ** m)) / k
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / Math.pow(k, -m);
} else {
tmp = ((a / k) * Math.pow(k, m)) / k;
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00082: tmp = a / math.pow(k, -m) else: tmp = ((a / k) * math.pow(k, m)) / k return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00082) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(Float64(Float64(a / k) * (k ^ m)) / k); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00082) tmp = a / (k ^ -m); else tmp = ((a / k) * (k ^ m)) / k; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00082], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a / k), $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00082:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k} \cdot {k}^{m}}{k}\\
\end{array}
\end{array}
if k < 8.1999999999999998e-4Initial program 93.5%
lift-pow.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6493.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
mul-1-negN/A
lower-neg.f6499.4
Applied rewrites99.4%
if 8.1999999999999998e-4 < k Initial program 79.1%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
lift-pow.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6494.2
Applied rewrites94.2%
Final simplification97.6%
(FPCore (a k m) :precision binary64 (if (<= k 0.00082) (/ a (pow k (- m))) (* (/ a k) (/ (pow k m) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / pow(k, -m);
} else {
tmp = (a / k) * (pow(k, m) / k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 0.00082d0) then
tmp = a / (k ** -m)
else
tmp = (a / k) * ((k ** m) / k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / Math.pow(k, -m);
} else {
tmp = (a / k) * (Math.pow(k, m) / k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00082: tmp = a / math.pow(k, -m) else: tmp = (a / k) * (math.pow(k, m) / k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00082) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(Float64(a / k) * Float64((k ^ m) / k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00082) tmp = a / (k ^ -m); else tmp = (a / k) * ((k ^ m) / k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00082], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00082:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{k} \cdot \frac{{k}^{m}}{k}\\
\end{array}
\end{array}
if k < 8.1999999999999998e-4Initial program 93.5%
lift-pow.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6493.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
mul-1-negN/A
lower-neg.f6499.4
Applied rewrites99.4%
if 8.1999999999999998e-4 < k Initial program 79.1%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
lift-pow.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.2
Applied rewrites94.2%
Final simplification97.6%
(FPCore (a k m) :precision binary64 (if (<= m 3.0) (* a (/ (pow k m) (fma k (+ k 10.0) 1.0))) (* a (pow k m))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.0) {
tmp = a * (pow(k, m) / fma(k, (k + 10.0), 1.0));
} else {
tmp = a * pow(k, m);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 3.0) tmp = Float64(a * Float64((k ^ m) / fma(k, Float64(k + 10.0), 1.0))); else tmp = Float64(a * (k ^ m)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 3.0], N[(a * N[(N[Power[k, m], $MachinePrecision] / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3:\\
\;\;\;\;a \cdot \frac{{k}^{m}}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\
\end{array}
\end{array}
if m < 3Initial program 96.3%
lift-pow.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6496.3
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6496.3
Applied rewrites96.3%
if 3 < m Initial program 73.6%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification97.6%
(FPCore (a k m) :precision binary64 (if (<= k 0.00082) (/ a (pow k (- m))) (* a (pow k (+ m -2.0)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / pow(k, -m);
} else {
tmp = a * pow(k, (m + -2.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 (k <= 0.00082d0) then
tmp = a / (k ** -m)
else
tmp = a * (k ** (m + (-2.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a / Math.pow(k, -m);
} else {
tmp = a * Math.pow(k, (m + -2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00082: tmp = a / math.pow(k, -m) else: tmp = a * math.pow(k, (m + -2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00082) tmp = Float64(a / (k ^ Float64(-m))); else tmp = Float64(a * (k ^ Float64(m + -2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00082) tmp = a / (k ^ -m); else tmp = a * (k ^ (m + -2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00082], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m + -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00082:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m + -2\right)}\\
\end{array}
\end{array}
if k < 8.1999999999999998e-4Initial program 93.5%
lift-pow.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6493.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6493.5
Applied rewrites93.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
mul-1-negN/A
lower-neg.f6499.4
Applied rewrites99.4%
if 8.1999999999999998e-4 < k Initial program 79.1%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
lift-pow.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
pow2N/A
pow-divN/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval92.2
Applied rewrites92.2%
Final simplification96.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= m -1.75e-7)
t_0
(if (<= m 0.49) (* a (/ 1.0 (fma k (+ k 10.0) 1.0))) t_0))))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= -1.75e-7) {
tmp = t_0;
} else if (m <= 0.49) {
tmp = a * (1.0 / fma(k, (k + 10.0), 1.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= -1.75e-7) tmp = t_0; elseif (m <= 0.49) tmp = Float64(a * Float64(1.0 / fma(k, Float64(k + 10.0), 1.0))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.75e-7], t$95$0, If[LessEqual[m, 0.49], N[(a * N[(1.0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -1.75 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 0.49:\\
\;\;\;\;a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -1.74999999999999992e-7 or 0.48999999999999999 < m Initial program 86.9%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if -1.74999999999999992e-7 < m < 0.48999999999999999Initial program 92.2%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6489.5
Applied rewrites89.5%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6489.6
Applied rewrites89.6%
Final simplification96.7%
(FPCore (a k m) :precision binary64 (if (<= k 0.00082) (* a (pow k m)) (* a (pow k (+ m -2.0)))))
double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a * pow(k, m);
} else {
tmp = a * pow(k, (m + -2.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 (k <= 0.00082d0) then
tmp = a * (k ** m)
else
tmp = a * (k ** (m + (-2.0d0)))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 0.00082) {
tmp = a * Math.pow(k, m);
} else {
tmp = a * Math.pow(k, (m + -2.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 0.00082: tmp = a * math.pow(k, m) else: tmp = a * math.pow(k, (m + -2.0)) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 0.00082) tmp = Float64(a * (k ^ m)); else tmp = Float64(a * (k ^ Float64(m + -2.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 0.00082) tmp = a * (k ^ m); else tmp = a * (k ^ (m + -2.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 0.00082], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m + -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00082:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m + -2\right)}\\
\end{array}
\end{array}
if k < 8.1999999999999998e-4Initial program 93.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6499.4
Applied rewrites99.4%
if 8.1999999999999998e-4 < k Initial program 79.1%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
lift-pow.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
pow2N/A
pow-divN/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval92.2
Applied rewrites92.2%
Final simplification96.9%
(FPCore (a k m)
:precision binary64
(if (<= m -2.2)
(* a (/ (- 1.0 (/ (+ 10.0 (/ -99.0 k)) k)) (* k k)))
(if (<= m 1.26)
(* a (/ 1.0 (fma k (+ k 10.0) 1.0)))
(* a (* k (* k (* k k)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.2) {
tmp = a * ((1.0 - ((10.0 + (-99.0 / k)) / k)) / (k * k));
} else if (m <= 1.26) {
tmp = a * (1.0 / fma(k, (k + 10.0), 1.0));
} else {
tmp = a * (k * (k * (k * k)));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -2.2) tmp = Float64(a * Float64(Float64(1.0 - Float64(Float64(10.0 + Float64(-99.0 / k)) / k)) / Float64(k * k))); elseif (m <= 1.26) tmp = Float64(a * Float64(1.0 / fma(k, Float64(k + 10.0), 1.0))); else tmp = Float64(a * Float64(k * Float64(k * Float64(k * k)))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -2.2], N[(a * N[(N[(1.0 - N[(N[(10.0 + N[(-99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a * N[(1.0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.2:\\
\;\;\;\;a \cdot \frac{1 - \frac{10 + \frac{-99}{k}}{k}}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\\
\end{array}
\end{array}
if m < -2.2000000000000002Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6429.6
Applied rewrites29.6%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6429.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6429.6
Applied rewrites29.6%
Taylor expanded in k around -inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f6469.4
Applied rewrites69.4%
if -2.2000000000000002 < m < 1.26000000000000001Initial program 92.4%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6487.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
if 1.26000000000000001 < m Initial program 73.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f642.9
Applied rewrites2.9%
lift-+.f64N/A
flip3-+N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites2.2%
Taylor expanded in k around inf
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.7
Applied rewrites37.7%
Taylor expanded in k around 0
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
Final simplification77.8%
(FPCore (a k m)
:precision binary64
(if (<= m -0.43)
(/ a (* k k))
(if (<= m 1.26)
(* a (/ 1.0 (fma k (+ k 10.0) 1.0)))
(* a (* k (* k (* k k)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = a / (k * k);
} else if (m <= 1.26) {
tmp = a * (1.0 / fma(k, (k + 10.0), 1.0));
} else {
tmp = a * (k * (k * (k * k)));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.26) tmp = Float64(a * Float64(1.0 / fma(k, Float64(k + 10.0), 1.0))); else tmp = Float64(a * Float64(k * Float64(k * Float64(k * k)))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a * N[(1.0 / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\\
\end{array}
\end{array}
if m < -0.429999999999999993Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6460.0
Applied rewrites60.0%
if -0.429999999999999993 < m < 1.26000000000000001Initial program 92.3%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6488.6
Applied rewrites88.6%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.7
Applied rewrites88.7%
if 1.26000000000000001 < m Initial program 73.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f642.9
Applied rewrites2.9%
lift-+.f64N/A
flip3-+N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites2.2%
Taylor expanded in k around inf
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.7
Applied rewrites37.7%
Taylor expanded in k around 0
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
Final simplification74.8%
(FPCore (a k m) :precision binary64 (if (<= m -0.43) (/ a (* k k)) (if (<= m 1.26) (/ a (fma k (+ k 10.0) 1.0)) (* a (* k (* k (* k k)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = a / (k * k);
} else if (m <= 1.26) {
tmp = a / fma(k, (k + 10.0), 1.0);
} else {
tmp = a * (k * (k * (k * k)));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.26) tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0)); else tmp = Float64(a * Float64(k * Float64(k * Float64(k * k)))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\\
\end{array}
\end{array}
if m < -0.429999999999999993Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6460.0
Applied rewrites60.0%
if -0.429999999999999993 < m < 1.26000000000000001Initial program 92.3%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6488.6
Applied rewrites88.6%
if 1.26000000000000001 < m Initial program 73.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f642.9
Applied rewrites2.9%
lift-+.f64N/A
flip3-+N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites2.2%
Taylor expanded in k around inf
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.7
Applied rewrites37.7%
Taylor expanded in k around 0
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
Final simplification74.8%
(FPCore (a k m) :precision binary64 (if (<= m -6.5e-136) (/ a (* k k)) (if (<= m 1.26) (/ a (fma k 10.0 1.0)) (* a (* k (* k (* k k)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -6.5e-136) {
tmp = a / (k * k);
} else if (m <= 1.26) {
tmp = a / fma(k, 10.0, 1.0);
} else {
tmp = a * (k * (k * (k * k)));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -6.5e-136) tmp = Float64(a / Float64(k * k)); elseif (m <= 1.26) tmp = Float64(a / fma(k, 10.0, 1.0)); else tmp = Float64(a * Float64(k * Float64(k * Float64(k * k)))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -6.5e-136], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6.5 \cdot 10^{-136}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\\
\end{array}
\end{array}
if m < -6.50000000000000011e-136Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6440.5
Applied rewrites40.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.8
Applied rewrites59.8%
if -6.50000000000000011e-136 < m < 1.26000000000000001Initial program 90.1%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6487.5
Applied rewrites87.5%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6464.8
Applied rewrites64.8%
if 1.26000000000000001 < m Initial program 73.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f642.9
Applied rewrites2.9%
lift-+.f64N/A
flip3-+N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites2.2%
Taylor expanded in k around inf
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.7
Applied rewrites37.7%
Taylor expanded in k around 0
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
Final simplification66.8%
(FPCore (a k m)
:precision binary64
(if (<= m -6.5e-136)
(/ a (* k k))
(if (<= m 2.05)
(/ a (fma k 10.0 1.0))
(* a (fma k (fma k 99.0 -10.0) 1.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -6.5e-136) {
tmp = a / (k * k);
} else if (m <= 2.05) {
tmp = a / fma(k, 10.0, 1.0);
} else {
tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -6.5e-136) tmp = Float64(a / Float64(k * k)); elseif (m <= 2.05) tmp = Float64(a / fma(k, 10.0, 1.0)); else tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -6.5e-136], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.05], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6.5 \cdot 10^{-136}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 2.05:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\
\end{array}
\end{array}
if m < -6.50000000000000011e-136Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6440.5
Applied rewrites40.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.8
Applied rewrites59.8%
if -6.50000000000000011e-136 < m < 2.0499999999999998Initial program 90.1%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6487.5
Applied rewrites87.5%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6464.8
Applied rewrites64.8%
if 2.0499999999999998 < m Initial program 73.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f642.9
Applied rewrites2.9%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f642.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.9
Applied rewrites2.9%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6437.0
Applied rewrites37.0%
Final simplification53.2%
(FPCore (a k m) :precision binary64 (if (<= m -3.9e-144) (/ a (* k k)) (* a (fma k (fma k 99.0 -10.0) 1.0))))
double code(double a, double k, double m) {
double tmp;
if (m <= -3.9e-144) {
tmp = a / (k * k);
} else {
tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -3.9e-144) tmp = Float64(a / Float64(k * k)); else tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -3.9e-144], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.9 \cdot 10^{-144}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\
\end{array}
\end{array}
if m < -3.90000000000000015e-144Initial program 100.0%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6442.6
Applied rewrites42.6%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.5
Applied rewrites59.5%
if -3.90000000000000015e-144 < m Initial program 79.9%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6436.4
Applied rewrites36.4%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6436.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6436.4
Applied rewrites36.4%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6442.6
Applied rewrites42.6%
Final simplification49.9%
(FPCore (a k m) :precision binary64 (* a (fma k -10.0 1.0)))
double code(double a, double k, double m) {
return a * fma(k, -10.0, 1.0);
}
function code(a, k, m) return Float64(a * fma(k, -10.0, 1.0)) end
code[a_, k_, m_] := N[(a * N[(k * -10.0 + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \mathsf{fma}\left(k, -10, 1\right)
\end{array}
Initial program 88.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6439.1
Applied rewrites39.1%
lift-+.f64N/A
lift-fma.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6439.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6439.1
Applied rewrites39.1%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6418.8
Applied rewrites18.8%
Final simplification18.8%
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
return a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a
end function
public static double code(double a, double k, double m) {
return a;
}
def code(a, k, m): return a
function code(a, k, m) return a end
function tmp = code(a, k, m) tmp = a; end
code[a_, k_, m_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 88.6%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f6439.1
Applied rewrites39.1%
Taylor expanded in k around 0
Applied rewrites17.4%
/-rgt-identity17.4
Applied rewrites17.4%
herbie shell --seed 2024220
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))