
(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 20 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 (if (<= (+ (* y x) (/ (* z t) 16.0)) 5e+271) (fma a (* b -0.25) (fma 0.0625 (* z t) (fma x y c))) (fma y x (fma z (* t 0.0625) (* (* a b) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((y * x) + ((z * t) / 16.0)) <= 5e+271) {
tmp = fma(a, (b * -0.25), fma(0.0625, (z * t), fma(x, y, c)));
} else {
tmp = fma(y, x, fma(z, (t * 0.0625), ((a * b) * -0.25)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(y * x) + Float64(Float64(z * t) / 16.0)) <= 5e+271) tmp = fma(a, Float64(b * -0.25), fma(0.0625, Float64(z * t), fma(x, y, c))); else tmp = fma(y, x, fma(z, Float64(t * 0.0625), Float64(Float64(a * b) * -0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(y * x), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision], 5e+271], N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x + \frac{z \cdot t}{16} \leq 5 \cdot 10^{+271}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 5.0000000000000003e271Initial program 99.0%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
if 5.0000000000000003e271 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 86.6%
Taylor expanded in c around 0
associate--l+N/A
lower-fma.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
Applied rewrites100.0%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (fma y x (* 0.0625 (* z t)))) (t_2 (+ (* y x) (/ (* z t) 16.0)))) (if (<= t_2 -2e+79) t_1 (if (<= t_2 1e+151) (+ c (* a (* b -0.25))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, (0.0625 * (z * t)));
double t_2 = (y * x) + ((z * t) / 16.0);
double tmp;
if (t_2 <= -2e+79) {
tmp = t_1;
} else if (t_2 <= 1e+151) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, Float64(0.0625 * Float64(z * t))) t_2 = Float64(Float64(y * x) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (t_2 <= -2e+79) tmp = t_1; elseif (t_2 <= 1e+151) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+79], t$95$1, If[LessEqual[t$95$2, 1e+151], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, 0.0625 \cdot \left(z \cdot t\right)\right)\\
t_2 := y \cdot x + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+151}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -1.99999999999999993e79 or 1.00000000000000002e151 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 95.1%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites99.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
if -1.99999999999999993e79 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 1.00000000000000002e151Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
Final simplification77.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (fma z (* t 0.0625) (* (* a b) -0.25)))))
(if (<= (* z t) -5e+80)
t_1
(if (<= (* z t) 1e+34) (fma y x (fma a (* b -0.25) c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, fma(z, (t * 0.0625), ((a * b) * -0.25)));
double tmp;
if ((z * t) <= -5e+80) {
tmp = t_1;
} else if ((z * t) <= 1e+34) {
tmp = fma(y, x, fma(a, (b * -0.25), c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, fma(z, Float64(t * 0.0625), Float64(Float64(a * b) * -0.25))) tmp = 0.0 if (Float64(z * t) <= -5e+80) tmp = t_1; elseif (Float64(z * t) <= 1e+34) tmp = fma(y, x, fma(a, Float64(b * -0.25), c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e+80], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+34], N[(y * x + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right)\right)\\
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999961e80 or 9.99999999999999946e33 < (*.f64 z t) Initial program 94.2%
Taylor expanded in c around 0
associate--l+N/A
lower-fma.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.2
Applied rewrites86.2%
Applied rewrites90.9%
if -4.99999999999999961e80 < (*.f64 z t) < 9.99999999999999946e33Initial program 99.3%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6462.4
Applied rewrites62.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6496.1
Applied rewrites96.1%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* y x) -1e+95)
(fma x y c)
(if (<= (* y x) 4e-131)
(fma (* z 0.0625) t c)
(if (<= (* y x) 1e+151) (+ c (* a (* b -0.25))) (fma x y c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * x) <= -1e+95) {
tmp = fma(x, y, c);
} else if ((y * x) <= 4e-131) {
tmp = fma((z * 0.0625), t, c);
} else if ((y * x) <= 1e+151) {
tmp = c + (a * (b * -0.25));
} else {
tmp = fma(x, y, c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(y * x) <= -1e+95) tmp = fma(x, y, c); elseif (Float64(y * x) <= 4e-131) tmp = fma(Float64(z * 0.0625), t, c); elseif (Float64(y * x) <= 1e+151) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = fma(x, y, c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(y * x), $MachinePrecision], -1e+95], N[(x * y + c), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 4e-131], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+151], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y + c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{elif}\;y \cdot x \leq 4 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{elif}\;y \cdot x \leq 10^{+151}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000002e95 or 1.00000000000000002e151 < (*.f64 x y) Initial program 94.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6480.8
Applied rewrites80.8%
Taylor expanded in t around 0
Applied rewrites73.1%
if -1.00000000000000002e95 < (*.f64 x y) < 3.9999999999999999e-131Initial program 98.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6471.9
Applied rewrites71.9%
Taylor expanded in x around 0
Applied rewrites69.6%
Applied rewrites70.0%
if 3.9999999999999999e-131 < (*.f64 x y) < 1.00000000000000002e151Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.4
Applied rewrites70.4%
Final simplification71.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* a b) -1e+250)
t_1
(if (<= (* a b) 2e-239)
(fma x y c)
(if (<= (* a b) 2e+59) (fma (* z 0.0625) t c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((a * b) <= -1e+250) {
tmp = t_1;
} else if ((a * b) <= 2e-239) {
tmp = fma(x, y, c);
} else if ((a * b) <= 2e+59) {
tmp = fma((z * 0.0625), t, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(a * b) <= -1e+250) tmp = t_1; elseif (Float64(a * b) <= 2e-239) tmp = fma(x, y, c); elseif (Float64(a * b) <= 2e+59) tmp = fma(Float64(z * 0.0625), t, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+250], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-239], N[(x * y + c), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999992e249 or 1.99999999999999994e59 < (*.f64 a b) Initial program 92.2%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.3
Applied rewrites75.3%
if -9.9999999999999992e249 < (*.f64 a b) < 2.0000000000000002e-239Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6490.9
Applied rewrites90.9%
Taylor expanded in t around 0
Applied rewrites66.1%
if 2.0000000000000002e-239 < (*.f64 a b) < 1.99999999999999994e59Initial program 98.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6487.4
Applied rewrites87.4%
Taylor expanded in x around 0
Applied rewrites68.8%
Applied rewrites68.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* a b) -1e+250)
t_1
(if (<= (* a b) 2e-239)
(fma x y c)
(if (<= (* a b) 2e+59) (fma 0.0625 (* z t) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((a * b) <= -1e+250) {
tmp = t_1;
} else if ((a * b) <= 2e-239) {
tmp = fma(x, y, c);
} else if ((a * b) <= 2e+59) {
tmp = fma(0.0625, (z * t), c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(a * b) <= -1e+250) tmp = t_1; elseif (Float64(a * b) <= 2e-239) tmp = fma(x, y, c); elseif (Float64(a * b) <= 2e+59) tmp = fma(0.0625, Float64(z * t), c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+250], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-239], N[(x * y + c), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(0.0625 * N[(z * t), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999992e249 or 1.99999999999999994e59 < (*.f64 a b) Initial program 92.2%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.3
Applied rewrites75.3%
if -9.9999999999999992e249 < (*.f64 a b) < 2.0000000000000002e-239Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6490.9
Applied rewrites90.9%
Taylor expanded in t around 0
Applied rewrites66.1%
if 2.0000000000000002e-239 < (*.f64 a b) < 1.99999999999999994e59Initial program 98.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6487.4
Applied rewrites87.4%
Taylor expanded in x around 0
Applied rewrites68.8%
Final simplification69.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (fma a (* b -0.25) c))))
(if (<= (* y x) -1e+95)
t_1
(if (<= (* y x) 5e-58) (fma a (* b -0.25) (fma 0.0625 (* z t) c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, fma(a, (b * -0.25), c));
double tmp;
if ((y * x) <= -1e+95) {
tmp = t_1;
} else if ((y * x) <= 5e-58) {
tmp = fma(a, (b * -0.25), fma(0.0625, (z * t), c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, fma(a, Float64(b * -0.25), c)) tmp = 0.0 if (Float64(y * x) <= -1e+95) tmp = t_1; elseif (Float64(y * x) <= 5e-58) tmp = fma(a, Float64(b * -0.25), fma(0.0625, Float64(z * t), c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -1e+95], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 5e-58], N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, z \cdot t, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000002e95 or 4.99999999999999977e-58 < (*.f64 x y) Initial program 95.8%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.6
Applied rewrites89.6%
if -1.00000000000000002e95 < (*.f64 x y) < 4.99999999999999977e-58Initial program 98.6%
Taylor expanded in c around 0
associate--l+N/A
lower-fma.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.8
Applied rewrites64.8%
Applied rewrites65.4%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6496.8
Applied rewrites96.8%
Final simplification93.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma a (* b -0.25) c)) (t_2 (fma y x t_1)))
(if (<= (* y x) -1e+95)
t_2
(if (<= (* y x) 5e-58) (fma 0.0625 (* z t) t_1) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(a, (b * -0.25), c);
double t_2 = fma(y, x, t_1);
double tmp;
if ((y * x) <= -1e+95) {
tmp = t_2;
} else if ((y * x) <= 5e-58) {
tmp = fma(0.0625, (z * t), t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(b * -0.25), c) t_2 = fma(y, x, t_1) tmp = 0.0 if (Float64(y * x) <= -1e+95) tmp = t_2; elseif (Float64(y * x) <= 5e-58) tmp = fma(0.0625, Float64(z * t), t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]}, Block[{t$95$2 = N[(y * x + t$95$1), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -1e+95], t$95$2, If[LessEqual[N[(y * x), $MachinePrecision], 5e-58], N[(0.0625 * N[(z * t), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b \cdot -0.25, c\right)\\
t_2 := \mathsf{fma}\left(y, x, t\_1\right)\\
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000002e95 or 4.99999999999999977e-58 < (*.f64 x y) Initial program 95.8%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.6
Applied rewrites89.6%
if -1.00000000000000002e95 < (*.f64 x y) < 4.99999999999999977e-58Initial program 98.6%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6496.0
Applied rewrites96.0%
Final simplification93.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (fma a (* b -0.25) c))))
(if (<= (* a b) -2e+114)
t_1
(if (<= (* a b) 2e+59) (fma y x (fma z (* t 0.0625) c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, fma(a, (b * -0.25), c));
double tmp;
if ((a * b) <= -2e+114) {
tmp = t_1;
} else if ((a * b) <= 2e+59) {
tmp = fma(y, x, fma(z, (t * 0.0625), c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, fma(a, Float64(b * -0.25), c)) tmp = 0.0 if (Float64(a * b) <= -2e+114) tmp = t_1; elseif (Float64(a * b) <= 2e+59) tmp = fma(y, x, fma(z, Float64(t * 0.0625), c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+114], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(y * x + N[(z * N[(t * 0.0625), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t \cdot 0.0625, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e114 or 1.99999999999999994e59 < (*.f64 a b) Initial program 93.5%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6492.8
Applied rewrites92.8%
if -2e114 < (*.f64 a b) < 1.99999999999999994e59Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.9
Applied rewrites91.9%
Applied rewrites92.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma a (* b -0.25) (fma x y c))))
(if (<= (* a b) -2e+114)
t_1
(if (<= (* a b) 2e+59) (fma y x (fma z (* t 0.0625) c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(a, (b * -0.25), fma(x, y, c));
double tmp;
if ((a * b) <= -2e+114) {
tmp = t_1;
} else if ((a * b) <= 2e+59) {
tmp = fma(y, x, fma(z, (t * 0.0625), c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(b * -0.25), fma(x, y, c)) tmp = 0.0 if (Float64(a * b) <= -2e+114) tmp = t_1; elseif (Float64(a * b) <= 2e+59) tmp = fma(y, x, fma(z, Float64(t * 0.0625), c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+114], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(y * x + N[(z * N[(t * 0.0625), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t \cdot 0.0625, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e114 or 1.99999999999999994e59 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6489.4
Applied rewrites89.4%
if -2e114 < (*.f64 a b) < 1.99999999999999994e59Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.9
Applied rewrites91.9%
Applied rewrites92.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma a (* b -0.25) (fma x y c))))
(if (<= (* a b) -2e+114)
t_1
(if (<= (* a b) 2e+59) (fma 0.0625 (* z t) (fma x y c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(a, (b * -0.25), fma(x, y, c));
double tmp;
if ((a * b) <= -2e+114) {
tmp = t_1;
} else if ((a * b) <= 2e+59) {
tmp = fma(0.0625, (z * t), fma(x, y, c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(b * -0.25), fma(x, y, c)) tmp = 0.0 if (Float64(a * b) <= -2e+114) tmp = t_1; elseif (Float64(a * b) <= 2e+59) tmp = fma(0.0625, Float64(z * t), fma(x, y, c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+114], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e114 or 1.99999999999999994e59 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6489.4
Applied rewrites89.4%
if -2e114 < (*.f64 a b) < 1.99999999999999994e59Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.9
Applied rewrites91.9%
Final simplification91.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (* (* a b) -0.25))))
(if (<= (* a b) -5e+197)
t_1
(if (<= (* a b) 2e+59) (fma 0.0625 (* z t) (fma x y c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, ((a * b) * -0.25));
double tmp;
if ((a * b) <= -5e+197) {
tmp = t_1;
} else if ((a * b) <= 2e+59) {
tmp = fma(0.0625, (z * t), fma(x, y, c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, Float64(Float64(a * b) * -0.25)) tmp = 0.0 if (Float64(a * b) <= -5e+197) tmp = t_1; elseif (Float64(a * b) <= 2e+59) tmp = fma(0.0625, Float64(z * t), fma(x, y, c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+197], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+59], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(a \cdot b\right) \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000009e197 or 1.99999999999999994e59 < (*.f64 a b) Initial program 92.7%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6487.6
Applied rewrites87.6%
if -5.00000000000000009e197 < (*.f64 a b) < 1.99999999999999994e59Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.0
Applied rewrites91.0%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (* (* a b) -0.25))))
(if (<= (* y x) -2e+64)
t_1
(if (<= (* y x) 2e-27) (fma (* z 0.0625) t c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, ((a * b) * -0.25));
double tmp;
if ((y * x) <= -2e+64) {
tmp = t_1;
} else if ((y * x) <= 2e-27) {
tmp = fma((z * 0.0625), t, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, Float64(Float64(a * b) * -0.25)) tmp = 0.0 if (Float64(y * x) <= -2e+64) tmp = t_1; elseif (Float64(y * x) <= 2e-27) tmp = fma(Float64(z * 0.0625), t, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -2e+64], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e-27], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(a \cdot b\right) \cdot -0.25\right)\\
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000004e64 or 2.0000000000000001e-27 < (*.f64 x y) Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6480.4
Applied rewrites80.4%
if -2.00000000000000004e64 < (*.f64 x y) < 2.0000000000000001e-27Initial program 98.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6471.7
Applied rewrites71.7%
Taylor expanded in x around 0
Applied rewrites69.0%
Applied rewrites69.4%
Final simplification74.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma a (* b -0.25) (* y x))))
(if (<= (* y x) -2e+64)
t_1
(if (<= (* y x) 2e-27) (fma (* z 0.0625) t c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(a, (b * -0.25), (y * x));
double tmp;
if ((y * x) <= -2e+64) {
tmp = t_1;
} else if ((y * x) <= 2e-27) {
tmp = fma((z * 0.0625), t, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(b * -0.25), Float64(y * x)) tmp = 0.0 if (Float64(y * x) <= -2e+64) tmp = t_1; elseif (Float64(y * x) <= 2e-27) tmp = fma(Float64(z * 0.0625), t, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -2e+64], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e-27], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b \cdot -0.25, y \cdot x\right)\\
\mathbf{if}\;y \cdot x \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000004e64 or 2.0000000000000001e-27 < (*.f64 x y) Initial program 95.7%
Taylor expanded in c around 0
associate--l+N/A
lower-fma.f64N/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
Applied rewrites89.9%
Taylor expanded in z around 0
Applied rewrites77.8%
if -2.00000000000000004e64 < (*.f64 x y) < 2.0000000000000001e-27Initial program 98.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6471.7
Applied rewrites71.7%
Taylor expanded in x around 0
Applied rewrites69.0%
Applied rewrites69.4%
Final simplification73.2%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* a (* b -0.25)))) (if (<= (* a b) -1e+250) t_1 (if (<= (* a b) 2e+160) (fma x y c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((a * b) <= -1e+250) {
tmp = t_1;
} else if ((a * b) <= 2e+160) {
tmp = fma(x, y, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(a * b) <= -1e+250) tmp = t_1; elseif (Float64(a * b) <= 2e+160) tmp = fma(x, y, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+250], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+160], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999992e249 or 2.00000000000000001e160 < (*.f64 a b) Initial program 90.7%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
if -9.9999999999999992e249 < (*.f64 a b) < 2.00000000000000001e160Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6488.0
Applied rewrites88.0%
Taylor expanded in t around 0
Applied rewrites60.8%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* 0.0625 (* z t)))) (if (<= (* z t) -1e+199) t_1 (if (<= (* z t) 1e+34) (fma x y c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((z * t) <= -1e+199) {
tmp = t_1;
} else if ((z * t) <= 1e+34) {
tmp = fma(x, y, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(z * t) <= -1e+199) tmp = t_1; elseif (Float64(z * t) <= 1e+34) tmp = fma(x, y, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+199], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+34], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.0000000000000001e199 or 9.99999999999999946e33 < (*.f64 z t) Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
if -1.0000000000000001e199 < (*.f64 z t) < 9.99999999999999946e33Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6470.3
Applied rewrites70.3%
Taylor expanded in t around 0
Applied rewrites63.8%
Final simplification62.8%
(FPCore (x y z t a b c) :precision binary64 (fma y x (+ (fma z (* t 0.0625) (* (* a b) -0.25)) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(y, x, (fma(z, (t * 0.0625), ((a * b) * -0.25)) + c));
}
function code(x, y, z, t, a, b, c) return fma(y, x, Float64(fma(z, Float64(t * 0.0625), Float64(Float64(a * b) * -0.25)) + c)) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + N[(N[(z * N[(t * 0.0625), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right) + c\right)
\end{array}
Initial program 97.3%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites99.6%
(FPCore (x y z t a b c) :precision binary64 (fma y x (fma (* z t) 0.0625 (fma a (* b -0.25) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(y, x, fma((z * t), 0.0625, fma(a, (b * -0.25), c)));
}
function code(x, y, z, t, a, b, c) return fma(y, x, fma(Float64(z * t), 0.0625, fma(a, Float64(b * -0.25), c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + N[(N[(z * t), $MachinePrecision] * 0.0625 + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x, \mathsf{fma}\left(z \cdot t, 0.0625, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\right)
\end{array}
Initial program 97.3%
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites99.6%
lift-+.f64N/A
lift-fma.f64N/A
associate-+l+N/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6498.9
Applied rewrites98.9%
(FPCore (x y z t a b c) :precision binary64 (fma x y c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, c);
}
function code(x, y, z, t, a, b, c) return fma(x, y, c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, c\right)
\end{array}
Initial program 97.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6472.4
Applied rewrites72.4%
Taylor expanded in t around 0
Applied rewrites49.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 97.3%
Taylor expanded in x around inf
lower-*.f6427.3
Applied rewrites27.3%
Final simplification27.3%
herbie shell --seed 2024221
(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))