
(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 (if (<= (+ (+ (* z t) (* x y)) (* a b)) INFINITY) (+ (fma x y (* z t)) (* a b)) (* a (+ b (* z (/ t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((z * t) + (x * y)) + (a * b)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + (a * b);
} else {
tmp = a * (b + (z * (t / a)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(z * t) + Float64(x * y)) + Float64(a * b)) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(a * b)); else tmp = Float64(a * Float64(b + Float64(z * Float64(t / a)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(a * N[(b + N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(z \cdot t + x \cdot y\right) + a \cdot b \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 100.0%
fma-define100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
fma-define25.0%
Simplified25.0%
Taylor expanded in x around 0 41.7%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
associate-*r/66.7%
Simplified66.7%
Final simplification98.4%
(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 95.3%
+-commutative95.3%
fma-define96.9%
fma-define98.0%
Simplified98.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* z t) (* x y)) (* a b)))) (if (<= t_1 INFINITY) t_1 (* a (+ b (* z (/ t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * t) + (x * y)) + (a * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (b + (z * (t / a)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * t) + (x * y)) + (a * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (b + (z * (t / a)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * t) + (x * y)) + (a * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (b + (z * (t / a))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * t) + Float64(x * y)) + Float64(a * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(b + Float64(z * Float64(t / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * t) + (x * y)) + (a * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (b + (z * (t / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(b + N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t + x \cdot y\right) + a \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
fma-define25.0%
Simplified25.0%
Taylor expanded in x around 0 41.7%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
associate-*r/66.7%
Simplified66.7%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -6.2e+135)
(* x y)
(if (<= (* x y) 2.6e-217)
(* a b)
(if (<= (* x y) 1.2e+80) (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -6.2e+135) {
tmp = x * y;
} else if ((x * y) <= 2.6e-217) {
tmp = a * b;
} else if ((x * y) <= 1.2e+80) {
tmp = 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 ((x * y) <= (-6.2d+135)) then
tmp = x * y
else if ((x * y) <= 2.6d-217) then
tmp = a * b
else if ((x * y) <= 1.2d+80) then
tmp = 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 ((x * y) <= -6.2e+135) {
tmp = x * y;
} else if ((x * y) <= 2.6e-217) {
tmp = a * b;
} else if ((x * y) <= 1.2e+80) {
tmp = z * t;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -6.2e+135: tmp = x * y elif (x * y) <= 2.6e-217: tmp = a * b elif (x * y) <= 1.2e+80: tmp = z * t else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -6.2e+135) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.6e-217) tmp = Float64(a * b); elseif (Float64(x * y) <= 1.2e+80) tmp = 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 ((x * y) <= -6.2e+135) tmp = x * y; elseif ((x * y) <= 2.6e-217) tmp = a * b; elseif ((x * y) <= 1.2e+80) tmp = z * t; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.2e+135], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.6e-217], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+80], N[(z * t), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+135}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.6 \cdot 10^{-217}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+80}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6.20000000000000044e135 or 1.1999999999999999e80 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf 83.8%
Taylor expanded in a around inf 73.7%
associate-*r/72.6%
Simplified72.6%
Taylor expanded in a around 0 78.5%
if -6.20000000000000044e135 < (*.f64 x y) < 2.59999999999999993e-217Initial program 98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in a around inf 55.6%
if 2.59999999999999993e-217 < (*.f64 x y) < 1.1999999999999999e80Initial program 97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in x around 0 81.5%
Taylor expanded in a around inf 75.7%
*-commutative75.7%
associate-*r/73.4%
Simplified73.4%
Taylor expanded in a around 0 50.3%
Final simplification62.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* z t) -2e+93) (not (<= (* z t) 1e+65))) (* t (+ z (* a (/ b t)))) (+ (* x y) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z * t) <= -2e+93) || !((z * t) <= 1e+65)) {
tmp = t * (z + (a * (b / t)));
} else {
tmp = (x * y) + (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 (((z * t) <= (-2d+93)) .or. (.not. ((z * t) <= 1d+65))) then
tmp = t * (z + (a * (b / t)))
else
tmp = (x * y) + (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 (((z * t) <= -2e+93) || !((z * t) <= 1e+65)) {
tmp = t * (z + (a * (b / t)));
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((z * t) <= -2e+93) or not ((z * t) <= 1e+65): tmp = t * (z + (a * (b / t))) else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(z * t) <= -2e+93) || !(Float64(z * t) <= 1e+65)) tmp = Float64(t * Float64(z + Float64(a * Float64(b / t)))); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((z * t) <= -2e+93) || ~(((z * t) <= 1e+65))) tmp = t * (z + (a * (b / t))); else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+93], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+65]], $MachinePrecision]], N[(t * N[(z + N[(a * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+93} \lor \neg \left(z \cdot t \leq 10^{+65}\right):\\
\;\;\;\;t \cdot \left(z + a \cdot \frac{b}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 z t) < -2.00000000000000009e93 or 9.9999999999999999e64 < (*.f64 z t) Initial program 90.7%
fma-define93.8%
Simplified93.8%
Taylor expanded in x around 0 80.3%
Taylor expanded in t around inf 79.9%
associate-/l*80.0%
Simplified80.0%
if -2.00000000000000009e93 < (*.f64 z t) < 9.9999999999999999e64Initial program 98.1%
Taylor expanded in x around inf 90.4%
Final simplification86.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* z t) -2e+93) (not (<= (* z t) 2e+64))) (+ (* z t) (* a b)) (+ (* x y) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z * t) <= -2e+93) || !((z * t) <= 2e+64)) {
tmp = (z * t) + (a * b);
} else {
tmp = (x * y) + (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 (((z * t) <= (-2d+93)) .or. (.not. ((z * t) <= 2d+64))) then
tmp = (z * t) + (a * b)
else
tmp = (x * y) + (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 (((z * t) <= -2e+93) || !((z * t) <= 2e+64)) {
tmp = (z * t) + (a * b);
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((z * t) <= -2e+93) or not ((z * t) <= 2e+64): tmp = (z * t) + (a * b) else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(z * t) <= -2e+93) || !(Float64(z * t) <= 2e+64)) tmp = Float64(Float64(z * t) + Float64(a * b)); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((z * t) <= -2e+93) || ~(((z * t) <= 2e+64))) tmp = (z * t) + (a * b); else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+93], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+64]], $MachinePrecision]], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+93} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+64}\right):\\
\;\;\;\;z \cdot t + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 z t) < -2.00000000000000009e93 or 2.00000000000000004e64 < (*.f64 z t) Initial program 90.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in x around 0 80.5%
if -2.00000000000000009e93 < (*.f64 z t) < 2.00000000000000004e64Initial program 98.1%
Taylor expanded in x around inf 90.3%
Final simplification86.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (* x y) -2.02e+136) (not (<= (* x y) 2e+80))) (* 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) <= -2.02e+136) || !((x * y) <= 2e+80)) {
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) <= (-2.02d+136)) .or. (.not. ((x * y) <= 2d+80))) 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) <= -2.02e+136) || !((x * y) <= 2e+80)) {
tmp = x * y;
} else {
tmp = (z * t) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x * y) <= -2.02e+136) or not ((x * y) <= 2e+80): 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) <= -2.02e+136) || !(Float64(x * y) <= 2e+80)) 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) <= -2.02e+136) || ~(((x * y) <= 2e+80))) 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], -2.02e+136], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+80]], $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 -2.02 \cdot 10^{+136} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+80}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -2.02000000000000002e136 or 2e80 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf 83.8%
Taylor expanded in a around inf 73.7%
associate-*r/72.6%
Simplified72.6%
Taylor expanded in a around 0 78.5%
if -2.02000000000000002e136 < (*.f64 x y) < 2e80Initial program 98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in x around 0 85.3%
Final simplification83.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -0.0025) (not (<= t 1.4e+71))) (* z t) (* a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.0025) || !(t <= 1.4e+71)) {
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 ((t <= (-0.0025d0)) .or. (.not. (t <= 1.4d+71))) 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 ((t <= -0.0025) || !(t <= 1.4e+71)) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -0.0025) or not (t <= 1.4e+71): tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -0.0025) || !(t <= 1.4e+71)) 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 ((t <= -0.0025) || ~((t <= 1.4e+71))) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.0025], N[Not[LessEqual[t, 1.4e+71]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0025 \lor \neg \left(t \leq 1.4 \cdot 10^{+71}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if t < -0.00250000000000000005 or 1.40000000000000001e71 < t Initial program 91.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in x around 0 68.6%
Taylor expanded in a around inf 63.1%
*-commutative63.1%
associate-*r/61.9%
Simplified61.9%
Taylor expanded in a around 0 50.6%
if -0.00250000000000000005 < t < 1.40000000000000001e71Initial program 98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in a around inf 46.3%
Final simplification48.0%
(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 95.3%
fma-define96.5%
Simplified96.5%
Taylor expanded in a around inf 36.9%
herbie shell --seed 2024135
(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)))