protected override ScalarValue GetValue(ScalarValue value) { var a = value.Exp(); var b = (-value).Exp(); return((a - b) / (a + b)); }
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"); }
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"); }
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())); }
protected override ScalarValue GetValue(ScalarValue value) { return((value.Exp() + (-value).Exp()) / 2.0); }
protected override ScalarValue GetValue(ScalarValue value) { return value.Exp(); }
protected override ScalarValue GetValue(ScalarValue value) { var a = value.Exp(); var b = (-value).Exp(); return (a + b) / (a - b); }
protected override ScalarValue GetValue(ScalarValue value) { return 2.0 / (value.Exp() - (-value).Exp()); }
protected override ScalarValue GetValue(ScalarValue value) { return(value.Exp()); }