
(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 14 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) (+ (+ x (* y z)) (* t a))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * a) * b) + Float64(Float64(x + Float64(y * z)) + Float64(t * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \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 96.7%
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%
associate-*l*21.1%
Simplified21.1%
Taylor expanded in z around inf 84.2%
+-commutative84.2%
Simplified84.2%
Final simplification95.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.35e+58)
x
(if (<= x -4.8e-109)
(* t a)
(if (<= x -1.25e-244)
(* z (* a b))
(if (<= x 9.5e-196)
(* y z)
(if (<= x 2.5e-30) (* t a) (if (<= x 1.95e+110) (* a (* z b)) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.35e+58) {
tmp = x;
} else if (x <= -4.8e-109) {
tmp = t * a;
} else if (x <= -1.25e-244) {
tmp = z * (a * b);
} else if (x <= 9.5e-196) {
tmp = y * z;
} else if (x <= 2.5e-30) {
tmp = t * a;
} else if (x <= 1.95e+110) {
tmp = a * (z * b);
} 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 (x <= (-1.35d+58)) then
tmp = x
else if (x <= (-4.8d-109)) then
tmp = t * a
else if (x <= (-1.25d-244)) then
tmp = z * (a * b)
else if (x <= 9.5d-196) then
tmp = y * z
else if (x <= 2.5d-30) then
tmp = t * a
else if (x <= 1.95d+110) then
tmp = a * (z * b)
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 (x <= -1.35e+58) {
tmp = x;
} else if (x <= -4.8e-109) {
tmp = t * a;
} else if (x <= -1.25e-244) {
tmp = z * (a * b);
} else if (x <= 9.5e-196) {
tmp = y * z;
} else if (x <= 2.5e-30) {
tmp = t * a;
} else if (x <= 1.95e+110) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.35e+58: tmp = x elif x <= -4.8e-109: tmp = t * a elif x <= -1.25e-244: tmp = z * (a * b) elif x <= 9.5e-196: tmp = y * z elif x <= 2.5e-30: tmp = t * a elif x <= 1.95e+110: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.35e+58) tmp = x; elseif (x <= -4.8e-109) tmp = Float64(t * a); elseif (x <= -1.25e-244) tmp = Float64(z * Float64(a * b)); elseif (x <= 9.5e-196) tmp = Float64(y * z); elseif (x <= 2.5e-30) tmp = Float64(t * a); elseif (x <= 1.95e+110) tmp = Float64(a * Float64(z * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.35e+58) tmp = x; elseif (x <= -4.8e-109) tmp = t * a; elseif (x <= -1.25e-244) tmp = z * (a * b); elseif (x <= 9.5e-196) tmp = y * z; elseif (x <= 2.5e-30) tmp = t * a; elseif (x <= 1.95e+110) tmp = a * (z * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.35e+58], x, If[LessEqual[x, -4.8e-109], N[(t * a), $MachinePrecision], If[LessEqual[x, -1.25e-244], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.5e-30], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.95e+110], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-244}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-30}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+110}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.3500000000000001e58 or 1.9500000000000002e110 < x Initial program 89.4%
associate-+l+89.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 66.1%
if -1.3500000000000001e58 < x < -4.79999999999999977e-109 or 9.50000000000000032e-196 < x < 2.49999999999999986e-30Initial program 92.0%
associate-+l+92.0%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in t around inf 78.5%
Taylor expanded in t around inf 74.5%
Taylor expanded in a around inf 49.9%
if -4.79999999999999977e-109 < x < -1.24999999999999999e-244Initial program 92.6%
associate-+l+92.6%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in z around inf 75.6%
+-commutative75.6%
Simplified75.6%
Taylor expanded in a around inf 57.7%
*-commutative57.7%
Simplified57.7%
if -1.24999999999999999e-244 < x < 9.50000000000000032e-196Initial program 87.2%
associate-+l+87.2%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
if 2.49999999999999986e-30 < x < 1.9500000000000002e110Initial program 85.3%
associate-+l+85.3%
+-commutative85.3%
fma-define85.3%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 82.7%
Taylor expanded in x around 0 67.8%
Taylor expanded in t around 0 44.5%
Final simplification55.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -3.8e+59)
x
(if (<= x -5e-109)
(* t a)
(if (<= x -1.7e-245)
t_1
(if (<= x 4e-196)
(* y z)
(if (<= x 5.7e-30) (* t a) (if (<= x 1.1e+106) t_1 x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (x <= -3.8e+59) {
tmp = x;
} else if (x <= -5e-109) {
tmp = t * a;
} else if (x <= -1.7e-245) {
tmp = t_1;
} else if (x <= 4e-196) {
tmp = y * z;
} else if (x <= 5.7e-30) {
tmp = t * a;
} else if (x <= 1.1e+106) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (x <= (-3.8d+59)) then
tmp = x
else if (x <= (-5d-109)) then
tmp = t * a
else if (x <= (-1.7d-245)) then
tmp = t_1
else if (x <= 4d-196) then
tmp = y * z
else if (x <= 5.7d-30) then
tmp = t * a
else if (x <= 1.1d+106) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (x <= -3.8e+59) {
tmp = x;
} else if (x <= -5e-109) {
tmp = t * a;
} else if (x <= -1.7e-245) {
tmp = t_1;
} else if (x <= 4e-196) {
tmp = y * z;
} else if (x <= 5.7e-30) {
tmp = t * a;
} else if (x <= 1.1e+106) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if x <= -3.8e+59: tmp = x elif x <= -5e-109: tmp = t * a elif x <= -1.7e-245: tmp = t_1 elif x <= 4e-196: tmp = y * z elif x <= 5.7e-30: tmp = t * a elif x <= 1.1e+106: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (x <= -3.8e+59) tmp = x; elseif (x <= -5e-109) tmp = Float64(t * a); elseif (x <= -1.7e-245) tmp = t_1; elseif (x <= 4e-196) tmp = Float64(y * z); elseif (x <= 5.7e-30) tmp = Float64(t * a); elseif (x <= 1.1e+106) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (x <= -3.8e+59) tmp = x; elseif (x <= -5e-109) tmp = t * a; elseif (x <= -1.7e-245) tmp = t_1; elseif (x <= 4e-196) tmp = y * z; elseif (x <= 5.7e-30) tmp = t * a; elseif (x <= 1.1e+106) tmp = t_1; else tmp = x; 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[x, -3.8e+59], x, If[LessEqual[x, -5e-109], N[(t * a), $MachinePrecision], If[LessEqual[x, -1.7e-245], t$95$1, If[LessEqual[x, 4e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 5.7e-30], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.1e+106], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{-30}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.8000000000000001e59 or 1.09999999999999996e106 < x Initial program 89.4%
associate-+l+89.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 66.1%
if -3.8000000000000001e59 < x < -5.0000000000000002e-109 or 4.0000000000000002e-196 < x < 5.69999999999999977e-30Initial program 92.0%
associate-+l+92.0%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in t around inf 78.5%
Taylor expanded in t around inf 74.5%
Taylor expanded in a around inf 49.9%
if -5.0000000000000002e-109 < x < -1.7e-245 or 5.69999999999999977e-30 < x < 1.09999999999999996e106Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
fma-define88.6%
associate-*l*90.2%
*-commutative90.2%
*-commutative90.2%
distribute-rgt-out93.6%
*-commutative93.6%
Simplified93.6%
Taylor expanded in y around 0 77.5%
Taylor expanded in x around 0 69.4%
Taylor expanded in t around 0 47.1%
if -1.7e-245 < x < 4.0000000000000002e-196Initial program 87.2%
associate-+l+87.2%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
Final simplification54.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.8e+58)
x
(if (<= x -1.8e-76)
(* t a)
(if (<= x 1.3e-195)
(* y z)
(if (<= x 2.55e-18)
(* t a)
(if (<= x 2800000.0) (* y z) (if (<= x 5.5e+105) (* t a) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.8e+58) {
tmp = x;
} else if (x <= -1.8e-76) {
tmp = t * a;
} else if (x <= 1.3e-195) {
tmp = y * z;
} else if (x <= 2.55e-18) {
tmp = t * a;
} else if (x <= 2800000.0) {
tmp = y * z;
} else if (x <= 5.5e+105) {
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 (x <= (-1.8d+58)) then
tmp = x
else if (x <= (-1.8d-76)) then
tmp = t * a
else if (x <= 1.3d-195) then
tmp = y * z
else if (x <= 2.55d-18) then
tmp = t * a
else if (x <= 2800000.0d0) then
tmp = y * z
else if (x <= 5.5d+105) 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 (x <= -1.8e+58) {
tmp = x;
} else if (x <= -1.8e-76) {
tmp = t * a;
} else if (x <= 1.3e-195) {
tmp = y * z;
} else if (x <= 2.55e-18) {
tmp = t * a;
} else if (x <= 2800000.0) {
tmp = y * z;
} else if (x <= 5.5e+105) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.8e+58: tmp = x elif x <= -1.8e-76: tmp = t * a elif x <= 1.3e-195: tmp = y * z elif x <= 2.55e-18: tmp = t * a elif x <= 2800000.0: tmp = y * z elif x <= 5.5e+105: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.8e+58) tmp = x; elseif (x <= -1.8e-76) tmp = Float64(t * a); elseif (x <= 1.3e-195) tmp = Float64(y * z); elseif (x <= 2.55e-18) tmp = Float64(t * a); elseif (x <= 2800000.0) tmp = Float64(y * z); elseif (x <= 5.5e+105) 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 (x <= -1.8e+58) tmp = x; elseif (x <= -1.8e-76) tmp = t * a; elseif (x <= 1.3e-195) tmp = y * z; elseif (x <= 2.55e-18) tmp = t * a; elseif (x <= 2800000.0) tmp = y * z; elseif (x <= 5.5e+105) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.8e+58], x, If[LessEqual[x, -1.8e-76], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.3e-195], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.55e-18], N[(t * a), $MachinePrecision], If[LessEqual[x, 2800000.0], N[(y * z), $MachinePrecision], If[LessEqual[x, 5.5e+105], N[(t * a), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-76}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-195}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-18}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2800000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+105}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.79999999999999998e58 or 5.49999999999999979e105 < x Initial program 89.4%
associate-+l+89.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 66.1%
if -1.79999999999999998e58 < x < -1.8e-76 or 1.3000000000000001e-195 < x < 2.54999999999999991e-18 or 2.8e6 < x < 5.49999999999999979e105Initial program 90.6%
associate-+l+90.6%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in t around inf 74.8%
Taylor expanded in t around inf 71.9%
Taylor expanded in a around inf 46.5%
if -1.8e-76 < x < 1.3000000000000001e-195 or 2.54999999999999991e-18 < x < 2.8e6Initial program 88.5%
associate-+l+88.5%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 43.6%
*-commutative43.6%
Simplified43.6%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -9.2e+63)
t_1
(if (<= a 1.58e+32)
(+ x (* y z))
(if (or (<= a 3.4e+93) (not (<= a 2.05e+161))) t_1 (+ x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -9.2e+63) {
tmp = t_1;
} else if (a <= 1.58e+32) {
tmp = x + (y * z);
} else if ((a <= 3.4e+93) || !(a <= 2.05e+161)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-9.2d+63)) then
tmp = t_1
else if (a <= 1.58d+32) then
tmp = x + (y * z)
else if ((a <= 3.4d+93) .or. (.not. (a <= 2.05d+161))) then
tmp = t_1
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 t_1 = a * (t + (z * b));
double tmp;
if (a <= -9.2e+63) {
tmp = t_1;
} else if (a <= 1.58e+32) {
tmp = x + (y * z);
} else if ((a <= 3.4e+93) || !(a <= 2.05e+161)) {
tmp = t_1;
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -9.2e+63: tmp = t_1 elif a <= 1.58e+32: tmp = x + (y * z) elif (a <= 3.4e+93) or not (a <= 2.05e+161): tmp = t_1 else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -9.2e+63) tmp = t_1; elseif (a <= 1.58e+32) tmp = Float64(x + Float64(y * z)); elseif ((a <= 3.4e+93) || !(a <= 2.05e+161)) tmp = t_1; else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -9.2e+63) tmp = t_1; elseif (a <= 1.58e+32) tmp = x + (y * z); elseif ((a <= 3.4e+93) || ~((a <= 2.05e+161))) tmp = t_1; else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.2e+63], t$95$1, If[LessEqual[a, 1.58e+32], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 3.4e+93], N[Not[LessEqual[a, 2.05e+161]], $MachinePrecision]], t$95$1, N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.58 \cdot 10^{+32}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+93} \lor \neg \left(a \leq 2.05 \cdot 10^{+161}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if a < -9.19999999999999973e63 or 1.58000000000000006e32 < a < 3.4e93 or 2.0500000000000001e161 < a Initial program 79.3%
associate-+l+79.3%
+-commutative79.3%
fma-define79.3%
associate-*l*87.6%
*-commutative87.6%
*-commutative87.6%
distribute-rgt-out93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around 0 91.8%
Taylor expanded in x around 0 84.4%
if -9.19999999999999973e63 < a < 1.58000000000000006e32Initial program 98.4%
associate-+l+98.4%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around 0 75.8%
if 3.4e93 < a < 2.0500000000000001e161Initial program 84.2%
associate-+l+84.2%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in z around 0 79.5%
+-commutative79.5%
Simplified79.5%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* z (* a b))))
(if (<= b -5.8e+220)
t_2
(if (<= b 1.7e-189)
t_1
(if (<= b 2.3e-159) (* t a) (if (<= b 1.06e+80) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = z * (a * b);
double tmp;
if (b <= -5.8e+220) {
tmp = t_2;
} else if (b <= 1.7e-189) {
tmp = t_1;
} else if (b <= 2.3e-159) {
tmp = t * a;
} else if (b <= 1.06e+80) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (y * z)
t_2 = z * (a * b)
if (b <= (-5.8d+220)) then
tmp = t_2
else if (b <= 1.7d-189) then
tmp = t_1
else if (b <= 2.3d-159) then
tmp = t * a
else if (b <= 1.06d+80) then
tmp = t_1
else
tmp = t_2
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 t_2 = z * (a * b);
double tmp;
if (b <= -5.8e+220) {
tmp = t_2;
} else if (b <= 1.7e-189) {
tmp = t_1;
} else if (b <= 2.3e-159) {
tmp = t * a;
} else if (b <= 1.06e+80) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = z * (a * b) tmp = 0 if b <= -5.8e+220: tmp = t_2 elif b <= 1.7e-189: tmp = t_1 elif b <= 2.3e-159: tmp = t * a elif b <= 1.06e+80: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(z * Float64(a * b)) tmp = 0.0 if (b <= -5.8e+220) tmp = t_2; elseif (b <= 1.7e-189) tmp = t_1; elseif (b <= 2.3e-159) tmp = Float64(t * a); elseif (b <= 1.06e+80) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = z * (a * b); tmp = 0.0; if (b <= -5.8e+220) tmp = t_2; elseif (b <= 1.7e-189) tmp = t_1; elseif (b <= 2.3e-159) tmp = t * a; elseif (b <= 1.06e+80) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.8e+220], t$95$2, If[LessEqual[b, 1.7e-189], t$95$1, If[LessEqual[b, 2.3e-159], N[(t * a), $MachinePrecision], If[LessEqual[b, 1.06e+80], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -5.8 \cdot 10^{+220}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-159}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 1.06 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -5.79999999999999983e220 or 1.05999999999999996e80 < b Initial program 87.2%
associate-+l+87.2%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in z around inf 68.0%
+-commutative68.0%
Simplified68.0%
Taylor expanded in a around inf 65.0%
*-commutative65.0%
Simplified65.0%
if -5.79999999999999983e220 < b < 1.7000000000000001e-189 or 2.29999999999999978e-159 < b < 1.05999999999999996e80Initial program 90.0%
associate-+l+90.0%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 65.4%
if 1.7000000000000001e-189 < b < 2.29999999999999978e-159Initial program 100.0%
associate-+l+100.0%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around inf 84.6%
Taylor expanded in t around inf 84.6%
Taylor expanded in a around inf 84.0%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5.8e+147) (+ x (+ (* t a) (* (* z 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 (b <= -5.8e+147) {
tmp = x + ((t * a) + ((z * 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 (b <= (-5.8d+147)) then
tmp = x + ((t * a) + ((z * 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 (b <= -5.8e+147) {
tmp = x + ((t * a) + ((z * 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 b <= -5.8e+147: tmp = x + ((t * a) + ((z * 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 (b <= -5.8e+147) tmp = Float64(x + Float64(Float64(t * a) + Float64(Float64(z * 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 (b <= -5.8e+147) tmp = x + ((t * a) + ((z * 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[b, -5.8e+147], N[(x + N[(N[(t * a), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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}\;b \leq -5.8 \cdot 10^{+147}:\\
\;\;\;\;x + \left(t \cdot a + \left(z \cdot a\right) \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 b < -5.7999999999999997e147Initial program 89.1%
associate-+l+89.1%
+-commutative89.1%
fma-define89.1%
associate-*l*76.5%
*-commutative76.5%
*-commutative76.5%
distribute-rgt-out81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y around 0 84.6%
+-commutative84.6%
distribute-lft-in79.2%
*-commutative79.2%
associate-*r*91.8%
*-commutative91.8%
Applied egg-rr91.8%
if -5.7999999999999997e147 < b Initial program 89.6%
associate-+l+89.6%
associate-*l*92.8%
Simplified92.8%
Final simplification92.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.9e+24) (not (<= b 2.8e-136))) (+ 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 ((b <= -1.9e+24) || !(b <= 2.8e-136)) {
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 ((b <= (-1.9d+24)) .or. (.not. (b <= 2.8d-136))) 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 ((b <= -1.9e+24) || !(b <= 2.8e-136)) {
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 (b <= -1.9e+24) or not (b <= 2.8e-136): 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 ((b <= -1.9e+24) || !(b <= 2.8e-136)) 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 ((b <= -1.9e+24) || ~((b <= 2.8e-136))) 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[b, -1.9e+24], N[Not[LessEqual[b, 2.8e-136]], $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}\;b \leq -1.9 \cdot 10^{+24} \lor \neg \left(b \leq 2.8 \cdot 10^{-136}\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 b < -1.90000000000000008e24 or 2.8000000000000001e-136 < b Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
fma-define89.5%
associate-*l*83.7%
*-commutative83.7%
*-commutative83.7%
distribute-rgt-out88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in y around 0 86.6%
if -1.90000000000000008e24 < b < 2.8000000000000001e-136Initial program 89.5%
associate-+l+89.5%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in t around inf 94.8%
Final simplification90.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.4e+145) (not (<= z 1.45e+113))) (* 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.4e+145) || !(z <= 1.45e+113)) {
tmp = 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.4d+145)) .or. (.not. (z <= 1.45d+113))) then
tmp = 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.4e+145) || !(z <= 1.45e+113)) {
tmp = 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.4e+145) or not (z <= 1.45e+113): tmp = 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.4e+145) || !(z <= 1.45e+113)) tmp = 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.4e+145) || ~((z <= 1.45e+113))) tmp = 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.4e+145], N[Not[LessEqual[z, 1.45e+113]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $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.4 \cdot 10^{+145} \lor \neg \left(z \leq 1.45 \cdot 10^{+113}\right):\\
\;\;\;\;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.3999999999999999e145 or 1.44999999999999992e113 < z Initial program 73.7%
associate-+l+73.7%
associate-*l*75.2%
Simplified75.2%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.3999999999999999e145 < z < 1.44999999999999992e113Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
fma-define96.1%
associate-*l*96.7%
*-commutative96.7%
*-commutative96.7%
distribute-rgt-out98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in y around 0 87.3%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.55e+76) (+ x (+ (* t a) (* (* z a) b))) (if (<= b 2.6e-136) (+ (+ x (* y z)) (* t a)) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.55e+76) {
tmp = x + ((t * a) + ((z * a) * b));
} else if (b <= 2.6e-136) {
tmp = (x + (y * z)) + (t * a);
} 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 (b <= (-1.55d+76)) then
tmp = x + ((t * a) + ((z * a) * b))
else if (b <= 2.6d-136) then
tmp = (x + (y * z)) + (t * a)
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 (b <= -1.55e+76) {
tmp = x + ((t * a) + ((z * a) * b));
} else if (b <= 2.6e-136) {
tmp = (x + (y * z)) + (t * a);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.55e+76: tmp = x + ((t * a) + ((z * a) * b)) elif b <= 2.6e-136: tmp = (x + (y * z)) + (t * a) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.55e+76) tmp = Float64(x + Float64(Float64(t * a) + Float64(Float64(z * a) * b))); elseif (b <= 2.6e-136) tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); 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 (b <= -1.55e+76) tmp = x + ((t * a) + ((z * a) * b)); elseif (b <= 2.6e-136) tmp = (x + (y * z)) + (t * a); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.55e+76], N[(x + N[(N[(t * a), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-136], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{+76}:\\
\;\;\;\;x + \left(t \cdot a + \left(z \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-136}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -1.55000000000000006e76Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
fma-define87.7%
associate-*l*78.1%
*-commutative78.1%
*-commutative78.1%
distribute-rgt-out82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
distribute-lft-in78.2%
*-commutative78.2%
associate-*r*87.8%
*-commutative87.8%
Applied egg-rr87.8%
if -1.55000000000000006e76 < b < 2.59999999999999997e-136Initial program 90.3%
associate-+l+90.3%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in t around inf 93.5%
if 2.59999999999999997e-136 < b Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
fma-define89.5%
associate-*l*85.2%
*-commutative85.2%
*-commutative85.2%
distribute-rgt-out91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around 0 88.7%
Final simplification90.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.7e+66) (not (<= z 2.2e-28))) (* 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.7e+66) || !(z <= 2.2e-28)) {
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.7d+66)) .or. (.not. (z <= 2.2d-28))) 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.7e+66) || !(z <= 2.2e-28)) {
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.7e+66) or not (z <= 2.2e-28): 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.7e+66) || !(z <= 2.2e-28)) 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.7e+66) || ~((z <= 2.2e-28))) 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.7e+66], N[Not[LessEqual[z, 2.2e-28]], $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.7 \cdot 10^{+66} \lor \neg \left(z \leq 2.2 \cdot 10^{-28}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.70000000000000015e66 or 2.19999999999999996e-28 < z Initial program 79.3%
associate-+l+79.3%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.70000000000000015e66 < z < 2.19999999999999996e-28Initial program 97.9%
associate-+l+97.9%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in z around 0 79.1%
+-commutative79.1%
Simplified79.1%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.2e+68) (* z (* a b)) (if (<= z 1.6e+61) (+ x (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e+68) {
tmp = z * (a * b);
} else if (z <= 1.6e+61) {
tmp = x + (t * a);
} 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 (z <= (-3.2d+68)) then
tmp = z * (a * b)
else if (z <= 1.6d+61) then
tmp = x + (t * a)
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 (z <= -3.2e+68) {
tmp = z * (a * b);
} else if (z <= 1.6e+61) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e+68: tmp = z * (a * b) elif z <= 1.6e+61: tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.2e+68) tmp = Float64(z * Float64(a * b)); elseif (z <= 1.6e+61) tmp = Float64(x + Float64(t * a)); 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 (z <= -3.2e+68) tmp = z * (a * b); elseif (z <= 1.6e+61) tmp = x + (t * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e+68], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+61], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+68}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+61}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if z < -3.19999999999999994e68Initial program 73.4%
associate-+l+73.4%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in z around inf 82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
Simplified54.3%
if -3.19999999999999994e68 < z < 1.5999999999999999e61Initial program 96.9%
associate-+l+96.9%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in z around 0 74.9%
+-commutative74.9%
Simplified74.9%
if 1.5999999999999999e61 < z Initial program 80.8%
associate-+l+80.8%
associate-*l*77.2%
Simplified77.2%
Taylor expanded in a around 0 65.9%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e+59) x (if (<= x 1.4e+108) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e+59) {
tmp = x;
} else if (x <= 1.4e+108) {
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 (x <= (-1.1d+59)) then
tmp = x
else if (x <= 1.4d+108) 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 (x <= -1.1e+59) {
tmp = x;
} else if (x <= 1.4e+108) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.1e+59: tmp = x elif x <= 1.4e+108: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e+59) tmp = x; elseif (x <= 1.4e+108) 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 (x <= -1.1e+59) tmp = x; elseif (x <= 1.4e+108) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e+59], x, If[LessEqual[x, 1.4e+108], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+108}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.1e59 or 1.3999999999999999e108 < x Initial program 89.4%
associate-+l+89.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 66.1%
if -1.1e59 < x < 1.3999999999999999e108Initial program 89.6%
associate-+l+89.6%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in t around inf 69.9%
Taylor expanded in t around inf 70.1%
Taylor expanded in a around inf 35.4%
(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 89.5%
associate-+l+89.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around inf 30.0%
(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 2024096
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(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)))