(FPCore (a x b y c z d) :precision binary64 (+ (+ (+ (* a x) (* b y)) (* c z)) d))
double code(double a, double x, double b, double y, double c, double z, double d) { return (((a * x) + (b * y)) + (c * z)) + d; }
real(8) function code(a, x, b, y, c, z, d) real(8), intent (in) :: a real(8), intent (in) :: x real(8), intent (in) :: b real(8), intent (in) :: y real(8), intent (in) :: c real(8), intent (in) :: z real(8), intent (in) :: d code = (((a * x) + (b * y)) + (c * z)) + d end function
public static double code(double a, double x, double b, double y, double c, double z, double d) { return (((a * x) + (b * y)) + (c * z)) + d; }
def code(a, x, b, y, c, z, d): return (((a * x) + (b * y)) + (c * z)) + d
function code(a, x, b, y, c, z, d) return Float64(Float64(Float64(Float64(a * x) + Float64(b * y)) + Float64(c * z)) + d) end
function tmp = code(a, x, b, y, c, z, d) tmp = (((a * x) + (b * y)) + (c * z)) + d; end
code[a_, x_, b_, y_, c_, z_, d_] := N[(N[(N[(N[(a * x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision] + N[(c * z), $MachinePrecision]), $MachinePrecision] + d), $MachinePrecision]
\begin{array}{l} \\ \left(\left(a \cdot x + b \cdot y\right) + c \cdot z\right) + d \end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (a x b y c z d) :precision binary64 (+ (+ (+ (* a x) (* b y)) (* c z)) d))
double code(double a, double x, double b, double y, double c, double z, double d) { return (((a * x) + (b * y)) + (c * z)) + d; }
real(8) function code(a, x, b, y, c, z, d) real(8), intent (in) :: a real(8), intent (in) :: x real(8), intent (in) :: b real(8), intent (in) :: y real(8), intent (in) :: c real(8), intent (in) :: z real(8), intent (in) :: d code = (((a * x) + (b * y)) + (c * z)) + d end function
public static double code(double a, double x, double b, double y, double c, double z, double d) { return (((a * x) + (b * y)) + (c * z)) + d; }
def code(a, x, b, y, c, z, d): return (((a * x) + (b * y)) + (c * z)) + d
function code(a, x, b, y, c, z, d) return Float64(Float64(Float64(Float64(a * x) + Float64(b * y)) + Float64(c * z)) + d) end
function tmp = code(a, x, b, y, c, z, d) tmp = (((a * x) + (b * y)) + (c * z)) + d; end
code[a_, x_, b_, y_, c_, z_, d_] := N[(N[(N[(N[(a * x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision] + N[(c * z), $MachinePrecision]), $MachinePrecision] + d), $MachinePrecision]
\begin{array}{l} \\ \left(\left(a \cdot x + b \cdot y\right) + c \cdot z\right) + d \end{array}
(FPCore (a x b y c z d) :precision binary64 (fma y b (fma x a (fma z c d))))
double code(double a, double x, double b, double y, double c, double z, double d) { return fma(y, b, fma(x, a, fma(z, c, d))); }
function code(a, x, b, y, c, z, d) return fma(y, b, fma(x, a, fma(z, c, d))) end
code[a_, x_, b_, y_, c_, z_, d_] := N[(y * b + N[(x * a + N[(z * c + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \mathsf{fma}\left(y, b, \mathsf{fma}\left(x, a, \mathsf{fma}\left(z, c, d\right)\right)\right) \end{array}
Initial program 100.0%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= (* a x) -2e-232) (not (<= (* a x) 2e-284))) (fma a x (fma c z d)) (fma z c (fma y b d))))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((a * x) <= -2e-232) || !((a * x) <= 2e-284)) { tmp = fma(a, x, fma(c, z, d)); } else { tmp = fma(z, c, fma(y, b, d)); } return tmp; }
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((Float64(a * x) <= -2e-232) || !(Float64(a * x) <= 2e-284)) tmp = fma(a, x, fma(c, z, d)); else tmp = fma(z, c, fma(y, b, d)); end return tmp end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[N[(a * x), $MachinePrecision], -2e-232], N[Not[LessEqual[N[(a * x), $MachinePrecision], 2e-284]], $MachinePrecision]], N[(a * x + N[(c * z + d), $MachinePrecision]), $MachinePrecision], N[(z * c + N[(y * b + d), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -2 \cdot 10^{-232} \lor \neg \left(a \cdot x \leq 2 \cdot 10^{-284}\right):\\ \;\;\;\;\mathsf{fma}\left(a, x, \mathsf{fma}\left(c, z, d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, c, \mathsf{fma}\left(y, b, d\right)\right)\\ \end{array} \end{array}
if (*.f64 a x) < -2.00000000000000005e-232 or 2.00000000000000007e-284 < (*.f64 a x)
Initial program 99.9%
Taylor expanded in b around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
95.4
Applied rewrites95.4%
Applied rewrites95.4%
if -2.00000000000000005e-232 < (*.f64 a x) < 2.00000000000000007e-284
Initial program 100.0%
Taylor expanded in a around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
98.9
Applied rewrites98.9%
Final simplification97.8%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= (* c z) -5e-220) (not (<= (* c z) 2.5e-237))) (fma a x (fma c z d)) (fma y b (fma x a d))))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((c * z) <= -5e-220) || !((c * z) <= 2.5e-237)) { tmp = fma(a, x, fma(c, z, d)); } else { tmp = fma(y, b, fma(x, a, d)); } return tmp; }
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((Float64(c * z) <= -5e-220) || !(Float64(c * z) <= 2.5e-237)) tmp = fma(a, x, fma(c, z, d)); else tmp = fma(y, b, fma(x, a, d)); end return tmp end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[N[(c * z), $MachinePrecision], -5e-220], N[Not[LessEqual[N[(c * z), $MachinePrecision], 2.5e-237]], $MachinePrecision]], N[(a * x + N[(c * z + d), $MachinePrecision]), $MachinePrecision], N[(y * b + N[(x * a + d), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot z \leq -5 \cdot 10^{-220} \lor \neg \left(c \cdot z \leq 2.5 \cdot 10^{-237}\right):\\ \;\;\;\;\mathsf{fma}\left(a, x, \mathsf{fma}\left(c, z, d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, b, \mathsf{fma}\left(x, a, d\right)\right)\\ \end{array} \end{array}
if (*.f64 c z) < -5.0000000000000002e-220 or 2.5000000000000001e-237 < (*.f64 c z)
Initial program 99.9%
Taylor expanded in b around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
93.5
Applied rewrites93.5%
Applied rewrites93.5%
if -5.0000000000000002e-220 < (*.f64 c z) < 2.5000000000000001e-237
Initial program 100.0%
Taylor expanded in c around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
99.5
Applied rewrites99.5%
Final simplification97.7%
(FPCore (a x b y c z d) :precision binary64 (if (<= (* c z) -5e-220) (fma a x (fma c z d)) (if (<= (* c z) 2.5e-237) (fma y b (fma x a d)) (fma z c (fma x a d)))))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if ((c * z) <= -5e-220) { tmp = fma(a, x, fma(c, z, d)); } else if ((c * z) <= 2.5e-237) { tmp = fma(y, b, fma(x, a, d)); } else { tmp = fma(z, c, fma(x, a, d)); } return tmp; }
function code(a, x, b, y, c, z, d) tmp = 0.0 if (Float64(c * z) <= -5e-220) tmp = fma(a, x, fma(c, z, d)); elseif (Float64(c * z) <= 2.5e-237) tmp = fma(y, b, fma(x, a, d)); else tmp = fma(z, c, fma(x, a, d)); end return tmp end
code[a_, x_, b_, y_, c_, z_, d_] := If[LessEqual[N[(c * z), $MachinePrecision], -5e-220], N[(a * x + N[(c * z + d), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * z), $MachinePrecision], 2.5e-237], N[(y * b + N[(x * a + d), $MachinePrecision]), $MachinePrecision], N[(z * c + N[(x * a + d), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot z \leq -5 \cdot 10^{-220}:\\ \;\;\;\;\mathsf{fma}\left(a, x, \mathsf{fma}\left(c, z, d\right)\right)\\ \mathbf{elif}\;c \cdot z \leq 2.5 \cdot 10^{-237}:\\ \;\;\;\;\mathsf{fma}\left(y, b, \mathsf{fma}\left(x, a, d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, c, \mathsf{fma}\left(x, a, d\right)\right)\\ \end{array} \end{array}
if (*.f64 c z) < -5.0000000000000002e-220
Initial program 100.0%
Taylor expanded in b around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
92.9
Applied rewrites92.9%
Applied rewrites92.9%
if -5.0000000000000002e-220 < (*.f64 c z) < 2.5000000000000001e-237
Initial program 100.0%
Taylor expanded in c around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
99.5
Applied rewrites99.5%
if 2.5000000000000001e-237 < (*.f64 c z)
Initial program 99.9%
Taylor expanded in b around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
93.8
Applied rewrites93.8%
Final simplification97.7%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= (* a x) -5e-119) (not (<= (* a x) 5e-74))) (* a x) (fma b y d)))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((a * x) <= -5e-119) || !((a * x) <= 5e-74)) { tmp = a * x; } else { tmp = fma(b, y, d); } return tmp; }
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((Float64(a * x) <= -5e-119) || !(Float64(a * x) <= 5e-74)) tmp = Float64(a * x); else tmp = fma(b, y, d); end return tmp end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[N[(a * x), $MachinePrecision], -5e-119], N[Not[LessEqual[N[(a * x), $MachinePrecision], 5e-74]], $MachinePrecision]], N[(a * x), $MachinePrecision], N[(b * y + d), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -5 \cdot 10^{-119} \lor \neg \left(a \cdot x \leq 5 \cdot 10^{-74}\right):\\ \;\;\;\;a \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, y, d\right)\\ \end{array} \end{array}
if (*.f64 a x) < -4.99999999999999993e-119 or 4.99999999999999998e-74 < (*.f64 a x)
Initial program 100.0%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64
84.4
Applied rewrites84.4%
if -4.99999999999999993e-119 < (*.f64 a x) < 4.99999999999999998e-74
Initial program 100.0%
Taylor expanded in c around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
86.1
Applied rewrites86.1%
Taylor expanded in a around 0
Applied rewrites81.0%
Final simplification81.2%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= (* c z) -5e-220) (not (<= (* c z) 5e-237))) (* z c) (* b y)))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((c * z) <= -5e-220) || !((c * z) <= 5e-237)) { tmp = z * c; } else { tmp = b * y; } return tmp; }
real(8) function code(a, x, b, y, c, z, d) real(8), intent (in) :: a real(8), intent (in) :: x real(8), intent (in) :: b real(8), intent (in) :: y real(8), intent (in) :: c real(8), intent (in) :: z real(8), intent (in) :: d real(8) :: tmp if (((c * z) <= (-5d-220)) .or. (.not. ((c * z) <= 5d-237))) then tmp = z * c else tmp = b * y end if code = tmp end function
public static double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((c * z) <= -5e-220) || !((c * z) <= 5e-237)) { tmp = z * c; } else { tmp = b * y; } return tmp; }
def code(a, x, b, y, c, z, d): tmp = 0 if ((c * z) <= -5e-220) or not ((c * z) <= 5e-237): tmp = z * c else: tmp = b * y return tmp
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((Float64(c * z) <= -5e-220) || !(Float64(c * z) <= 5e-237)) tmp = Float64(z * c); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(a, x, b, y, c, z, d) tmp = 0.0; if (((c * z) <= -5e-220) || ~(((c * z) <= 5e-237))) tmp = z * c; else tmp = b * y; end tmp_2 = tmp; end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[N[(c * z), $MachinePrecision], -5e-220], N[Not[LessEqual[N[(c * z), $MachinePrecision], 5e-237]], $MachinePrecision]], N[(z * c), $MachinePrecision], N[(b * y), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot z \leq -5 \cdot 10^{-220} \lor \neg \left(c \cdot z \leq 5 \cdot 10^{-237}\right):\\ \;\;\;\;z \cdot c\\ \mathbf{else}:\\ \;\;\;\;b \cdot y\\ \end{array} \end{array}
if (*.f64 c z) < -5.0000000000000002e-220 or 5.0000000000000002e-237 < (*.f64 c z)
Initial program 99.9%
Taylor expanded in c around inf
*-commutative
N/A
lower-*.f64
42.0
Applied rewrites42.0%
if -5.0000000000000002e-220 < (*.f64 c z) < 5.0000000000000002e-237
Initial program 100.0%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
Taylor expanded in b around inf
lower-*.f64
18.4
Applied rewrites18.4%
Final simplification25.3%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= (* a x) -6e-233) (not (<= (* a x) 7e-271))) (* a x) (* b y)))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((a * x) <= -6e-233) || !((a * x) <= 7e-271)) { tmp = a * x; } else { tmp = b * y; } return tmp; }
real(8) function code(a, x, b, y, c, z, d) real(8), intent (in) :: a real(8), intent (in) :: x real(8), intent (in) :: b real(8), intent (in) :: y real(8), intent (in) :: c real(8), intent (in) :: z real(8), intent (in) :: d real(8) :: tmp if (((a * x) <= (-6d-233)) .or. (.not. ((a * x) <= 7d-271))) then tmp = a * x else tmp = b * y end if code = tmp end function
public static double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if (((a * x) <= -6e-233) || !((a * x) <= 7e-271)) { tmp = a * x; } else { tmp = b * y; } return tmp; }
def code(a, x, b, y, c, z, d): tmp = 0 if ((a * x) <= -6e-233) or not ((a * x) <= 7e-271): tmp = a * x else: tmp = b * y return tmp
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((Float64(a * x) <= -6e-233) || !(Float64(a * x) <= 7e-271)) tmp = Float64(a * x); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(a, x, b, y, c, z, d) tmp = 0.0; if (((a * x) <= -6e-233) || ~(((a * x) <= 7e-271))) tmp = a * x; else tmp = b * y; end tmp_2 = tmp; end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[N[(a * x), $MachinePrecision], -6e-233], N[Not[LessEqual[N[(a * x), $MachinePrecision], 7e-271]], $MachinePrecision]], N[(a * x), $MachinePrecision], N[(b * y), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -6 \cdot 10^{-233} \lor \neg \left(a \cdot x \leq 7 \cdot 10^{-271}\right):\\ \;\;\;\;a \cdot x\\ \mathbf{else}:\\ \;\;\;\;b \cdot y\\ \end{array} \end{array}
if (*.f64 a x) < -5.99999999999999997e-233 or 6.9999999999999999e-271 < (*.f64 a x)
Initial program 99.9%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64
31.2
Applied rewrites31.2%
if -5.99999999999999997e-233 < (*.f64 a x) < 6.9999999999999999e-271
Initial program 100.0%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
Taylor expanded in b around inf
lower-*.f64
18.7
Applied rewrites18.7%
Final simplification22.6%
(FPCore (a x b y c z d) :precision binary64 (if (or (<= b -1e-54) (not (<= b 1.5e-96))) (fma b y d) (fma a x (fma c z d))))
double code(double a, double x, double b, double y, double c, double z, double d) { double tmp; if ((b <= -1e-54) || !(b <= 1.5e-96)) { tmp = fma(b, y, d); } else { tmp = fma(a, x, fma(c, z, d)); } return tmp; }
function code(a, x, b, y, c, z, d) tmp = 0.0 if ((b <= -1e-54) || !(b <= 1.5e-96)) tmp = fma(b, y, d); else tmp = fma(a, x, fma(c, z, d)); end return tmp end
code[a_, x_, b_, y_, c_, z_, d_] := If[Or[LessEqual[b, -1e-54], N[Not[LessEqual[b, 1.5e-96]], $MachinePrecision]], N[(b * y + d), $MachinePrecision], N[(a * x + N[(c * z + d), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-54} \lor \neg \left(b \leq 1.5 \cdot 10^{-96}\right):\\ \;\;\;\;\mathsf{fma}\left(b, y, d\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, x, \mathsf{fma}\left(c, z, d\right)\right)\\ \end{array} \end{array}
if b < -1e-54 or 1.5e-96 < b
Initial program 100.0%
Taylor expanded in c around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
89.4
Applied rewrites89.4%
Taylor expanded in a around 0
Applied rewrites78.5%
if -1e-54 < b < 1.5e-96
Initial program 100.0%
Taylor expanded in b around 0
associate-+r+
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
94.3
Applied rewrites94.3%
Applied rewrites94.3%
Final simplification90.5%
(FPCore (a x b y c z d) :precision binary64 (* a x))
double code(double a, double x, double b, double y, double c, double z, double d) { return a * x; }
real(8) function code(a, x, b, y, c, z, d) real(8), intent (in) :: a real(8), intent (in) :: x real(8), intent (in) :: b real(8), intent (in) :: y real(8), intent (in) :: c real(8), intent (in) :: z real(8), intent (in) :: d code = a * x end function
public static double code(double a, double x, double b, double y, double c, double z, double d) { return a * x; }
def code(a, x, b, y, c, z, d): return a * x
function code(a, x, b, y, c, z, d) return Float64(a * x) end
function tmp = code(a, x, b, y, c, z, d) tmp = a * x; end
code[a_, x_, b_, y_, c_, z_, d_] := N[(a * x), $MachinePrecision]
\begin{array}{l} \\ a \cdot x \end{array}
Initial program 100.0%
lift-+.f64
N/A
lift-+.f64
N/A
associate-+l+
N/A
lift-+.f64
N/A
+-commutative
N/A
associate-+l+
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-fma.f64
100.0
Applied rewrites100.0%
Taylor expanded in a around inf
lower-*.f64
13.3
Applied rewrites13.3%
herbie shell --seed 1
(FPCore (a x b y c z d)
:name "a*x+b*y+c*z+d"
:precision binary64
:pre (and (and (and (and (and (and (and (<= -1.0 a) (<= a 1.0)) (and (<= -1000.0 x) (<= x 1000.0))) (and (<= -1.0 b) (<= b 1.0))) (and (<= -1000.0 y) (<= y 1000.0))) (and (<= -1.0 c) (<= c 1.0))) (and (<= -1000.0 z) (<= z 1000.0))) (and (<= -1000.0 d) (<= d 1000.0)))
(+ (+ (+ (* a x) (* b y)) (* c z)) d))