
(FPCore (x y z t a b) :precision binary64 (+ (+ (* x y) (* z t)) (* a b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * t)) + (a * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * t)) + (a * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * t)) + (a * b);
}
def code(x, y, z, t, a, b): return ((x * y) + (z * t)) + (a * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * t)) + (a * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y + z \cdot t\right) + a \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (* x y) (* z t)) (* a b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * t)) + (a * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * t)) + (a * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * t)) + (a * b);
}
def code(x, y, z, t, a, b): return ((x * y) + (z * t)) + (a * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * t)) + (a * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y + z \cdot t\right) + a \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma x y (fma z t (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, y, fma(z, t, (a * b)));
}
function code(x, y, z, t, a, b) return fma(x, y, fma(z, t, Float64(a * b))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)
\end{array}
Initial program 99.6%
associate-+l+99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (+ (fma z t (* a b)) (* x y)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, t, (a * b)) + (x * y);
}
function code(x, y, z, t, a, b) return Float64(fma(z, t, Float64(a * b)) + Float64(x * y)) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, a \cdot b\right) + x \cdot y
\end{array}
Initial program 99.6%
associate-+l+99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
fma-udef99.6%
+-commutative99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= (* x y) -1.1e+93)
(not
(or (<= (* x y) 4.4e-54)
(and (not (<= (* x y) 7.3e+31)) (<= (* x y) 8.5e+128)))))
(+ (* a b) (* x y))
(+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * y) <= -1.1e+93) || !(((x * y) <= 4.4e-54) || (!((x * y) <= 7.3e+31) && ((x * y) <= 8.5e+128)))) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((x * y) <= (-1.1d+93)) .or. (.not. ((x * y) <= 4.4d-54) .or. (.not. ((x * y) <= 7.3d+31)) .and. ((x * y) <= 8.5d+128))) then
tmp = (a * b) + (x * y)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * y) <= -1.1e+93) || !(((x * y) <= 4.4e-54) || (!((x * y) <= 7.3e+31) && ((x * y) <= 8.5e+128)))) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -1.1e+93) or not (((x * y) <= 4.4e-54) or (not ((x * y) <= 7.3e+31) and ((x * y) <= 8.5e+128))): tmp = (a * b) + (x * y) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(x * y) <= -1.1e+93) || !((Float64(x * y) <= 4.4e-54) || (!(Float64(x * y) <= 7.3e+31) && (Float64(x * y) <= 8.5e+128)))) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((x * y) <= -1.1e+93) || ~((((x * y) <= 4.4e-54) || (~(((x * y) <= 7.3e+31)) && ((x * y) <= 8.5e+128))))) tmp = (a * b) + (x * y); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.1e+93], N[Not[Or[LessEqual[N[(x * y), $MachinePrecision], 4.4e-54], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.3e+31]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 8.5e+128]]]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.1 \cdot 10^{+93} \lor \neg \left(x \cdot y \leq 4.4 \cdot 10^{-54} \lor \neg \left(x \cdot y \leq 7.3 \cdot 10^{+31}\right) \land x \cdot y \leq 8.5 \cdot 10^{+128}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.10000000000000011e93 or 4.3999999999999999e-54 < (*.f64 x y) < 7.30000000000000023e31 or 8.50000000000000045e128 < (*.f64 x y) Initial program 99.1%
Taylor expanded in z around 0 89.3%
if -1.10000000000000011e93 < (*.f64 x y) < 4.3999999999999999e-54 or 7.30000000000000023e31 < (*.f64 x y) < 8.50000000000000045e128Initial program 100.0%
Taylor expanded in x around 0 92.2%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -9.2e+90)
(+ (* x y) (* z t))
(if (or (<= (* x y) 8.5e-57)
(and (not (<= (* x y) 5.9e+31)) (<= (* x y) 1e+129)))
(+ (* a b) (* z t))
(+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -9.2e+90) {
tmp = (x * y) + (z * t);
} else if (((x * y) <= 8.5e-57) || (!((x * y) <= 5.9e+31) && ((x * y) <= 1e+129))) {
tmp = (a * b) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x * y) <= (-9.2d+90)) then
tmp = (x * y) + (z * t)
else if (((x * y) <= 8.5d-57) .or. (.not. ((x * y) <= 5.9d+31)) .and. ((x * y) <= 1d+129)) then
tmp = (a * b) + (z * t)
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -9.2e+90) {
tmp = (x * y) + (z * t);
} else if (((x * y) <= 8.5e-57) || (!((x * y) <= 5.9e+31) && ((x * y) <= 1e+129))) {
tmp = (a * b) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -9.2e+90: tmp = (x * y) + (z * t) elif ((x * y) <= 8.5e-57) or (not ((x * y) <= 5.9e+31) and ((x * y) <= 1e+129)): tmp = (a * b) + (z * t) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -9.2e+90) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif ((Float64(x * y) <= 8.5e-57) || (!(Float64(x * y) <= 5.9e+31) && (Float64(x * y) <= 1e+129))) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x * y) <= -9.2e+90) tmp = (x * y) + (z * t); elseif (((x * y) <= 8.5e-57) || (~(((x * y) <= 5.9e+31)) && ((x * y) <= 1e+129))) tmp = (a * b) + (z * t); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * y), $MachinePrecision], -9.2e+90], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 8.5e-57], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.9e+31]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 1e+129]]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.2 \cdot 10^{+90}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-57} \lor \neg \left(x \cdot y \leq 5.9 \cdot 10^{+31}\right) \land x \cdot y \leq 10^{+129}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.20000000000000001e90Initial program 98.1%
Taylor expanded in a around 0 94.8%
if -9.20000000000000001e90 < (*.f64 x y) < 8.49999999999999955e-57 or 5.9000000000000004e31 < (*.f64 x y) < 1e129Initial program 100.0%
Taylor expanded in x around 0 92.2%
if 8.49999999999999955e-57 < (*.f64 x y) < 5.9000000000000004e31 or 1e129 < (*.f64 x y) Initial program 100.0%
Taylor expanded in z around 0 94.8%
Final simplification93.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -3e+99)
(* x y)
(if (<= (* x y) 0.0)
(* a b)
(if (<= (* x y) 3e-73)
(* z t)
(if (<= (* x y) 1.65e+129) (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -3e+99) {
tmp = x * y;
} else if ((x * y) <= 0.0) {
tmp = a * b;
} else if ((x * y) <= 3e-73) {
tmp = z * t;
} else if ((x * y) <= 1.65e+129) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x * y) <= (-3d+99)) then
tmp = x * y
else if ((x * y) <= 0.0d0) then
tmp = a * b
else if ((x * y) <= 3d-73) then
tmp = z * t
else if ((x * y) <= 1.65d+129) then
tmp = a * b
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -3e+99) {
tmp = x * y;
} else if ((x * y) <= 0.0) {
tmp = a * b;
} else if ((x * y) <= 3e-73) {
tmp = z * t;
} else if ((x * y) <= 1.65e+129) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -3e+99: tmp = x * y elif (x * y) <= 0.0: tmp = a * b elif (x * y) <= 3e-73: tmp = z * t elif (x * y) <= 1.65e+129: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -3e+99) tmp = Float64(x * y); elseif (Float64(x * y) <= 0.0) tmp = Float64(a * b); elseif (Float64(x * y) <= 3e-73) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.65e+129) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x * y) <= -3e+99) tmp = x * y; elseif ((x * y) <= 0.0) tmp = a * b; elseif ((x * y) <= 3e-73) tmp = z * t; elseif ((x * y) <= 1.65e+129) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * y), $MachinePrecision], -3e+99], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e-73], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.65e+129], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3 \cdot 10^{+99}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-73}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+129}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.00000000000000014e99 or 1.64999999999999995e129 < (*.f64 x y) Initial program 98.9%
Taylor expanded in x around inf 81.6%
if -3.00000000000000014e99 < (*.f64 x y) < -0.0 or 3e-73 < (*.f64 x y) < 1.64999999999999995e129Initial program 100.0%
Taylor expanded in a around inf 51.4%
if -0.0 < (*.f64 x y) < 3e-73Initial program 100.0%
Taylor expanded in z around inf 62.0%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -2.6e+98) (not (<= (* x y) 2.6e+129))) (* x y) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * y) <= -2.6e+98) || !((x * y) <= 2.6e+129)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((x * y) <= (-2.6d+98)) .or. (.not. ((x * y) <= 2.6d+129))) then
tmp = x * y
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * y) <= -2.6e+98) || !((x * y) <= 2.6e+129)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -2.6e+98) or not ((x * y) <= 2.6e+129): tmp = x * y else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(x * y) <= -2.6e+98) || !(Float64(x * y) <= 2.6e+129)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((x * y) <= -2.6e+98) || ~(((x * y) <= 2.6e+129))) tmp = x * y; else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.6e+98], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.6e+129]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+98} \lor \neg \left(x \cdot y \leq 2.6 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -2.6e98 or 2.60000000000000012e129 < (*.f64 x y) Initial program 98.9%
Taylor expanded in x around inf 81.6%
if -2.6e98 < (*.f64 x y) < 2.60000000000000012e129Initial program 100.0%
Taylor expanded in x around 0 88.2%
Final simplification85.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -3.2e-52) (not (<= (* a b) 5.2e+30))) (* a b) (* z t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -3.2e-52) || !((a * b) <= 5.2e+30)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((a * b) <= (-3.2d-52)) .or. (.not. ((a * b) <= 5.2d+30))) then
tmp = a * b
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -3.2e-52) || !((a * b) <= 5.2e+30)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -3.2e-52) or not ((a * b) <= 5.2e+30): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * b) <= -3.2e-52) || !(Float64(a * b) <= 5.2e+30)) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a * b) <= -3.2e-52) || ~(((a * b) <= 5.2e+30))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -3.2e-52], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5.2e+30]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.2 \cdot 10^{-52} \lor \neg \left(a \cdot b \leq 5.2 \cdot 10^{+30}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -3.2000000000000001e-52 or 5.19999999999999977e30 < (*.f64 a b) Initial program 99.2%
Taylor expanded in a around inf 62.6%
if -3.2000000000000001e-52 < (*.f64 a b) < 5.19999999999999977e30Initial program 100.0%
Taylor expanded in z around inf 45.9%
Final simplification54.0%
(FPCore (x y z t a b) :precision binary64 (+ (* a b) (+ (* x y) (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
return (a * b) + ((x * y) + (z * t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (a * b) + ((x * y) + (z * t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (a * b) + ((x * y) + (z * t));
}
def code(x, y, z, t, a, b): return (a * b) + ((x * y) + (z * t))
function code(x, y, z, t, a, b) return Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) end
function tmp = code(x, y, z, t, a, b) tmp = (a * b) + ((x * y) + (z * t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b + \left(x \cdot y + z \cdot t\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b) {
return a * b;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a * b;
}
def code(x, y, z, t, a, b): return a * b
function code(x, y, z, t, a, b) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 99.6%
Taylor expanded in a around inf 35.5%
Final simplification35.5%
herbie shell --seed 2024020
(FPCore (x y z t a b)
:name "Linear.V3:$cdot from linear-1.19.1.3, B"
:precision binary64
(+ (+ (* x y) (* z t)) (* a b)))