bool FloatEquals(double x, double y) { return ((x - y).abs()) <= (EPSILON*math.max(1.0, math.max(x.abs(), y.abs()))); }