%! ps %%% New shake the box explorations (C:\\Documents and Settings\\don\\Desktop\\gonzo\\gonzo.ps) run % use internal gonzo % /realto8dstring is the high level code for the reporting conversion. It % determines the sign and then tests for values too large or too small. % It then goes to processgoodreal for actual report conversions. % A final deferencing is done to provide a unique output string. /realto8dstring {dup 0 lt % test and flag negatives /isneg exch store abs /val exch store % save real as absolute value val 100000000 ge { % report and error trap values (real is too big! )== % that are too large to process real_is_too_big! } if val 0.00000001 le % truncate small numbers to zero {(0.0000000)} {processgoodreal} ifelse % process numbers versus zeros isneg {(-)}{( )} ifelse % create leading space or minus exch mergestr % add leading space or minus 20 string cvs % dereference string to avoid % any possible rude surprises } store % /processgoodreal continues the realto8string processing after numbers too % large and too small have been dealt with. Subprocs are called for tenmillions, % unitsormore, and fractions. Note that log floor cvi tells you the decade % size and position of any positive number. /processgoodreal { val log floor cvi % evaluate decimal location /posn exch store % posn 7 eq {tenmillions} % treat ten millions special {posn 0 ge {unitsormore} % handle >1 as a class {fractions} % handle fractions as a class ifelse } ifelse } store % /tenmillions handles ten millions as a special case needing no reformatting. /tenmillions { val round cvi % use ten millions val as is. 20 string cvs } store % /unitsormore handles units through millions... /unitsormore { /workstring val % scale val as needed to 10-99 megs 1 7 posn sub {10 mul} % this may give more accuracy repeat mul round cvi 20 string cvs store % and convert to string workstring 0 posn 1 add % stuff decimal point getinterval (.) mergestr workstring % post remainder of string posn 1 add workstring length 1 sub posn sub getinterval mergestr 20 string cvs % dereference } store % /fractions handles fractional values /fractions {/workstring val % scale workstring 1 7 posn sub {10 mul} repeat % this may give more accuracy mul round cvi 20 string cvs store % and convert to string (0.) % prepend leading zero and dp posn neg 1 sub % add intermediate zeros {(0) mergestr} repeat workstring mergestr % postpend value 20 string cvs % dereference } store %%%%%%%%%%%% %%%%%%%%%%%%%%% reporting routines for 7 besteff %%%%%%%%%%% %%%%%%%%%%%% /report28 { /curdat exch store /dat28 [ % fundamental curdat 0 get cos curdat 1 get cos sub curdat 2 get cos curdat 3 get cos sub add curdat 4 get cos curdat 5 get cos sub add curdat 6 get cos curdat 7 get cos sub add curdat 8 get cos curdat 9 get cos sub add curdat 10 get cos curdat 11 get cos sub add curdat 12 get cos curdat 13 get cos sub add 4 mul pi div dup /curampl exch store curdat 0 get 3 mul cos curdat 1 get 3 mul cos sub % 3H curdat 2 get 3 mul cos curdat 3 get 3 mul cos sub add curdat 4 get 3 mul cos curdat 5 get 3 mul cos sub add curdat 6 get 3 mul cos curdat 7 get 3 mul cos sub add curdat 8 get 3 mul cos curdat 9 get 3 mul cos sub add curdat 10 get 3 mul cos curdat 11 get 3 mul cos sub add curdat 12 get 3 mul cos curdat 13 get 3 mul cos sub add 4 mul pi div curampl div 3 div curdat 0 get 5 mul cos curdat 1 get 5 mul cos sub % 5H curdat 2 get 5 mul cos curdat 3 get 5 mul cos sub add curdat 4 get 5 mul cos curdat 5 get 5 mul cos sub add curdat 6 get 5 mul cos curdat 7 get 5 mul cos sub add curdat 8 get 5 mul cos curdat 9 get 5 mul cos sub add curdat 10 get 5 mul cos curdat 11 get 5 mul cos sub add curdat 12 get 5 mul cos curdat 13 get 5 mul cos sub add 4 mul pi div curampl div 5 div curdat 0 get 7 mul cos curdat 1 get 7 mul cos sub % 7H curdat 2 get 7 mul cos curdat 3 get 7 mul cos sub add curdat 4 get 7 mul cos curdat 5 get 7 mul cos sub add curdat 6 get 7 mul cos curdat 7 get 7 mul cos sub add curdat 8 get 7 mul cos curdat 9 get 7 mul cos sub add curdat 10 get 7 mul cos curdat 11 get 7 mul cos sub add curdat 12 get 7 mul cos curdat 13 get 7 mul cos sub add 4 mul pi div curampl div 7 div curdat 0 get 9 mul cos curdat 1 get 9 mul cos sub % 9H curdat 2 get 9 mul cos curdat 3 get 9 mul cos sub add curdat 4 get 9 mul cos curdat 5 get 9 mul cos sub add curdat 6 get 9 mul cos curdat 7 get 9 mul cos sub add curdat 8 get 9 mul cos curdat 9 get 9 mul cos sub add curdat 10 get 9 mul cos curdat 11 get 9 mul cos sub add curdat 12 get 9 mul cos curdat 13 get 9 mul cos sub add 4 mul pi div curampl div 9 div curdat 0 get 11 mul cos curdat 1 get 11 mul cos sub % 11H curdat 2 get 11 mul cos curdat 3 get 11 mul cos sub add curdat 4 get 11 mul cos curdat 5 get 11 mul cos sub add curdat 6 get 11 mul cos curdat 7 get 11 mul cos sub add curdat 8 get 11 mul cos curdat 9 get 11 mul cos sub add curdat 10 get 11 mul cos curdat 11 get 11 mul cos sub add curdat 12 get 11 mul cos curdat 13 get 11 mul cos sub add 4 mul pi div curampl div 11 div curdat 0 get 13 mul cos curdat 1 get 13 mul cos sub % 13H curdat 2 get 13 mul cos curdat 3 get 13 mul cos sub add curdat 4 get 13 mul cos curdat 5 get 13 mul cos sub add curdat 6 get 13 mul cos curdat 7 get 13 mul cos sub add curdat 8 get 13 mul cos curdat 9 get 13 mul cos sub add curdat 10 get 13 mul cos curdat 11 get 13 mul cos sub add curdat 12 get 13 mul cos curdat 13 get 13 mul cos sub add 4 mul pi div curampl div 13 div curdat 0 get 15 mul cos curdat 1 get 15 mul cos sub % 15H curdat 2 get 15 mul cos curdat 3 get 15 mul cos sub add curdat 4 get 15 mul cos curdat 5 get 15 mul cos sub add curdat 6 get 15 mul cos curdat 7 get 15 mul cos sub add curdat 8 get 15 mul cos curdat 9 get 15 mul cos sub add curdat 10 get 15 mul cos curdat 11 get 15 mul cos sub add curdat 12 get 15 mul cos curdat 13 get 15 mul cos sub add 4 mul pi div curampl div 15 div curdat 0 get 17 mul cos curdat 1 get 17 mul cos sub % 17H curdat 2 get 17 mul cos curdat 3 get 17 mul cos sub add curdat 4 get 17 mul cos curdat 5 get 17 mul cos sub add curdat 6 get 17 mul cos curdat 7 get 17 mul cos sub add curdat 8 get 17 mul cos curdat 9 get 17 mul cos sub add curdat 10 get 17 mul cos curdat 11 get 17 mul cos sub add curdat 12 get 17 mul cos curdat 13 get 17 mul cos sub add 4 mul pi div curampl div 17 div curdat 0 get 19 mul cos curdat 1 get 19 mul cos sub % 19H curdat 2 get 19 mul cos curdat 3 get 19 mul cos sub add curdat 4 get 19 mul cos curdat 5 get 19 mul cos sub add curdat 6 get 19 mul cos curdat 7 get 19 mul cos sub add curdat 8 get 19 mul cos curdat 9 get 19 mul cos sub add curdat 10 get 19 mul cos curdat 11 get 19 mul cos sub add curdat 12 get 19 mul cos curdat 13 get 19 mul cos sub add 4 mul pi div curampl div 19 div curdat 0 get 21 mul cos curdat 1 get 21 mul cos sub % 21H curdat 2 get 21 mul cos curdat 3 get 21 mul cos sub add curdat 4 get 21 mul cos curdat 5 get 21 mul cos sub add curdat 6 get 21 mul cos curdat 7 get 21 mul cos sub add curdat 8 get 21 mul cos curdat 9 get 21 mul cos sub add curdat 10 get 21 mul cos curdat 11 get 21 mul cos sub add curdat 12 get 21 mul cos curdat 13 get 21 mul cos sub add 4 mul pi div curampl div 21 div curdat 0 get 23 mul cos curdat 1 get 23 mul cos sub % 23H curdat 2 get 23 mul cos curdat 3 get 23 mul cos sub add curdat 4 get 23 mul cos curdat 5 get 23 mul cos sub add curdat 6 get 23 mul cos curdat 7 get 23 mul cos sub add curdat 8 get 23 mul cos curdat 9 get 23 mul cos sub add curdat 10 get 23 mul cos curdat 11 get 23 mul cos sub add curdat 12 get 23 mul cos curdat 13 get 23 mul cos sub add 4 mul pi div curampl div 23 div curdat 0 get 25 mul cos curdat 1 get 25 mul cos sub % 25H curdat 2 get 25 mul cos curdat 3 get 25 mul cos sub add curdat 4 get 25 mul cos curdat 5 get 25 mul cos sub add curdat 6 get 25 mul cos curdat 7 get 25 mul cos sub add curdat 8 get 25 mul cos curdat 9 get 25 mul cos sub add curdat 10 get 25 mul cos curdat 11 get 25 mul cos sub add curdat 12 get 25 mul cos curdat 13 get 25 mul cos sub add 4 mul pi div curampl div 25 div curdat 0 get 27 mul cos curdat 1 get 27 mul cos sub % 27H curdat 2 get 27 mul cos curdat 3 get 27 mul cos sub add curdat 4 get 27 mul cos curdat 5 get 27 mul cos sub add curdat 6 get 27 mul cos curdat 7 get 27 mul cos sub add curdat 8 get 27 mul cos curdat 9 get 27 mul cos sub add curdat 10 get 27 mul cos curdat 11 get 27 mul cos sub add curdat 12 get 27 mul cos curdat 13 get 27 mul cos sub add 4 mul pi div curampl div 27 div ] store % this is presently distortion only; no amplitude weighting dat28 1 get dup mul % start with 3H dat28 2 get dup mul add dat28 3 get dup mul add dat28 4 get dup mul add dat28 5 get dup mul add dat28 6 get dup mul add dat28 7 get dup mul add dat28 8 get dup mul add dat28 9 get dup mul add dat28 10 get dup mul add dat28 11 get dup mul add dat28 12 get dup mul add % dat28 13 get dup mul add % temp no h27 for exp check sqrt 100 mul /dist28 exch store /dat28 mark dat28 aload pop dist28 ] store } store % report format is (\n\n) print flush % angslist report28 dat28 {realto8dstring ==} forall %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%% end reporting routines %%%%%%%%%%%%%%%%% /realangsfin [ % this is the all zeros final data for .53 11.2042290591 % p1s 12.4905319207 % p1e 22.4525477004 % p2s 24.9806655448 % p2e 33.7881350824 % p3s 37.4682808414 % p3e 45.2516393413 % p4s 49.9470192811 % p4e 56.8780123572 % p5s 62.4024934519 % p5e 68.6910801478 % p6s 74.8080801604 % p6e 80.6964035956 % p7s 87.1238700988 % p7e ] store realangsfin report28 dat28 {realto8dstring ==} forall % verifies as six leading zeros of distortion and ( 0.53000016) amplitude. % coarse jitter estimator /zock { /totalevents 0 store /zerosumevents 0 store -1 1 1 {/j1 exch store -1 1 1 {/j2 exch store -1 1 1 {/j3 exch store -1 1 1 {/j4 exch store % (.) print flush -1 1 1 {/j5 exch store -1 1 1 {/j6 exch store -1 1 1 {/j7 exch store /pc7 j1 j2 add j3 add j4 add j5 add j6 add j7 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc7 7 add get cvx exec { /j8 exch store /pc8 pc7 j8 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc8 6 add get cvx exec { /j9 exch store /pc9 pc8 j9 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc9 5 add get cvx exec { /j10 exch store /pc10 pc9 j10 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc10 4 add get cvx exec { /j11 exch store /pc11 pc10 j11 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc11 3 add get cvx exec { /j12 exch store /pc12 pc11 j12 add store [{ 1 1 1} { 0 1 1} {-1 1 1} {-1 1 0} {-1 1 -1} ] pc12 2 add get cvx exec { /j13 exch store /pc13 pc12 j13 add store 0 pc13 1 eq {pop -1} if pc13 -1 eq {pop 1} if /j14 exch store % /totalevents totalevents 1 add store % pc13 j14 add 0 eq {/zerosumevents zerosumevents 1 add store} if } for } for } for } for } for } for } for } for } for } for } for } for } for totalevents == zerosumevents == } bind store stopwatchon zock stopwatchoff % takes 38.776 seconds to return 4,782,969 total events and 616,227 zero events. % ratio is 7.76:1 or about eight to one % time to return only zero events? % fixing j8 only -- 4,780,053 events for 616,227 zero events in 33.658 seconds. % fixing j9 ------ 4,745,061 events for 616,227 zero events in 33.448 seconds. % fixing j10 ------ 4,610,925 events for 616,227 zero events in 32.607 seconds % fixing j11 ------ 4,303,125 events for 616,227 zero events in 30.854 seconds % fixing j12 ------ 3,786,345 events for 616,227 zero events in 28.201 seconds. % fixing j13 ------ 3,087,009 events for 616,227 zero events in 26.098 seconds. % fixing j14 ------ 1,029,003 events for 616,227 zero events in 17.946 seconds. % why look at unneeded events? 17.735 seconds without (.) reporting % binding makes it worse???? 1.669 ratio about 5/3? % but DOES preserve total zero events accurately! % rearrangement provided 1,029,003 events for 616,227 zero events in 9.343 seconds. % why excess? % If pc7 is -6, nothing prevents pc8 from going to -7!!! % presently executes 616,227 events for 616,227 zero events in 7.381 seconds. % empty loop time is % EOF