/* Note: Bitwise-anding the results along each component gives the expected result for [a,b) x [A,B) intersection [c,d) x [C,D).  */
static int intersect_interval(double a, double b, double c, double d)
/* Note: Bitwise-anding the results along each component gives the expected result for [a,b) x [A,B) intersection [c,d) x [C,D).  */
static int intersect_interval(double a, double b, double c, double d)
{
    if (c <= a && b <= d)
	return INSIDE;
    else if (a >= d || b <= c)
	return OUTSIDE;
    else
	return PARTIAL;
}