diff options
Diffstat (limited to 'graphics/pstricks/contrib/pst-func/dvips/pst-func.pro')
-rw-r--r-- | graphics/pstricks/contrib/pst-func/dvips/pst-func.pro | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro index f752442e87..a0a58d9e92 100644 --- a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro +++ b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro @@ -1,4 +1,4 @@ -%% $Id: pst-func.pro 861 2018-12-13 20:40:06Z herbert $ +%% $Id: pst-func.pro 689 2023-04-03 06:46:27Z herbert $ %% %% This is file `pst-func.pro', %% @@ -16,7 +16,7 @@ %% `pst-func' is a PSTricks package to plot special math functions %% %% -%% version 0.17 / 2018-12-13 Herbert Voss +%% version 0.19 / 2023-04-02 Herbert Voss % /tx@FuncDict 100 dict def tx@FuncDict begin @@ -289,13 +289,13 @@ tx@FuncDict begin /s1 0 def /s2 0 def 1 1 M { - /k exch def - /xVal k 2 mul 1 sub h mul a add def + /simp_k exch def + /xVal simp_k 2 mul 1 sub h mul a add def /s1 s1 xVal useX { /x exch def } if SFunc add def } for 1 1 M 1 sub { - /k exch def - /xVal k 2 mul h mul a add def + /simp_k exch def + /xVal simp_k 2 mul h mul a add def /s2 s2 xVal useX { /x exch def } if SFunc add def } for /I a useX { /x exch def } if SFunc b useX { /x exch def } if SFunc add s1 4 mul add s2 2 mul add 3 div h mul def @@ -305,12 +305,12 @@ tx@FuncDict begin /LogGamma { 5 dict begin % z on stack /z ED /sum 0 def - /k 1 def + /logGamma_k 1 def { - z k div dup 1 add ln sub dup + z logGamma_k div dup 1 add ln sub dup abs eps8 lt { pop exit } if sum add /sum exch def - /k k 1 add def + /logGamma_k logGamma_k 1 add def } loop sum z ln sub CEuler z mul sub end @@ -321,10 +321,10 @@ tx@FuncDict begin /xtmp exch def /n exch def 0 0 1 n .5 mul floor { - /k exch def - xtmp xtmp mul 1 sub k exp - xtmp n 2 k mul sub exp mul - n 2 k mul MoverN mul + /cheb_k exch def + xtmp xtmp mul 1 sub cheb_k exp + xtmp n 2 cheb_k mul sub exp mul + n 2 cheb_k mul MoverN mul add } for end @@ -335,10 +335,10 @@ tx@FuncDict begin /xtmp exch def /n exch def 0 0 1 n .5 mul floor { - /k exch def - xtmp xtmp mul 1 sub k exp - xtmp n 2 k mul sub exp mul - n 1 add 2 k mul 1 add MoverN mul + /cheb_k exch def + xtmp xtmp mul 1 sub cheb_k exp + xtmp n 2 cheb_k mul sub exp mul + n 1 add 2 cheb_k mul 1 add MoverN mul add } for end @@ -368,6 +368,27 @@ tx@FuncDict begin } def %end{vasicek density} % +% https://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html +/ConfHyperFunc { % Confluent Hypergeometric Funtion of the First Kind + % on stack must be a b z + 10 dict begin + /z ED /b ED /a ED + /sum 1 def + /k 0 def + /nom 1 def + /denom 1 def + { + nom a k add mul z mul /nom ED + denom b k add mul k 1 add mul /denom ED + nom denom div /diff ED + sum diff add /sum ED + diff 1e-5 lt { exit } { k 1 add /k ED } ifelse + k 1000 ge { (Error ConfHyperFunc: k =1000) == exit } if + } loop + sum + end +} def +% end % /arraySum { % on stack the array |