
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m): return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m) return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) end
function tmp = code(a, k, m) tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k)); end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= k 5e-90)
t_0
(pow (fma (+ (/ k t_0) (/ 10.0 t_0)) k (/ 1.0 t_0)) -1.0))))
double code(double a, double k, double m) {
double t_0 = pow(k, m) * a;
double tmp;
if (k <= 5e-90) {
tmp = t_0;
} else {
tmp = pow(fma(((k / t_0) + (10.0 / t_0)), k, (1.0 / t_0)), -1.0);
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ m) * a) tmp = 0.0 if (k <= 5e-90) tmp = t_0; else tmp = fma(Float64(Float64(k / t_0) + Float64(10.0 / t_0)), k, Float64(1.0 / t_0)) ^ -1.0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[k, 5e-90], t$95$0, N[Power[N[(N[(N[(k / t$95$0), $MachinePrecision] + N[(10.0 / t$95$0), $MachinePrecision]), $MachinePrecision] * k + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {k}^{m} \cdot a\\
\mathbf{if}\;k \leq 5 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{k}{t\_0} + \frac{10}{t\_0}, k, \frac{1}{t\_0}\right)\right)}^{-1}\\
\end{array}
\end{array}
if k < 5.00000000000000019e-90Initial program 97.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if 5.00000000000000019e-90 < k Initial program 79.4%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6479.4
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6479.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.4
Applied rewrites79.4%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.9
Applied rewrites99.9%
Final simplification100.0%
(FPCore (a k m) :precision binary64 (let* ((t_0 (/ (pow k (- m)) a))) (if (<= k 2e-81) (* (pow k m) a) (/ 1.0 (fma (* (+ 10.0 k) t_0) k t_0)))))
double code(double a, double k, double m) {
double t_0 = pow(k, -m) / a;
double tmp;
if (k <= 2e-81) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / fma(((10.0 + k) * t_0), k, t_0);
}
return tmp;
}
function code(a, k, m) t_0 = Float64((k ^ Float64(-m)) / a) tmp = 0.0 if (k <= 2e-81) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / fma(Float64(Float64(10.0 + k) * t_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-81], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(N[(10.0 + k), $MachinePrecision] * t$95$0), $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^{-81}:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\left(10 + k\right) \cdot t\_0, k, t\_0\right)}\\
\end{array}
\end{array}
if k < 1.9999999999999999e-81Initial program 97.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if 1.9999999999999999e-81 < k Initial program 79.2%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6479.2
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6479.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.9
Applied rewrites99.9%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification100.0%
(FPCore (a k m) :precision binary64 (if (<= k 1.0) (* (pow k m) a) (/ 1.0 (* (* (/ (pow (/ 1.0 k) m) a) k) k))))
double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = pow(k, m) * a;
} else {
tmp = 1.0 / (((pow((1.0 / k), m) / a) * k) * k);
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (k <= 1.0d0) then
tmp = (k ** m) * a
else
tmp = 1.0d0 / (((((1.0d0 / k) ** m) / a) * k) * k)
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (k <= 1.0) {
tmp = Math.pow(k, m) * a;
} else {
tmp = 1.0 / (((Math.pow((1.0 / k), m) / a) * k) * k);
}
return tmp;
}
def code(a, k, m): tmp = 0 if k <= 1.0: tmp = math.pow(k, m) * a else: tmp = 1.0 / (((math.pow((1.0 / k), m) / a) * k) * k) return tmp
function code(a, k, m) tmp = 0.0 if (k <= 1.0) tmp = Float64((k ^ m) * a); else tmp = Float64(1.0 / Float64(Float64(Float64((Float64(1.0 / k) ^ m) / a) * k) * k)); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (k <= 1.0) tmp = (k ^ m) * a; else tmp = 1.0 / (((((1.0 / k) ^ m) / a) * k) * k); end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[k, 1.0], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(1.0 / N[(N[(N[(N[Power[N[(1.0 / k), $MachinePrecision], m], $MachinePrecision] / a), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1:\\
\;\;\;\;{k}^{m} \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\frac{{\left(\frac{1}{k}\right)}^{m}}{a} \cdot k\right) \cdot k}\\
\end{array}
\end{array}
if k < 1Initial program 97.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.3
Applied rewrites99.3%
if 1 < k Initial program 74.5%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6474.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6474.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.9
Applied rewrites99.9%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in k around inf
Applied rewrites99.9%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (pow k m) a)))
(if (<= m -9e+14)
t_0
(if (<= m 5.6e-7) (/ 1.0 (fma (+ 10.0 k) (/ k 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 <= -9e+14) {
tmp = t_0;
} else if (m <= 5.6e-7) {
tmp = 1.0 / fma((10.0 + k), (k / 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 <= -9e+14) tmp = t_0; elseif (m <= 5.6e-7) tmp = Float64(1.0 / fma(Float64(10.0 + k), Float64(k / 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, -9e+14], t$95$0, If[LessEqual[m, 5.6e-7], N[(1.0 / N[(N[(10.0 + k), $MachinePrecision] * N[(k / a), $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 -9 \cdot 10^{+14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 5.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(10 + k, \frac{k}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -9e14 or 5.60000000000000038e-7 < m Initial program 90.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
if -9e14 < m < 5.60000000000000038e-7Initial program 88.7%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6488.7
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.7
Applied rewrites88.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in m around 0
Applied rewrites99.1%
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* (+ 10.0 k) k)) (t_1 (* t_0 k)))
(if (<= m -1.8e+17)
(* 1.0 (/ a (fma (* t_1 (+ 10.0 k)) t_0 1.0)))
(if (<= m 1.35)
(/ 1.0 (fma (+ 10.0 k) (/ k a) (/ 1.0 a)))
(* (fma t_1 (+ 10.0 k) (* (- k) k)) (/ a 1.0))))))
double code(double a, double k, double m) {
double t_0 = (10.0 + k) * k;
double t_1 = t_0 * k;
double tmp;
if (m <= -1.8e+17) {
tmp = 1.0 * (a / fma((t_1 * (10.0 + k)), t_0, 1.0));
} else if (m <= 1.35) {
tmp = 1.0 / fma((10.0 + k), (k / a), (1.0 / a));
} else {
tmp = fma(t_1, (10.0 + k), (-k * k)) * (a / 1.0);
}
return tmp;
}
function code(a, k, m) t_0 = Float64(Float64(10.0 + k) * k) t_1 = Float64(t_0 * k) tmp = 0.0 if (m <= -1.8e+17) tmp = Float64(1.0 * Float64(a / fma(Float64(t_1 * Float64(10.0 + k)), t_0, 1.0))); elseif (m <= 1.35) tmp = Float64(1.0 / fma(Float64(10.0 + k), Float64(k / a), Float64(1.0 / a))); else tmp = Float64(fma(t_1, Float64(10.0 + k), Float64(Float64(-k) * k)) * Float64(a / 1.0)); end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(10.0 + k), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * k), $MachinePrecision]}, If[LessEqual[m, -1.8e+17], N[(1.0 * N[(a / N[(N[(t$95$1 * N[(10.0 + k), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.35], N[(1.0 / N[(N[(10.0 + k), $MachinePrecision] * N[(k / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(10.0 + k), $MachinePrecision] + N[((-k) * k), $MachinePrecision]), $MachinePrecision] * N[(a / 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(10 + k\right) \cdot k\\
t_1 := t\_0 \cdot k\\
\mathbf{if}\;m \leq -1.8 \cdot 10^{+17}:\\
\;\;\;\;1 \cdot \frac{a}{\mathsf{fma}\left(t\_1 \cdot \left(10 + k\right), t\_0, 1\right)}\\
\mathbf{elif}\;m \leq 1.35:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(10 + k, \frac{k}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, 10 + k, \left(-k\right) \cdot k\right) \cdot \frac{a}{1}\\
\end{array}
\end{array}
if m < -1.8e17Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6437.0
Applied rewrites37.0%
Applied rewrites14.2%
Taylor expanded in k around 0
Applied rewrites66.7%
if -1.8e17 < m < 1.3500000000000001Initial program 89.1%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6489.0
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6489.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.8
Applied rewrites98.7%
Taylor expanded in m around 0
Applied rewrites96.6%
if 1.3500000000000001 < m Initial program 83.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites2.3%
Taylor expanded in k around inf
Applied rewrites34.8%
Taylor expanded in k around 0
Applied rewrites53.5%
Final simplification72.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9e+14)
(/ (- a (/ (* (/ a k) -99.0) k)) (* k k))
(if (<= m 1.35)
(/ 1.0 (fma (+ 10.0 k) (/ k a) (/ 1.0 a)))
(* (fma (* (* (+ 10.0 k) k) k) (+ 10.0 k) (* (- k) k)) (/ a 1.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = (a - (((a / k) * -99.0) / k)) / (k * k);
} else if (m <= 1.35) {
tmp = 1.0 / fma((10.0 + k), (k / a), (1.0 / a));
} else {
tmp = fma((((10.0 + k) * k) * k), (10.0 + k), (-k * k)) * (a / 1.0);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(Float64(a - Float64(Float64(Float64(a / k) * -99.0) / k)) / Float64(k * k)); elseif (m <= 1.35) tmp = Float64(1.0 / fma(Float64(10.0 + k), Float64(k / a), Float64(1.0 / a))); else tmp = Float64(fma(Float64(Float64(Float64(10.0 + k) * k) * k), Float64(10.0 + k), Float64(Float64(-k) * k)) * Float64(a / 1.0)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(N[(a - N[(N[(N[(a / k), $MachinePrecision] * -99.0), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.35], N[(1.0 / N[(N[(10.0 + k), $MachinePrecision] * N[(k / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(10.0 + k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * N[(10.0 + k), $MachinePrecision] + N[((-k) * k), $MachinePrecision]), $MachinePrecision] * N[(a / 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{a - \frac{\frac{a}{k} \cdot -99}{k}}{k \cdot k}\\
\mathbf{elif}\;m \leq 1.35:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(10 + k, \frac{k}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(10 + k\right) \cdot k\right) \cdot k, 10 + k, \left(-k\right) \cdot k\right) \cdot \frac{a}{1}\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6436.5
Applied rewrites36.5%
Taylor expanded in k around inf
Applied rewrites63.5%
Taylor expanded in k around 0
Applied rewrites63.5%
if -9e14 < m < 1.3500000000000001Initial program 89.0%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6488.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in m around 0
Applied rewrites97.6%
if 1.3500000000000001 < m Initial program 83.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites2.3%
Taylor expanded in k around inf
Applied rewrites34.8%
Taylor expanded in k around 0
Applied rewrites53.5%
Final simplification72.4%
(FPCore (a k m)
:precision binary64
(if (<= m -9e+14)
(* (/ 1.0 (* k k)) a)
(if (<= m 1.35)
(/ 1.0 (fma (+ 10.0 k) (/ k a) (/ 1.0 a)))
(* (fma (* (* (+ 10.0 k) k) k) (+ 10.0 k) (* (- k) k)) (/ a 1.0)))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = (1.0 / (k * k)) * a;
} else if (m <= 1.35) {
tmp = 1.0 / fma((10.0 + k), (k / a), (1.0 / a));
} else {
tmp = fma((((10.0 + k) * k) * k), (10.0 + k), (-k * k)) * (a / 1.0);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(Float64(1.0 / Float64(k * k)) * a); elseif (m <= 1.35) tmp = Float64(1.0 / fma(Float64(10.0 + k), Float64(k / a), Float64(1.0 / a))); else tmp = Float64(fma(Float64(Float64(Float64(10.0 + k) * k) * k), Float64(10.0 + k), Float64(Float64(-k) * k)) * Float64(a / 1.0)); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[m, 1.35], N[(1.0 / N[(N[(10.0 + k), $MachinePrecision] * N[(k / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(10.0 + k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * N[(10.0 + k), $MachinePrecision] + N[((-k) * k), $MachinePrecision]), $MachinePrecision] * N[(a / 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{k \cdot k} \cdot a\\
\mathbf{elif}\;m \leq 1.35:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(10 + k, \frac{k}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(10 + k\right) \cdot k\right) \cdot k, 10 + k, \left(-k\right) \cdot k\right) \cdot \frac{a}{1}\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in m around 0
Applied rewrites36.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
if -9e14 < m < 1.3500000000000001Initial program 89.0%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6488.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in m around 0
Applied rewrites97.6%
if 1.3500000000000001 < m Initial program 83.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites2.3%
Taylor expanded in k around inf
Applied rewrites34.8%
Taylor expanded in k around 0
Applied rewrites53.5%
Final simplification71.2%
(FPCore (a k m)
:precision binary64
(if (<= m -9e+14)
(* (/ 1.0 (* k k)) a)
(if (<= m 8e-5)
(/ 1.0 (fma (+ 10.0 k) (/ k a) (/ 1.0 a)))
(fma (fma (* 99.0 a) k (* -10.0 a)) k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = (1.0 / (k * k)) * a;
} else if (m <= 8e-5) {
tmp = 1.0 / fma((10.0 + k), (k / a), (1.0 / a));
} else {
tmp = fma(fma((99.0 * a), k, (-10.0 * a)), k, a);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(Float64(1.0 / Float64(k * k)) * a); elseif (m <= 8e-5) tmp = Float64(1.0 / fma(Float64(10.0 + k), Float64(k / a), Float64(1.0 / a))); else tmp = fma(fma(Float64(99.0 * a), k, Float64(-10.0 * a)), k, a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[m, 8e-5], N[(1.0 / N[(N[(10.0 + k), $MachinePrecision] * N[(k / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(99.0 * a), $MachinePrecision] * k + N[(-10.0 * a), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{k \cdot k} \cdot a\\
\mathbf{elif}\;m \leq 8 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(10 + k, \frac{k}{a}, \frac{1}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(99 \cdot a, k, -10 \cdot a\right), k, a\right)\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in m around 0
Applied rewrites36.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
if -9e14 < m < 8.00000000000000065e-5Initial program 88.7%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6488.7
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6488.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.7
Applied rewrites88.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in m around 0
Applied rewrites99.1%
if 8.00000000000000065e-5 < m Initial program 83.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.5
Applied rewrites3.5%
Applied rewrites2.8%
Taylor expanded in k around 0
Applied rewrites10.1%
Taylor expanded in k around 0
Applied rewrites22.9%
(FPCore (a k m)
:precision binary64
(if (<= m -9e+14)
(* (/ 1.0 (* k k)) a)
(if (<= m 8e-5)
(/ a (fma (+ 10.0 k) k 1.0))
(fma (fma (* 99.0 a) k (* -10.0 a)) k a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = (1.0 / (k * k)) * a;
} else if (m <= 8e-5) {
tmp = a / fma((10.0 + k), k, 1.0);
} else {
tmp = fma(fma((99.0 * a), k, (-10.0 * a)), k, a);
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(Float64(1.0 / Float64(k * k)) * a); elseif (m <= 8e-5) tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0)); else tmp = fma(fma(Float64(99.0 * a), k, Float64(-10.0 * a)), k, a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[m, 8e-5], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(99.0 * a), $MachinePrecision] * k + N[(-10.0 * a), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{k \cdot k} \cdot a\\
\mathbf{elif}\;m \leq 8 \cdot 10^{-5}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(99 \cdot a, k, -10 \cdot a\right), k, a\right)\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in m around 0
Applied rewrites36.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
if -9e14 < m < 8.00000000000000065e-5Initial program 88.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6488.8
Applied rewrites88.8%
if 8.00000000000000065e-5 < m Initial program 83.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.5
Applied rewrites3.5%
Applied rewrites2.8%
Taylor expanded in k around 0
Applied rewrites10.1%
Taylor expanded in k around 0
Applied rewrites22.9%
Final simplification55.9%
(FPCore (a k m) :precision binary64 (if (<= m -9e+14) (* (/ 1.0 (* k k)) a) (if (<= m 85000000000.0) (/ a (fma (+ 10.0 k) k 1.0)) (* (* -10.0 k) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = (1.0 / (k * k)) * a;
} else if (m <= 85000000000.0) {
tmp = a / fma((10.0 + k), k, 1.0);
} else {
tmp = (-10.0 * k) * a;
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(Float64(1.0 / Float64(k * k)) * a); elseif (m <= 85000000000.0) tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0)); else tmp = Float64(Float64(-10.0 * k) * a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(N[(1.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[m, 85000000000.0], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * k), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{k \cdot k} \cdot a\\
\mathbf{elif}\;m \leq 85000000000:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(-10 \cdot k\right) \cdot a\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in m around 0
Applied rewrites36.5%
Taylor expanded in k around inf
unpow2N/A
lower-*.f6459.0
Applied rewrites59.0%
if -9e14 < m < 8.5e10Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6485.7
Applied rewrites85.7%
if 8.5e10 < m Initial program 84.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites3.0%
Taylor expanded in k around 0
Applied rewrites4.9%
Taylor expanded in k around inf
Applied rewrites13.7%
Final simplification52.3%
(FPCore (a k m) :precision binary64 (if (<= m -9e+14) (/ a (* k k)) (if (<= m 85000000000.0) (/ a (fma (+ 10.0 k) k 1.0)) (* (* -10.0 k) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -9e+14) {
tmp = a / (k * k);
} else if (m <= 85000000000.0) {
tmp = a / fma((10.0 + k), k, 1.0);
} else {
tmp = (-10.0 * k) * a;
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -9e+14) tmp = Float64(a / Float64(k * k)); elseif (m <= 85000000000.0) tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0)); else tmp = Float64(Float64(-10.0 * k) * a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -9e+14], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 85000000000.0], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * k), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -9 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 85000000000:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(-10 \cdot k\right) \cdot a\\
\end{array}
\end{array}
if m < -9e14Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6436.5
Applied rewrites36.5%
Taylor expanded in k around inf
Applied rewrites57.5%
if -9e14 < m < 8.5e10Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6485.7
Applied rewrites85.7%
if 8.5e10 < m Initial program 84.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites3.0%
Taylor expanded in k around 0
Applied rewrites4.9%
Taylor expanded in k around inf
Applied rewrites13.7%
Final simplification51.9%
(FPCore (a k m) :precision binary64 (if (<= m -2e-60) (/ a (* k k)) (if (<= m 86000000000.0) (/ a (fma 10.0 k 1.0)) (* (* -10.0 k) a))))
double code(double a, double k, double m) {
double tmp;
if (m <= -2e-60) {
tmp = a / (k * k);
} else if (m <= 86000000000.0) {
tmp = a / fma(10.0, k, 1.0);
} else {
tmp = (-10.0 * k) * a;
}
return tmp;
}
function code(a, k, m) tmp = 0.0 if (m <= -2e-60) tmp = Float64(a / Float64(k * k)); elseif (m <= 86000000000.0) tmp = Float64(a / fma(10.0, k, 1.0)); else tmp = Float64(Float64(-10.0 * k) * a); end return tmp end
code[a_, k_, m_] := If[LessEqual[m, -2e-60], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 86000000000.0], N[(a / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * k), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -2 \cdot 10^{-60}:\\
\;\;\;\;\frac{a}{k \cdot k}\\
\mathbf{elif}\;m \leq 86000000000:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(-10 \cdot k\right) \cdot a\\
\end{array}
\end{array}
if m < -1.9999999999999999e-60Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6442.7
Applied rewrites42.7%
Taylor expanded in k around inf
Applied rewrites60.3%
if -1.9999999999999999e-60 < m < 8.6e10Initial program 87.3%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6484.6
Applied rewrites84.6%
Taylor expanded in k around 0
Applied rewrites65.1%
if 8.6e10 < m Initial program 84.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites3.0%
Taylor expanded in k around 0
Applied rewrites4.9%
Taylor expanded in k around inf
Applied rewrites13.7%
(FPCore (a k m) :precision binary64 (let* ((t_0 (/ a (* k k)))) (if (<= k -1.05e-285) t_0 (if (<= k 0.1) (fma (* -10.0 a) k a) t_0))))
double code(double a, double k, double m) {
double t_0 = a / (k * k);
double tmp;
if (k <= -1.05e-285) {
tmp = t_0;
} else if (k <= 0.1) {
tmp = fma((-10.0 * a), k, a);
} else {
tmp = t_0;
}
return tmp;
}
function code(a, k, m) t_0 = Float64(a / Float64(k * k)) tmp = 0.0 if (k <= -1.05e-285) tmp = t_0; elseif (k <= 0.1) tmp = fma(Float64(-10.0 * a), k, a); else tmp = t_0; end return tmp end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.05e-285], t$95$0, If[LessEqual[k, 0.1], N[(N[(-10.0 * a), $MachinePrecision] * k + a), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq -1.05 \cdot 10^{-285}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;k \leq 0.1:\\
\;\;\;\;\mathsf{fma}\left(-10 \cdot a, k, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if k < -1.04999999999999992e-285 or 0.10000000000000001 < k Initial program 83.3%
Taylor expanded in m around 0
lower-/.f64N/A
unpow2N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
associate-*l*N/A
*-lft-identityN/A
distribute-rgt-inN/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6435.6
Applied rewrites35.6%
Taylor expanded in k around inf
Applied rewrites38.3%
if -1.04999999999999992e-285 < k < 0.10000000000000001Initial 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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f6454.3
Applied rewrites54.3%
Applied rewrites54.3%
Taylor expanded in k around 0
Applied rewrites53.4%
Applied rewrites53.4%
(FPCore (a k m) :precision binary64 (if (<= m 86000000000.0) (* 1.0 a) (* (* -10.0 k) a)))
double code(double a, double k, double m) {
double tmp;
if (m <= 86000000000.0) {
tmp = 1.0 * a;
} else {
tmp = (-10.0 * k) * a;
}
return tmp;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 86000000000.0d0) then
tmp = 1.0d0 * a
else
tmp = ((-10.0d0) * k) * a
end if
code = tmp
end function
public static double code(double a, double k, double m) {
double tmp;
if (m <= 86000000000.0) {
tmp = 1.0 * a;
} else {
tmp = (-10.0 * k) * a;
}
return tmp;
}
def code(a, k, m): tmp = 0 if m <= 86000000000.0: tmp = 1.0 * a else: tmp = (-10.0 * k) * a return tmp
function code(a, k, m) tmp = 0.0 if (m <= 86000000000.0) tmp = Float64(1.0 * a); else tmp = Float64(Float64(-10.0 * k) * a); end return tmp end
function tmp_2 = code(a, k, m) tmp = 0.0; if (m <= 86000000000.0) tmp = 1.0 * a; else tmp = (-10.0 * k) * a; end tmp_2 = tmp; end
code[a_, k_, m_] := If[LessEqual[m, 86000000000.0], N[(1.0 * a), $MachinePrecision], N[(N[(-10.0 * k), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 86000000000:\\
\;\;\;\;1 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(-10 \cdot k\right) \cdot a\\
\end{array}
\end{array}
if m < 8.6e10Initial program 92.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6474.9
Applied rewrites74.9%
Taylor expanded in m around 0
Applied rewrites34.0%
if 8.6e10 < m Initial program 84.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
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
lft-mult-inverseN/A
metadata-evalN/A
lower-+.f643.0
Applied rewrites3.0%
Applied rewrites3.0%
Taylor expanded in k around 0
Applied rewrites4.9%
Taylor expanded in k around inf
Applied rewrites13.7%
(FPCore (a k m) :precision binary64 (* 1.0 a))
double code(double a, double k, double m) {
return 1.0 * a;
}
real(8) function code(a, k, m)
real(8), intent (in) :: a
real(8), intent (in) :: k
real(8), intent (in) :: m
code = 1.0d0 * a
end function
public static double code(double a, double k, double m) {
return 1.0 * a;
}
def code(a, k, m): return 1.0 * a
function code(a, k, m) return Float64(1.0 * a) end
function tmp = code(a, k, m) tmp = 1.0 * a; end
code[a_, k_, m_] := N[(1.0 * a), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot a
\end{array}
Initial program 89.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6484.2
Applied rewrites84.2%
Taylor expanded in m around 0
Applied rewrites22.8%
herbie shell --seed 2024235
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))