Ejemplo n.º 1
0
        static string Test_DLL_Home()
        {
            double d0    = MyF.MyCos(A, e) + MyF.MyCos(B, e);
            double d1    = 2 * MyF.MyCos((A + B) / 2, e) * MyF.MyCos((A - B) / 2, e);
            double error = Math.Abs(d0 - d1);

            return($"   MAC Ф1 = {d0,19:F15}   MAC Ф2 = {d1,19:F15}  error = {error,10:E2}");
        }
Ejemplo n.º 2
0
        static string Test_DLL()
        {
            double d0    = MyF.MySin(A + B + C, e);
            double d1    = MyF.MySin(A, e) * MyF.MyCos(B, e) * MyF.MyCos(C, e);
            double d2    = MyF.MyCos(A, e) * MyF.MySin(B, e) * MyF.MyCos(C, e);
            double d3    = MyF.MyCos(A, e) * MyF.MyCos(B, e) * MyF.MySin(C, e);
            double d4    = MyF.MySin(A, e) * MyF.MySin(B, e) * MyF.MySin(C, e);
            double error = Math.Abs(d0 - (d1 + d2 + d3 - d4));

            return($"   MAC = {d0,19:F16}   error = {error,10:E2}");
        }
Ejemplo n.º 3
0
        static string TestMySinCos()
        {
            string txt = "           Test of MySinCos() \r\n";
            double unit, error, e = 1.0E-20;

            for (double x = 1.0; x <= 40; x += 1.0)
            {
                unit  = MyF.MyCos(x, e) * MyF.MyCos(x, e) + MyF.MySin(x, e) * MyF.MySin(x, e);
                error = (1.0 - unit);
                txt  += $"{x,7:F1}{unit,20:F16}{error,20:F16}\r\n";
            }
            return(txt);
        }