summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-16 21:59:28 +0000
committerKarl Berry <karl@freefriends.org>2018-11-16 21:59:28 +0000
commit36e2079a2071dab1e6737021dca6cce7fc754e69 (patch)
tree28b627751a61295089a9f12847caa1d5883df998 /Master/texmf-dist/dvips
parentaad909c632859989f4edb2a8ae379ca85f22d1f9 (diff)
pst-func (16nov18)
git-svn-id: svn://tug.org/texlive/trunk@49172 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pst-func/pst-func.pro55
1 files changed, 34 insertions, 21 deletions
diff --git a/Master/texmf-dist/dvips/pst-func/pst-func.pro b/Master/texmf-dist/dvips/pst-func/pst-func.pro
index 8be99845cd6..d5c66b3829e 100644
--- a/Master/texmf-dist/dvips/pst-func/pst-func.pro
+++ b/Master/texmf-dist/dvips/pst-func/pst-func.pro
@@ -16,7 +16,7 @@
%% `pst-func' is a PSTricks package to plot special math functions
%%
%%
-%% version 0.16 / 2014-05-07 Herbert Voss
+%% version 0.16 / 2018-11-15 Herbert Voss
%
/tx@FuncDict 100 dict def
tx@FuncDict begin
@@ -127,19 +127,31 @@ tx@FuncDict begin
%%
/Si { % integral sin from 0 to x (arg on stack)
10 dict begin % hold all local
- /arg exch def % x
- /Sum arg def %
- /sign -1 def
- /I 3 def
- { % a sequence of x - x^3/(3*3!) + x^5/(5*5!) -...+...
- arg I Power dup abs 1e30 gt { pop exit } if
- I factorial div I div sign mul
- dup abs eps8 lt { pop exit } if
- Sum add /Sum exch def
- /sign sign neg def
- /I I 2 add def
- } loop
- Sum
+ dup 0 eq
+ { pop 0 }
+ {
+ /arg exch def % x
+ /arg2 arg dup mul def
+ /Sum arg def %
+ /sign -1 def
+ /I 3 def
+ /Frac arg2 arg mul 6 div def
+ { % a sequence of x - x^3/(3*3!) + x^5/(5*5!) -...+...
+ Frac I div sign mul
+ dup abs eps5 lt { pop exit } if
+ Sum add /Sum exch def
+ /sign sign neg def
+ /I I 2 add def
+ Frac arg2 mul I 1 sub I mul div /Frac ED
+% arg I Power dup abs 1e30 gt { pop exit } if
+% I factorial div I div sign mul
+% dup abs eps8 lt { pop exit } if
+% Sum add /Sum exch def
+% /sign sign neg def
+% /I I 2 add def
+ } loop
+ Sum
+ } ifelse
end
} def
%
@@ -151,16 +163,17 @@ tx@FuncDict begin
10 dict begin % hold all local
abs /arg exch def
arg 0 eq { 0 } {
+ /arg2 arg dup mul def
/Sum CEuler arg ln add def
/sign -1 def
/I 2 def
- {
- arg I Power dup abs 1e30 gt { pop exit } if
- I factorial div I div sign mul
- dup abs eps8 lt { pop exit } if
- Sum add /Sum exch def
- /sign sign neg def
- /I I 2 add def
+ /Frac arg2 2 div def % first fraction
+ { Frac I div sign mul
+ dup abs eps5 lt { pop exit } if
+ Sum add /Sum exch def
+ /sign sign neg def
+ /I I 2 add def
+ Frac arg2 mul I 1 sub I mul div /Frac ED
} loop
Sum
} ifelse