
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma (* -0.25 a) b (fma y x (fma (* t z) 0.0625 c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma((-0.25 * a), b, fma(y, x, fma((t * z), 0.0625, c)));
}
function code(x, y, z, t, a, b, c) return fma(Float64(-0.25 * a), b, fma(y, x, fma(Float64(t * z), 0.0625, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(-0.25 * a), $MachinePrecision] * b + N[(y * x + N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.25 \cdot a, b, \mathsf{fma}\left(y, x, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\right)
\end{array}
Initial program 96.5%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6498.4
Applied rewrites98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* t z) 0.0625 (* y x))) (t_2 (+ (* x y) (/ (* z t) 16.0))))
(if (<= t_2 -5e+154)
t_1
(if (<= t_2 -4000000000000.0)
(fma y x c)
(if (<= t_2 1e+137)
(fma -0.25 (* b a) c)
(if (<= t_2 INFINITY) t_1 (fma -0.25 (* b a) (* y x))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((t * z), 0.0625, (y * x));
double t_2 = (x * y) + ((z * t) / 16.0);
double tmp;
if (t_2 <= -5e+154) {
tmp = t_1;
} else if (t_2 <= -4000000000000.0) {
tmp = fma(y, x, c);
} else if (t_2 <= 1e+137) {
tmp = fma(-0.25, (b * a), c);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-0.25, (b * a), (y * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(t * z), 0.0625, Float64(y * x)) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (t_2 <= -5e+154) tmp = t_1; elseif (t_2 <= -4000000000000.0) tmp = fma(y, x, c); elseif (t_2 <= 1e+137) tmp = fma(-0.25, Float64(b * a), c); elseif (t_2 <= Inf) tmp = t_1; else tmp = fma(-0.25, Float64(b * a), Float64(y * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] * 0.0625 + N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+154], t$95$1, If[LessEqual[t$95$2, -4000000000000.0], N[(y * x + c), $MachinePrecision], If[LessEqual[t$95$2, 1e+137], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t \cdot z, 0.0625, y \cdot x\right)\\
t_2 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -4000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -5.00000000000000004e154 or 1e137 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < +inf.0Initial program 98.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6489.9
Applied rewrites89.9%
Taylor expanded in c around 0
Applied rewrites85.7%
if -5.00000000000000004e154 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -4e12Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.9
Applied rewrites85.9%
Taylor expanded in x around 0
Applied rewrites56.5%
Taylor expanded in a around 0
Applied rewrites70.8%
if -4e12 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 1e137Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.9
Applied rewrites88.9%
Taylor expanded in x around 0
Applied rewrites83.5%
if +inf.0 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 0.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6457.1
Applied rewrites57.1%
Taylor expanded in c around 0
Applied rewrites57.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (/ (* z t) 16.0))))
(if (<= t_1 -5e+154)
(fma (* t z) 0.0625 (* y x))
(if (<= t_1 -4000000000000.0)
(fma y x c)
(if (<= t_1 1e+137)
(fma -0.25 (* b a) c)
(fma y x (* 0.0625 (* t z))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double tmp;
if (t_1 <= -5e+154) {
tmp = fma((t * z), 0.0625, (y * x));
} else if (t_1 <= -4000000000000.0) {
tmp = fma(y, x, c);
} else if (t_1 <= 1e+137) {
tmp = fma(-0.25, (b * a), c);
} else {
tmp = fma(y, x, (0.0625 * (t * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (t_1 <= -5e+154) tmp = fma(Float64(t * z), 0.0625, Float64(y * x)); elseif (t_1 <= -4000000000000.0) tmp = fma(y, x, c); elseif (t_1 <= 1e+137) tmp = fma(-0.25, Float64(b * a), c); else tmp = fma(y, x, Float64(0.0625 * Float64(t * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+154], N[(N[(t * z), $MachinePrecision] * 0.0625 + N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4000000000000.0], N[(y * x + c), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision], N[(y * x + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, 0.0625, y \cdot x\right)\\
\mathbf{elif}\;t\_1 \leq -4000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -5.00000000000000004e154Initial program 96.5%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6490.8
Applied rewrites90.8%
Taylor expanded in c around 0
Applied rewrites86.1%
if -5.00000000000000004e154 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -4e12Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.9
Applied rewrites85.9%
Taylor expanded in x around 0
Applied rewrites56.5%
Taylor expanded in a around 0
Applied rewrites70.8%
if -4e12 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 1e137Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.9
Applied rewrites88.9%
Taylor expanded in x around 0
Applied rewrites83.5%
if 1e137 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 89.8%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.4
Applied rewrites84.4%
Applied rewrites85.8%
Taylor expanded in c around 0
Applied rewrites81.0%
Final simplification81.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)) (t_2 (fma (* t 0.0625) z c)))
(if (<= t_1 -2e-63)
t_2
(if (<= t_1 0.0)
(fma y x (* (* b a) -0.25))
(if (<= t_1 1e+37) (fma y x c) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double t_2 = fma((t * 0.0625), z, c);
double tmp;
if (t_1 <= -2e-63) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(y, x, ((b * a) * -0.25));
} else if (t_1 <= 1e+37) {
tmp = fma(y, x, c);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) t_2 = fma(Float64(t * 0.0625), z, c) tmp = 0.0 if (t_1 <= -2e-63) tmp = t_2; elseif (t_1 <= 0.0) tmp = fma(y, x, Float64(Float64(b * a) * -0.25)); elseif (t_1 <= 1e+37) tmp = fma(y, x, c); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-63], t$95$2, If[LessEqual[t$95$1, 0.0], N[(y * x + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+37], N[(y * x + c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
t_2 := \mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(b \cdot a\right) \cdot -0.25\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -2.00000000000000013e-63 or 9.99999999999999954e36 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 93.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.0
Applied rewrites84.0%
Taylor expanded in x around 0
Applied rewrites77.1%
Applied rewrites77.1%
if -2.00000000000000013e-63 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -0.0Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in c around 0
Applied rewrites73.7%
Applied rewrites73.7%
if -0.0 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 9.99999999999999954e36Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.6
Applied rewrites94.6%
Taylor expanded in x around 0
Applied rewrites63.5%
Taylor expanded in a around 0
Applied rewrites68.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)) (t_2 (fma (* t 0.0625) z c)))
(if (<= t_1 -2e-63)
t_2
(if (<= t_1 0.0)
(fma -0.25 (* b a) (* y x))
(if (<= t_1 1e+37) (fma y x c) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double t_2 = fma((t * 0.0625), z, c);
double tmp;
if (t_1 <= -2e-63) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(-0.25, (b * a), (y * x));
} else if (t_1 <= 1e+37) {
tmp = fma(y, x, c);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) t_2 = fma(Float64(t * 0.0625), z, c) tmp = 0.0 if (t_1 <= -2e-63) tmp = t_2; elseif (t_1 <= 0.0) tmp = fma(-0.25, Float64(b * a), Float64(y * x)); elseif (t_1 <= 1e+37) tmp = fma(y, x, c); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-63], t$95$2, If[LessEqual[t$95$1, 0.0], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+37], N[(y * x + c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
t_2 := \mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, y \cdot x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -2.00000000000000013e-63 or 9.99999999999999954e36 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 93.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.0
Applied rewrites84.0%
Taylor expanded in x around 0
Applied rewrites77.1%
Applied rewrites77.1%
if -2.00000000000000013e-63 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -0.0Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in c around 0
Applied rewrites73.7%
if -0.0 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 9.99999999999999954e36Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.6
Applied rewrites94.6%
Taylor expanded in x around 0
Applied rewrites63.5%
Taylor expanded in a around 0
Applied rewrites68.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (<= t_1 -2e-40)
(fma (* 0.0625 z) t (fma y x c))
(if (<= t_1 1e+62)
(fma y x (fma -0.25 (* b a) c))
(fma -0.25 (* b a) (* (* t z) 0.0625))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if (t_1 <= -2e-40) {
tmp = fma((0.0625 * z), t, fma(y, x, c));
} else if (t_1 <= 1e+62) {
tmp = fma(y, x, fma(-0.25, (b * a), c));
} else {
tmp = fma(-0.25, (b * a), ((t * z) * 0.0625));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if (t_1 <= -2e-40) tmp = fma(Float64(0.0625 * z), t, fma(y, x, c)); elseif (t_1 <= 1e+62) tmp = fma(y, x, fma(-0.25, Float64(b * a), c)); else tmp = fma(-0.25, Float64(b * a), Float64(Float64(t * z) * 0.0625)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-40], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+62], N[(y * x + N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(-0.25, b \cdot a, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \left(t \cdot z\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.9999999999999999e-40Initial program 92.1%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6483.9
Applied rewrites83.9%
Applied rewrites86.5%
if -1.9999999999999999e-40 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 1.00000000000000004e62Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6497.2
Applied rewrites97.2%
if 1.00000000000000004e62 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 94.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6493.9
Applied rewrites93.9%
Taylor expanded in c around 0
Applied rewrites84.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -2e-40) (not (<= t_1 5000000000000.0)))
(fma y x (fma (* t z) 0.0625 c))
(fma y x (fma -0.25 (* b a) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -2e-40) || !(t_1 <= 5000000000000.0)) {
tmp = fma(y, x, fma((t * z), 0.0625, c));
} else {
tmp = fma(y, x, fma(-0.25, (b * a), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -2e-40) || !(t_1 <= 5000000000000.0)) tmp = fma(y, x, fma(Float64(t * z), 0.0625, c)); else tmp = fma(y, x, fma(-0.25, Float64(b * a), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-40], N[Not[LessEqual[t$95$1, 5000000000000.0]], $MachinePrecision]], N[(y * x + N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-40} \lor \neg \left(t\_1 \leq 5000000000000\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(-0.25, b \cdot a, c\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.9999999999999999e-40 or 5e12 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 93.5%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.3
Applied rewrites84.3%
if -1.9999999999999999e-40 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5e12Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6497.9
Applied rewrites97.9%
Final simplification90.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -2e+98) (not (<= t_1 2e+178)))
(fma (* t 0.0625) z c)
(fma y x (fma -0.25 (* b a) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -2e+98) || !(t_1 <= 2e+178)) {
tmp = fma((t * 0.0625), z, c);
} else {
tmp = fma(y, x, fma(-0.25, (b * a), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -2e+98) || !(t_1 <= 2e+178)) tmp = fma(Float64(t * 0.0625), z, c); else tmp = fma(y, x, fma(-0.25, Float64(b * a), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+98], N[Not[LessEqual[t$95$1, 2e+178]], $MachinePrecision]], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], N[(y * x + N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+98} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+178}\right):\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(-0.25, b \cdot a, c\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -2e98 or 2.0000000000000001e178 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 90.1%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
Taylor expanded in x around 0
Applied rewrites86.0%
Applied rewrites86.0%
if -2e98 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 2.0000000000000001e178Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6490.5
Applied rewrites90.5%
Final simplification88.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -2e+98) (not (<= t_1 2e+178)))
(fma (* t 0.0625) z c)
(fma -0.25 (* b a) (fma y x c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -2e+98) || !(t_1 <= 2e+178)) {
tmp = fma((t * 0.0625), z, c);
} else {
tmp = fma(-0.25, (b * a), fma(y, x, c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -2e+98) || !(t_1 <= 2e+178)) tmp = fma(Float64(t * 0.0625), z, c); else tmp = fma(-0.25, Float64(b * a), fma(y, x, c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+98], N[Not[LessEqual[t$95$1, 2e+178]], $MachinePrecision]], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+98} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+178}\right):\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -2e98 or 2.0000000000000001e178 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 90.1%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
Taylor expanded in x around 0
Applied rewrites86.0%
Applied rewrites86.0%
if -2e98 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 2.0000000000000001e178Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.5
Applied rewrites90.5%
Final simplification88.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (<= t_1 -2e-40)
(fma (* 0.0625 z) t (fma y x c))
(if (<= t_1 5000000000000.0)
(fma y x (fma -0.25 (* b a) c))
(fma y x (fma (* t z) 0.0625 c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if (t_1 <= -2e-40) {
tmp = fma((0.0625 * z), t, fma(y, x, c));
} else if (t_1 <= 5000000000000.0) {
tmp = fma(y, x, fma(-0.25, (b * a), c));
} else {
tmp = fma(y, x, fma((t * z), 0.0625, c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if (t_1 <= -2e-40) tmp = fma(Float64(0.0625 * z), t, fma(y, x, c)); elseif (t_1 <= 5000000000000.0) tmp = fma(y, x, fma(-0.25, Float64(b * a), c)); else tmp = fma(y, x, fma(Float64(t * z), 0.0625, c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-40], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5000000000000.0], N[(y * x + N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(-0.25, b \cdot a, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.9999999999999999e-40Initial program 92.1%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6483.9
Applied rewrites83.9%
Applied rewrites86.5%
if -1.9999999999999999e-40 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5e12Initial program 100.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6497.9
Applied rewrites97.9%
if 5e12 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 95.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.7
Applied rewrites84.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -2e-40) (not (<= t_1 5000000000000.0)))
(fma (* t 0.0625) z c)
(fma -0.25 (* b a) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -2e-40) || !(t_1 <= 5000000000000.0)) {
tmp = fma((t * 0.0625), z, c);
} else {
tmp = fma(-0.25, (b * a), c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -2e-40) || !(t_1 <= 5000000000000.0)) tmp = fma(Float64(t * 0.0625), z, c); else tmp = fma(-0.25, Float64(b * a), c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-40], N[Not[LessEqual[t$95$1, 5000000000000.0]], $MachinePrecision]], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-40} \lor \neg \left(t\_1 \leq 5000000000000\right):\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.9999999999999999e-40 or 5e12 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 93.5%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6484.3
Applied rewrites84.3%
Taylor expanded in x around 0
Applied rewrites75.9%
Applied rewrites75.9%
if -1.9999999999999999e-40 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 5e12Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.9
Applied rewrites97.9%
Taylor expanded in x around 0
Applied rewrites68.4%
Final simplification72.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -5e+205) (not (<= t_1 2e+178)))
(* (* t z) 0.0625)
(fma -0.25 (* b a) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -5e+205) || !(t_1 <= 2e+178)) {
tmp = (t * z) * 0.0625;
} else {
tmp = fma(-0.25, (b * a), c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -5e+205) || !(t_1 <= 2e+178)) tmp = Float64(Float64(t * z) * 0.0625); else tmp = fma(-0.25, Float64(b * a), c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+205], N[Not[LessEqual[t$95$1, 2e+178]], $MachinePrecision]], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+205} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+178}\right):\\
\;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -5.0000000000000002e205 or 2.0000000000000001e178 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 89.3%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6495.2
Applied rewrites95.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.1
Applied rewrites84.1%
if -5.0000000000000002e205 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 2.0000000000000001e178Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.4
Applied rewrites89.4%
Taylor expanded in x around 0
Applied rewrites63.1%
Final simplification70.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* z t) 16.0)))
(if (or (<= t_1 -1e+140) (not (<= t_1 2e+178)))
(* (* t z) 0.0625)
(fma y x c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) / 16.0;
double tmp;
if ((t_1 <= -1e+140) || !(t_1 <= 2e+178)) {
tmp = (t * z) * 0.0625;
} else {
tmp = fma(y, x, c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) / 16.0) tmp = 0.0 if ((t_1 <= -1e+140) || !(t_1 <= 2e+178)) tmp = Float64(Float64(t * z) * 0.0625); else tmp = fma(y, x, c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+140], N[Not[LessEqual[t$95$1, 2e+178]], $MachinePrecision]], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], N[(y * x + c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+140} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+178}\right):\\
\;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 z t) #s(literal 16 binary64)) < -1.00000000000000006e140 or 2.0000000000000001e178 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) Initial program 89.6%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6495.4
Applied rewrites95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6482.4
Applied rewrites82.4%
if -1.00000000000000006e140 < (/.f64 (*.f64 z t) #s(literal 16 binary64)) < 2.0000000000000001e178Initial program 100.0%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.9
Applied rewrites89.9%
Taylor expanded in x around 0
Applied rewrites63.1%
Taylor expanded in a around 0
Applied rewrites60.5%
Final simplification68.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* a b) 4.0)))
(if (or (<= t_1 -5e+190) (not (<= t_1 1e+111)))
(* (* -0.25 a) b)
(fma y x c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) / 4.0;
double tmp;
if ((t_1 <= -5e+190) || !(t_1 <= 1e+111)) {
tmp = (-0.25 * a) * b;
} else {
tmp = fma(y, x, c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) / 4.0) tmp = 0.0 if ((t_1 <= -5e+190) || !(t_1 <= 1e+111)) tmp = Float64(Float64(-0.25 * a) * b); else tmp = fma(y, x, c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+190], N[Not[LessEqual[t$95$1, 1e+111]], $MachinePrecision]], N[(N[(-0.25 * a), $MachinePrecision] * b), $MachinePrecision], N[(y * x + c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+190} \lor \neg \left(t\_1 \leq 10^{+111}\right):\\
\;\;\;\;\left(-0.25 \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 a b) #s(literal 4 binary64)) < -5.00000000000000036e190 or 9.99999999999999957e110 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) Initial program 93.1%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6469.7
Applied rewrites69.7%
if -5.00000000000000036e190 < (/.f64 (*.f64 a b) #s(literal 4 binary64)) < 9.99999999999999957e110Initial program 97.8%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.4
Applied rewrites62.4%
Taylor expanded in x around 0
Applied rewrites38.0%
Taylor expanded in a around 0
Applied rewrites55.1%
Final simplification59.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -2e+94)
(fma y x (fma (* t z) 0.0625 c))
(if (<= (* x y) 1e+101)
(fma (* -0.25 b) a (fma 0.0625 (* t z) c))
(fma (* 0.0625 z) t (fma y x c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2e+94) {
tmp = fma(y, x, fma((t * z), 0.0625, c));
} else if ((x * y) <= 1e+101) {
tmp = fma((-0.25 * b), a, fma(0.0625, (t * z), c));
} else {
tmp = fma((0.0625 * z), t, fma(y, x, c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2e+94) tmp = fma(y, x, fma(Float64(t * z), 0.0625, c)); elseif (Float64(x * y) <= 1e+101) tmp = fma(Float64(-0.25 * b), a, fma(0.0625, Float64(t * z), c)); else tmp = fma(Float64(0.0625 * z), t, fma(y, x, c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+94], N[(y * x + N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+101], N[(N[(-0.25 * b), $MachinePrecision] * a + N[(0.0625 * N[(t * z), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(-0.25 \cdot b, a, \mathsf{fma}\left(0.0625, t \cdot z, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e94Initial program 88.2%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
if -2e94 < (*.f64 x y) < 9.9999999999999998e100Initial program 99.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6495.4
Applied rewrites95.4%
Applied rewrites95.9%
if 9.9999999999999998e100 < (*.f64 x y) Initial program 89.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
Applied rewrites88.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* t z) 0.0625 c)))
(if (<= (* x y) -2e+94)
(fma y x t_1)
(if (<= (* x y) 1e+101)
(fma -0.25 (* b a) t_1)
(fma (* 0.0625 z) t (fma y x c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((t * z), 0.0625, c);
double tmp;
if ((x * y) <= -2e+94) {
tmp = fma(y, x, t_1);
} else if ((x * y) <= 1e+101) {
tmp = fma(-0.25, (b * a), t_1);
} else {
tmp = fma((0.0625 * z), t, fma(y, x, c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(t * z), 0.0625, c) tmp = 0.0 if (Float64(x * y) <= -2e+94) tmp = fma(y, x, t_1); elseif (Float64(x * y) <= 1e+101) tmp = fma(-0.25, Float64(b * a), t_1); else tmp = fma(Float64(0.0625 * z), t, fma(y, x, c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] * 0.0625 + c), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+94], N[(y * x + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+101], N[(-0.25 * N[(b * a), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(0.0625 * z), $MachinePrecision] * t + N[(y * x + c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t \cdot z, 0.0625, c\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, \mathsf{fma}\left(y, x, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e94Initial program 88.2%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
if -2e94 < (*.f64 x y) < 9.9999999999999998e100Initial program 99.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6495.4
Applied rewrites95.4%
if 9.9999999999999998e100 < (*.f64 x y) Initial program 89.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
Applied rewrites88.9%
(FPCore (x y z t a b c) :precision binary64 (fma y x c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(y, x, c);
}
function code(x, y, z, t, a, b, c) return fma(y, x, c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x, c\right)
\end{array}
Initial program 96.5%
Taylor expanded in z around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6467.5
Applied rewrites67.5%
Taylor expanded in x around 0
Applied rewrites48.3%
Taylor expanded in a around 0
Applied rewrites43.9%
(FPCore (x y z t a b c) :precision binary64 (* y x))
double code(double x, double y, double z, double t, double a, double b, double c) {
return y * x;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = y * x
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return y * x;
}
def code(x, y, z, t, a, b, c): return y * x
function code(x, y, z, t, a, b, c) return Float64(y * x) end
function tmp = code(x, y, z, t, a, b, c) tmp = y * x; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot x
\end{array}
Initial program 96.5%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6498.4
Applied rewrites98.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6421.7
Applied rewrites21.7%
herbie shell --seed 2024337
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))