
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (<= a 5e-97) (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)) (fma z y (+ x (* a (fma b z t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 5e-97) {
tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
} else {
tmp = fma(z, y, (x + (a * fma(b, z, t))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 5e-97) tmp = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)); else tmp = fma(z, y, Float64(x + Float64(a * fma(b, z, t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 5e-97], N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(z * y + N[(x + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5 \cdot 10^{-97}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)\\
\end{array}
\end{array}
if a < 4.9999999999999995e-97Initial program 97.6%
if 4.9999999999999995e-97 < a Initial program 82.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -1.72e+75)
(not
(or (<= t 2.9e+50)
(not (or (<= t 1.14e+108) (not (<= t 7.9e+151)))))))
(* a t)
(* (fma b a y) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.72e+75) || !((t <= 2.9e+50) || !((t <= 1.14e+108) || !(t <= 7.9e+151)))) {
tmp = a * t;
} else {
tmp = fma(b, a, y) * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.72e+75) || !((t <= 2.9e+50) || !((t <= 1.14e+108) || !(t <= 7.9e+151)))) tmp = Float64(a * t); else tmp = Float64(fma(b, a, y) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.72e+75], N[Not[Or[LessEqual[t, 2.9e+50], N[Not[Or[LessEqual[t, 1.14e+108], N[Not[LessEqual[t, 7.9e+151]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.72 \cdot 10^{+75} \lor \neg \left(t \leq 2.9 \cdot 10^{+50} \lor \neg \left(t \leq 1.14 \cdot 10^{+108} \lor \neg \left(t \leq 7.9 \cdot 10^{+151}\right)\right)\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
\end{array}
\end{array}
if t < -1.72e75 or 2.9e50 < t < 1.13999999999999994e108 or 7.9e151 < t Initial program 89.7%
Taylor expanded in t around inf
lower-*.f6466.4
Applied rewrites66.4%
if -1.72e75 < t < 2.9e50 or 1.13999999999999994e108 < t < 7.9e151Initial program 93.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6460.0
Applied rewrites60.0%
Final simplification62.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (fma b z t) a)))
(if (<= a -6.6e+47)
t_1
(if (<= a -4.2e-15)
(fma (* z b) a x)
(if (<= a -4.2e-277)
(* (fma b a y) z)
(if (<= a 6e-98) (fma (* a b) z x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, z, t) * a;
double tmp;
if (a <= -6.6e+47) {
tmp = t_1;
} else if (a <= -4.2e-15) {
tmp = fma((z * b), a, x);
} else if (a <= -4.2e-277) {
tmp = fma(b, a, y) * z;
} else if (a <= 6e-98) {
tmp = fma((a * b), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(b, z, t) * a) tmp = 0.0 if (a <= -6.6e+47) tmp = t_1; elseif (a <= -4.2e-15) tmp = fma(Float64(z * b), a, x); elseif (a <= -4.2e-277) tmp = Float64(fma(b, a, y) * z); elseif (a <= 6e-98) tmp = fma(Float64(a * b), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -6.6e+47], t$95$1, If[LessEqual[a, -4.2e-15], N[(N[(z * b), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[a, -4.2e-277], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 6e-98], N[(N[(a * b), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot b, a, x\right)\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-277}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot b, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.5999999999999998e47 or 6e-98 < a Initial program 86.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6480.5
Applied rewrites80.5%
if -6.5999999999999998e47 < a < -4.19999999999999962e-15Initial program 99.8%
Taylor expanded in y around 0
distribute-lft-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6491.5
Applied rewrites91.5%
Taylor expanded in z around inf
Applied rewrites78.0%
if -4.19999999999999962e-15 < a < -4.1999999999999999e-277Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6461.5
Applied rewrites61.5%
if -4.1999999999999999e-277 < a < 6e-98Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.9
Applied rewrites94.9%
Taylor expanded in y around 0
Applied rewrites62.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (* a b) z x)) (t_2 (* (fma b z t) a)))
(if (<= a -6.6e+47)
t_2
(if (<= a -8e-14)
t_1
(if (<= a -4.2e-277) (* (fma b a y) z) (if (<= a 6e-98) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((a * b), z, x);
double t_2 = fma(b, z, t) * a;
double tmp;
if (a <= -6.6e+47) {
tmp = t_2;
} else if (a <= -8e-14) {
tmp = t_1;
} else if (a <= -4.2e-277) {
tmp = fma(b, a, y) * z;
} else if (a <= 6e-98) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(a * b), z, x) t_2 = Float64(fma(b, z, t) * a) tmp = 0.0 if (a <= -6.6e+47) tmp = t_2; elseif (a <= -8e-14) tmp = t_1; elseif (a <= -4.2e-277) tmp = Float64(fma(b, a, y) * z); elseif (a <= 6e-98) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * z + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -6.6e+47], t$95$2, If[LessEqual[a, -8e-14], t$95$1, If[LessEqual[a, -4.2e-277], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 6e-98], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a \cdot b, z, x\right)\\
t_2 := \mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-277}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -6.5999999999999998e47 or 6e-98 < a Initial program 86.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6480.5
Applied rewrites80.5%
if -6.5999999999999998e47 < a < -7.99999999999999999e-14 or -4.1999999999999999e-277 < a < 6e-98Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6493.1
Applied rewrites93.1%
Taylor expanded in y around 0
Applied rewrites64.8%
if -7.99999999999999999e-14 < a < -4.1999999999999999e-277Initial program 99.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.4
Applied rewrites62.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (fma b a y) z)))
(if (<= z -4.5e+236)
t_1
(if (<= z -6.2e-163)
(* (fma b z t) a)
(if (<= z 9.6e-12) (fma 1.0 x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, a, y) * z;
double tmp;
if (z <= -4.5e+236) {
tmp = t_1;
} else if (z <= -6.2e-163) {
tmp = fma(b, z, t) * a;
} else if (z <= 9.6e-12) {
tmp = fma(1.0, x, (a * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(b, a, y) * z) tmp = 0.0 if (z <= -4.5e+236) tmp = t_1; elseif (z <= -6.2e-163) tmp = Float64(fma(b, z, t) * a); elseif (z <= 9.6e-12) tmp = fma(1.0, x, Float64(a * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4.5e+236], t$95$1, If[LessEqual[z, -6.2e-163], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[z, 9.6e-12], N[(1.0 * x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, a, y\right) \cdot z\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+236}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-163}:\\
\;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(1, x, a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.50000000000000018e236 or 9.59999999999999948e-12 < z Initial program 86.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6476.2
Applied rewrites76.2%
if -4.50000000000000018e236 < z < -6.19999999999999949e-163Initial program 89.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6469.6
Applied rewrites69.6%
if -6.19999999999999949e-163 < z < 9.59999999999999948e-12Initial program 99.7%
Taylor expanded in x around inf
+-commutativeN/A
associate-+r+N/A
distribute-rgt-inN/A
+-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
times-fracN/A
/-rgt-identityN/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites88.4%
Taylor expanded in x around inf
Applied rewrites82.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (fma b z t) a)))
(if (<= a -3.1e-15)
t_1
(if (<= a -3.7e-277)
(* (fma b a y) z)
(if (<= a 9.5e-114) (* 1.0 x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, z, t) * a;
double tmp;
if (a <= -3.1e-15) {
tmp = t_1;
} else if (a <= -3.7e-277) {
tmp = fma(b, a, y) * z;
} else if (a <= 9.5e-114) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(b, z, t) * a) tmp = 0.0 if (a <= -3.1e-15) tmp = t_1; elseif (a <= -3.7e-277) tmp = Float64(fma(b, a, y) * z); elseif (a <= 9.5e-114) tmp = Float64(1.0 * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -3.1e-15], t$95$1, If[LessEqual[a, -3.7e-277], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 9.5e-114], N[(1.0 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{if}\;a \leq -3.1 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{-277}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-114}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.0999999999999999e-15 or 9.49999999999999958e-114 < a Initial program 87.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6476.6
Applied rewrites76.6%
if -3.0999999999999999e-15 < a < -3.69999999999999985e-277Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6461.5
Applied rewrites61.5%
if -3.69999999999999985e-277 < a < 9.49999999999999958e-114Initial program 100.0%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6491.3
Applied rewrites91.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6475.0
Applied rewrites75.0%
Taylor expanded in x around inf
Applied rewrites54.8%
Final simplification69.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.1e-15) (fma (fma b z t) a x) (if (<= a 7.8e-97) (fma (fma b a y) z x) (fma z y (* (fma z b t) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.1e-15) {
tmp = fma(fma(b, z, t), a, x);
} else if (a <= 7.8e-97) {
tmp = fma(fma(b, a, y), z, x);
} else {
tmp = fma(z, y, (fma(z, b, t) * a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.1e-15) tmp = fma(fma(b, z, t), a, x); elseif (a <= 7.8e-97) tmp = fma(fma(b, a, y), z, x); else tmp = fma(z, y, Float64(fma(z, b, t) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.1e-15], N[(N[(b * z + t), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[a, 7.8e-97], N[(N[(b * a + y), $MachinePrecision] * z + x), $MachinePrecision], N[(z * y + N[(N[(z * b + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, \mathsf{fma}\left(z, b, t\right) \cdot a\right)\\
\end{array}
\end{array}
if a < -3.0999999999999999e-15Initial program 94.1%
Taylor expanded in y around 0
distribute-lft-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6492.5
Applied rewrites92.5%
if -3.0999999999999999e-15 < a < 7.7999999999999997e-97Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
if 7.7999999999999997e-97 < a Initial program 82.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.3
Applied rewrites92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a z) b)))
(if (<= b -4.4e+59)
t_1
(if (<= b 4.5e-299) (* y z) (if (<= b 3.4e+44) (* a t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * z) * b;
double tmp;
if (b <= -4.4e+59) {
tmp = t_1;
} else if (b <= 4.5e-299) {
tmp = y * z;
} else if (b <= 3.4e+44) {
tmp = a * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a * z) * b
if (b <= (-4.4d+59)) then
tmp = t_1
else if (b <= 4.5d-299) then
tmp = y * z
else if (b <= 3.4d+44) then
tmp = a * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * z) * b;
double tmp;
if (b <= -4.4e+59) {
tmp = t_1;
} else if (b <= 4.5e-299) {
tmp = y * z;
} else if (b <= 3.4e+44) {
tmp = a * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * z) * b tmp = 0 if b <= -4.4e+59: tmp = t_1 elif b <= 4.5e-299: tmp = y * z elif b <= 3.4e+44: tmp = a * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * z) * b) tmp = 0.0 if (b <= -4.4e+59) tmp = t_1; elseif (b <= 4.5e-299) tmp = Float64(y * z); elseif (b <= 3.4e+44) tmp = Float64(a * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * z) * b; tmp = 0.0; if (b <= -4.4e+59) tmp = t_1; elseif (b <= 4.5e-299) tmp = y * z; elseif (b <= 3.4e+44) tmp = a * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -4.4e+59], t$95$1, If[LessEqual[b, 4.5e-299], N[(y * z), $MachinePrecision], If[LessEqual[b, 3.4e+44], N[(a * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -4.4 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-299}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.3999999999999999e59 or 3.4e44 < b Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.1
Applied rewrites62.1%
Taylor expanded in y around 0
Applied rewrites54.2%
Taylor expanded in y around 0
Applied rewrites58.0%
if -4.3999999999999999e59 < b < 4.50000000000000003e-299Initial program 91.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
lower-*.f6441.7
Applied rewrites41.7%
if 4.50000000000000003e-299 < b < 3.4e44Initial program 90.3%
Taylor expanded in t around inf
lower-*.f6448.0
Applied rewrites48.0%
Final simplification49.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.1e-15) (not (<= a 3.6e-66))) (fma (fma b z t) a x) (fma (fma b a y) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.1e-15) || !(a <= 3.6e-66)) {
tmp = fma(fma(b, z, t), a, x);
} else {
tmp = fma(fma(b, a, y), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.1e-15) || !(a <= 3.6e-66)) tmp = fma(fma(b, z, t), a, x); else tmp = fma(fma(b, a, y), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.1e-15], N[Not[LessEqual[a, 3.6e-66]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a + x), $MachinePrecision], N[(N[(b * a + y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-15} \lor \neg \left(a \leq 3.6 \cdot 10^{-66}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\
\end{array}
\end{array}
if a < -3.0999999999999999e-15 or 3.60000000000000012e-66 < a Initial program 86.9%
Taylor expanded in y around 0
distribute-lft-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6491.8
Applied rewrites91.8%
if -3.0999999999999999e-15 < a < 3.60000000000000012e-66Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6491.4
Applied rewrites91.4%
Final simplification91.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1e+49) (not (<= a 4e-12))) (* (fma b z t) a) (fma (fma b a y) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1e+49) || !(a <= 4e-12)) {
tmp = fma(b, z, t) * a;
} else {
tmp = fma(fma(b, a, y), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1e+49) || !(a <= 4e-12)) tmp = Float64(fma(b, z, t) * a); else tmp = fma(fma(b, a, y), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1e+49], N[Not[LessEqual[a, 4e-12]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], N[(N[(b * a + y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+49} \lor \neg \left(a \leq 4 \cdot 10^{-12}\right):\\
\;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\
\end{array}
\end{array}
if a < -9.99999999999999946e48 or 3.99999999999999992e-12 < a Initial program 84.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6484.0
Applied rewrites84.0%
if -9.99999999999999946e48 < a < 3.99999999999999992e-12Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.3
Applied rewrites89.3%
Final simplification86.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.9e-54) (* a t) (if (<= t 6.5e-177) (* 1.0 x) (if (<= t 4.5e+49) (* y z) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-54) {
tmp = a * t;
} else if (t <= 6.5e-177) {
tmp = 1.0 * x;
} else if (t <= 4.5e+49) {
tmp = y * z;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.9d-54)) then
tmp = a * t
else if (t <= 6.5d-177) then
tmp = 1.0d0 * x
else if (t <= 4.5d+49) then
tmp = y * z
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-54) {
tmp = a * t;
} else if (t <= 6.5e-177) {
tmp = 1.0 * x;
} else if (t <= 4.5e+49) {
tmp = y * z;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.9e-54: tmp = a * t elif t <= 6.5e-177: tmp = 1.0 * x elif t <= 4.5e+49: tmp = y * z else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.9e-54) tmp = Float64(a * t); elseif (t <= 6.5e-177) tmp = Float64(1.0 * x); elseif (t <= 4.5e+49) tmp = Float64(y * z); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.9e-54) tmp = a * t; elseif (t <= 6.5e-177) tmp = 1.0 * x; elseif (t <= 4.5e+49) tmp = y * z; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.9e-54], N[(a * t), $MachinePrecision], If[LessEqual[t, 6.5e-177], N[(1.0 * x), $MachinePrecision], If[LessEqual[t, 4.5e+49], N[(y * z), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-54}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-177}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+49}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -1.9000000000000001e-54 or 4.49999999999999982e49 < t Initial program 90.0%
Taylor expanded in t around inf
lower-*.f6454.5
Applied rewrites54.5%
if -1.9000000000000001e-54 < t < 6.4999999999999998e-177Initial program 93.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6495.1
Applied rewrites95.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6480.2
Applied rewrites80.2%
Taylor expanded in x around inf
Applied rewrites41.6%
if 6.4999999999999998e-177 < t < 4.49999999999999982e49Initial program 96.9%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
Taylor expanded in y around inf
lower-*.f6441.4
Applied rewrites41.4%
Final simplification48.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.55e+33) (* (* z b) a) (if (<= b 3.4e+44) (* a t) (* (* a z) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.55e+33) {
tmp = (z * b) * a;
} else if (b <= 3.4e+44) {
tmp = a * t;
} else {
tmp = (a * z) * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-4.55d+33)) then
tmp = (z * b) * a
else if (b <= 3.4d+44) then
tmp = a * t
else
tmp = (a * z) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.55e+33) {
tmp = (z * b) * a;
} else if (b <= 3.4e+44) {
tmp = a * t;
} else {
tmp = (a * z) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.55e+33: tmp = (z * b) * a elif b <= 3.4e+44: tmp = a * t else: tmp = (a * z) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.55e+33) tmp = Float64(Float64(z * b) * a); elseif (b <= 3.4e+44) tmp = Float64(a * t); else tmp = Float64(Float64(a * z) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.55e+33) tmp = (z * b) * a; elseif (b <= 3.4e+44) tmp = a * t; else tmp = (a * z) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.55e+33], N[(N[(z * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 3.4e+44], N[(a * t), $MachinePrecision], N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.55 \cdot 10^{+33}:\\
\;\;\;\;\left(z \cdot b\right) \cdot a\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{+44}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot z\right) \cdot b\\
\end{array}
\end{array}
if b < -4.5499999999999998e33Initial program 95.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6464.0
Applied rewrites64.0%
Taylor expanded in z around inf
Applied rewrites58.0%
if -4.5499999999999998e33 < b < 3.4e44Initial program 90.7%
Taylor expanded in t around inf
lower-*.f6443.1
Applied rewrites43.1%
if 3.4e44 < b Initial program 93.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.8
Applied rewrites62.8%
Taylor expanded in y around 0
Applied rewrites53.3%
Taylor expanded in y around 0
Applied rewrites54.7%
(FPCore (x y z t a b) :precision binary64 (fma z y (+ x (* a (fma b z t)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, y, (x + (a * fma(b, z, t))));
}
function code(x, y, z, t, a, b) return fma(z, y, Float64(x + Float64(a * fma(b, z, t)))) end
code[x_, y_, z_, t_, a_, b_] := N[(z * y + N[(x + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)
\end{array}
Initial program 92.2%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6496.3
Applied rewrites96.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -2.7e+97) (not (<= x 2.9e-46))) (* 1.0 x) (* y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.7e+97) || !(x <= 2.9e-46)) {
tmp = 1.0 * x;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-2.7d+97)) .or. (.not. (x <= 2.9d-46))) then
tmp = 1.0d0 * x
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.7e+97) || !(x <= 2.9e-46)) {
tmp = 1.0 * x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.7e+97) or not (x <= 2.9e-46): tmp = 1.0 * x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -2.7e+97) || !(x <= 2.9e-46)) tmp = Float64(1.0 * x); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -2.7e+97) || ~((x <= 2.9e-46))) tmp = 1.0 * x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -2.7e+97], N[Not[LessEqual[x, 2.9e-46]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(y * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+97} \lor \neg \left(x \leq 2.9 \cdot 10^{-46}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if x < -2.69999999999999993e97 or 2.90000000000000005e-46 < x Initial program 94.4%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6495.6
Applied rewrites95.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.7
Applied rewrites94.7%
Taylor expanded in x around inf
Applied rewrites51.4%
if -2.69999999999999993e97 < x < 2.90000000000000005e-46Initial program 90.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6496.8
Applied rewrites96.8%
Taylor expanded in y around inf
lower-*.f6433.5
Applied rewrites33.5%
Final simplification41.0%
(FPCore (x y z t a b) :precision binary64 (* y z))
double code(double x, double y, double z, double t, double a, double b) {
return y * z;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = y * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y * z;
}
def code(x, y, z, t, a, b): return y * z
function code(x, y, z, t, a, b) return Float64(y * z) end
function tmp = code(x, y, z, t, a, b) tmp = y * z; end
code[x_, y_, z_, t_, a_, b_] := N[(y * z), $MachinePrecision]
\begin{array}{l}
\\
y \cdot z
\end{array}
Initial program 92.2%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6496.3
Applied rewrites96.3%
Taylor expanded in y around inf
lower-*.f6425.4
Applied rewrites25.4%
Final simplification25.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024318
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))