
(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.4%
associate-+l+98.4%
fma-define98.8%
fma-define99.6%
Simplified99.6%
Final simplification99.6%
(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.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* a b) -8.2e-20)
(* a b)
(if (<= (* a b) -2.6e-132)
(* z t)
(if (<= (* a b) -9.6e-308)
(* x y)
(if (<= (* a b) 2.1e-256)
(* z t)
(if (<= (* a b) 7.5e-237)
(* x y)
(if (<= (* a b) 1000000000.0)
(* z t)
(if (<= (* a b) 5.5e+108) (* x y) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -8.2e-20) {
tmp = a * b;
} else if ((a * b) <= -2.6e-132) {
tmp = z * t;
} else if ((a * b) <= -9.6e-308) {
tmp = x * y;
} else if ((a * b) <= 2.1e-256) {
tmp = z * t;
} else if ((a * b) <= 7.5e-237) {
tmp = x * y;
} else if ((a * b) <= 1000000000.0) {
tmp = z * t;
} else if ((a * b) <= 5.5e+108) {
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) <= (-8.2d-20)) then
tmp = a * b
else if ((a * b) <= (-2.6d-132)) then
tmp = z * t
else if ((a * b) <= (-9.6d-308)) then
tmp = x * y
else if ((a * b) <= 2.1d-256) then
tmp = z * t
else if ((a * b) <= 7.5d-237) then
tmp = x * y
else if ((a * b) <= 1000000000.0d0) then
tmp = z * t
else if ((a * b) <= 5.5d+108) 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) <= -8.2e-20) {
tmp = a * b;
} else if ((a * b) <= -2.6e-132) {
tmp = z * t;
} else if ((a * b) <= -9.6e-308) {
tmp = x * y;
} else if ((a * b) <= 2.1e-256) {
tmp = z * t;
} else if ((a * b) <= 7.5e-237) {
tmp = x * y;
} else if ((a * b) <= 1000000000.0) {
tmp = z * t;
} else if ((a * b) <= 5.5e+108) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a * b) <= -8.2e-20: tmp = a * b elif (a * b) <= -2.6e-132: tmp = z * t elif (a * b) <= -9.6e-308: tmp = x * y elif (a * b) <= 2.1e-256: tmp = z * t elif (a * b) <= 7.5e-237: tmp = x * y elif (a * b) <= 1000000000.0: tmp = z * t elif (a * b) <= 5.5e+108: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a * b) <= -8.2e-20) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.6e-132) tmp = Float64(z * t); elseif (Float64(a * b) <= -9.6e-308) tmp = Float64(x * y); elseif (Float64(a * b) <= 2.1e-256) tmp = Float64(z * t); elseif (Float64(a * b) <= 7.5e-237) tmp = Float64(x * y); elseif (Float64(a * b) <= 1000000000.0) tmp = Float64(z * t); elseif (Float64(a * b) <= 5.5e+108) 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) <= -8.2e-20) tmp = a * b; elseif ((a * b) <= -2.6e-132) tmp = z * t; elseif ((a * b) <= -9.6e-308) tmp = x * y; elseif ((a * b) <= 2.1e-256) tmp = z * t; elseif ((a * b) <= 7.5e-237) tmp = x * y; elseif ((a * b) <= 1000000000.0) tmp = z * t; elseif ((a * b) <= 5.5e+108) 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], -8.2e-20], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.6e-132], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -9.6e-308], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.1e-256], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.5e-237], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1000000000.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.5e+108], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.2 \cdot 10^{-20}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.6 \cdot 10^{-132}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -9.6 \cdot 10^{-308}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.1 \cdot 10^{-256}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 7.5 \cdot 10^{-237}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1000000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 5.5 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -8.2000000000000002e-20 or 5.4999999999999998e108 < (*.f64 a b) Initial program 96.2%
Taylor expanded in a around inf 63.9%
if -8.2000000000000002e-20 < (*.f64 a b) < -2.6000000000000001e-132 or -9.60000000000000032e-308 < (*.f64 a b) < 2.10000000000000003e-256 or 7.50000000000000034e-237 < (*.f64 a b) < 1e9Initial program 100.0%
Taylor expanded in z around inf 61.7%
if -2.6000000000000001e-132 < (*.f64 a b) < -9.60000000000000032e-308 or 2.10000000000000003e-256 < (*.f64 a b) < 7.50000000000000034e-237 or 1e9 < (*.f64 a b) < 5.4999999999999998e108Initial program 100.0%
Taylor expanded in x around inf 72.5%
Final simplification65.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= (* x y) -1.55e+162)
(not
(or (<= (* x y) -7e+125)
(and (not (<= (* x y) -2.05e+83)) (<= (* x y) 2.55e+159)))))
(* 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.55e+162) || !(((x * y) <= -7e+125) || (!((x * y) <= -2.05e+83) && ((x * y) <= 2.55e+159)))) {
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) <= (-1.55d+162)) .or. (.not. ((x * y) <= (-7d+125)) .or. (.not. ((x * y) <= (-2.05d+83))) .and. ((x * y) <= 2.55d+159))) 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) <= -1.55e+162) || !(((x * y) <= -7e+125) || (!((x * y) <= -2.05e+83) && ((x * y) <= 2.55e+159)))) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -1.55e+162) or not (((x * y) <= -7e+125) or (not ((x * y) <= -2.05e+83) and ((x * y) <= 2.55e+159))): 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) <= -1.55e+162) || !((Float64(x * y) <= -7e+125) || (!(Float64(x * y) <= -2.05e+83) && (Float64(x * y) <= 2.55e+159)))) 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) <= -1.55e+162) || ~((((x * y) <= -7e+125) || (~(((x * y) <= -2.05e+83)) && ((x * y) <= 2.55e+159))))) 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], -1.55e+162], N[Not[Or[LessEqual[N[(x * y), $MachinePrecision], -7e+125], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -2.05e+83]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 2.55e+159]]]], $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 -1.55 \cdot 10^{+162} \lor \neg \left(x \cdot y \leq -7 \cdot 10^{+125} \lor \neg \left(x \cdot y \leq -2.05 \cdot 10^{+83}\right) \land x \cdot y \leq 2.55 \cdot 10^{+159}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e162 or -7.00000000000000023e125 < (*.f64 x y) < -2.05e83 or 2.54999999999999984e159 < (*.f64 x y) Initial program 97.3%
Taylor expanded in x around inf 81.1%
if -1.55e162 < (*.f64 x y) < -7.00000000000000023e125 or -2.05e83 < (*.f64 x y) < 2.54999999999999984e159Initial program 98.9%
Taylor expanded in x around 0 83.3%
Final simplification82.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -1.45e+53) (not (<= (* x y) 1.9e+157))) (+ (* 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.45e+53) || !((x * y) <= 1.9e+157)) {
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.45d+53)) .or. (.not. ((x * y) <= 1.9d+157))) 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.45e+53) || !((x * y) <= 1.9e+157)) {
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.45e+53) or not ((x * y) <= 1.9e+157): 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.45e+53) || !(Float64(x * y) <= 1.9e+157)) 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.45e+53) || ~(((x * y) <= 1.9e+157))) 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.45e+53], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.9e+157]], $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.45 \cdot 10^{+53} \lor \neg \left(x \cdot y \leq 1.9 \cdot 10^{+157}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4500000000000001e53 or 1.9e157 < (*.f64 x y) Initial program 97.8%
Taylor expanded in z around 0 85.2%
if -1.4500000000000001e53 < (*.f64 x y) < 1.9e157Initial program 98.8%
Taylor expanded in x around 0 84.1%
Final simplification84.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -1e-60) (not (<= (* a b) 5e+108))) (+ (* 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 (((a * b) <= -1e-60) || !((a * b) <= 5e+108)) {
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 (((a * b) <= (-1d-60)) .or. (.not. ((a * b) <= 5d+108))) 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 (((a * b) <= -1e-60) || !((a * b) <= 5e+108)) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -1e-60) or not ((a * b) <= 5e+108): 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 ((Float64(a * b) <= -1e-60) || !(Float64(a * b) <= 5e+108)) 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 (((a * b) <= -1e-60) || ~(((a * b) <= 5e+108))) tmp = (a * b) + (z * t); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e-60], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+108]], $MachinePrecision]], 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}\;a \cdot b \leq -1 \cdot 10^{-60} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+108}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999997e-61 or 4.99999999999999991e108 < (*.f64 a b) Initial program 96.4%
Taylor expanded in x around 0 83.1%
if -9.9999999999999997e-61 < (*.f64 a b) < 4.99999999999999991e108Initial program 100.0%
Taylor expanded in a around 0 94.8%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* a b) -8.5e-20) (not (<= (* a b) 4.8e+89))) (* a b) (* z t)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * b) <= -8.5e-20) || !((a * b) <= 4.8e+89)) {
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) <= (-8.5d-20)) .or. (.not. ((a * b) <= 4.8d+89))) 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) <= -8.5e-20) || !((a * b) <= 4.8e+89)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a * b) <= -8.5e-20) or not ((a * b) <= 4.8e+89): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * b) <= -8.5e-20) || !(Float64(a * b) <= 4.8e+89)) 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) <= -8.5e-20) || ~(((a * b) <= 4.8e+89))) 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], -8.5e-20], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.8e+89]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{-20} \lor \neg \left(a \cdot b \leq 4.8 \cdot 10^{+89}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -8.5000000000000005e-20 or 4.80000000000000009e89 < (*.f64 a b) Initial program 96.4%
Taylor expanded in a around inf 61.8%
if -8.5000000000000005e-20 < (*.f64 a b) < 4.80000000000000009e89Initial program 100.0%
Taylor expanded in z around inf 50.4%
Final simplification55.4%
(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 31.3%
Final simplification31.3%
herbie shell --seed 2024115
(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)))