
(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 10 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.4%
associate-+l+98.4%
fma-define98.8%
fma-define99.2%
Simplified99.2%
(FPCore (x y z t a b) :precision binary64 (fma a b (fma x y (* z t))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, b, fma(x, y, (z * t)));
}
function code(x, y, z, t, a, b) return fma(a, b, fma(x, y, Float64(z * t))) end
code[x_, y_, z_, t_, a_, b_] := N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
\end{array}
Initial program 98.4%
+-commutative98.4%
fma-define98.8%
fma-define98.8%
Simplified98.8%
(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.4%
fma-define98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -8.5e+136)
(* x y)
(if (<= (* x y) -4.9e-116)
(* a b)
(if (<= (* x y) 0.0)
(* z t)
(if (<= (* x y) 1.15e-123)
(* a b)
(if (<= (* x y) 2.8e+21)
(* z t)
(if (<= (* x y) 5.8e+143) (* a b) (* x y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -8.5e+136) {
tmp = x * y;
} else if ((x * y) <= -4.9e-116) {
tmp = a * b;
} else if ((x * y) <= 0.0) {
tmp = z * t;
} else if ((x * y) <= 1.15e-123) {
tmp = a * b;
} else if ((x * y) <= 2.8e+21) {
tmp = z * t;
} else if ((x * y) <= 5.8e+143) {
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) <= (-8.5d+136)) then
tmp = x * y
else if ((x * y) <= (-4.9d-116)) then
tmp = a * b
else if ((x * y) <= 0.0d0) then
tmp = z * t
else if ((x * y) <= 1.15d-123) then
tmp = a * b
else if ((x * y) <= 2.8d+21) then
tmp = z * t
else if ((x * y) <= 5.8d+143) 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) <= -8.5e+136) {
tmp = x * y;
} else if ((x * y) <= -4.9e-116) {
tmp = a * b;
} else if ((x * y) <= 0.0) {
tmp = z * t;
} else if ((x * y) <= 1.15e-123) {
tmp = a * b;
} else if ((x * y) <= 2.8e+21) {
tmp = z * t;
} else if ((x * y) <= 5.8e+143) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -8.5e+136: tmp = x * y elif (x * y) <= -4.9e-116: tmp = a * b elif (x * y) <= 0.0: tmp = z * t elif (x * y) <= 1.15e-123: tmp = a * b elif (x * y) <= 2.8e+21: tmp = z * t elif (x * y) <= 5.8e+143: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -8.5e+136) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.9e-116) tmp = Float64(a * b); elseif (Float64(x * y) <= 0.0) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.15e-123) tmp = Float64(a * b); elseif (Float64(x * y) <= 2.8e+21) tmp = Float64(z * t); elseif (Float64(x * y) <= 5.8e+143) 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) <= -8.5e+136) tmp = x * y; elseif ((x * y) <= -4.9e-116) tmp = a * b; elseif ((x * y) <= 0.0) tmp = z * t; elseif ((x * y) <= 1.15e-123) tmp = a * b; elseif ((x * y) <= 2.8e+21) tmp = z * t; elseif ((x * y) <= 5.8e+143) 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], -8.5e+136], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.9e-116], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-123], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+21], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+143], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+136}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.9 \cdot 10^{-116}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-123}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+21}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+143}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.49999999999999966e136 or 5.7999999999999996e143 < (*.f64 x y) Initial program 97.5%
Taylor expanded in x around inf 83.5%
if -8.49999999999999966e136 < (*.f64 x y) < -4.89999999999999977e-116 or 0.0 < (*.f64 x y) < 1.14999999999999993e-123 or 2.8e21 < (*.f64 x y) < 5.7999999999999996e143Initial program 100.0%
Taylor expanded in a around inf 63.4%
if -4.89999999999999977e-116 < (*.f64 x y) < 0.0 or 1.14999999999999993e-123 < (*.f64 x y) < 2.8e21Initial program 97.9%
Taylor expanded in z around inf 64.5%
Final simplification70.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -2e+83) (not (<= (* x y) 1e+58))) (+ (* 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) <= -2e+83) || !((x * y) <= 1e+58)) {
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) <= (-2d+83)) .or. (.not. ((x * y) <= 1d+58))) 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) <= -2e+83) || !((x * y) <= 1e+58)) {
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) <= -2e+83) or not ((x * y) <= 1e+58): 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) <= -2e+83) || !(Float64(x * y) <= 1e+58)) 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) <= -2e+83) || ~(((x * y) <= 1e+58))) 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], -2e+83], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+58]], $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 -2 \cdot 10^{+83} \lor \neg \left(x \cdot y \leq 10^{+58}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000006e83Initial program 100.0%
Taylor expanded in z around 0 92.3%
if -2.00000000000000006e83 < (*.f64 x y) < 9.99999999999999944e57Initial program 98.7%
Taylor expanded in x around 0 90.6%
if 9.99999999999999944e57 < (*.f64 x y) Initial program 96.1%
Taylor expanded in x around inf 96.1%
Taylor expanded in x around inf 90.4%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -2.5e+49) (not (<= (* x y) 7.2e+62))) (+ (* 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) <= -2.5e+49) || !((x * y) <= 7.2e+62)) {
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) <= (-2.5d+49)) .or. (.not. ((x * y) <= 7.2d+62))) 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) <= -2.5e+49) || !((x * y) <= 7.2e+62)) {
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) <= -2.5e+49) or not ((x * y) <= 7.2e+62): 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) <= -2.5e+49) || !(Float64(x * y) <= 7.2e+62)) 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) <= -2.5e+49) || ~(((x * y) <= 7.2e+62))) 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], -2.5e+49], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.2e+62]], $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 -2.5 \cdot 10^{+49} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+62}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5000000000000002e49 or 7.2e62 < (*.f64 x y) Initial program 98.0%
Taylor expanded in z around 0 91.3%
if -2.5000000000000002e49 < (*.f64 x y) < 7.2e62Initial program 98.7%
Taylor expanded in x around 0 90.6%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -3.8e+205) (not (<= (* x y) 1.1e+148))) (* 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) <= -3.8e+205) || !((x * y) <= 1.1e+148)) {
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) <= (-3.8d+205)) .or. (.not. ((x * y) <= 1.1d+148))) 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) <= -3.8e+205) || !((x * y) <= 1.1e+148)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -3.8e+205) or not ((x * y) <= 1.1e+148): 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) <= -3.8e+205) || !(Float64(x * y) <= 1.1e+148)) 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) <= -3.8e+205) || ~(((x * y) <= 1.1e+148))) 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], -3.8e+205], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+148]], $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 -3.8 \cdot 10^{+205} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+148}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -3.8e205 or 1.0999999999999999e148 < (*.f64 x y) Initial program 97.1%
Taylor expanded in x around inf 89.1%
if -3.8e205 < (*.f64 x y) < 1.0999999999999999e148Initial program 98.9%
Taylor expanded in x around 0 85.7%
Final simplification86.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -5.8e+45) (not (<= (* a b) 1.35e-58))) (* a b) (* z t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -5.8e+45) || !((a * b) <= 1.35e-58)) {
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) <= (-5.8d+45)) .or. (.not. ((a * b) <= 1.35d-58))) 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) <= -5.8e+45) || !((a * b) <= 1.35e-58)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -5.8e+45) or not ((a * b) <= 1.35e-58): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * b) <= -5.8e+45) || !(Float64(a * b) <= 1.35e-58)) 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) <= -5.8e+45) || ~(((a * b) <= 1.35e-58))) 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], -5.8e+45], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.35e-58]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{+45} \lor \neg \left(a \cdot b \leq 1.35 \cdot 10^{-58}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -5.7999999999999994e45 or 1.3499999999999999e-58 < (*.f64 a b) Initial program 97.0%
Taylor expanded in a around inf 62.9%
if -5.7999999999999994e45 < (*.f64 a b) < 1.3499999999999999e-58Initial program 100.0%
Taylor expanded in z around inf 51.2%
Final simplification57.2%
(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.4%
Final simplification98.4%
(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.4%
Taylor expanded in a around inf 37.2%
herbie shell --seed 2024103
(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)))