
(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 18 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 (* a (pow k m))))
(if (<= k 2e-37)
t_0
(/ 1.0 (fma k (+ (/ k t_0) (/ 10.0 t_0)) (/ 1.0 t_0))))))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (k <= 2e-37) {
tmp = t_0;
} else {
tmp = 1.0 / fma(k, ((k / t_0) + (10.0 / t_0)), (1.0 / t_0));
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (k <= 2e-37) tmp = t_0; else tmp = Float64(1.0 / fma(k, Float64(Float64(k / t_0) + Float64(10.0 / t_0)), Float64(1.0 / t_0))); end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2e-37], t$95$0, N[(1.0 / N[(k * N[(N[(k / t$95$0), $MachinePrecision] + N[(10.0 / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, \frac{k}{t\_0} + \frac{10}{t\_0}, \frac{1}{t\_0}\right)}\\
\end{array}
\end{array}
if k < 2.00000000000000013e-37Initial program 95.6%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if 2.00000000000000013e-37 < k Initial program 76.4%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6476.4
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-+.f6476.4
Applied rewrites76.4%
Taylor expanded in k around 0
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) 1e+178)
(/ 1.0 (fma (* (/ (pow k (- m)) a) (+ k 10.0)) k (/ 1.0 a)))
t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= 1e+178) {
tmp = 1.0 / fma(((pow(k, -m) / a) * (k + 10.0)), k, (1.0 / a));
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 1e+178) tmp = Float64(1.0 / fma(Float64(Float64((k ^ Float64(-m)) / a) * Float64(k + 10.0)), k, Float64(1.0 / a))); 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[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+178], N[(1.0 / N[(N[(N[(N[Power[k, (-m)], $MachinePrecision] / a), $MachinePrecision] * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] * k + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+178}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\frac{{k}^{\left(-m\right)}}{a} \cdot \left(k + 10\right), k, \frac{1}{a}\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))) < 1.0000000000000001e178Initial program 96.7%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6496.6
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.6
Applied rewrites96.6%
Taylor expanded in k around 0
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6480.1
Applied rewrites80.1%
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6480.1
Applied rewrites89.2%
Taylor expanded in m around 0
lower-/.f6485.4
Applied rewrites85.4%
if 1.0000000000000001e178 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 60.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification88.7%
(FPCore (a k m) :precision binary64 (let* ((t_0 (/ (pow k (- m)) a))) (if (<= k 2e-37) (* a (pow k m)) (/ 1.0 (fma (* t_0 (+ k 10.0)) k t_0)))))
double code(double a, double k, double m) {
double t_0 = pow(k, -m) / a;
double tmp;
if (k <= 2e-37) {
tmp = a * pow(k, m);
} else {
tmp = 1.0 / fma((t_0 * (k + 10.0)), k, t_0);
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ Float64(-m)) / a) tmp = 0.0 if (k <= 2e-37) tmp = Float64(a * (k ^ m)); else tmp = Float64(1.0 / fma(Float64(t_0 * Float64(k + 10.0)), k, t_0)); end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, (-m)], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[k, 2e-37], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(t$95$0 * N[(k + 10.0), $MachinePrecision]), $MachinePrecision] * k + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{k}^{\left(-m\right)}}{a}\\
\mathbf{if}\;k \leq 2 \cdot 10^{-37}:\\
\;\;\;\;a \cdot {k}^{m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(t\_0 \cdot \left(k + 10\right), k, t\_0\right)}\\
\end{array}
\end{array}
if k < 2.00000000000000013e-37Initial program 95.6%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if 2.00000000000000013e-37 < k Initial program 76.4%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6476.4
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-+.f6476.4
Applied rewrites76.4%
Taylor expanded in k around 0
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.7%
(FPCore (a k m) :precision binary64 (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))) 0.0) (* k (* k (- a))) (fma a (* k -10.0) a)))
double code(double a, double k, double m) {
double tmp;
if (((a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k))) <= 0.0) {
tmp = k * (k * -a);
} else {
tmp = fma(a, (k * -10.0), a);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= 0.0) tmp = Float64(k * Float64(k * Float64(-a))); else tmp = fma(a, Float64(k * -10.0), a); end return tmp end
code[a_, k_, m_] := If[LessEqual[N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(k * N[(k * (-a)), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * -10.0), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\
\;\;\;\;k \cdot \left(k \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, k \cdot -10, a\right)\\
\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))) < 0.0Initial program 96.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-+.f6450.9
Applied rewrites50.9%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites31.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6430.0
Applied rewrites30.0%
Taylor expanded in k around 0
mul-1-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6413.7
Applied rewrites13.7%
if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) Initial program 72.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-+.f6436.6
Applied rewrites36.6%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6435.4
Applied rewrites35.4%
Final simplification20.8%
(FPCore (a k m) :precision binary64 (let* ((t_0 (* a (pow k m)))) (if (<= m 2.7) (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) t_0)))
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (m <= 2.7) {
tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = 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 = a * (k ** m)
if (m <= 2.7d0) then
tmp = t_0 / ((1.0d0 + (k * 10.0d0)) + (k * k))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double t_0 = a * Math.pow(k, m);
double tmp;
if (m <= 2.7) {
tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, k, m): t_0 = a * math.pow(k, m) tmp = 0 if m <= 2.7: tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k)) else: tmp = t_0 return tmp
function code(a, k, m) t_0 = Float64(a * (k ^ m)) tmp = 0.0 if (m <= 2.7) tmp = Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, k, m) t_0 = a * (k ^ m); tmp = 0.0; if (m <= 2.7) tmp = t_0 / ((1.0 + (k * 10.0)) + (k * k)); else tmp = t_0; end tmp_2 = tmp; end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 2.7], N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq 2.7:\\
\;\;\;\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < 2.7000000000000002Initial program 96.1%
if 2.7000000000000002 < m Initial program 72.9%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Final simplification97.4%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= m -2.1e-5)
t_0
(if (<= m 0.000105) (/ a (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 <= -2.1e-5) {
tmp = t_0;
} else if (m <= 0.000105) {
tmp = a / 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 <= -2.1e-5) tmp = t_0; elseif (m <= 0.000105) tmp = Float64(a / 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, -2.1e-5], t$95$0, If[LessEqual[m, 0.000105], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -2.1 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 0.000105:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -2.09999999999999988e-5 or 1.05e-4 < m Initial program 86.0%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if -2.09999999999999988e-5 < m < 1.05e-4Initial program 92.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.0
Applied rewrites92.0%
Final simplification97.1%
(FPCore (a k m)
:precision binary64
(if (<= m -9.2e+26)
(/
(fma
(/ a (* k k))
100.0
(- a (/ (fma (/ a k) -10001.0 (* a -20.0)) (* k (* k k)))))
(* k k))
(if (<= m 0.48)
(/ 1.0 (/ (fma k (+ k 10.0) 1.0) a))
(if (<= m 1.55e+175)
(* (* k k) (- (* a 99.0) (/ (fma a 10.0 (/ a (- k))) k)))
(*
(* k k)
(fma
k
(fma
k
(fma (fma a 2000.0 (* a -6000.0)) (- k) (* a -300.0))
(* a 20.0))
(- a)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.2e+26) {
tmp = fma((a / (k * k)), 100.0, (a - (fma((a / k), -10001.0, (a * -20.0)) / (k * (k * k))))) / (k * k);
} else if (m <= 0.48) {
tmp = 1.0 / (fma(k, (k + 10.0), 1.0) / a);
} else if (m <= 1.55e+175) {
tmp = (k * k) * ((a * 99.0) - (fma(a, 10.0, (a / -k)) / k));
} else {
tmp = (k * k) * fma(k, fma(k, fma(fma(a, 2000.0, (a * -6000.0)), -k, (a * -300.0)), (a * 20.0)), -a);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.2e+26) tmp = Float64(fma(Float64(a / Float64(k * k)), 100.0, Float64(a - Float64(fma(Float64(a / k), -10001.0, Float64(a * -20.0)) / Float64(k * Float64(k * k))))) / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(1.0 / Float64(fma(k, Float64(k + 10.0), 1.0) / a)); elseif (m <= 1.55e+175) tmp = Float64(Float64(k * k) * Float64(Float64(a * 99.0) - Float64(fma(a, 10.0, Float64(a / Float64(-k))) / k))); else tmp = Float64(Float64(k * k) * fma(k, fma(k, fma(fma(a, 2000.0, Float64(a * -6000.0)), Float64(-k), Float64(a * -300.0)), Float64(a * 20.0)), Float64(-a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.2e+26], N[(N[(N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision] * 100.0 + N[(a - N[(N[(N[(a / k), $MachinePrecision] * -10001.0 + N[(a * -20.0), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(1.0 / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.55e+175], N[(N[(k * k), $MachinePrecision] * N[(N[(a * 99.0), $MachinePrecision] - N[(N[(a * 10.0 + N[(a / (-k)), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * N[(N[(a * 2000.0 + N[(a * -6000.0), $MachinePrecision]), $MachinePrecision] * (-k) + N[(a * -300.0), $MachinePrecision]), $MachinePrecision] + N[(a * 20.0), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k \cdot k}, 100, a - \frac{\mathsf{fma}\left(\frac{a}{k}, -10001, a \cdot -20\right)}{k \cdot \left(k \cdot k\right)}\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{a}}\\
\mathbf{elif}\;m \leq 1.55 \cdot 10^{+175}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \left(a \cdot 99 - \frac{\mathsf{fma}\left(a, 10, \frac{a}{-k}\right)}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(\mathsf{fma}\left(a, 2000, a \cdot -6000\right), -k, a \cdot -300\right), a \cdot 20\right), -a\right)\\
\end{array}
\end{array}
if m < -9.2000000000000002e26Initial 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-+.f6439.7
Applied rewrites39.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites22.6%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6421.4
Applied rewrites21.4%
Taylor expanded in k around -inf
lower-/.f64N/A
Applied rewrites75.2%
if -9.2000000000000002e26 < m < 0.47999999999999998Initial program 93.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-+.f6488.4
Applied rewrites88.4%
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.6
Applied rewrites88.6%
if 0.47999999999999998 < m < 1.54999999999999992e175Initial program 66.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.0
Applied rewrites3.0%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.5%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.6
Applied rewrites32.6%
Taylor expanded in k around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
if 1.54999999999999992e175 < m Initial program 82.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.1
Applied rewrites3.1%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
Taylor expanded in k around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9.2e+26)
(/ (fma (/ a (* k k)) 100.0 a) (* k k))
(if (<= m 0.48)
(/ 1.0 (/ (fma k (+ k 10.0) 1.0) a))
(if (<= m 1.55e+175)
(* (* k k) (- (* a 99.0) (/ (fma a 10.0 (/ a (- k))) k)))
(*
(* k k)
(fma
k
(fma
k
(fma (fma a 2000.0 (* a -6000.0)) (- k) (* a -300.0))
(* a 20.0))
(- a)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.2e+26) {
tmp = fma((a / (k * k)), 100.0, a) / (k * k);
} else if (m <= 0.48) {
tmp = 1.0 / (fma(k, (k + 10.0), 1.0) / a);
} else if (m <= 1.55e+175) {
tmp = (k * k) * ((a * 99.0) - (fma(a, 10.0, (a / -k)) / k));
} else {
tmp = (k * k) * fma(k, fma(k, fma(fma(a, 2000.0, (a * -6000.0)), -k, (a * -300.0)), (a * 20.0)), -a);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.2e+26) tmp = Float64(fma(Float64(a / Float64(k * k)), 100.0, a) / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(1.0 / Float64(fma(k, Float64(k + 10.0), 1.0) / a)); elseif (m <= 1.55e+175) tmp = Float64(Float64(k * k) * Float64(Float64(a * 99.0) - Float64(fma(a, 10.0, Float64(a / Float64(-k))) / k))); else tmp = Float64(Float64(k * k) * fma(k, fma(k, fma(fma(a, 2000.0, Float64(a * -6000.0)), Float64(-k), Float64(a * -300.0)), Float64(a * 20.0)), Float64(-a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.2e+26], N[(N[(N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision] * 100.0 + a), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(1.0 / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.55e+175], N[(N[(k * k), $MachinePrecision] * N[(N[(a * 99.0), $MachinePrecision] - N[(N[(a * 10.0 + N[(a / (-k)), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * N[(N[(a * 2000.0 + N[(a * -6000.0), $MachinePrecision]), $MachinePrecision] * (-k) + N[(a * -300.0), $MachinePrecision]), $MachinePrecision] + N[(a * 20.0), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k \cdot k}, 100, a\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{a}}\\
\mathbf{elif}\;m \leq 1.55 \cdot 10^{+175}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \left(a \cdot 99 - \frac{\mathsf{fma}\left(a, 10, \frac{a}{-k}\right)}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(\mathsf{fma}\left(a, 2000, a \cdot -6000\right), -k, a \cdot -300\right), a \cdot 20\right), -a\right)\\
\end{array}
\end{array}
if m < -9.2000000000000002e26Initial 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-+.f6439.7
Applied rewrites39.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites22.6%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6421.4
Applied rewrites21.4%
Taylor expanded in k around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.8
Applied rewrites73.8%
if -9.2000000000000002e26 < m < 0.47999999999999998Initial program 93.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-+.f6488.4
Applied rewrites88.4%
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.6
Applied rewrites88.6%
if 0.47999999999999998 < m < 1.54999999999999992e175Initial program 66.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.0
Applied rewrites3.0%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.5%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.6
Applied rewrites32.6%
Taylor expanded in k around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
if 1.54999999999999992e175 < m Initial program 82.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.1
Applied rewrites3.1%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
Taylor expanded in k around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9.2e+26)
(/ (fma (/ a (* k k)) 100.0 a) (* k k))
(if (<= m 0.48)
(/ 1.0 (/ (fma k (+ k 10.0) 1.0) a))
(if (<= m 6e+149)
(* (* k k) (- (* a 99.0) (/ (fma a 10.0 (/ a (- k))) k)))
(* k (* 99.0 (* k a)))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.2e+26) {
tmp = fma((a / (k * k)), 100.0, a) / (k * k);
} else if (m <= 0.48) {
tmp = 1.0 / (fma(k, (k + 10.0), 1.0) / a);
} else if (m <= 6e+149) {
tmp = (k * k) * ((a * 99.0) - (fma(a, 10.0, (a / -k)) / k));
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.2e+26) tmp = Float64(fma(Float64(a / Float64(k * k)), 100.0, a) / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(1.0 / Float64(fma(k, Float64(k + 10.0), 1.0) / a)); elseif (m <= 6e+149) tmp = Float64(Float64(k * k) * Float64(Float64(a * 99.0) - Float64(fma(a, 10.0, Float64(a / Float64(-k))) / k))); else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.2e+26], N[(N[(N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision] * 100.0 + a), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(1.0 / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 6e+149], N[(N[(k * k), $MachinePrecision] * N[(N[(a * 99.0), $MachinePrecision] - N[(N[(a * 10.0 + N[(a / (-k)), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k \cdot k}, 100, a\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{a}}\\
\mathbf{elif}\;m \leq 6 \cdot 10^{+149}:\\
\;\;\;\;\left(k \cdot k\right) \cdot \left(a \cdot 99 - \frac{\mathsf{fma}\left(a, 10, \frac{a}{-k}\right)}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -9.2000000000000002e26Initial 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-+.f6439.7
Applied rewrites39.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites22.6%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6421.4
Applied rewrites21.4%
Taylor expanded in k around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.8
Applied rewrites73.8%
if -9.2000000000000002e26 < m < 0.47999999999999998Initial program 93.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-+.f6488.4
Applied rewrites88.4%
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.6
Applied rewrites88.6%
if 0.47999999999999998 < m < 6.00000000000000007e149Initial program 62.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-+.f642.9
Applied rewrites2.9%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.1%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.2
Applied rewrites28.2%
Taylor expanded in k around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6458.7
Applied rewrites58.7%
if 6.00000000000000007e149 < m Initial program 82.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-+.f643.2
Applied rewrites3.2%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites18.0%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.7
Applied rewrites29.7%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
Final simplification73.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9.2e+26)
(/ (fma (/ a (* k k)) 100.0 a) (* k k))
(if (<= m 0.48)
(/ 1.0 (/ (fma k (+ k 10.0) 1.0) a))
(* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.2e+26) {
tmp = fma((a / (k * k)), 100.0, a) / (k * k);
} else if (m <= 0.48) {
tmp = 1.0 / (fma(k, (k + 10.0), 1.0) / a);
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.2e+26) tmp = Float64(fma(Float64(a / Float64(k * k)), 100.0, a) / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(1.0 / Float64(fma(k, Float64(k + 10.0), 1.0) / a)); else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.2e+26], N[(N[(N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision] * 100.0 + a), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(1.0 / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k \cdot k}, 100, a\right)}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -9.2000000000000002e26Initial 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-+.f6439.7
Applied rewrites39.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-/.f64N/A
Applied rewrites22.6%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6421.4
Applied rewrites21.4%
Taylor expanded in k around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.8
Applied rewrites73.8%
if -9.2000000000000002e26 < m < 0.47999999999999998Initial program 93.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-+.f6488.4
Applied rewrites88.4%
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.6
Applied rewrites88.6%
if 0.47999999999999998 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification72.0%
(FPCore (a k m)
:precision binary64
(if (<= m -9.2e+26)
(/ a (* k k))
(if (<= m 0.48)
(/ 1.0 (/ (fma k (+ k 10.0) 1.0) a))
(* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.2e+26) {
tmp = a / (k * k);
} else if (m <= 0.48) {
tmp = 1.0 / (fma(k, (k + 10.0), 1.0) / a);
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9.2e+26) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(1.0 / Float64(fma(k, Float64(k + 10.0), 1.0) / a)); else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9.2e+26], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(1.0 / N[(N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k, k + 10, 1\right)}{a}}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -9.2000000000000002e26Initial 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-+.f6439.7
Applied rewrites39.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6470.0
Applied rewrites70.0%
if -9.2000000000000002e26 < m < 0.47999999999999998Initial program 93.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-+.f6488.4
Applied rewrites88.4%
lift-+.f64N/A
lift-fma.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.6
Applied rewrites88.6%
if 0.47999999999999998 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification71.0%
(FPCore (a k m) :precision binary64 (if (<= m -0.27) (/ a (* k k)) (if (<= m 0.48) (/ a (fma k (+ k 10.0) 1.0)) (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -0.27) {
tmp = a / (k * k);
} else if (m <= 0.48) {
tmp = a / fma(k, (k + 10.0), 1.0);
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -0.27) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0)); else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -0.27], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.27:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -0.27000000000000002Initial 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-+.f6439.5
Applied rewrites39.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6467.8
Applied rewrites67.8%
if -0.27000000000000002 < m < 0.47999999999999998Initial program 92.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-+.f6491.2
Applied rewrites91.2%
if 0.47999999999999998 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification70.9%
(FPCore (a k m) :precision binary64 (if (<= m -2.9e-10) (/ a (* k k)) (if (<= m 0.48) (/ a (fma k 10.0 1.0)) (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2.9e-10) {
tmp = a / (k * k);
} else if (m <= 0.48) {
tmp = a / fma(k, 10.0, 1.0);
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -2.9e-10) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.48) tmp = Float64(a / fma(k, 10.0, 1.0)); else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -2.9e-10], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.48], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2.9 \cdot 10^{-10}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.48:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -2.89999999999999981e-10Initial 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.7
Applied rewrites40.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6467.8
Applied rewrites67.8%
if -2.89999999999999981e-10 < m < 0.47999999999999998Initial program 92.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-+.f6491.8
Applied rewrites91.8%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6467.1
Applied rewrites67.1%
if 0.47999999999999998 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification62.2%
(FPCore (a k m) :precision binary64 (if (<= m -9.5e-11) (/ a (* k k)) (if (<= m 0.21) a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9.5e-11) {
tmp = a / (k * k);
} else if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.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 <= (-9.5d-11)) then
tmp = a / (k * k)
else if (m <= 0.21d0) then
tmp = a
else
tmp = k * (99.0d0 * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -9.5e-11) {
tmp = a / (k * k);
} else if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -9.5e-11: tmp = a / (k * k) elif m <= 0.21: tmp = a else: tmp = k * (99.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -9.5e-11) tmp = Float64(a / Float64(k * k)); elseif (m <= 0.21) tmp = a; else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -9.5e-11) tmp = a / (k * k); elseif (m <= 0.21) tmp = a; else tmp = k * (99.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -9.5e-11], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.21], a, N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 0.21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -9.49999999999999951e-11Initial 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.7
Applied rewrites40.7%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6467.8
Applied rewrites67.8%
if -9.49999999999999951e-11 < m < 0.209999999999999992Initial program 92.6%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6459.7
Applied rewrites59.7%
Taylor expanded in m around 0
Applied rewrites58.9%
*-rgt-identity58.9
Applied rewrites58.9%
if 0.209999999999999992 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification59.3%
(FPCore (a k m) :precision binary64 (if (<= m -1.82e-10) (/ a (* k 10.0)) (if (<= m 0.21) a (* k (* 99.0 (* k a))))))
double code(double a, double k, double m) {
double tmp;
if (m <= -1.82e-10) {
tmp = a / (k * 10.0);
} else if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.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 <= (-1.82d-10)) then
tmp = a / (k * 10.0d0)
else if (m <= 0.21d0) then
tmp = a
else
tmp = k * (99.0d0 * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= -1.82e-10) {
tmp = a / (k * 10.0);
} else if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= -1.82e-10: tmp = a / (k * 10.0) elif m <= 0.21: tmp = a else: tmp = k * (99.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= -1.82e-10) tmp = Float64(a / Float64(k * 10.0)); elseif (m <= 0.21) tmp = a; else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= -1.82e-10) tmp = a / (k * 10.0); elseif (m <= 0.21) tmp = a; else tmp = k * (99.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, -1.82e-10], N[(a / N[(k * 10.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.21], a, N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.82 \cdot 10^{-10}:\\
\;\;\;\;\frac{a}{k \cdot 10}\\
\mathbf{elif}\;m \leq 0.21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < -1.8199999999999999e-10Initial 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.7
Applied rewrites40.7%
Taylor expanded in k around inf
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6448.5
Applied rewrites48.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f6428.4
Applied rewrites28.4%
if -1.8199999999999999e-10 < m < 0.209999999999999992Initial program 92.6%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6459.7
Applied rewrites59.7%
Taylor expanded in m around 0
Applied rewrites58.9%
*-rgt-identity58.9
Applied rewrites58.9%
if 0.209999999999999992 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification46.8%
(FPCore (a k m) :precision binary64 (if (<= m 0.21) a (* k (* 99.0 (* k a)))))
double code(double a, double k, double m) {
double tmp;
if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.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 <= 0.21d0) then
tmp = a
else
tmp = k * (99.0d0 * (k * a))
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 0.21) {
tmp = a;
} else {
tmp = k * (99.0 * (k * a));
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 0.21: tmp = a else: tmp = k * (99.0 * (k * a)) return tmp
function code(a, k, m) tmp = 0.0 if (m <= 0.21) tmp = a; else tmp = Float64(k * Float64(99.0 * Float64(k * a))); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 0.21) tmp = a; else tmp = k * (99.0 * (k * a)); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 0.21], a, N[(k * N[(99.0 * N[(k * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 0.21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(99 \cdot \left(k \cdot a\right)\right)\\
\end{array}
\end{array}
if m < 0.209999999999999992Initial program 96.1%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6477.7
Applied rewrites77.7%
Taylor expanded in m around 0
Applied rewrites33.0%
*-rgt-identity33.0
Applied rewrites33.0%
if 0.209999999999999992 < m Initial program 72.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-+.f643.1
Applied rewrites3.1%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites17.6%
Taylor expanded in k around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
Taylor expanded in k around inf
unpow2N/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.5
Applied rewrites51.5%
Final simplification39.1%
(FPCore (a k m) :precision binary64 (fma a (* k -10.0) a))
double code(double a, double k, double m) {
return fma(a, (k * -10.0), a);
}
function code(a, k, m) return fma(a, Float64(k * -10.0), a) end
code[a_, k_, m_] := N[(a * N[(k * -10.0), $MachinePrecision] + a), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, k \cdot -10, a\right)
\end{array}
Initial program 88.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-+.f6446.2
Applied rewrites46.2%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6423.9
Applied rewrites23.9%
(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.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6485.1
Applied rewrites85.1%
Taylor expanded in m around 0
Applied rewrites23.3%
*-rgt-identity23.3
Applied rewrites23.3%
herbie shell --seed 2024216
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))