summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-22 01:40:51 +0000
committerKarl Berry <karl@freefriends.org>2009-01-22 01:40:51 +0000
commit25849400ed3a564641cc47c0ed070f3079f5a611 (patch)
treee6d33de6d10a6d5693dc675e8850a78017832a62 /Master/texmf-dist/dvips
parent1f747b52ef79b4ea4fbc870c9423139e82bd9b60 (diff)
pst-match 0.21 (20jan09)
git-svn-id: svn://tug.org/texlive/trunk@11942 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pst-math/pst-math.pro105
1 files changed, 55 insertions, 50 deletions
diff --git a/Master/texmf-dist/dvips/pst-math/pst-math.pro b/Master/texmf-dist/dvips/pst-math/pst-math.pro
index 333877ad284..711bb8f167c 100644
--- a/Master/texmf-dist/dvips/pst-math/pst-math.pro
+++ b/Master/texmf-dist/dvips/pst-math/pst-math.pro
@@ -2,63 +2,41 @@
% -*- Mode: Postscript -*-
% pst-math.pro --- PostScript header file pst-math.pro
%
-% Author : Christophe JORSSEN <christophe.jorssen@libre.fr.invalid>
-% ('libre' is the french word for 'free' if you want to contact me ;-))
+% Author : Christophe JORSSEN
+% Author : Herbert Voß <hvoss@tug.org>
% Created the : Sat 20 March 2004
-% Last Mod : Thu 01 November 2007
-% Version : 1.3
-%
-/ArgumentOutOfRange {%
- gsave /Times-Roman findfont 10 scalefont setfont 0 0 moveto
- ([pst-math] At least one argument was out of range) show grestore} bind def
-
-/DIV { dup 0 eq { pop ArgumentOutOfRange} { div } ifelse } bind def
-
+% Last Mod : $Date: 2009/01/19 $
+% Version : 1.2 $
+%
/PI 3.14159265359 def
/ENeperian 2.71828182846 def
-
+%
/DegToRad {PI mul 180 div} bind def
/RadToDeg {180 mul PI div} bind def
-
+%
/COS {RadToDeg cos} bind def
/SIN {RadToDeg sin} bind def
/TAN {dup SIN exch COS Div} bind def
/tan {dup sin exch cos Div} bind def
/ATAN {neg -1 atan 180 sub DegToRad} bind def
-
-/sec {cos 1 exch Div} bind def
-/cosec {sin 1 exch Div} bind def
-/cotan {dup cos exch sin Div} bind def
-/SEC {RadToDeg sec} bind def
-/COSEC {RadToDeg cosec} bind def
-/COTAN {RadToDeg cotan} bind def
-
-/acos {dup dup -1 ge exch 1 le and
- {dup dup mul neg 1 add sqrt exch atan}
- {pop 0 ArgumentOutOfRange} ifelse} bind def
-/ACOS {acos DegToRad} bind def
-/asin {dup dup -1 ge exch 1 le and
- {neg dup dup mul neg 1 add sqrt neg atan 180 sub}
- {pop 0 ArgumentOutOfRange} ifelse} bind def
-/ASIN {asin DegToRad} bind def
-
+/ACOS {dup dup mul neg 1 add sqrt exch atan DegToRad} bind def
+/acos {dup dup mul neg 1 add sqrt exch atan} bind def
+/ASIN {neg dup dup mul neg 1 add sqrt neg atan 180 sub DegToRad} bind def
+/asin {neg dup dup mul neg 1 add sqrt neg atan 180 sub} bind def
+%
/EXP {ENeperian exch exp} bind def
-
+%
/COSH {dup EXP exch neg EXP add 2 div} bind def
/SINH {dup EXP exch neg EXP sub 2 div} bind def
/TANH {dup SINH exch COSH div} bind def
-/ACOSH {dup 1 ge
- {dup dup mul 1 sub sqrt add ln}
- {pop 0 ArgumentOutOfRange} ifelse} bind def
+/ACOSH {dup dup mul 1 sub sqrt add ln} bind def
/ASINH {dup dup mul 1 add sqrt add ln} bind def
-/ATANH {dup dup -1 gt exch 1 lt and
- {dup 1 add exch neg 1 add Div ln 2 div}
- {pop 0 ArgumentOutOfRange} ifelse} bind def
-
-/SINC {dup 0 eq {pop 1} {dup SIN exch Div} ifelse} bind def
-
+/ATANH {dup 1 add exch neg 1 add Div ln 2 div} bind def
+%
+/SINC {dup SIN exch Div} bind def
+%
/GAUSS {dup mul 2 mul dup 4 -2 roll sub dup mul exch div neg EXP exch PI mul sqrt div} bind def
-
+%
/GAMMA { 2 dict begin % hv 2007-08-30
/z exch def
1.000000000190015 % p(0)
@@ -74,9 +52,9 @@
add % build the sum
} for
Pi 2 mul sqrt z div mul
- z 5.5 add z 0.5 add exp mul Euler z 5.5 add neg exp mul
+ z 5.5 add z 0.5 add exp mul ENeperian z 5.5 add neg exp mul
end } bind def
-
+%
/GAMMALN {dup dup dup 5.5 add dup ln 3 -1 roll .5 add mul sub neg 1.000000000190015
0 1 5 {
[76.18009172947146 -86.50532032941677 24.0140982483091 -1.231739572450155
@@ -84,7 +62,7 @@
4 -1 roll 1 add dup 5 1 roll div add} for
4 -1 roll div 2.5066282746310005 mul ln add exch pop} bind def
/BETA {2 copy add GAMMALN neg exch GAMMALN 3 -1 roll GAMMALN EXP} bind def
-
+%
/HORNER {aload length
dup 2 add -1 roll
exch 1 sub {
@@ -93,7 +71,7 @@
} repeat
pop
} bind def
-
+%
/BESSEL_J0 {dup abs 8 lt {
dup mul dup [57568490574 -13362590354 651619640.7 -11214424.18 77392.33017 -184.9052456] HORNER
exch [57568490411 1029532985 9494680.718 59272.64853 267.8532712 1] HORNER
@@ -104,7 +82,7 @@
exch [-.1562499995E-1 .1430488765E-3 -.6911147651E-5 .7621095161E-6 -.934945152E-7] HORNER
4 -1 roll SIN mul 3 -1 roll mul neg add mul}
ifelse} bind def
-
+%
/BESSEL_Y0 {dup 8 lt {
dup dup mul dup [-2957821389 7062834065 -512359803.6 10879881.29 -86327.92757 228.4622733] HORNER
exch [40076544269 745249964.8 7189466.438 47447.26470 226.1030244 1] HORNER
@@ -115,7 +93,7 @@
exch [-.1562499995E-1 .1430488765E-3 -.6911147651E-5 .7621095161E-6 -.934945152E-7] HORNER
4 -1 roll COS mul 3 -1 roll mul add mul}
ifelse} bind def
-
+%
/BESSEL_J1 {dup abs 8 lt {
dup dup mul dup 3 -2 roll [72362614232 -7895059235 242396853.1 -2972611.439 15704.48260 -30.16036606] HORNER mul
exch [144725228442 2300535178 18583304.74 99447.43394 376.9991397 1] HORNER
@@ -126,7 +104,7 @@
exch [.04687499995 6.2002690873E-3 .8449199096E-5 -.88228987E-6 .105787412E-6] HORNER
4 -1 roll SIN mul 3 -1 roll mul neg add mul exch dup abs Div mul}
ifelse} bind def
-
+%
/BESSEL_Y1 {dup 8 lt {
dup dup dup mul dup [-.4900604943E13 .1275274390E13 -.5153428139E11 .7349264551E9 -.4237922726E7 .8511937935E4] HORNER
exch [.2499580570E14 .4244419664E12 .3733650367E10 .2245904002E8 .1020426050E6 .3549632885E3 1] HORNER
@@ -137,11 +115,38 @@
exch [.04687499995 -.2002690873E-3 .8449199096E-5 6.88228987E-6 .105787412E-6] HORNER
4 -1 roll COS mul 3 -1 roll mul add mul}
ifelse} bind def
-
+%
% En cours...
/BESSEL_Yn {dup 0 eq {pop BESSEL_Y0}{dup 1 eq {pop BESSEL_Y1}{
exch dup BESSEL_Y0 exch dup BESSEL_Y1 exch 2 exch Div {
mul 3 -1 roll mul 2 index sub pstack} for
} ifelse } ifelse } bind def
-
+%
+/SIMPSON { 1 dict begin %% on stack a b var f ierr Dominik Rodriguez
+ 3 index 5 index sub % compute h
+ 1 % a b var f ierr h n
+ 4 index 7 index def 3 index exec % a b var f ierr h n f(a)
+ 5 index 7 index def 4 index exec add % a b var f ierr h n f(a)+f(b)
+ 5 index 8 index 4 index 2 div add def 4 index exec % a b var f ierr h n f(a)+f(b) f(a+h/2)
+ exch 1 index 4 mul add 0 % a b var f ierr h n old=f(a+h/2) Estim=f(a)+f(b)+4f(a+h/2) NbLoop
+ { % a b var f ierr h n old Estim NbLoop
+ 5 -1 roll 2 div dup 6 1 roll % h<-h/2
+ 5 -1 roll 2 mul 5 1 roll % n<-2n
+ % a b var f ierr h n old Estim NbLoop h
+ 2 div 10 index add 0 % a b var f ierr h n old Estim NbLoop a+h/2 Cumul
+ 5 index {
+ 1 index 10 index exch def 8 index exec add exch 6 index add exch
+ } repeat % a b var f ierr h n old Estim NbLoop a+nh/2 Cumul
+ exch pop % a b var f ierr h n old Estim NbLoop New
+ 2 index 1 index 4 mul 6 -1 roll 2 mul sub sub % a b var f ierr h n Estim NbLoop New Diff
+ 4 -1 roll 2 mul 1 index sub 4 1 roll % a b var f ierr h n Estim NbLoop New Diff
+ exch 4 1 roll % a b var f ierr h n old Estim NbLoop Diff
+ 5 index 6 div mul abs 6 index lt { exit } if
+ 1 add dup 9 eq { exit } if
+ } loop % a b var f ierr h n old Estim NbLoop
+ exch 5 -1 roll 6 div mul mark 10 2 roll cleartomark
+end
+} def
+%
+%
% END pst-math.pro