
(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 98.8%
associate-+l+98.8%
fma-def99.6%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (+ (* a b) (fma x y (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
return (a * b) + fma(x, y, (z * t));
}
function code(x, y, z, t, a, b) return Float64(Float64(a * b) + fma(x, y, Float64(z * t))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a * b), $MachinePrecision] + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b + \mathsf{fma}\left(x, y, z \cdot t\right)
\end{array}
Initial program 98.8%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* a b) -2e+116)
(* a b)
(if (<= (* a b) -3.8e-120)
(* z t)
(if (<= (* a b) -1e-322)
(* x y)
(if (or (<= (* a b) 8.5e-81)
(and (not (<= (* a b) 7.5e+26)) (<= (* a b) 4.8e+121)))
(* z t)
(* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -2e+116) {
tmp = a * b;
} else if ((a * b) <= -3.8e-120) {
tmp = z * t;
} else if ((a * b) <= -1e-322) {
tmp = x * y;
} else if (((a * b) <= 8.5e-81) || (!((a * b) <= 7.5e+26) && ((a * b) <= 4.8e+121))) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a * b) <= (-2d+116)) then
tmp = a * b
else if ((a * b) <= (-3.8d-120)) then
tmp = z * t
else if ((a * b) <= (-1d-322)) then
tmp = x * y
else if (((a * b) <= 8.5d-81) .or. (.not. ((a * b) <= 7.5d+26)) .and. ((a * b) <= 4.8d+121)) then
tmp = z * t
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -2e+116) {
tmp = a * b;
} else if ((a * b) <= -3.8e-120) {
tmp = z * t;
} else if ((a * b) <= -1e-322) {
tmp = x * y;
} else if (((a * b) <= 8.5e-81) || (!((a * b) <= 7.5e+26) && ((a * b) <= 4.8e+121))) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a * b) <= -2e+116: tmp = a * b elif (a * b) <= -3.8e-120: tmp = z * t elif (a * b) <= -1e-322: tmp = x * y elif ((a * b) <= 8.5e-81) or (not ((a * b) <= 7.5e+26) and ((a * b) <= 4.8e+121)): tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a * b) <= -2e+116) tmp = Float64(a * b); elseif (Float64(a * b) <= -3.8e-120) tmp = Float64(z * t); elseif (Float64(a * b) <= -1e-322) tmp = Float64(x * y); elseif ((Float64(a * b) <= 8.5e-81) || (!(Float64(a * b) <= 7.5e+26) && (Float64(a * b) <= 4.8e+121))) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a * b) <= -2e+116) tmp = a * b; elseif ((a * b) <= -3.8e-120) tmp = z * t; elseif ((a * b) <= -1e-322) tmp = x * y; elseif (((a * b) <= 8.5e-81) || (~(((a * b) <= 7.5e+26)) && ((a * b) <= 4.8e+121))) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+116], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.8e-120], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-322], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 8.5e-81], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.5e+26]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 4.8e+121]]], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+116}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3.8 \cdot 10^{-120}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-322}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{-81} \lor \neg \left(a \cdot b \leq 7.5 \cdot 10^{+26}\right) \land a \cdot b \leq 4.8 \cdot 10^{+121}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000003e116 or 8.5000000000000001e-81 < (*.f64 a b) < 7.49999999999999941e26 or 4.8e121 < (*.f64 a b) Initial program 98.0%
Taylor expanded in a around inf 73.8%
if -2.00000000000000003e116 < (*.f64 a b) < -3.7999999999999997e-120 or -9.88131e-323 < (*.f64 a b) < 8.5000000000000001e-81 or 7.49999999999999941e26 < (*.f64 a b) < 4.8e121Initial program 99.3%
Taylor expanded in z around inf 60.1%
if -3.7999999999999997e-120 < (*.f64 a b) < -9.88131e-323Initial program 100.0%
Taylor expanded in x around inf 60.3%
Final simplification65.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* a b) -2.7e+117)
(* a b)
(if (or (<= (* a b) 8.6e-78)
(and (not (<= (* a b) 4.3e+27)) (<= (* a b) 1.95e+121)))
(* z t)
(* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -2.7e+117) {
tmp = a * b;
} else if (((a * b) <= 8.6e-78) || (!((a * b) <= 4.3e+27) && ((a * b) <= 1.95e+121))) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a * b) <= (-2.7d+117)) then
tmp = a * b
else if (((a * b) <= 8.6d-78) .or. (.not. ((a * b) <= 4.3d+27)) .and. ((a * b) <= 1.95d+121)) then
tmp = z * t
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -2.7e+117) {
tmp = a * b;
} else if (((a * b) <= 8.6e-78) || (!((a * b) <= 4.3e+27) && ((a * b) <= 1.95e+121))) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a * b) <= -2.7e+117: tmp = a * b elif ((a * b) <= 8.6e-78) or (not ((a * b) <= 4.3e+27) and ((a * b) <= 1.95e+121)): tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a * b) <= -2.7e+117) tmp = Float64(a * b); elseif ((Float64(a * b) <= 8.6e-78) || (!(Float64(a * b) <= 4.3e+27) && (Float64(a * b) <= 1.95e+121))) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a * b) <= -2.7e+117) tmp = a * b; elseif (((a * b) <= 8.6e-78) || (~(((a * b) <= 4.3e+27)) && ((a * b) <= 1.95e+121))) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.7e+117], N[(a * b), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 8.6e-78], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.3e+27]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 1.95e+121]]], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.7 \cdot 10^{+117}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 8.6 \cdot 10^{-78} \lor \neg \left(a \cdot b \leq 4.3 \cdot 10^{+27}\right) \land a \cdot b \leq 1.95 \cdot 10^{+121}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.7000000000000002e117 or 8.59999999999999987e-78 < (*.f64 a b) < 4.30000000000000008e27 or 1.94999999999999992e121 < (*.f64 a b) Initial program 98.0%
Taylor expanded in a around inf 73.8%
if -2.7000000000000002e117 < (*.f64 a b) < 8.59999999999999987e-78 or 4.30000000000000008e27 < (*.f64 a b) < 1.94999999999999992e121Initial program 99.4%
Taylor expanded in z around inf 56.3%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.4e-185) (not (<= y 7.6e+143))) (+ (* 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 ((y <= -1.4e-185) || !(y <= 7.6e+143)) {
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 ((y <= (-1.4d-185)) .or. (.not. (y <= 7.6d+143))) 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 ((y <= -1.4e-185) || !(y <= 7.6e+143)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.4e-185) or not (y <= 7.6e+143): 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 ((y <= -1.4e-185) || !(y <= 7.6e+143)) 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 ((y <= -1.4e-185) || ~((y <= 7.6e+143))) 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[y, -1.4e-185], N[Not[LessEqual[y, 7.6e+143]], $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}\;y \leq -1.4 \cdot 10^{-185} \lor \neg \left(y \leq 7.6 \cdot 10^{+143}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if y < -1.39999999999999996e-185 or 7.60000000000000001e143 < y Initial program 99.3%
Taylor expanded in z around 0 71.9%
if -1.39999999999999996e-185 < y < 7.60000000000000001e143Initial program 98.3%
Taylor expanded in x around 0 89.9%
Final simplification80.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.2e+23) (* x y) (if (<= y 2.6e+144) (+ (* a b) (* z t)) (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.2e+23) {
tmp = x * y;
} else if (y <= 2.6e+144) {
tmp = (a * b) + (z * t);
} 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 (y <= (-1.2d+23)) then
tmp = x * y
else if (y <= 2.6d+144) then
tmp = (a * b) + (z * t)
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 (y <= -1.2e+23) {
tmp = x * y;
} else if (y <= 2.6e+144) {
tmp = (a * b) + (z * t);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.2e+23: tmp = x * y elif y <= 2.6e+144: tmp = (a * b) + (z * t) else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.2e+23) tmp = Float64(x * y); elseif (y <= 2.6e+144) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.2e+23) tmp = x * y; elseif (y <= 2.6e+144) tmp = (a * b) + (z * t); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.2e+23], N[(x * y), $MachinePrecision], If[LessEqual[y, 2.6e+144], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+23}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+144}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.2e23 or 2.5999999999999999e144 < y Initial program 98.9%
Taylor expanded in x around inf 54.6%
if -1.2e23 < y < 2.5999999999999999e144Initial program 98.8%
Taylor expanded in x around 0 89.0%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.4e-185) (+ (* a b) (* x y)) (if (<= y 3.5e+126) (+ (* a b) (* z t)) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.4e-185) {
tmp = (a * b) + (x * y);
} else if (y <= 3.5e+126) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (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 (y <= (-1.4d-185)) then
tmp = (a * b) + (x * y)
else if (y <= 3.5d+126) then
tmp = (a * b) + (z * t)
else
tmp = (x * y) + (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 (y <= -1.4e-185) {
tmp = (a * b) + (x * y);
} else if (y <= 3.5e+126) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.4e-185: tmp = (a * b) + (x * y) elif y <= 3.5e+126: tmp = (a * b) + (z * t) else: tmp = (x * y) + (z * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.4e-185) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (y <= 3.5e+126) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(x * y) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.4e-185) tmp = (a * b) + (x * y); elseif (y <= 3.5e+126) tmp = (a * b) + (z * t); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.4e-185], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+126], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-185}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+126}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if y < -1.39999999999999996e-185Initial program 99.0%
Taylor expanded in z around 0 69.9%
if -1.39999999999999996e-185 < y < 3.5000000000000003e126Initial program 98.2%
Taylor expanded in x around 0 90.3%
if 3.5000000000000003e126 < y Initial program 100.0%
Taylor expanded in a around 0 87.5%
Final simplification81.7%
(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 98.8%
Final simplification98.8%
(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 98.8%
Taylor expanded in a around inf 38.4%
Final simplification38.4%
herbie shell --seed 2023274
(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)))