Esempio n. 1
0
        public static double4 madsub(double4 a, double4 b, double4 c)
        {
            if (Fma.IsFmaSupported)
            {
                v256 temp = Fma.mm256_fmsubadd_pd(*(v256 *)&a, *(v256 *)&b, *(v256 *)&c);

                return(*(double4 *)&temp);
            }
            else
            {
                return(new double4(a.x * b.x + c.x, a.y * b.y - c.y, a.z * b.z + c.z, a.w * b.w - c.w));
            }
        }
Esempio n. 2
0
        public static double3 madsub(double3 a, double3 b, double3 c)
        {
            if (Fma.IsFmaSupported)
            {
                v256 temp = Fma.mm256_fmsubadd_pd(*(v256 *)&a, *(v256 *)&b, *(v256 *)&c);

                return(*(double3 *)&temp);
            }
            else
            {
                return(new double3(a.x * b.x + c.x, a.y * b.y - c.y, a.z * b.z + c.z));
            }
        }