ChebEval() public static method

Evaluate a real Chebyshev polynomial on an interval, given the coefficients.
public static ChebEval ( ChebSeries cs, Double x ) : Double
cs ChebSeries The coefficients to consider.
x Double The real evaluation argument.
return Double
コード例 #1
0
        static double RiemannZeta1msLt0(double s)
        {
            if (s > -19.0)
            {
                var x = (-19 - 2.0 * s) / 19.0;
                var c = Helpers.ChebEval(zetaGt1, x);
                return(c / (-s));
            }

            var f2 = 1.0 - Math.Pow(2.0, -(1.0 - s));
            var f3 = 1.0 - Math.Pow(3.0, -(1.0 - s));
            var f5 = 1.0 - Math.Pow(5.0, -(1.0 - s));
            var f7 = 1.0 - Math.Pow(7.0, -(1.0 - s));

            return(1.0 / (f2 * f3 * f5 * f7));
        }
コード例 #2
0
        static ScalarValue RiemannZeta1msLt0(ScalarValue s)
        {
            if (s.Re > -19.0)
            {
                var x = (-19 - 2.0 * s) / 19.0;
                var c = Helpers.ChebEval(zetaGt1, x);
                return(c / (-s));
            }

            var f2 = 1.0 - new ScalarValue(2.0).Pow(-(1.0 - s));
            var f3 = 1.0 - new ScalarValue(3.0).Pow(-(1.0 - s));
            var f5 = 1.0 - new ScalarValue(5.0).Pow(-(1.0 - s));
            var f7 = 1.0 - new ScalarValue(7.0).Pow(-(1.0 - s));

            return(1.0 / (f2 * f3 * f5 * f7));
        }
コード例 #3
0
        static double RiemannZetaGt0(double s)
        {
            if (s < 1.0)
            {
                var c = Helpers.ChebEval(zetaLt1, 2.0 * s - 1.0);
                return(c / (s - 1.0));
            }
            else if (s <= 20.0)
            {
                var x = (2.0 * s - 21.0) / 19.0;
                var c = Helpers.ChebEval(zetaGt1, x);
                return(c / (s - 1.0));
            }

            var f2 = 1.0 - Math.Pow(2.0, -s);
            var f3 = 1.0 - Math.Pow(3.0, -s);
            var f5 = 1.0 - Math.Pow(5.0, -s);
            var f7 = 1.0 - Math.Pow(7.0, -s);

            return(1.0 / (f2 * f3 * f5 * f7));
        }
コード例 #4
0
        static ScalarValue RiemannZetaGt0(ScalarValue s)
        {
            if (s.Re < 1.0)
            {
                var c = Helpers.ChebEval(zetaLt1, 2.0 * s - 1.0);
                return(c / (s - 1.0));
            }
            else if (s.Re <= 20.0)
            {
                var x = (2.0 * s - 21.0) / 19.0;
                var c = Helpers.ChebEval(zetaGt1, x);
                return(c / (s - 1.0));
            }

            var f2 = 1.0 - new ScalarValue(2.0).Pow(-s);
            var f3 = 1.0 - new ScalarValue(3.0).Pow(-s);
            var f5 = 1.0 - new ScalarValue(5.0).Pow(-s);
            var f7 = 1.0 - new ScalarValue(7.0).Pow(-s);

            return(1.0 / (f2 * f3 * f5 * f7));
        }