
(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 (let* ((t_1 (+ (+ (* x y) (* z t)) (* a b)))) (if (<= t_1 INFINITY) t_1 (* y (+ x (* b (/ a y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * t)) + (a * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y * (x + (b * (a / y)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * t)) + (a * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y * (x + (b * (a / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * t)) + (a * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = y * (x + (b * (a / y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(y * Float64(x + Float64(b * Float64(a / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * t)) + (a * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = y * (x + (b * (a / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * N[(x + N[(b * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) + a \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + b \cdot \frac{a}{y}\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%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -1.95e+206)
(* x y)
(if (<= (* x y) 2.6e+47)
(+ (* t z) (* a b))
(if (<= (* x y) 1.5e+73)
(* x y)
(if (<= (* x y) 1.6e+111) (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -1.95e+206) {
tmp = x * y;
} else if ((x * y) <= 2.6e+47) {
tmp = (t * z) + (a * b);
} else if ((x * y) <= 1.5e+73) {
tmp = x * y;
} else if ((x * y) <= 1.6e+111) {
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) <= (-1.95d+206)) then
tmp = x * y
else if ((x * y) <= 2.6d+47) then
tmp = (t * z) + (a * b)
else if ((x * y) <= 1.5d+73) then
tmp = x * y
else if ((x * y) <= 1.6d+111) 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) <= -1.95e+206) {
tmp = x * y;
} else if ((x * y) <= 2.6e+47) {
tmp = (t * z) + (a * b);
} else if ((x * y) <= 1.5e+73) {
tmp = x * y;
} else if ((x * y) <= 1.6e+111) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -1.95e+206: tmp = x * y elif (x * y) <= 2.6e+47: tmp = (t * z) + (a * b) elif (x * y) <= 1.5e+73: tmp = x * y elif (x * y) <= 1.6e+111: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -1.95e+206) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.6e+47) tmp = Float64(Float64(t * z) + Float64(a * b)); elseif (Float64(x * y) <= 1.5e+73) tmp = Float64(x * y); elseif (Float64(x * y) <= 1.6e+111) 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) <= -1.95e+206) tmp = x * y; elseif ((x * y) <= 2.6e+47) tmp = (t * z) + (a * b); elseif ((x * y) <= 1.5e+73) tmp = x * y; elseif ((x * y) <= 1.6e+111) 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], -1.95e+206], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.6e+47], N[(N[(t * z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+73], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.6e+111], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.95 \cdot 10^{+206}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.6 \cdot 10^{+47}:\\
\;\;\;\;t \cdot z + a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+73}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+111}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.95e206 or 2.60000000000000003e47 < (*.f64 x y) < 1.50000000000000005e73 or 1.6e111 < (*.f64 x y) Initial program 93.5%
Taylor expanded in x around inf 0
Simplified0
if -1.95e206 < (*.f64 x y) < 2.60000000000000003e47Initial program 97.7%
Taylor expanded in x around 0 0
Simplified0
if 1.50000000000000005e73 < (*.f64 x y) < 1.6e111Initial program 100.0%
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x y) -1.5e+77)
(* x y)
(if (<= (* x y) -3.7)
(* a b)
(if (<= (* x y) -2.05e-281)
(* t z)
(if (<= (* x y) 1.16e+47) (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -1.5e+77) {
tmp = x * y;
} else if ((x * y) <= -3.7) {
tmp = a * b;
} else if ((x * y) <= -2.05e-281) {
tmp = t * z;
} else if ((x * y) <= 1.16e+47) {
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) <= (-1.5d+77)) then
tmp = x * y
else if ((x * y) <= (-3.7d0)) then
tmp = a * b
else if ((x * y) <= (-2.05d-281)) then
tmp = t * z
else if ((x * y) <= 1.16d+47) 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) <= -1.5e+77) {
tmp = x * y;
} else if ((x * y) <= -3.7) {
tmp = a * b;
} else if ((x * y) <= -2.05e-281) {
tmp = t * z;
} else if ((x * y) <= 1.16e+47) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -1.5e+77: tmp = x * y elif (x * y) <= -3.7: tmp = a * b elif (x * y) <= -2.05e-281: tmp = t * z elif (x * y) <= 1.16e+47: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -1.5e+77) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.7) tmp = Float64(a * b); elseif (Float64(x * y) <= -2.05e-281) tmp = Float64(t * z); elseif (Float64(x * y) <= 1.16e+47) 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) <= -1.5e+77) tmp = x * y; elseif ((x * y) <= -3.7) tmp = a * b; elseif ((x * y) <= -2.05e-281) tmp = t * z; elseif ((x * y) <= 1.16e+47) 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], -1.5e+77], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.7], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.05e-281], N[(t * z), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.16e+47], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+77}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.7:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq -2.05 \cdot 10^{-281}:\\
\;\;\;\;t \cdot z\\
\mathbf{elif}\;x \cdot y \leq 1.16 \cdot 10^{+47}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4999999999999999e77 or 1.1600000000000001e47 < (*.f64 x y) Initial program 95.4%
Taylor expanded in x around inf 0
Simplified0
if -1.4999999999999999e77 < (*.f64 x y) < -3.7000000000000002 or -2.05e-281 < (*.f64 x y) < 1.1600000000000001e47Initial program 97.2%
Taylor expanded in a around inf 0
Simplified0
if -3.7000000000000002 < (*.f64 x y) < -2.05e-281Initial program 97.5%
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z t a b) :precision binary64 (if (<= (* x y) -1e+83) (+ (* x y) (* a b)) (if (<= (* x y) 2e+18) (+ (* t z) (* a b)) (* y (+ x (* b (/ a y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * y) <= -1e+83) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= 2e+18) {
tmp = (t * z) + (a * b);
} else {
tmp = y * (x + (b * (a / 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) <= (-1d+83)) then
tmp = (x * y) + (a * b)
else if ((x * y) <= 2d+18) then
tmp = (t * z) + (a * b)
else
tmp = y * (x + (b * (a / 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) <= -1e+83) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= 2e+18) {
tmp = (t * z) + (a * b);
} else {
tmp = y * (x + (b * (a / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * y) <= -1e+83: tmp = (x * y) + (a * b) elif (x * y) <= 2e+18: tmp = (t * z) + (a * b) else: tmp = y * (x + (b * (a / y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * y) <= -1e+83) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(x * y) <= 2e+18) tmp = Float64(Float64(t * z) + Float64(a * b)); else tmp = Float64(y * Float64(x + Float64(b * Float64(a / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x * y) <= -1e+83) tmp = (x * y) + (a * b); elseif ((x * y) <= 2e+18) tmp = (t * z) + (a * b); else tmp = y * (x + (b * (a / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+83], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+18], N[(N[(t * z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(y * N[(x + N[(b * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+83}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+18}:\\
\;\;\;\;t \cdot z + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + b \cdot \frac{a}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000003e83Initial program 95.9%
Taylor expanded in x around inf 0
Simplified0
if -1.00000000000000003e83 < (*.f64 x y) < 2e18Initial program 97.2%
Taylor expanded in x around 0 0
Simplified0
if 2e18 < (*.f64 x y) Initial program 95.2%
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= (* x y) -2.85e+72)
t_1
(if (<= (* x y) 1.5e-160) (+ (* t z) (* a b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -2.85e+72) {
tmp = t_1;
} else if ((x * y) <= 1.5e-160) {
tmp = (t * z) + (a * b);
} 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) :: tmp
t_1 = (x * y) + (a * b)
if ((x * y) <= (-2.85d+72)) then
tmp = t_1
else if ((x * y) <= 1.5d-160) then
tmp = (t * z) + (a * b)
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 tmp;
if ((x * y) <= -2.85e+72) {
tmp = t_1;
} else if ((x * y) <= 1.5e-160) {
tmp = (t * z) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * y) + (a * b) tmp = 0 if (x * y) <= -2.85e+72: tmp = t_1 elif (x * y) <= 1.5e-160: tmp = (t * z) + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -2.85e+72) tmp = t_1; elseif (Float64(x * y) <= 1.5e-160) tmp = Float64(Float64(t * z) + Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -2.85e+72) tmp = t_1; elseif ((x * y) <= 1.5e-160) tmp = (t * z) + (a * b); 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]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.85e+72], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.5e-160], N[(N[(t * z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -2.85 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-160}:\\
\;\;\;\;t \cdot z + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.8499999999999998e72 or 1.49999999999999998e-160 < (*.f64 x y) Initial program 95.9%
Taylor expanded in x around inf 0
Simplified0
if -2.8499999999999998e72 < (*.f64 x y) < 1.49999999999999998e-160Initial program 97.2%
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t z) (* a b))))
(if (<= (* a b) -4.4e-53)
t_1
(if (<= (* a b) 0.00025) (+ (* t z) (* x y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * z) + (a * b);
double tmp;
if ((a * b) <= -4.4e-53) {
tmp = t_1;
} else if ((a * b) <= 0.00025) {
tmp = (t * z) + (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) :: tmp
t_1 = (t * z) + (a * b)
if ((a * b) <= (-4.4d-53)) then
tmp = t_1
else if ((a * b) <= 0.00025d0) then
tmp = (t * z) + (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 = (t * z) + (a * b);
double tmp;
if ((a * b) <= -4.4e-53) {
tmp = t_1;
} else if ((a * b) <= 0.00025) {
tmp = (t * z) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * z) + (a * b) tmp = 0 if (a * b) <= -4.4e-53: tmp = t_1 elif (a * b) <= 0.00025: tmp = (t * z) + (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t * z) + Float64(a * b)) tmp = 0.0 if (Float64(a * b) <= -4.4e-53) tmp = t_1; elseif (Float64(a * b) <= 0.00025) tmp = Float64(Float64(t * z) + Float64(x * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t * z) + (a * b); tmp = 0.0; if ((a * b) <= -4.4e-53) tmp = t_1; elseif ((a * b) <= 0.00025) tmp = (t * z) + (x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -4.4e-53], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 0.00025], N[(N[(t * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot z + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -4.4 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 0.00025:\\
\;\;\;\;t \cdot z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.40000000000000037e-53 or 2.5000000000000001e-4 < (*.f64 a b) Initial program 93.7%
Taylor expanded in x around 0 0
Simplified0
if -4.40000000000000037e-53 < (*.f64 a b) < 2.5000000000000001e-4Initial program 100.0%
Taylor expanded in a around 0 0
Simplified0
(FPCore (x y z t a b) :precision binary64 (if (<= (* a b) -2.95e+24) (* a b) (if (<= (* a b) 4e-26) (* t z) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a * b) <= -2.95e+24) {
tmp = a * b;
} else if ((a * b) <= 4e-26) {
tmp = t * z;
} 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.95d+24)) then
tmp = a * b
else if ((a * b) <= 4d-26) then
tmp = t * z
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.95e+24) {
tmp = a * b;
} else if ((a * b) <= 4e-26) {
tmp = t * z;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a * b) <= -2.95e+24: tmp = a * b elif (a * b) <= 4e-26: tmp = t * z else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(a * b) <= -2.95e+24) tmp = Float64(a * b); elseif (Float64(a * b) <= 4e-26) tmp = Float64(t * z); 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.95e+24) tmp = a * b; elseif ((a * b) <= 4e-26) tmp = t * z; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.95e+24], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e-26], N[(t * z), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.95 \cdot 10^{+24}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{-26}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.94999999999999987e24 or 4.0000000000000002e-26 < (*.f64 a b) Initial program 93.6%
Taylor expanded in a around inf 0
Simplified0
if -2.94999999999999987e24 < (*.f64 a b) < 4.0000000000000002e-26Initial program 100.0%
Taylor expanded in z around inf 0
Simplified0
(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 96.5%
Taylor expanded in a around inf 0
Simplified0
herbie shell --seed 2024110
(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)))