
(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 8 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 a b (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, y, fma(a, b, (z * t)));
}
function code(x, y, z, t, a, b) return fma(x, y, fma(a, b, Float64(z * t))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * y + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, z \cdot t\right)\right)
\end{array}
Initial program 99.2%
associate-+l+99.2%
fma-define99.2%
+-commutative99.2%
fma-define99.6%
Simplified99.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))) (t_2 (+ (* z t) (* a b))))
(if (<= (* a b) -3.2e+187)
t_2
(if (<= (* a b) -3.5e+71)
t_1
(if (<= (* a b) -54000000.0)
t_2
(if (<= (* a b) 2.7e-83) (+ (* z t) (* x y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (a * b);
double t_2 = (z * t) + (a * b);
double tmp;
if ((a * b) <= -3.2e+187) {
tmp = t_2;
} else if ((a * b) <= -3.5e+71) {
tmp = t_1;
} else if ((a * b) <= -54000000.0) {
tmp = t_2;
} else if ((a * b) <= 2.7e-83) {
tmp = (z * t) + (x * y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) + (a * b)
t_2 = (z * t) + (a * b)
if ((a * b) <= (-3.2d+187)) then
tmp = t_2
else if ((a * b) <= (-3.5d+71)) then
tmp = t_1
else if ((a * b) <= (-54000000.0d0)) then
tmp = t_2
else if ((a * b) <= 2.7d-83) then
tmp = (z * t) + (x * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (a * b);
double t_2 = (z * t) + (a * b);
double tmp;
if ((a * b) <= -3.2e+187) {
tmp = t_2;
} else if ((a * b) <= -3.5e+71) {
tmp = t_1;
} else if ((a * b) <= -54000000.0) {
tmp = t_2;
} else if ((a * b) <= 2.7e-83) {
tmp = (z * t) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * y) + (a * b) t_2 = (z * t) + (a * b) tmp = 0 if (a * b) <= -3.2e+187: tmp = t_2 elif (a * b) <= -3.5e+71: tmp = t_1 elif (a * b) <= -54000000.0: tmp = t_2 elif (a * b) <= 2.7e-83: tmp = (z * t) + (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(a * b)) t_2 = Float64(Float64(z * t) + Float64(a * b)) tmp = 0.0 if (Float64(a * b) <= -3.2e+187) tmp = t_2; elseif (Float64(a * b) <= -3.5e+71) tmp = t_1; elseif (Float64(a * b) <= -54000000.0) tmp = t_2; elseif (Float64(a * b) <= 2.7e-83) tmp = Float64(Float64(z * t) + Float64(x * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * y) + (a * b); t_2 = (z * t) + (a * b); tmp = 0.0; if ((a * b) <= -3.2e+187) tmp = t_2; elseif ((a * b) <= -3.5e+71) tmp = t_1; elseif ((a * b) <= -54000000.0) tmp = t_2; elseif ((a * b) <= 2.7e-83) tmp = (z * t) + (x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.2e+187], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -3.5e+71], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -54000000.0], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2.7e-83], N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
t_2 := z \cdot t + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -3.2 \cdot 10^{+187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -3.5 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -54000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-83}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -3.19999999999999993e187 or -3.4999999999999999e71 < (*.f64 a b) < -5.4e7Initial program 100.0%
associate-+l+100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 96.2%
if -3.19999999999999993e187 < (*.f64 a b) < -3.4999999999999999e71 or 2.69999999999999991e-83 < (*.f64 a b) Initial program 98.0%
Taylor expanded in x around inf 88.6%
if -5.4e7 < (*.f64 a b) < 2.69999999999999991e-83Initial program 100.0%
Taylor expanded in z around inf 90.0%
Taylor expanded in a around 0 88.4%
Taylor expanded in z around 0 98.3%
Final simplification94.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* a b) -7e+69)
(* a b)
(if (<= (* a b) -4.3e-179)
(* z t)
(if (<= (* a b) 3700000.0) (* x y) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -7e+69) {
tmp = a * b;
} else if ((a * b) <= -4.3e-179) {
tmp = z * t;
} else if ((a * b) <= 3700000.0) {
tmp = x * y;
} 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) <= (-7d+69)) then
tmp = a * b
else if ((a * b) <= (-4.3d-179)) then
tmp = z * t
else if ((a * b) <= 3700000.0d0) then
tmp = x * y
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) <= -7e+69) {
tmp = a * b;
} else if ((a * b) <= -4.3e-179) {
tmp = z * t;
} else if ((a * b) <= 3700000.0) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a * b) <= -7e+69: tmp = a * b elif (a * b) <= -4.3e-179: tmp = z * t elif (a * b) <= 3700000.0: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a * b) <= -7e+69) tmp = Float64(a * b); elseif (Float64(a * b) <= -4.3e-179) tmp = Float64(z * t); elseif (Float64(a * b) <= 3700000.0) tmp = Float64(x * y); 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) <= -7e+69) tmp = a * b; elseif ((a * b) <= -4.3e-179) tmp = z * t; elseif ((a * b) <= 3700000.0) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a * b), $MachinePrecision], -7e+69], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4.3e-179], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3700000.0], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -7 \cdot 10^{+69}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -4.3 \cdot 10^{-179}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3700000:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -6.99999999999999974e69 or 3.7e6 < (*.f64 a b) Initial program 98.2%
associate-+l+98.2%
fma-define98.2%
+-commutative98.2%
fma-define99.1%
Simplified99.1%
Taylor expanded in a around inf 70.8%
if -6.99999999999999974e69 < (*.f64 a b) < -4.30000000000000026e-179Initial program 100.0%
Taylor expanded in z around inf 98.1%
Taylor expanded in a around 0 85.3%
Taylor expanded in t around inf 58.0%
if -4.30000000000000026e-179 < (*.f64 a b) < 3.7e6Initial program 100.0%
Taylor expanded in z around inf 88.8%
Taylor expanded in a around 0 83.8%
Taylor expanded in z around 0 63.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -21000.0) (not (<= (* a b) 25000000000.0))) (+ (* z t) (* a b)) (+ (* z t) (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -21000.0) || !((a * b) <= 25000000000.0)) {
tmp = (z * t) + (a * b);
} else {
tmp = (z * t) + (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 (((a * b) <= (-21000.0d0)) .or. (.not. ((a * b) <= 25000000000.0d0))) then
tmp = (z * t) + (a * b)
else
tmp = (z * t) + (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 (((a * b) <= -21000.0) || !((a * b) <= 25000000000.0)) {
tmp = (z * t) + (a * b);
} else {
tmp = (z * t) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -21000.0) or not ((a * b) <= 25000000000.0): tmp = (z * t) + (a * b) else: tmp = (z * t) + (x * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * b) <= -21000.0) || !(Float64(a * b) <= 25000000000.0)) tmp = Float64(Float64(z * t) + Float64(a * b)); else tmp = Float64(Float64(z * t) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a * b) <= -21000.0) || ~(((a * b) <= 25000000000.0))) tmp = (z * t) + (a * b); else tmp = (z * t) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -21000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 25000000000.0]], $MachinePrecision]], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -21000 \lor \neg \left(a \cdot b \leq 25000000000\right):\\
\;\;\;\;z \cdot t + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -21000 or 2.5e10 < (*.f64 a b) Initial program 98.4%
associate-+l+98.4%
fma-define98.4%
+-commutative98.4%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 83.8%
if -21000 < (*.f64 a b) < 2.5e10Initial program 100.0%
Taylor expanded in z around inf 91.3%
Taylor expanded in a around 0 87.1%
Taylor expanded in z around 0 95.8%
Final simplification89.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -4.6e+127) (not (<= (* x y) 1.65e+160))) (* x y) (+ (* z t) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * y) <= -4.6e+127) || !((x * y) <= 1.65e+160)) {
tmp = x * y;
} else {
tmp = (z * t) + (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 (((x * y) <= (-4.6d+127)) .or. (.not. ((x * y) <= 1.65d+160))) then
tmp = x * y
else
tmp = (z * t) + (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 (((x * y) <= -4.6e+127) || !((x * y) <= 1.65e+160)) {
tmp = x * y;
} else {
tmp = (z * t) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -4.6e+127) or not ((x * y) <= 1.65e+160): tmp = x * y else: tmp = (z * t) + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(x * y) <= -4.6e+127) || !(Float64(x * y) <= 1.65e+160)) tmp = Float64(x * y); else tmp = Float64(Float64(z * t) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((x * y) <= -4.6e+127) || ~(((x * y) <= 1.65e+160))) tmp = x * y; else tmp = (z * t) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4.6e+127], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.65e+160]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+127} \lor \neg \left(x \cdot y \leq 1.65 \cdot 10^{+160}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -4.6000000000000003e127 or 1.6499999999999999e160 < (*.f64 x y) Initial program 100.0%
Taylor expanded in z around inf 84.5%
Taylor expanded in a around 0 80.6%
Taylor expanded in z around 0 85.5%
if -4.6000000000000003e127 < (*.f64 x y) < 1.6499999999999999e160Initial program 98.9%
associate-+l+98.9%
fma-define98.9%
+-commutative98.9%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 82.6%
Final simplification83.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -9.4e-7) (not (<= (* a b) 38000000.0))) (* a b) (* x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -9.4e-7) || !((a * b) <= 38000000.0)) {
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 (((a * b) <= (-9.4d-7)) .or. (.not. ((a * b) <= 38000000.0d0))) 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 (((a * b) <= -9.4e-7) || !((a * b) <= 38000000.0)) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -9.4e-7) or not ((a * b) <= 38000000.0): tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * b) <= -9.4e-7) || !(Float64(a * b) <= 38000000.0)) 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 (((a * b) <= -9.4e-7) || ~(((a * b) <= 38000000.0))) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -9.4e-7], N[Not[LessEqual[N[(a * b), $MachinePrecision], 38000000.0]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9.4 \cdot 10^{-7} \lor \neg \left(a \cdot b \leq 38000000\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -9.4e-7 or 3.8e7 < (*.f64 a b) Initial program 98.4%
associate-+l+98.4%
fma-define98.4%
+-commutative98.4%
fma-define99.2%
Simplified99.2%
Taylor expanded in a around inf 65.2%
if -9.4e-7 < (*.f64 a b) < 3.8e7Initial program 100.0%
Taylor expanded in z around inf 91.1%
Taylor expanded in a around 0 86.8%
Taylor expanded in z around 0 57.7%
Final simplification61.5%
(FPCore (x y z t a b) :precision binary64 (+ (* a b) (+ (* z t) (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (a * b) + ((z * t) + (x * y));
}
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) + ((z * t) + (x * y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (a * b) + ((z * t) + (x * y));
}
def code(x, y, z, t, a, b): return (a * b) + ((z * t) + (x * y))
function code(x, y, z, t, a, b) return Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) end
function tmp = code(x, y, z, t, a, b) tmp = (a * b) + ((z * t) + (x * y)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b + \left(z \cdot t + x \cdot y\right)
\end{array}
Initial program 99.2%
Final simplification99.2%
(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.2%
associate-+l+99.2%
fma-define99.2%
+-commutative99.2%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around inf 36.3%
herbie shell --seed 2024191
(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)))