protected override ScalarValue GetValue(ScalarValue value)
        {
            var a = value.Exp();
            var b = (-value).Exp();

            return((a - b) / (a + b));
        }
예제 #2
0
        static ScalarValue Halley(ScalarValue x, ScalarValue w0)
        {
            for (var i = 0; i < 250; i++)
            {
                var e = w0.Exp();
                var f = e * w0 - x;
                var dw = f / ((w0 + 1.0) * e - ((w0 + 2.0) / (w0 + 1.0)) * f / 2.0);
                var w1 = w0 - dw;

                if (w1 == w0)
                {
                    return w1;
                }

                w0 = w1;
            }

            throw new YAMPNotConvergedException("Lambert");
        }
예제 #3
0
        static ScalarValue Halley(ScalarValue x, ScalarValue w0)
        {
            for (var i = 0; i < 250; i++)
            {
                var e  = w0.Exp();
                var f  = e * w0 - x;
                var dw = f / ((w0 + 1.0) * e - ((w0 + 2.0) / (w0 + 1.0)) * f / 2.0);
                var w1 = w0 - dw;

                if (w1 == w0)
                {
                    return(w1);
                }

                w0 = w1;
            }

            throw new YAMPNotConvergedException("Lambert");
        }
예제 #4
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return (value.Exp() + (-value).Exp()) / 2.0;
 }
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return(2.0 / (value.Exp() - (-value).Exp()));
 }
예제 #6
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return((value.Exp() + (-value).Exp()) / 2.0);
 }
예제 #7
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return value.Exp();
 }
예제 #8
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     var a = value.Exp();
     var b = (-value).Exp();
     return (a + b) / (a - b);
 }
예제 #9
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return 2.0 / (value.Exp() - (-value).Exp());
 }
예제 #10
0
 protected override ScalarValue GetValue(ScalarValue value)
 {
     return(value.Exp());
 }