public static double2 madsub(double2 a, double2 b, double2 c) { if (Fma.IsFmaSupported) { v128 temp = Fma.fmsubadd_pd(*(v128 *)&a, *(v128 *)&b, *(v128 *)&c); return(*(double2 *)&temp); } else if (Sse2.IsSse2Supported) { v128 negate = Sse2.xor_pd(*(v128 *)&c, new v128(0L, 1L << 63)); return(math.mad(a, b, *(double2 *)&negate)); } else { return(new double2(a.x * b.x + c.x, a.y * b.y - c.y)); } }