예제 #1
0
        static void TestAll(Func <double, double> func)
        {
            string n = func.Method.Name;

            TestCommon(func, TestMin, TestMax, n);
            TestCommon((double y, double x) => Htam.Atan2_1(func, y, x), TestMin, TestMax, n + "-atan21");
            TestCommon((double y, double x) => Htam.Atan2_2(func, y, x), TestMin, TestMax, n + "-atan22");
        }
예제 #2
0
        IEnumerable <TestItem> GetTestItems()
        {
            yield return(new TestItem {
                Delta = 0.0136638037737241, Name = nameof(Htam.AtanSO1),
                Method = Pack(Htam.AtanSO1)
            });

            yield return(new TestItem {
                Delta = 0.0935295762042112, Name = nameof(Htam.AtanMac),
                Method = Pack((double a) => Htam.AtanMac(a))
            });

            yield return(new TestItem {
                Delta = 0.0658025452458654, Name = nameof(Htam.AtanMac) + "-16",
                Method = Pack((double a) => Htam.AtanMac(a, 16))
            });

            yield return(new TestItem {
                Delta = 0.0569347297414578, Name = nameof(Htam.AtanMac) + "-32",
                Method = Pack((double a) => Htam.AtanMac(a, 32))
            });

            yield return(new TestItem {
                Delta = 0.00226640192840601, Name = nameof(Htam.AtanActon),
                Method = Pack((double a) => Htam.AtanActon(a))
            });

            yield return(new TestItem {
                Delta = 3.45821481589903E-08, Name = nameof(Htam.AtanActon) + "-16",
                Method = Pack((double a) => Htam.AtanActon(a, 16))
            });

            yield return(new TestItem {
                Delta = 5.04457586814056E-14, Name = nameof(Htam.AtanActon) + "-32",
                Method = Pack((double a) => Htam.AtanActon(a, 32))
            });

            yield return(new TestItem {
                Delta = 5.64583343687364E-08, Name = nameof(Htam.AtanAms),
                Method = Pack((double a) => Htam.AtanAms(a))
            });

            yield return(new TestItem {
                Delta = 122.793568849762, Name = nameof(Htam.Atanfdlibm),
                Method = Pack(Htam.Atanfdlibm)
            });
        }
예제 #3
0
        IEnumerable <TestItem> CosGetTestItems()
        {
            yield return(new TestItem {
                Delta = 4.28993995275212E-08, Name = nameof(NBSApplied.Cos),
                Method = Pack(NBSApplied.Cos)
            });

            yield return(new TestItem {
                Delta = 0.30451787266993, Name = nameof(Htam.Cordic) + "-Cos",
                Method = Pack((double a) => Htam.Cordic(a).Item1)
            });

            yield return(new TestItem {
                Delta = 4.68074049085002E-06, Name = nameof(Htam.Cordic) + "-Cos-24",
                Method = Pack((double a) => Htam.Cordic(a, 24).Item1)
            });
        }
예제 #4
0
        IEnumerable <TestItem> SinGetTestItems()
        {
            yield return(new TestItem {
                Delta = 1.09810064102525E-13, Name = nameof(Htam.SinSO),
                Method = Pack(Htam.SinSO)
            });

            yield return(new TestItem {
                Delta = 78.6051247042265, Name = nameof(Htam.Sin3),
                Method = Pack(Htam.Sin3)
            });

            yield return(new TestItem {
                Delta = 0.0635031546303115, Name = nameof(Htam.SinXupremZero),
                Method = Pack(Htam.SinXupremZero)
            });

            yield return(new TestItem {
                Delta = 3.06749508765944E-08, Name = nameof(Htam.SinAms),
                Method = Pack(Htam.SinAms)
            });

            yield return(new TestItem {
                Delta = 4.73341042769437E-05, Name = nameof(Htam.Sin5),
                Method = Pack((double a) => Htam.Sin5(a))
            });

            yield return(new TestItem {
                Delta = 1.28626401479628E-13, Name = nameof(Htam.Sin5) + "-16",
                Method = Pack((double a) => Htam.Sin5(a, 16))
            });

            yield return(new TestItem {
                Delta = 1.93058194713749E-13, Name = nameof(Htam.Sin5) + "-32",
                Method = Pack((double a) => Htam.Sin5(a, 32))
            });

            yield return(new TestItem {
                Delta = 0.301510668694616, Name = nameof(Htam.Cordic) + "-Sin",
                Method = Pack((double a) => Htam.Cordic(a).Item2)
            });

            yield return(new TestItem {
                Delta = 4.72747762933103E-06, Name = nameof(Htam.Cordic) + "-Sin-24",
                Method = Pack((double a) => Htam.Cordic(a, 24).Item2)
            });

            yield return(new TestItem {
                Delta = 0.00400130951601312, Name = nameof(Htam.SinTaylor),
                Method = Pack(Htam.SinTaylor)
            });

            yield return(new TestItem {
                Delta = 2.261290882078, Name = nameof(Htam.SinFdlibm),
                Method = Pack(Htam.SinFdlibm)
            });

            yield return(new TestItem {
                Delta = 14.075154510891, Name = nameof(Htam.Sin6),
                Method = Pack((double a) => Htam.Sin6(a))
            });

            yield return(new TestItem {
                Delta = 6.75028061584193, Name = nameof(Htam.Sin6) + "-16",
                Method = Pack((double a) => Htam.Sin6(a, 16))
            });

            yield return(new TestItem {
                Delta = 3.30773444231687, Name = nameof(Htam.Sin6) + "-32",
                Method = Pack((double a) => Htam.Sin6(a, 32))
            });
        }