
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m)
:precision binary64
(if (<= m -4.8e-6)
(* (/ (pow k m) (fma k (+ k 10.0) 1.0)) a)
(if (<= m 0.00021)
(/ 1.0 (fma k (+ (/ k a) (/ 10.0 a)) (/ 1.0 a)))
(* (pow k m) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -4.8e-6) {
tmp = (pow(k, m) / fma(k, (k + 10.0), 1.0)) * a;
} else if (m <= 0.00021) {
tmp = 1.0 / fma(k, ((k / a) + (10.0 / a)), (1.0 / a));
} else {
tmp = pow(k, m) * a;
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -4.8e-6) tmp = Float64(Float64((k ^ m) / fma(k, Float64(k + 10.0), 1.0)) * a); elseif (m <= 0.00021) tmp = Float64(1.0 / fma(k, Float64(Float64(k / a) + Float64(10.0 / a)), Float64(1.0 / a))); else tmp = Float64((k ^ m) * a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -4.8e-6], N[(N[(N[Power[k, m], $MachinePrecision] / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[m, 0.00021], N[(1.0 / N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a\\
\mathbf{elif}\;m \leq 0.00021:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{a} + \frac{10}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;{k}^{m} \cdot a\\
\end{array}
\end{array}
if m < -4.7999999999999998e-6Initial program 100.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64100.0
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-+.f64100.0
Applied rewrites100.0%
if -4.7999999999999998e-6 < m < 2.1000000000000001e-4Initial program 90.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-+.f6489.6
Applied rewrites89.6%
Applied rewrites88.9%
Taylor expanded in k around 0
Applied rewrites97.9%
if 2.1000000000000001e-4 < m Initial program 85.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification99.3%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m -0.00035)
(/ t_0 (* k k))
(if (<= m 0.00021)
(/ 1.0 (fma k (+ (/ k a) (/ 10.0 a)) (/ 1.0 a)))
t_0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= -0.00035) {
tmp = t_0 / (k * k);
} else if (m <= 0.00021) {
tmp = 1.0 / fma(k, ((k / a) + (10.0 / a)), (1.0 / a));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= -0.00035) tmp = Float64(t_0 / Float64(k * k)); elseif (m <= 0.00021) tmp = Float64(1.0 / fma(k, Float64(Float64(k / a) + Float64(10.0 / a)), Float64(1.0 / a))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, -0.00035], N[(t$95$0 / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.00021], N[(1.0 / N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq -0.00035:\\
\;\;\;\;\frac{t\_0}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.00021:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{a} + \frac{10}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -3.49999999999999996e-4Initial program 100.0%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6499.7
Applied rewrites99.7%
if -3.49999999999999996e-4 < m < 2.1000000000000001e-4Initial program 90.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-+.f6489.6
Applied rewrites89.6%
Applied rewrites88.9%
Taylor expanded in k around 0
Applied rewrites97.9%
if 2.1000000000000001e-4 < m Initial program 85.5%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification99.2%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m -0.32)
t_0
(if (<= m 0.00021)
(/ 1.0 (fma k (+ (/ k a) (/ 10.0 a)) (/ 1.0 a)))
t_0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (m <= -0.32) {
tmp = t_0;
} else if (m <= 0.00021) {
tmp = 1.0 / fma(k, ((k / a) + (10.0 / a)), (1.0 / a));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (m <= -0.32) tmp = t_0; elseif (m <= 0.00021) tmp = Float64(1.0 / fma(k, Float64(Float64(k / a) + Float64(10.0 / a)), Float64(1.0 / a))); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[m, -0.32], t$95$0, If[LessEqual[m, 0.00021], N[(1.0 / N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;m \leq -0.32:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 0.00021:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{a} + \frac{10}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -0.320000000000000007 or 2.1000000000000001e-4 < m Initial program 92.8%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if -0.320000000000000007 < m < 2.1000000000000001e-4Initial program 90.5%
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.8
Applied rewrites88.8%
Applied rewrites88.1%
Taylor expanded in k around 0
Applied rewrites96.9%
Final simplification98.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9.8e+190)
(* (/ (fma (/ a k) -20.0 a) (* (* k k) (* k k))) (fma k 10.0 -1.0))
(if (<= m -0.31)
(/ (- a (* (/ a k) (+ 10.0 (/ -99.0 k)))) (* k k))
(if (<= m 4.5e+34)
(/ 1.0 (fma k (+ (/ k a) (/ 10.0 a)) (/ 1.0 a)))
(* (* k k) (fma -10.0 (/ a k) (* a 99.0)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.8e+190) {
tmp = (fma((a / k), -20.0, a) / ((k * k) * (k * k))) * fma(k, 10.0, -1.0);
} else if (m <= -0.31) {
tmp = (a - ((a / k) * (10.0 + (-99.0 / k)))) / (k * k);
} else if (m <= 4.5e+34) {
tmp = 1.0 / fma(k, ((k / a) + (10.0 / a)), (1.0 / a));
} else {
tmp = (k * k) * fma(-10.0, (a / k), (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.8e+190) tmp = Float64(Float64(fma(Float64(a / k), -20.0, a) / Float64(Float64(k * k) * Float64(k * k))) * fma(k, 10.0, -1.0)); elseif (m <= -0.31) tmp = Float64(Float64(a - Float64(Float64(a / k) * Float64(10.0 + Float64(-99.0 / k)))) / Float64(k * k)); elseif (m <= 4.5e+34) tmp = Float64(1.0 / fma(k, Float64(Float64(k / a) + Float64(10.0 / a)), Float64(1.0 / a))); else tmp = Float64(Float64(k * k) * fma(-10.0, Float64(a / k), Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.8e+190], N[(N[(N[(N[(a / k), $MachinePrecision] * -20.0 + a), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * 10.0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -0.31], N[(N[(a - N[(N[(a / k), $MachinePrecision] * N[(10.0 + N[(-99.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.5e+34], N[(1.0 / N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(-10.0 * N[(a / k), $MachinePrecision] + N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.8 \cdot 10^{+190}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k}, -20, a\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \mathsf{fma}\left(k, 10, -1\right)\\
\mathbf{elif}\;m \leq -0.31:\\
\;\;\;\;\frac{a - \frac{a}{k} \cdot \left(10 + \frac{-99}{k}\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 4.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{a} + \frac{10}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(-10, \frac{a}{k}, a \cdot 99\right)\\
\end{array}
\end{array}
if m < -9.7999999999999993e190Initial 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-+.f6435.7
Applied rewrites35.7%
Applied rewrites25.1%
Taylor expanded in k around 0
Applied rewrites51.7%
Taylor expanded in k around inf
Applied rewrites83.7%
if -9.7999999999999993e190 < m < -0.309999999999999998Initial 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-+.f6425.8
Applied rewrites25.8%
Taylor expanded in k around inf
Applied rewrites71.5%
if -0.309999999999999998 < m < 4.5e34Initial program 91.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-+.f6483.4
Applied rewrites83.4%
Applied rewrites82.7%
Taylor expanded in k around 0
Applied rewrites91.0%
if 4.5e34 < m Initial program 84.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-+.f643.2
Applied rewrites3.2%
Taylor expanded in k around 0
Applied rewrites24.1%
Taylor expanded in k around inf
Applied rewrites46.3%
Final simplification72.6%
(FPCore (a k m)
:precision binary64
(if (<= m -0.31)
(/ (- a (* (/ a k) (+ 10.0 (/ -99.0 k)))) (* k k))
(if (<= m 4.5e+34)
(/ 1.0 (fma k (+ (/ k a) (/ 10.0 a)) (/ 1.0 a)))
(* (* k k) (fma -10.0 (/ a k) (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.31) {
tmp = (a - ((a / k) * (10.0 + (-99.0 / k)))) / (k * k);
} else if (m <= 4.5e+34) {
tmp = 1.0 / fma(k, ((k / a) + (10.0 / a)), (1.0 / a));
} else {
tmp = (k * k) * fma(-10.0, (a / k), (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.31) tmp = Float64(Float64(a - Float64(Float64(a / k) * Float64(10.0 + Float64(-99.0 / k)))) / Float64(k * k)); elseif (m <= 4.5e+34) tmp = Float64(1.0 / fma(k, Float64(Float64(k / a) + Float64(10.0 / a)), Float64(1.0 / a))); else tmp = Float64(Float64(k * k) * fma(-10.0, Float64(a / k), Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.31], N[(N[(a - N[(N[(a / k), $MachinePrecision] * N[(10.0 + N[(-99.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.5e+34], N[(1.0 / N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(-10.0 * N[(a / k), $MachinePrecision] + N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.31:\\
\;\;\;\;\frac{a - \frac{a}{k} \cdot \left(10 + \frac{-99}{k}\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 4.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{a} + \frac{10}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(-10, \frac{a}{k}, a \cdot 99\right)\\
\end{array}
\end{array}
if m < -0.309999999999999998Initial 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
Applied rewrites69.0%
if -0.309999999999999998 < m < 4.5e34Initial program 91.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-+.f6483.4
Applied rewrites83.4%
Applied rewrites82.7%
Taylor expanded in k around 0
Applied rewrites91.0%
if 4.5e34 < m Initial program 84.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-+.f643.2
Applied rewrites3.2%
Taylor expanded in k around 0
Applied rewrites24.1%
Taylor expanded in k around inf
Applied rewrites46.3%
Final simplification70.4%
(FPCore (a k m)
:precision binary64
(if (<= m -0.43)
(/ (- a (* (/ a k) (+ 10.0 (/ -99.0 k)))) (* k k))
(if (<= m 4.5e+34)
(/ a (fma k 10.0 (fma k k 1.0)))
(* (* k k) (fma -10.0 (/ a k) (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = (a - ((a / k) * (10.0 + (-99.0 / k)))) / (k * k);
} else if (m <= 4.5e+34) {
tmp = a / fma(k, 10.0, fma(k, k, 1.0));
} else {
tmp = (k * k) * fma(-10.0, (a / k), (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(Float64(a - Float64(Float64(a / k) * Float64(10.0 + Float64(-99.0 / k)))) / Float64(k * k)); elseif (m <= 4.5e+34) tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0))); else tmp = Float64(Float64(k * k) * fma(-10.0, Float64(a / k), Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(N[(a - N[(N[(a / k), $MachinePrecision] * N[(10.0 + N[(-99.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.5e+34], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(-10.0 * N[(a / k), $MachinePrecision] + N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;\frac{a - \frac{a}{k} \cdot \left(10 + \frac{-99}{k}\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 4.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(-10, \frac{a}{k}, a \cdot 99\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
Applied rewrites69.0%
if -0.429999999999999993 < m < 4.5e34Initial program 91.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-+.f6483.4
Applied rewrites83.4%
Applied rewrites83.4%
if 4.5e34 < m Initial program 84.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-+.f643.2
Applied rewrites3.2%
Taylor expanded in k around 0
Applied rewrites24.1%
Taylor expanded in k around inf
Applied rewrites46.3%
Final simplification67.6%
(FPCore (a k m)
:precision binary64
(if (<= m -0.43)
(* a (/ 1.0 (* k k)))
(if (<= m 4.5e+34)
(/ a (fma k 10.0 (fma k k 1.0)))
(* (* k k) (fma -10.0 (/ a k) (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = a * (1.0 / (k * k));
} else if (m <= 4.5e+34) {
tmp = a / fma(k, 10.0, fma(k, k, 1.0));
} else {
tmp = (k * k) * fma(-10.0, (a / k), (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 4.5e+34) tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0))); else tmp = Float64(Float64(k * k) * fma(-10.0, Float64(a / k), Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.5e+34], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(-10.0 * N[(a / k), $MachinePrecision] + N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 4.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(-10, \frac{a}{k}, a \cdot 99\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%
Applied rewrites29.3%
Taylor expanded in k around inf
Applied rewrites58.4%
Applied rewrites59.6%
if -0.429999999999999993 < m < 4.5e34Initial program 91.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-+.f6483.4
Applied rewrites83.4%
Applied rewrites83.4%
if 4.5e34 < m Initial program 84.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-+.f643.2
Applied rewrites3.2%
Taylor expanded in k around 0
Applied rewrites24.1%
Taylor expanded in k around inf
Applied rewrites46.3%
Final simplification64.5%
(FPCore (a k m) :precision binary64 (if (<= m -0.43) (* a (/ 1.0 (* k k))) (if (<= m 1.26) (/ a (fma k 10.0 (fma k k 1.0))) (* k (* k (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = a * (1.0 / (k * k));
} else if (m <= 1.26) {
tmp = a / fma(k, 10.0, fma(k, k, 1.0));
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 1.26) tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0))); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\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%
Applied rewrites29.3%
Taylor expanded in k around inf
Applied rewrites58.4%
Applied rewrites59.6%
if -0.429999999999999993 < m < 1.26000000000000001Initial program 90.5%
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.8
Applied rewrites88.8%
Applied rewrites88.8%
if 1.26000000000000001 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
Final simplification63.7%
(FPCore (a k m) :precision binary64 (if (<= m -0.43) (* a (/ 1.0 (* k k))) (if (<= m 1.26) (/ a (fma k (+ k 10.0) 1.0)) (* k (* k (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.43) {
tmp = a * (1.0 / (k * k));
} else if (m <= 1.26) {
tmp = a / fma(k, (k + 10.0), 1.0);
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.43) tmp = Float64(a * Float64(1.0 / Float64(k * k))); elseif (m <= 1.26) tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0)); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.43], N[(a * N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.26], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.43:\\
\;\;\;\;a \cdot \frac{1}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.26:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\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%
Applied rewrites29.3%
Taylor expanded in k around inf
Applied rewrites58.4%
Applied rewrites59.6%
if -0.429999999999999993 < m < 1.26000000000000001Initial program 90.5%
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.8
Applied rewrites88.8%
if 1.26000000000000001 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
Final simplification63.7%
(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)) (* k (* k (* a 99.0))))))
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 = k * (k * (a * 99.0));
}
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(k * Float64(k * Float64(a * 99.0))); 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[(k * N[(k * N[(a * 99.0), $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}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\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
Applied rewrites58.4%
if -0.429999999999999993 < m < 1.26000000000000001Initial program 90.5%
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.8
Applied rewrites88.8%
if 1.26000000000000001 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
Final simplification63.3%
(FPCore (a k m) :precision binary64 (if (<= m -7e-26) (/ a (* k k)) (if (<= m 0.4) (/ a (fma k 10.0 1.0)) (* k (* k (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -7e-26) {
tmp = a / (k * k);
} else if (m <= 0.4) {
tmp = a / fma(k, 10.0, 1.0);
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -7e-26) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.4) tmp = Float64(a / fma(k, 10.0, 1.0)); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -7e-26], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.4], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7 \cdot 10^{-26}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.4:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < -6.9999999999999997e-26Initial program 98.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-+.f6431.3
Applied rewrites31.3%
Taylor expanded in k around inf
Applied rewrites58.7%
if -6.9999999999999997e-26 < m < 0.40000000000000002Initial program 91.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-+.f6490.2
Applied rewrites90.2%
Taylor expanded in k around 0
Applied rewrites62.6%
if 0.40000000000000002 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
(FPCore (a k m)
:precision binary64
(if (<= m 3.6e-265)
(/ a (* k k))
(if (<= m 2e+62)
(fma (* k (fma 99.0 k -10.0)) a a)
(* k (* k (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.6e-265) {
tmp = a / (k * k);
} else if (m <= 2e+62) {
tmp = fma((k * fma(99.0, k, -10.0)), a, a);
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= 3.6e-265) tmp = Float64(a / Float64(k * k)); elseif (m <= 2e+62) tmp = fma(Float64(k * fma(99.0, k, -10.0)), a, a); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, 3.6e-265], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2e+62], N[(N[(k * N[(99.0 * k + -10.0), $MachinePrecision]), $MachinePrecision] * a + a), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.6 \cdot 10^{-265}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot \mathsf{fma}\left(99, k, -10\right), a, a\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 3.6000000000000002e-265Initial program 97.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-+.f6450.9
Applied rewrites50.9%
Taylor expanded in k around inf
Applied rewrites57.3%
if 3.6000000000000002e-265 < m < 2.00000000000000007e62Initial program 88.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-+.f6468.2
Applied rewrites68.2%
Taylor expanded in k around 0
Applied rewrites45.4%
Applied rewrites47.0%
if 2.00000000000000007e62 < m Initial program 85.7%
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-+.f643.3
Applied rewrites3.3%
Taylor expanded in k around 0
Applied rewrites22.1%
Taylor expanded in k around inf
Applied rewrites43.2%
(FPCore (a k m) :precision binary64 (if (<= m 3.6e-265) (/ a (* k k)) (if (<= m 0.395) (* a 1.0) (* k (* k (* a 99.0))))))
double code(double a, double k, double m) {
double tmp;
if (m <= 3.6e-265) {
tmp = a / (k * k);
} else if (m <= 0.395) {
tmp = a * 1.0;
} else {
tmp = k * (k * (a * 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.6d-265) then
tmp = a / (k * k)
else if (m <= 0.395d0) then
tmp = a * 1.0d0
else
tmp = k * (k * (a * 99.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 3.6e-265) {
tmp = a / (k * k);
} else if (m <= 0.395) {
tmp = a * 1.0;
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 3.6e-265: tmp = a / (k * k) elif m <= 0.395: tmp = a * 1.0 else: tmp = k * (k * (a * 99.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 3.6e-265) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.395) tmp = Float64(a * 1.0); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 3.6e-265) tmp = a / (k * k); elseif (m <= 0.395) tmp = a * 1.0; else tmp = k * (k * (a * 99.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 3.6e-265], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.395], N[(a * 1.0), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 3.6 \cdot 10^{-265}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.395:\\
\;\;\;\;a \cdot 1\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 3.6000000000000002e-265Initial program 97.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-+.f6450.9
Applied rewrites50.9%
Taylor expanded in k around inf
Applied rewrites57.3%
if 3.6000000000000002e-265 < m < 0.39500000000000002Initial program 89.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6451.2
Applied rewrites51.2%
Taylor expanded in m around 0
Applied rewrites51.2%
if 0.39500000000000002 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
(FPCore (a k m) :precision binary64 (if (<= m 0.395) (* a 1.0) (* k (* k (* a 99.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.395) {
tmp = a * 1.0;
} else {
tmp = k * (k * (a * 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.395d0) then
tmp = a * 1.0d0
else
tmp = k * (k * (a * 99.0d0))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.395) {
tmp = a * 1.0;
} else {
tmp = k * (k * (a * 99.0));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.395: tmp = a * 1.0 else: tmp = k * (k * (a * 99.0)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.395) tmp = Float64(a * 1.0); else tmp = Float64(k * Float64(k * Float64(a * 99.0))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.395) tmp = a * 1.0; else tmp = k * (k * (a * 99.0)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.395], N[(a * 1.0), $MachinePrecision], N[(k * N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.395:\\
\;\;\;\;a \cdot 1\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(k \cdot \left(a \cdot 99\right)\right)\\
\end{array}
\end{array}
if m < 0.39500000000000002Initial program 95.1%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6471.3
Applied rewrites71.3%
Taylor expanded in m around 0
Applied rewrites25.0%
if 0.39500000000000002 < m Initial program 85.5%
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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
Applied rewrites22.6%
Taylor expanded in k around inf
Applied rewrites40.5%
(FPCore (a k m) :precision binary64 (fma (* k a) -10.0 a))
double code(double a, double k, double m) {
return fma((k * a), -10.0, a);
}
function code(a, k, m) return fma(Float64(k * a), -10.0, a) end
code[a_, k_, m_] := N[(N[(k * a), $MachinePrecision] * -10.0 + a), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(k \cdot a, -10, a\right)
\end{array}
Initial program 92.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-+.f6441.7
Applied rewrites41.7%
Taylor expanded in k around 0
Applied rewrites23.3%
Taylor expanded in k around 0
Applied rewrites18.9%
Applied rewrites19.7%
Final simplification19.7%
(FPCore (a k m) :precision binary64 (fma k (* a -10.0) a))
double code(double a, double k, double m) {
return fma(k, (a * -10.0), a);
}
function code(a, k, m) return fma(k, Float64(a * -10.0), a) end
code[a_, k_, m_] := N[(k * N[(a * -10.0), $MachinePrecision] + a), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(k, a \cdot -10, a\right)
\end{array}
Initial program 92.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-+.f6441.7
Applied rewrites41.7%
Taylor expanded in k around 0
Applied rewrites18.9%
(FPCore (a k m) :precision binary64 (* a 1.0))
double code(double a, double k, double m) {
return a * 1.0;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = a * 1.0d0
end function
public static double code(double a, double k, double m) {
return a * 1.0;
}
def code(a, k, m): return a * 1.0
function code(a, k, m) return Float64(a * 1.0) end
function tmp = code(a, k, m) tmp = a * 1.0; end
code[a_, k_, m_] := N[(a * 1.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 1
\end{array}
Initial program 92.0%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6480.6
Applied rewrites80.6%
Taylor expanded in m around 0
Applied rewrites18.1%
herbie shell --seed 2024221
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))