
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * 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)) + ((a * z) * 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)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * 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)) + ((a * z) * 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)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= (+ (+ (+ x (* y z)) (* t a)) t_1) INFINITY)
(+ (fma 1.0 x (fma z y (* t a))) t_1)
(* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if ((((x + (y * z)) + (t * a)) + t_1) <= ((double) INFINITY)) {
tmp = fma(1.0, x, fma(z, y, (t * a))) + t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + t_1) <= Inf) tmp = Float64(fma(1.0, x, fma(z, y, Float64(t * a))) + t_1); else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(1.0 * x + N[(z * y + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(1, x, \mathsf{fma}\left(z, y, t \cdot a\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.0%
associate-+l+98.0%
*-un-lft-identity98.0%
fma-define98.0%
*-commutative98.0%
fma-define98.0%
*-commutative98.0%
Applied egg-rr98.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
*-un-lft-identity0.0%
fma-define0.0%
*-commutative0.0%
fma-define0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in a around inf 91.7%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= t -2.3e+39)
(* t a)
(if (<= t -1.75e-205)
t_1
(if (<= t 1.12e-246)
x
(if (<= t 1.85e-214)
(* y z)
(if (<= t 2.6e-141)
t_1
(if (<= t 1e-74)
(* y z)
(if (<= t 1020000000000.0)
t_1
(if (or (<= t 9.5e+36)
(and (not (<= t 1.05e+55)) (<= t 3.6e+95)))
x
(* t a)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (t <= -2.3e+39) {
tmp = t * a;
} else if (t <= -1.75e-205) {
tmp = t_1;
} else if (t <= 1.12e-246) {
tmp = x;
} else if (t <= 1.85e-214) {
tmp = y * z;
} else if (t <= 2.6e-141) {
tmp = t_1;
} else if (t <= 1e-74) {
tmp = y * z;
} else if (t <= 1020000000000.0) {
tmp = t_1;
} else if ((t <= 9.5e+36) || (!(t <= 1.05e+55) && (t <= 3.6e+95))) {
tmp = x;
} else {
tmp = t * a;
}
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 = a * (z * b)
if (t <= (-2.3d+39)) then
tmp = t * a
else if (t <= (-1.75d-205)) then
tmp = t_1
else if (t <= 1.12d-246) then
tmp = x
else if (t <= 1.85d-214) then
tmp = y * z
else if (t <= 2.6d-141) then
tmp = t_1
else if (t <= 1d-74) then
tmp = y * z
else if (t <= 1020000000000.0d0) then
tmp = t_1
else if ((t <= 9.5d+36) .or. (.not. (t <= 1.05d+55)) .and. (t <= 3.6d+95)) then
tmp = x
else
tmp = t * a
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 = a * (z * b);
double tmp;
if (t <= -2.3e+39) {
tmp = t * a;
} else if (t <= -1.75e-205) {
tmp = t_1;
} else if (t <= 1.12e-246) {
tmp = x;
} else if (t <= 1.85e-214) {
tmp = y * z;
} else if (t <= 2.6e-141) {
tmp = t_1;
} else if (t <= 1e-74) {
tmp = y * z;
} else if (t <= 1020000000000.0) {
tmp = t_1;
} else if ((t <= 9.5e+36) || (!(t <= 1.05e+55) && (t <= 3.6e+95))) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if t <= -2.3e+39: tmp = t * a elif t <= -1.75e-205: tmp = t_1 elif t <= 1.12e-246: tmp = x elif t <= 1.85e-214: tmp = y * z elif t <= 2.6e-141: tmp = t_1 elif t <= 1e-74: tmp = y * z elif t <= 1020000000000.0: tmp = t_1 elif (t <= 9.5e+36) or (not (t <= 1.05e+55) and (t <= 3.6e+95)): tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (t <= -2.3e+39) tmp = Float64(t * a); elseif (t <= -1.75e-205) tmp = t_1; elseif (t <= 1.12e-246) tmp = x; elseif (t <= 1.85e-214) tmp = Float64(y * z); elseif (t <= 2.6e-141) tmp = t_1; elseif (t <= 1e-74) tmp = Float64(y * z); elseif (t <= 1020000000000.0) tmp = t_1; elseif ((t <= 9.5e+36) || (!(t <= 1.05e+55) && (t <= 3.6e+95))) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (t <= -2.3e+39) tmp = t * a; elseif (t <= -1.75e-205) tmp = t_1; elseif (t <= 1.12e-246) tmp = x; elseif (t <= 1.85e-214) tmp = y * z; elseif (t <= 2.6e-141) tmp = t_1; elseif (t <= 1e-74) tmp = y * z; elseif (t <= 1020000000000.0) tmp = t_1; elseif ((t <= 9.5e+36) || (~((t <= 1.05e+55)) && (t <= 3.6e+95))) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+39], N[(t * a), $MachinePrecision], If[LessEqual[t, -1.75e-205], t$95$1, If[LessEqual[t, 1.12e-246], x, If[LessEqual[t, 1.85e-214], N[(y * z), $MachinePrecision], If[LessEqual[t, 2.6e-141], t$95$1, If[LessEqual[t, 1e-74], N[(y * z), $MachinePrecision], If[LessEqual[t, 1020000000000.0], t$95$1, If[Or[LessEqual[t, 9.5e+36], And[N[Not[LessEqual[t, 1.05e+55]], $MachinePrecision], LessEqual[t, 3.6e+95]]], x, N[(t * a), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-246}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-214}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{-74}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 1020000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+36} \lor \neg \left(t \leq 1.05 \cdot 10^{+55}\right) \land t \leq 3.6 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -2.30000000000000012e39 or 9.49999999999999974e36 < t < 1.05e55 or 3.59999999999999978e95 < t Initial program 93.0%
associate-+l+93.0%
*-un-lft-identity93.0%
fma-define93.0%
*-commutative93.0%
fma-define93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in t around inf 60.9%
if -2.30000000000000012e39 < t < -1.75e-205 or 1.8500000000000001e-214 < t < 2.60000000000000011e-141 or 9.99999999999999958e-75 < t < 1.02e12Initial program 91.5%
associate-+l+91.5%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in t around 0 83.4%
+-commutative83.4%
+-commutative83.4%
associate-*r*83.3%
distribute-rgt-in88.2%
Simplified88.2%
Taylor expanded in y around 0 74.0%
Taylor expanded in x around 0 49.5%
*-commutative49.5%
Simplified49.5%
if -1.75e-205 < t < 1.11999999999999995e-246 or 1.02e12 < t < 9.49999999999999974e36 or 1.05e55 < t < 3.59999999999999978e95Initial program 100.0%
associate-+l+100.0%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in x around inf 54.0%
if 1.11999999999999995e-246 < t < 1.8500000000000001e-214 or 2.60000000000000011e-141 < t < 9.99999999999999958e-75Initial program 89.2%
associate-+l+89.2%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
Final simplification57.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= t -1.02e+39)
(* t a)
(if (<= t -1.55e-204)
t_1
(if (<= t 5.1e-248)
x
(if (<= t 1.9e-212)
(* y z)
(if (<= t 1.3e-141)
(* a (* z b))
(if (<= t 1.15e-76)
(* y z)
(if (<= t 2100.0)
t_1
(if (or (<= t 3e+37) (and (not (<= t 1.65e+55)) (<= t 5e+93)))
x
(* t a)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (t <= -1.02e+39) {
tmp = t * a;
} else if (t <= -1.55e-204) {
tmp = t_1;
} else if (t <= 5.1e-248) {
tmp = x;
} else if (t <= 1.9e-212) {
tmp = y * z;
} else if (t <= 1.3e-141) {
tmp = a * (z * b);
} else if (t <= 1.15e-76) {
tmp = y * z;
} else if (t <= 2100.0) {
tmp = t_1;
} else if ((t <= 3e+37) || (!(t <= 1.65e+55) && (t <= 5e+93))) {
tmp = x;
} else {
tmp = t * a;
}
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 = (z * a) * b
if (t <= (-1.02d+39)) then
tmp = t * a
else if (t <= (-1.55d-204)) then
tmp = t_1
else if (t <= 5.1d-248) then
tmp = x
else if (t <= 1.9d-212) then
tmp = y * z
else if (t <= 1.3d-141) then
tmp = a * (z * b)
else if (t <= 1.15d-76) then
tmp = y * z
else if (t <= 2100.0d0) then
tmp = t_1
else if ((t <= 3d+37) .or. (.not. (t <= 1.65d+55)) .and. (t <= 5d+93)) then
tmp = x
else
tmp = t * a
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 = (z * a) * b;
double tmp;
if (t <= -1.02e+39) {
tmp = t * a;
} else if (t <= -1.55e-204) {
tmp = t_1;
} else if (t <= 5.1e-248) {
tmp = x;
} else if (t <= 1.9e-212) {
tmp = y * z;
} else if (t <= 1.3e-141) {
tmp = a * (z * b);
} else if (t <= 1.15e-76) {
tmp = y * z;
} else if (t <= 2100.0) {
tmp = t_1;
} else if ((t <= 3e+37) || (!(t <= 1.65e+55) && (t <= 5e+93))) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if t <= -1.02e+39: tmp = t * a elif t <= -1.55e-204: tmp = t_1 elif t <= 5.1e-248: tmp = x elif t <= 1.9e-212: tmp = y * z elif t <= 1.3e-141: tmp = a * (z * b) elif t <= 1.15e-76: tmp = y * z elif t <= 2100.0: tmp = t_1 elif (t <= 3e+37) or (not (t <= 1.65e+55) and (t <= 5e+93)): tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (t <= -1.02e+39) tmp = Float64(t * a); elseif (t <= -1.55e-204) tmp = t_1; elseif (t <= 5.1e-248) tmp = x; elseif (t <= 1.9e-212) tmp = Float64(y * z); elseif (t <= 1.3e-141) tmp = Float64(a * Float64(z * b)); elseif (t <= 1.15e-76) tmp = Float64(y * z); elseif (t <= 2100.0) tmp = t_1; elseif ((t <= 3e+37) || (!(t <= 1.65e+55) && (t <= 5e+93))) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (t <= -1.02e+39) tmp = t * a; elseif (t <= -1.55e-204) tmp = t_1; elseif (t <= 5.1e-248) tmp = x; elseif (t <= 1.9e-212) tmp = y * z; elseif (t <= 1.3e-141) tmp = a * (z * b); elseif (t <= 1.15e-76) tmp = y * z; elseif (t <= 2100.0) tmp = t_1; elseif ((t <= 3e+37) || (~((t <= 1.65e+55)) && (t <= 5e+93))) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t, -1.02e+39], N[(t * a), $MachinePrecision], If[LessEqual[t, -1.55e-204], t$95$1, If[LessEqual[t, 5.1e-248], x, If[LessEqual[t, 1.9e-212], N[(y * z), $MachinePrecision], If[LessEqual[t, 1.3e-141], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-76], N[(y * z), $MachinePrecision], If[LessEqual[t, 2100.0], t$95$1, If[Or[LessEqual[t, 3e+37], And[N[Not[LessEqual[t, 1.65e+55]], $MachinePrecision], LessEqual[t, 5e+93]]], x, N[(t * a), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{+39}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{-248}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-212}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-141}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-76}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 2100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+37} \lor \neg \left(t \leq 1.65 \cdot 10^{+55}\right) \land t \leq 5 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -1.02e39 or 3.00000000000000022e37 < t < 1.65e55 or 5.0000000000000001e93 < t Initial program 93.0%
associate-+l+93.0%
*-un-lft-identity93.0%
fma-define93.0%
*-commutative93.0%
fma-define93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in t around inf 60.9%
if -1.02e39 < t < -1.55e-204 or 1.15000000000000003e-76 < t < 2100Initial program 92.3%
Taylor expanded in x around 0 68.4%
+-commutative68.4%
*-commutative68.4%
fma-undefine68.4%
Applied egg-rr68.4%
Taylor expanded in b around inf 46.0%
associate-*r*45.9%
*-commutative45.9%
associate-*r*48.0%
Simplified48.0%
if -1.55e-204 < t < 5.09999999999999972e-248 or 2100 < t < 3.00000000000000022e37 or 1.65e55 < t < 5.0000000000000001e93Initial program 100.0%
associate-+l+100.0%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in x around inf 54.0%
if 5.09999999999999972e-248 < t < 1.90000000000000011e-212 or 1.30000000000000005e-141 < t < 1.15000000000000003e-76Initial program 89.2%
associate-+l+89.2%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
if 1.90000000000000011e-212 < t < 1.30000000000000005e-141Initial program 87.9%
associate-+l+87.9%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in t around 0 93.7%
+-commutative93.7%
+-commutative93.7%
associate-*r*87.6%
distribute-rgt-in93.8%
Simplified93.8%
Taylor expanded in y around 0 87.9%
Taylor expanded in x around 0 63.9%
*-commutative63.9%
Simplified63.9%
Final simplification58.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
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)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
*-un-lft-identity0.0%
fma-define0.0%
*-commutative0.0%
fma-define0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in a around inf 91.7%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= z -3.5e-51)
t_1
(if (<= z 5.5e+31)
(+ x (* t a))
(if (or (<= z 4.4e+223) (not (<= z 3.8e+288))) t_1 (* (* z a) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -3.5e-51) {
tmp = t_1;
} else if (z <= 5.5e+31) {
tmp = x + (t * a);
} else if ((z <= 4.4e+223) || !(z <= 3.8e+288)) {
tmp = t_1;
} else {
tmp = (z * 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) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if (z <= (-3.5d-51)) then
tmp = t_1
else if (z <= 5.5d+31) then
tmp = x + (t * a)
else if ((z <= 4.4d+223) .or. (.not. (z <= 3.8d+288))) then
tmp = t_1
else
tmp = (z * 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 t_1 = x + (y * z);
double tmp;
if (z <= -3.5e-51) {
tmp = t_1;
} else if (z <= 5.5e+31) {
tmp = x + (t * a);
} else if ((z <= 4.4e+223) || !(z <= 3.8e+288)) {
tmp = t_1;
} else {
tmp = (z * a) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if z <= -3.5e-51: tmp = t_1 elif z <= 5.5e+31: tmp = x + (t * a) elif (z <= 4.4e+223) or not (z <= 3.8e+288): tmp = t_1 else: tmp = (z * a) * b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -3.5e-51) tmp = t_1; elseif (z <= 5.5e+31) tmp = Float64(x + Float64(t * a)); elseif ((z <= 4.4e+223) || !(z <= 3.8e+288)) tmp = t_1; else tmp = Float64(Float64(z * a) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (z <= -3.5e-51) tmp = t_1; elseif (z <= 5.5e+31) tmp = x + (t * a); elseif ((z <= 4.4e+223) || ~((z <= 3.8e+288))) tmp = t_1; else tmp = (z * a) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-51], t$95$1, If[LessEqual[z, 5.5e+31], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.4e+223], N[Not[LessEqual[z, 3.8e+288]], $MachinePrecision]], t$95$1, N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+31}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+223} \lor \neg \left(z \leq 3.8 \cdot 10^{+288}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if z < -3.4999999999999997e-51 or 5.50000000000000002e31 < z < 4.3999999999999999e223 or 3.80000000000000008e288 < z Initial program 90.4%
associate-+l+90.4%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in a around 0 65.0%
if -3.4999999999999997e-51 < z < 5.50000000000000002e31Initial program 98.3%
associate-+l+98.3%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 83.1%
+-commutative83.1%
Simplified83.1%
if 4.3999999999999999e223 < z < 3.80000000000000008e288Initial program 72.7%
Taylor expanded in x around 0 70.8%
+-commutative70.8%
*-commutative70.8%
fma-undefine70.8%
Applied egg-rr70.8%
Taylor expanded in b around inf 81.0%
associate-*r*81.0%
*-commutative81.0%
associate-*r*89.0%
Simplified89.0%
Final simplification74.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= t -1.15e+96)
(* t a)
(if (<= t 7.6e-211)
t_1
(if (<= t 2.9e-173) (* a (* z b)) (if (<= t 4.5e+100) t_1 (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (t <= -1.15e+96) {
tmp = t * a;
} else if (t <= 7.6e-211) {
tmp = t_1;
} else if (t <= 2.9e-173) {
tmp = a * (z * b);
} else if (t <= 4.5e+100) {
tmp = t_1;
} else {
tmp = t * a;
}
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 * z)
if (t <= (-1.15d+96)) then
tmp = t * a
else if (t <= 7.6d-211) then
tmp = t_1
else if (t <= 2.9d-173) then
tmp = a * (z * b)
else if (t <= 4.5d+100) then
tmp = t_1
else
tmp = t * a
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 * z);
double tmp;
if (t <= -1.15e+96) {
tmp = t * a;
} else if (t <= 7.6e-211) {
tmp = t_1;
} else if (t <= 2.9e-173) {
tmp = a * (z * b);
} else if (t <= 4.5e+100) {
tmp = t_1;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if t <= -1.15e+96: tmp = t * a elif t <= 7.6e-211: tmp = t_1 elif t <= 2.9e-173: tmp = a * (z * b) elif t <= 4.5e+100: tmp = t_1 else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (t <= -1.15e+96) tmp = Float64(t * a); elseif (t <= 7.6e-211) tmp = t_1; elseif (t <= 2.9e-173) tmp = Float64(a * Float64(z * b)); elseif (t <= 4.5e+100) tmp = t_1; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (t <= -1.15e+96) tmp = t * a; elseif (t <= 7.6e-211) tmp = t_1; elseif (t <= 2.9e-173) tmp = a * (z * b); elseif (t <= 4.5e+100) tmp = t_1; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e+96], N[(t * a), $MachinePrecision], If[LessEqual[t, 7.6e-211], t$95$1, If[LessEqual[t, 2.9e-173], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+100], t$95$1, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+96}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-173}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -1.15000000000000008e96 or 4.50000000000000036e100 < t Initial program 93.1%
associate-+l+93.1%
*-un-lft-identity93.1%
fma-define93.1%
*-commutative93.1%
fma-define93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in t around inf 64.3%
if -1.15000000000000008e96 < t < 7.60000000000000023e-211 or 2.8999999999999998e-173 < t < 4.50000000000000036e100Initial program 93.9%
associate-+l+93.9%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in a around 0 69.6%
if 7.60000000000000023e-211 < t < 2.8999999999999998e-173Initial program 85.5%
associate-+l+85.5%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in t around 0 85.7%
+-commutative85.7%
+-commutative85.7%
associate-*r*71.8%
distribute-rgt-in86.1%
Simplified86.1%
Taylor expanded in y around 0 100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification68.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -8e+35)
(* t a)
(if (<= t 3.6e-250)
x
(if (<= t 4.5e-30) (* y z) (if (<= t 6.6e+93) x (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8e+35) {
tmp = t * a;
} else if (t <= 3.6e-250) {
tmp = x;
} else if (t <= 4.5e-30) {
tmp = y * z;
} else if (t <= 6.6e+93) {
tmp = x;
} else {
tmp = t * a;
}
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 <= (-8d+35)) then
tmp = t * a
else if (t <= 3.6d-250) then
tmp = x
else if (t <= 4.5d-30) then
tmp = y * z
else if (t <= 6.6d+93) then
tmp = x
else
tmp = t * a
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 <= -8e+35) {
tmp = t * a;
} else if (t <= 3.6e-250) {
tmp = x;
} else if (t <= 4.5e-30) {
tmp = y * z;
} else if (t <= 6.6e+93) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8e+35: tmp = t * a elif t <= 3.6e-250: tmp = x elif t <= 4.5e-30: tmp = y * z elif t <= 6.6e+93: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8e+35) tmp = Float64(t * a); elseif (t <= 3.6e-250) tmp = x; elseif (t <= 4.5e-30) tmp = Float64(y * z); elseif (t <= 6.6e+93) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -8e+35) tmp = t * a; elseif (t <= 3.6e-250) tmp = x; elseif (t <= 4.5e-30) tmp = y * z; elseif (t <= 6.6e+93) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8e+35], N[(t * a), $MachinePrecision], If[LessEqual[t, 3.6e-250], x, If[LessEqual[t, 4.5e-30], N[(y * z), $MachinePrecision], If[LessEqual[t, 6.6e+93], x, N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+35}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-250}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-30}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -7.9999999999999997e35 or 6.60000000000000017e93 < t Initial program 92.6%
associate-+l+92.6%
*-un-lft-identity92.6%
fma-define92.6%
*-commutative92.6%
fma-define92.6%
*-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in t around inf 61.3%
if -7.9999999999999997e35 < t < 3.59999999999999982e-250 or 4.49999999999999967e-30 < t < 6.60000000000000017e93Initial program 95.4%
associate-+l+95.4%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in x around inf 39.0%
if 3.59999999999999982e-250 < t < 4.49999999999999967e-30Initial program 90.7%
associate-+l+90.7%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in y around inf 53.1%
*-commutative53.1%
Simplified53.1%
Final simplification50.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -6e+112) (+ x (* z (+ y (* a b)))) (+ (+ x (* y z)) (+ (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6e+112) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * 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 <= (-6d+112)) then
tmp = x + (z * (y + (a * b)))
else
tmp = (x + (y * z)) + ((t * a) + (a * (z * 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 <= -6e+112) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6e+112: tmp = x + (z * (y + (a * b))) else: tmp = (x + (y * z)) + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6e+112) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6e+112) tmp = x + (z * (y + (a * b))); else tmp = (x + (y * z)) + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6e+112], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+112}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -5.99999999999999958e112Initial program 92.9%
associate-+l+92.9%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in t around 0 79.4%
+-commutative79.4%
+-commutative79.4%
associate-*r*93.0%
distribute-rgt-in95.4%
Simplified95.4%
if -5.99999999999999958e112 < z Initial program 93.5%
associate-+l+93.5%
associate-*l*94.8%
Simplified94.8%
Final simplification94.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.2e-111) (not (<= a 2.8e-72))) (+ x (* a (+ t (* z b)))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.2e-111) || !(a <= 2.8e-72)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
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 <= (-3.2d-111)) .or. (.not. (a <= 2.8d-72))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (y * z)
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 <= -3.2e-111) || !(a <= 2.8e-72)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.2e-111) or not (a <= 2.8e-72): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.2e-111) || !(a <= 2.8e-72)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.2e-111) || ~((a <= 2.8e-72))) tmp = x + (a * (t + (z * b))); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.2e-111], N[Not[LessEqual[a, 2.8e-72]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-111} \lor \neg \left(a \leq 2.8 \cdot 10^{-72}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.1999999999999998e-111 or 2.7999999999999998e-72 < a Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
fma-define90.1%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
distribute-rgt-out96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 87.8%
if -3.1999999999999998e-111 < a < 2.7999999999999998e-72Initial program 98.9%
associate-+l+98.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in a around 0 86.8%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e-50) (not (<= z 1.26e+33))) (+ x (* z (+ y (* a b)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e-50) || !(z <= 1.26e+33)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * 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 <= (-1.2d-50)) .or. (.not. (z <= 1.26d+33))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + (a * (t + (z * 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 <= -1.2e-50) || !(z <= 1.26e+33)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e-50) or not (z <= 1.26e+33): tmp = x + (z * (y + (a * b))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e-50) || !(z <= 1.26e+33)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.2e-50) || ~((z <= 1.26e+33))) tmp = x + (z * (y + (a * b))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e-50], N[Not[LessEqual[z, 1.26e+33]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-50} \lor \neg \left(z \leq 1.26 \cdot 10^{+33}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.20000000000000001e-50 or 1.26e33 < z Initial program 89.0%
associate-+l+89.0%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in t around 0 80.4%
+-commutative80.4%
+-commutative80.4%
associate-*r*87.6%
distribute-rgt-in90.5%
Simplified90.5%
if -1.20000000000000001e-50 < z < 1.26e33Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
fma-define98.3%
associate-*l*99.1%
*-commutative99.1%
*-commutative99.1%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 92.6%
Final simplification91.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4000000000.0) (not (<= a 4e-54))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4000000000.0) || !(a <= 4e-54)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
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 <= (-4000000000.0d0)) .or. (.not. (a <= 4d-54))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + (t * a)
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 <= -4000000000.0) || !(a <= 4e-54)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4000000000.0) or not (a <= 4e-54): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4000000000.0) || !(a <= 4e-54)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4000000000.0) || ~((a <= 4e-54))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4000000000.0], N[Not[LessEqual[a, 4e-54]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4000000000 \lor \neg \left(a \leq 4 \cdot 10^{-54}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if a < -4e9 or 4.0000000000000001e-54 < a Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
fma-define88.0%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
distribute-rgt-out96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in y around 0 92.0%
if -4e9 < a < 4.0000000000000001e-54Initial program 99.2%
associate-+l+99.2%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in t around inf 93.1%
Final simplification92.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.75e-7) (not (<= a 8.5e-50))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.75e-7) || !(a <= 8.5e-50)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
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 <= (-1.75d-7)) .or. (.not. (a <= 8.5d-50))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
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 <= -1.75e-7) || !(a <= 8.5e-50)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.75e-7) or not (a <= 8.5e-50): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.75e-7) || !(a <= 8.5e-50)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.75e-7) || ~((a <= 8.5e-50))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.75e-7], N[Not[LessEqual[a, 8.5e-50]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{-7} \lor \neg \left(a \leq 8.5 \cdot 10^{-50}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.74999999999999992e-7 or 8.50000000000000012e-50 < a Initial program 88.1%
associate-+l+88.1%
*-un-lft-identity88.1%
fma-define88.1%
*-commutative88.1%
fma-define88.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in a around inf 81.2%
if -1.74999999999999992e-7 < a < 8.50000000000000012e-50Initial program 99.1%
associate-+l+99.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around 0 81.1%
Final simplification81.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.5e-51) (not (<= z 8e+57))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.5e-51) || !(z <= 8e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
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 <= (-1.5d-51)) .or. (.not. (z <= 8d+57))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
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 <= -1.5e-51) || !(z <= 8e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.5e-51) or not (z <= 8e+57): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.5e-51) || !(z <= 8e+57)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.5e-51) || ~((z <= 8e+57))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.5e-51], N[Not[LessEqual[z, 8e+57]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-51} \lor \neg \left(z \leq 8 \cdot 10^{+57}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.50000000000000001e-51 or 8.00000000000000039e57 < z Initial program 88.3%
associate-+l+88.3%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in z around inf 78.2%
if -1.50000000000000001e-51 < z < 8.00000000000000039e57Initial program 98.4%
associate-+l+98.4%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 81.7%
+-commutative81.7%
Simplified81.7%
Final simplification80.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.2e+36) (not (<= t 1.4e+94))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6.2e+36) || !(t <= 1.4e+94)) {
tmp = t * a;
} else {
tmp = x;
}
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 <= (-6.2d+36)) .or. (.not. (t <= 1.4d+94))) then
tmp = t * a
else
tmp = x
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 <= -6.2e+36) || !(t <= 1.4e+94)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -6.2e+36) or not (t <= 1.4e+94): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6.2e+36) || !(t <= 1.4e+94)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -6.2e+36) || ~((t <= 1.4e+94))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6.2e+36], N[Not[LessEqual[t, 1.4e+94]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+36} \lor \neg \left(t \leq 1.4 \cdot 10^{+94}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.1999999999999999e36 or 1.39999999999999999e94 < t Initial program 92.6%
associate-+l+92.6%
*-un-lft-identity92.6%
fma-define92.6%
*-commutative92.6%
fma-define92.6%
*-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in t around inf 61.3%
if -6.1999999999999999e36 < t < 1.39999999999999999e94Initial program 93.9%
associate-+l+93.9%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around inf 33.9%
Final simplification44.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.4%
associate-+l+93.4%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 27.1%
Final simplification27.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} 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 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
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 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024042
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))