1 /*! \file
2 
3 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
5 2015, 2016, 2017, 2018
6 University Corporation for Atmospheric Research/Unidata.
7 
8 See \ref copyright file for more info.
9 
10 */
11 #include "config.h"
12 #include <stdlib.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include "netcdf.h"
16 #include "t_srcdir.h"
17 
18 /* The DDS in netcdf classic form is as follows:
19 netcdf test {
20 dimensions:
21 	t = 10 ;
22 	x = 10 ;
23 	y = 10 ;
24 	z = 10 ;
25 variables:
26 	double OneD(x) ;
27 	double TwoD(x, y) ;
28 	double ThreeD(x, y, z) ;
29 	double FourD(x, y, z, t) ;
30 }
31 */
32 
33 /* Use the ThreeD variable */
34 #define VAR "ThreeD"
35 
36 #define X 10
37 #define Y 10
38 #define Z 10
39 
40 #define RANK 3
41 
42 #define ERRCODE 2
43 #define ERR(e) {printf("Error: %s\n", nc_strerror(e)); exit(ERRCODE);}
44 
45 #undef DEBUG
46 
47 /* Setup an odometer */
48 typedef struct Odom {
49     int rank;
50     size_t* index;
51     size_t* stop;
52     size_t* start;
53     size_t* count;
54 } Odom;
55 
56 #ifdef IGNORE
57 static float threeD_data[X*Y*Z];
58 static int dims[RANK] = {X,Y,Z};
59 #endif
60 static float threeD[X][Y][Z];
61 
62 static Odom* odom_create(int rank);
63 static void odom_reclaim(Odom* odom);
64 static void odom_set(Odom* odom, size_t* start, size_t* count);
65 static int odom_more(Odom* odom);
66 static int odom_incr(Odom* odom);
67 static size_t odom_count(Odom* odom);
68 
69 static int check(size_t* start, size_t* count);
70 
71 /* Define whole variable start/count */
72 static size_t start0[RANK] = {0,0,0};
73 static size_t count0[RANK] = {X,Y,Z};
74 
floateq(float f1,float f2)75 static int floateq(float f1, float f2)
76 {
77     float diff = f1 - f2;
78     if(diff > 0 && diff < 0.005) return 1;
79     if(diff < 0 && diff > -0.005) return 1;
80     return 0;
81 }
82 
83 int
main()84 main()
85 {
86     int ncid, varid;
87     int retval;
88     size_t start[RANK];
89     size_t count[RANK];
90     const char* topsrcdir;
91     char url[4096];
92 
93     topsrcdir = gettopsrcdir();
94 
95     strncpy(url,"file://",sizeof(url));
96     strlcat(url,topsrcdir,sizeof(url));
97     strlcat(url,"/ncdap_test/testdata3/test.06",sizeof(url));
98 
99     printf("test_vara: url=%s\n",url);
100 
101     memset((void*)threeD,0,sizeof(threeD));
102 
103     if((retval = nc_open(url, NC_NOWRITE, &ncid)))
104        ERR(retval);
105 
106     if((retval = nc_inq_varid(ncid, VAR, &varid)))
107        ERR(retval);
108 
109     /* test 1: Read the whole variable */
110     memcpy(start,start0,sizeof(start0));
111     memcpy(count,count0,sizeof(count0));
112 
113     if((retval = nc_get_vara_float(ncid,varid,start,count,(float*)threeD)))
114        ERR(retval);
115     if(!check(start,count)) goto fail;
116 
117     /* test 2: Read the slice with X=0 */
118     memcpy(start,start0,sizeof(start0));
119     memcpy(count,count0,sizeof(count0));
120     count[0] = 1;
121 
122     if((retval = nc_get_vara_float(ncid,varid,start,count,(float*)threeD)))
123        ERR(retval);
124     if(!check(start,count)) goto fail;
125 
126     if((retval = nc_close(ncid)))
127        ERR(retval);
128 
129     printf("*** PASS\n");
130     return 0;
131 fail:
132     printf("*** FAIL\n");
133     return 1;
134 }
135 
check(size_t * start,size_t * count)136 static int check(size_t* start, size_t* count)
137 {
138     int ok = 1;
139     Odom* odom = odom_create(RANK);
140     float* result = (float*)threeD;
141     float* expected = (float*)threeD;
142     odom_set(odom,start,count);
143     while(odom_more(odom)) {
144 	size_t offset = odom_count(odom);
145 	if(floateq(result[offset],expected[offset])) {
146 	    fprintf(stderr,"fail: result[%lu] = %f ; expected[%lu] = %f\n",
147 		(long unsigned)offset,result[offset],(long unsigned)offset,expected[offset]);
148 	    ok=0;
149 	}
150         odom_incr(odom);
151     }
152     odom_reclaim(odom);
153     return ok;
154 }
155 
odom_create(int rank)156 static Odom* odom_create(int rank)
157 {
158     Odom* odom = (Odom*)malloc(sizeof(Odom));
159     /* Init the odometer */
160     odom->rank = rank;
161     odom->index = (size_t*)calloc(sizeof(size_t)*rank,1);
162     odom->stop = (size_t*)calloc(sizeof(size_t)*rank,1);
163     odom->start = (size_t*)calloc(sizeof(size_t)*rank,1);
164     odom->count = (size_t*)calloc(sizeof(size_t)*rank,1);
165     return odom;
166 }
167 
odom_reclaim(Odom * odom)168 static void odom_reclaim(Odom* odom)
169 {
170     free(odom->index);
171     free(odom->stop);
172     free(odom->start);
173     free(odom->count);
174     free(odom);
175 }
176 
177 
odom_set(Odom * odom,size_t * start,size_t * count)178 static void odom_set(Odom* odom, size_t* start, size_t* count)
179 {
180     int i;
181     /* Init the odometer */
182     for(i=0;i<odom->rank;i++) {
183         odom->start[i] = start[i];
184         odom->count[i] = count[i];
185     }
186     for(i=0;i<odom->rank;i++) {
187         odom->index[i] = odom->start[i];
188         odom->stop[i] =  odom->start[i] + odom->count[i];
189     }
190 }
191 
odom_more(Odom * odom)192 static int odom_more(Odom* odom)
193 {
194     return (odom->index[0] < odom->stop[0]?1:0);
195 }
196 
odom_incr(Odom * odom)197 static int odom_incr(Odom* odom)
198 {
199     int i; /* do not make unsigned */
200     if(odom->rank == 0) return 0;
201     for(i=odom->rank-1;i>=0;i--) {
202         odom->index[i]++;
203         if(odom->index[i] < odom->stop[i]) break;
204 	if(i == 0) return 0; /* leave the 0th entry if it overflows*/
205 	odom->index[i] = odom->start[i]; /* reset this position*/
206     }
207     return 1;
208 }
209 
210 /* Convert current dapodometer settings to a single integer count*/
odom_count(Odom * odom)211 static size_t odom_count(Odom* odom)
212 {
213     int i;
214     size_t offset = 0;
215     for(i=0;i<odom->rank;i++) {
216 	offset *= odom->count[i];
217 	offset += odom->index[i];
218     }
219     return offset;
220 }
221 
222 #ifdef IGNORE
223 static float threeD_data[X][Y][Z] = {
224   1, 0.999950000416665, 0.999800006666578, 0.999550033748988,
225     0.999200106660978, 0.998750260394966, 0.998200539935204,
226     0.99755100025328, 0.996801706302619, 0.995952733011994,
227   0.995004165278026, 0.993956097956697, 0.992808635853866, 0.991561893714788,
228     0.990215996212637, 0.988771077936042, 0.987227283375627,
229     0.985584766909561, 0.983843692788121, 0.98200423511727,
230   0.980066577841242, 0.978030914724148, 0.975897449330606, 0.973666395005375,
231     0.97133797485203, 0.968912421710645, 0.966389978134513,
232     0.963770896365891, 0.961055438310771, 0.958243875512697,
233   0.955336489125606, 0.952333569885713, 0.949235418082441, 0.946042343528387,
234     0.942754665528346, 0.939372712847379, 0.935896823677935,
235     0.932327345606034, 0.92866463557651, 0.924909059857313,
236   0.921060994002885, 0.917120822816605, 0.913088940312308, 0.908965749674885,
237     0.904751663219963, 0.900447102352677, 0.896052497525525,
238     0.891568288195329, 0.886994922779284, 0.882332858610121,
239   0.877582561890373, 0.872744507645751, 0.86781917967765, 0.862807070514761,
240     0.857708681363824, 0.852524522059506, 0.847255111013416,
241     0.841900975162269, 0.836462649915187, 0.830940679100164,
242   0.825335614909678, 0.819648017845479, 0.813878456662534, 0.808027508312152,
243     0.802095757884293, 0.796083798549056, 0.789992231497365,
244     0.783821665880849, 0.777572718750928, 0.771246014997107,
245   0.764842187284488, 0.758361875990508, 0.751805729140895, 0.74517440234487,
246     0.738468558729588, 0.731688868873821, 0.724836010740905,
247     0.717910669610943, 0.710913538012277, 0.703845315652236,
248   0.696706709347165, 0.689498432951747, 0.682221207287614, 0.674875760071267,
249     0.667462825841308, 0.659983145884982, 0.652437468164052,
250     0.644826547240001, 0.63715114419858, 0.629412026573697,
251   0.621609968270664, 0.613745749488812, 0.605820156643463, 0.597833982287298,
252     0.589788025031098, 0.581683089463883, 0.573519986072457,
253     0.565299531160354, 0.557022546766217, 0.548689860581588,
254   0.54030230586814, 0.531860721374355, 0.52336595125165, 0.514818844969955,
255     0.506220257232778, 0.497571047891727, 0.488872081860527,
256     0.480124229028534, 0.47132836417374, 0.462485366875301,
257   0.453596121425577, 0.444661516741707, 0.435682446276712, 0.426659807930157,
258     0.417594503958358, 0.408487440884157, 0.399339529406273,
259     0.39015168430823, 0.380924824366882, 0.371659872260533,
260   0.362357754476674, 0.35301940121933, 0.343645746316047, 0.334237727124503,
261     0.324796284438776, 0.315322362395269, 0.305816908378289,
262     0.296280872925319, 0.286715209631956, 0.277120875056558,
263   0.267498828624587, 0.25785003253267, 0.248175451652373, 0.238476053433723,
264     0.228752807808459, 0.219006687093041, 0.209238665891419,
265     0.199449720997573, 0.189640831297834, 0.179812977673,
266   0.169967142900241, 0.160104311554831, 0.150225469911686, 0.140331605846737,
267     0.130423708738146, 0.120502769367367, 0.11056977982007,
268     0.100625733386932, 0.0906716244643097, 0.0807084484548006,
269   0.0707372016677029, 0.0607588812193859, 0.0507744849335792,
270     0.040785011241591, 0.0307914590824661, 0.0207948278030924,
271     0.0107961170582674, 0.000796326710733263, -0.00920354326880834,
272     -0.0192024929016926,
273   -0.0291995223012888, -0.0391936317729877, -0.0491838219141706,
274     -0.0591690937141481, -0.0691484486540619, -0.0791208888067339,
275     -0.089085416936459, -0.099041036598728, -0.108986752239871,
276     -0.118921569296612,
277   -0.128844494295525, -0.138754534952378, -0.148650700271364,
278     -0.158532000644198, -0.168397447949077, -0.178246055649492,
279     -0.18807683889288, -0.197888814609109, -0.207681001608784,
280     -0.217452420681365,
281   -0.227202094693087, -0.236929048684675, -0.246632309968834,
282     -0.256310908227523, -0.26596387560898, -0.275590246824513,
283     -0.285189059245021, -0.294759352997261, -0.304300171059833,
284     -0.313810559358882,
285   -0.323289566863503, -0.332736245680845, -0.342149651150898,
286     -0.35152884194096, -0.360872880139767, -0.370180831351287,
287     -0.379451764788155, -0.388684753364752, -0.397878873789916,
288     -0.407033206659266,
289   -0.416146836547142, -0.425218852098152, -0.4342483461183,
290     -0.443234415665709, -0.452176162140912, -0.461072691376713,
291     -0.469923113727602, -0.47872654415872, -0.487482102334359,
292     -0.496188912705999,
293   -0.504846104599858, -0.513452812303959, -0.522008175154707,
294     -0.530511337622945, -0.538961449399512, -0.547357665480271,
295     -0.555699146250613, -0.56398505756941, -0.572214570852437,
296     -0.580386863155222,
297   -0.588501117255346, -0.59655652173416, -0.60455227105793,
298     -0.612487565658385, -0.62036161201268, -0.628173622722739,
299     -0.635922816594002, -0.643608418713541, -0.651229660527546,
300     -0.658785779918188,
301   -0.666276021279824, -0.673699635594561, -0.681055880507152,
302     -0.688344020399238, -0.695563326462902, -0.702713076773554,
303     -0.70979255636212, -0.716801057286543, -0.723737878702569,
304     -0.730602326933837,
305   -0.737393715541245, -0.744111365391593, -0.750754604725491,
306     -0.757322769224544, -0.763815202077774, -0.770231254047307,
307     -0.776570283533293, -0.782831656638065, -0.789014747229531,
308     -0.795118937003784,
309   -0.801143615546934, -0.807088180396146, -0.81295203709989,
310     -0.818734599277382, -0.824435288677222, -0.830053535235222,
311     -0.835588777131408, -0.841040460846201, -0.846408041215776,
312     -0.851690981486566,
313   -0.856888753368947, -0.862000837090063, -0.867026721445802,
314     -0.871965903851917, -0.876817890394281, -0.881582195878286,
315     -0.886258343877352, -0.890845866780576, -0.895344305839492,
316     -0.899753211213941,
317   -0.904072142017061, -0.90830066635937, -0.912438361391958,
318     -0.916484813348769, -0.920439617587981, -0.924302378632464,
319     -0.928072710209333, -0.931750235288572, -0.935334586120739,
320     -0.938825404273736,
321   -0.942222340668658, -0.945525055614696, -0.948733218843107,
322     -0.951846509540242, -0.954864616379626, -0.95778723755309,
323     -0.960614080800952, -0.963344863441243, -0.965979312397975,
324     -0.968517164228447,
325   -0.970958165149591, -0.973302071063349, -0.975548647581083,
326     -0.977697670047013, -0.979748923560684, -0.981702202998454,
327     -0.983557313034006, -0.985314068157884, -0.986972292696038,
328     -0.988531820827396,
329   -0.989992496600445, -0.991354173948826, -0.992616716705937,
330     -0.993779998618556, -0.994843903359459, -0.995808324539061,
331     -0.996673165716047, -0.997438340407019, -0.998103772095146,
332     -0.998669394237814,
333   -0.999135150273279, -0.999500993626328, -0.999766887712928,
334     -0.999932805943894, -0.99999873172754, -0.999964658471342,
335     -0.999830589582598, -0.999596538468086, -0.999262528532721,
336     -0.998828593177219,
337   -0.998294775794753, -0.997661129766618, -0.996927718456887,
338     -0.996094615206081, -0.99516190332383, -0.994129676080546,
339     -0.992998036698093, -0.991767098339465, -0.990436984097473,
340     -0.989007826982433,
341   -0.987479769908865, -0.985852965681203, -0.984127576978514,
342     -0.982303776338232, -0.980381746138899, -0.978361678581934,
343     -0.97624377567241, -0.974028249198852, -0.971715320712062,
344     -0.969305221502961,
345   -0.966798192579461, -0.964194484642366, -0.961494358060299,
346     -0.958698082843669, -0.955805938617666, -0.952818214594305,
347     -0.949735209543496, -0.946557231763177, -0.943284599048476,
348     -0.939917638659938,
349   -0.936456687290796, -0.932902091033304, -0.929254205344123,
350     -0.925513395008784, -0.921680034105203, -0.917754505966276,
351     -0.913737203141545, -0.909628527357945, -0.90542888947963,
352     -0.901138709466889,
353   -0.896758416334147, -0.892288448107068, -0.88772925177875,
354     -0.883081283265026, -0.878345007358874, -0.873520897683938,
355     -0.868609436647165, -0.863611115390566, -0.858526433742102,
356     -0.8533559001657,
357   -0.848100031710408, -0.842759353958694, -0.83733440097388,
358     -0.831825715246746, -0.826233847641272, -0.820559357339561,
359     -0.814802811785913, -0.808964786630086, -0.803045865669731,
360     -0.797046640792012,
361   -0.790967711914417, -0.784809686924768, -0.778573181620433,
362     -0.772258819646744, -0.765867232434637, -0.759399059137508,
363     -0.752854946567295, -0.746235549129803, -0.739541528759258,
364     -0.73277355485212,
365   -0.72593230420014, -0.719018460922681, -0.71203271639831,
366     -0.704975769195658, -0.697848325003564, -0.690651096560507,
367     -0.683384803583336, -0.676050172695292, -0.668647937353351,
368     -0.66117883777488,
369   -0.653643620863612, -0.646043040134959, -0.63837785564066,
370     -0.630648833892775, -0.622856747787041, -0.615002376525574,
371     -0.607086505538955, -0.599109926407685, -0.591073436783031,
372     -0.582977840307259,
373   -0.574823946533269, -0.566612570843644, -0.55834453436911,
374     -0.550020663906425, -0.541641791835699, -0.533208756037154,
375     -0.524722399807346, -0.516183571774825, -0.507593125815277,
376     -0.49895192096614,
377   -0.490260821340699, -0.481520696041674, -0.47273241907431,
378     -0.46389686925898, -0.455014930143305, -0.446087489913793,
379     -0.437115441307028, -0.428099681520394, -0.419041112122356,
380     -0.409940638962306,
381   -0.400799172079975, -0.391617625614436, -0.38239691771268,
382     -0.373137970437818, -0.363841709676858, -0.354509065048132,
383     -0.345140969808323, -0.335738360759151, -0.326302178153684,
384     -0.316833365602319,
385   -0.307332869978419, -0.297801641323633, -0.288240632752882,
386     -0.278650800359055, -0.269033103117399, -0.259388502789626,
387     -0.249717963827731, -0.24002245327755, -0.230302940682059,
388     -0.220560397984419,
389   -0.21079579943078, -0.20101012147286, -0.191204342670302,
390     -0.181379443592811, -0.171536406722112, -0.161676216353687,
391     -0.151799858498356, -0.141908320783673, -0.13200259235517,
392     -0.122083663777433,
393   -0.112152526935055, -0.102210174933442, -0.0922576019995117,
394     -0.0822958033822624, -0.0723257752532545, -0.0623485146069917,
395     -0.0523650191612259, -0.0423762872571815, -0.0323833177597247,
396     -0.0223871099574771,
397   -0.0123886634628906, -0.00238897811228154, 0.0076109461341479,
398     0.0176101092923073, 0.0276075114542115, 0.0376021528879766,
399     0.0475930341377878, 0.057579156123846, 0.0675595202422752,
400     0.0775331284649787,
401   0.0874989834394464, 0.0974560885884857, 0.10740344820988,
402     0.117340067575955, 0.127264953033056, 0.137177112100907,
403     0.147075553571863, 0.156959287610023, 0.166827325850222, 0.176678681496857,
404   0.186512369422576, 0.196327406266778, 0.206122810533958, 0.215897602691854,
405     0.225650805269396, 0.235381442954451, 0.245088542691362,
406     0.254771133778243, 0.264428247964056, 0.274058919545427,
407   0.283662185463226, 0.293237085398863, 0.302782661870324, 0.312297960327916,
408     0.321782029249722, 0.331233920236754, 0.340652688107789,
409     0.350037390993891, 0.35938709043259, 0.368700851461733,
410   0.37797774271298, 0.387216836504937, 0.396417208935922, 0.405577939976361,
411     0.414698113560782, 0.423776817679428, 0.432813144469452,
412     0.441806190305705, 0.450755055891099, 0.459658846346532,
413   0.468516671300377, 0.477327644977522, 0.48609088628794, 0.494805518914805,
414     0.503470671402114, 0.512085477241841, 0.520649074960579,
415     0.529160608205695, 0.537619225830956, 0.546024081981648,
416   0.554374336179161, 0.562669153405032, 0.570907704184454, 0.57908916466921,
417     0.587212716720073, 0.595277547988606, 0.603282851998404,
418     0.611227828225735, 0.619111682179599, 0.626933625481169,
419   0.634692875942635, 0.642388657645414, 0.650020201017752, 0.657586742911669,
420     0.665087526679283, 0.672521802248466, 0.679888826197857,
421     0.687187861831201, 0.694418179251016, 0.701579055431586,
422   0.70866977429126, 0.715689626764061, 0.722637910870592, 0.729513931788232,
423     0.736317001920619, 0.74304644096641, 0.749701575987307,
424     0.756281741475356, 0.762786279419489, 0.769214539371333,
425   0.77556587851025, 0.781839661707619, 0.788035261590348, 0.794152058603611,
426     0.800189441072806, 0.806146805264716, 0.812023555447886,
427     0.817819103952194, 0.823532871227622, 0.829164285902202,
428   0.83471278483916, 0.840177813193225, 0.845558824466117, 0.850855280561193,
429     0.856066651837255, 0.861192417161521, 0.866232063961728,
430     0.871185088277397, 0.876050994810224, 0.880829296973609,
431   0.885519516941319, 0.890121185695265, 0.894633843072407, 0.899057037810768,
432     0.903390327594559, 0.907633279098413, 0.911785468030717,
433     0.915846479176035, 0.919815906436639, 0.92369335287311,
434   0.927478430744036, 0.931170761544783, 0.934769976045349, 0.938275714327283,
435     0.941687625819678, 0.945005369334228, 0.948228613099346,
436     0.951357034793342, 0.954390321576654, 0.957328170123131,
437   0.960170286650366, 0.962916386949075, 0.965566196411518, 0.968119450058955,
438     0.970575892568149, 0.972935278296897, 0.975197371308593,
439     0.977361945395819, 0.979428784102971, 0.981397680747901,
440   0.983268438442584, 0.985040870112812, 0.986714798516892, 0.98829005626338,
441     0.989766485827815, 0.991143939568469, 0.992422279741117,
442     0.993601378512806, 0.994681117974643, 0.99566139015358,
443   0.996542097023217, 0.997323150513601, 0.998004472520033, 0.998585994910881,
444     0.99906765953439, 0.999449418224499, 0.999731232805658,
445     0.999913075096642, 0.999994926913375, 0.999976780070743,
446   0.999858636383415, 0.999640507665662, 0.999322415730172, 0.998904392385876,
447     0.998386479434759, 0.997768728667684, 0.997051201859214,
448     0.996233970761431, 0.995317117096764, 0.994300732549815,
449   0.993184918758193, 0.991969787302346, 0.990655459694407, 0.989242067366043,
450     0.987729751655308, 0.986118663792513, 0.984408964885101,
451     0.982600825901538, 0.980694427654217, 0.978689960781373,
452   0.976587625728023, 0.974387632725921, 0.972090201772533, 0.96969556260904,
453     0.967203954697364, 0.964615627196218, 0.961930838936196,
454     0.959149858393887, 0.956272963665028, 0.953300442436693,
455   0.95023259195853, 0.947069719013028, 0.943812139884847, 0.940460180329185,
456     0.937014175539204, 0.933474470112512, 0.929841418016701,
457     0.926115382553955, 0.922296736324713, 0.918385861190416,
458   0.914383148235319, 0.910288997727383, 0.906103819078245, 0.901828030802283,
459     0.897462060474762, 0.893006344689077, 0.888461329013091,
460     0.883827467944587, 0.879105224865808, 0.874295071997128,
461   0.869397490349825, 0.864412969677983, 0.859342008429514, 0.854185113696319,
462     0.848942801163572, 0.84361559505816, 0.838204028096251,
463     0.832708641430035, 0.827129984593597, 0.821468615447972,
464   0.815725100125357, 0.809900012972498, 0.803993936493257, 0.798007461290359,
465     0.791941186006336, 0.785795717263661, 0.779571669604088,
466     0.773269665427194, 0.766890334928147, 0.760434316034681,
467   0.753902254343305, 0.747294803054744, 0.740612622908621, 0.733856382117381,
468     0.727026756299476, 0.720124428411794, 0.713150088681373,
469     0.706104434536373, 0.698988170536338, 0.691802008301737,
470   0.684546666442807, 0.677222870487685, 0.669831352809865, 0.662372852554955,
471     0.654848115566766, 0.647257894312724, 0.639602947808631,
472     0.631884041542758, 0.624101947399299, 0.616257443581182,
473   0.608351314532255, 0.600384350858831, 0.592357349250641, 0.584271112401154,
474     0.576126448927319, 0.567924173288695, 0.55966510570601,
475     0.551350072079141, 0.542979903904521, 0.534555438191992,
476   0.526077517381105, 0.517546989256877, 0.50896470686501, 0.500331528426593,
477     0.491648317252275, 0.482915941655938, 0.474135274867862,
478     0.465307194947413, 0.456432584695223, 0.447512331564922,
479   0.43854732757439, 0.429538469216557, 0.420486657369749, 0.411392797207609,
480     0.402257798108573, 0.393082573564941, 0.38386804109152,
481     0.374615122133879, 0.365324741976202, 0.355997829648764,
482   0.346635317835026, 0.337238142778366, 0.327807244188458, 0.318343565147303,
483     0.30884805201492, 0.299321654334707, 0.289765324738495,
484     0.280180018851278, 0.27056669519566, 0.260926315095994,
485   0.251259842582256, 0.241568244293641, 0.231852489381904, 0.222113549414439,
486     0.212352398277126, 0.202570012076944, 0.192767369044364,
487     0.182945449435517, 0.173105235434182, 0.163247711053556,
488   0.153373862037864, 0.14348467576378, 0.13358114114169, 0.123664248516802,
489     0.113734989570117, 0.103794357219253, 0.0938433455191623,
490     0.0838829495627223, 0.0739141653812273, 0.06393798984479,
491   0.0539554205626498, 0.0439674557834159, 0.0339750942952423,
492     0.0239793353259525, 0.0139811784431128, 0.00398162345407974,
493     -0.0060183296939816, -0.0160176810140879, -0.0260154305794408,
494     -0.0360105786234153,
495   -0.0460021256395369, -0.0559890724814288, -0.0659704204627299,
496     -0.0759451714569599, -0.0859123279973325, -0.0958708933764978,
497     -0.105819871746218, -0.115758268216946, -0.125685088957318,
498     -0.135599341293531,
499   -0.145500033808614, -0.155386176441565, -0.16525678058636,
500     -0.17511085919081, -0.184947426855267, -0.194765499931161,
501     -0.204564096619365, -0.214342237068377, -0.2240989434723,
502     -0.233833240168624,
503   -0.243544153735791, -0.253230713090538, -0.262891949585,
504     -0.272526897103582, -0.282134592159557, -0.291714073991427,
505     -0.301264384658992, -0.310784569139144, -0.320273675421368,
506     -0.329730754602944,
507   -0.339154860983835, -0.348545052161256, -0.357900389123914,
508     -0.367219936345908, -0.376502761880283, -0.385747937452222,
509     -0.394954538551871, -0.404121644526792, -0.413248338674028,
510     -0.422333708331768,
511   -0.431376844970621, -0.440376844284454, -0.449332806280839,
512     -0.458243835371038, -0.467109040459569, -0.47592753503331,
513     -0.484698437250152, -0.493420870027184, -0.502093961128397,
514     -0.510716843251906,
515   -0.519288654116686, -0.527808536548793, -0.536275638567084,
516     -0.544689113468413, -0.553048119912302, -0.561351822005071,
517     -0.569599389383433, -0.57778999729752, -0.585922826693367,
518     -0.593997064294812,
519   -0.602011902684824, -0.609966540386242, -0.617860181941925,
520     -0.625692037994295, -0.633461325364275, -0.641167267129602,
521     -0.648809092702519, -0.656386037906838, -0.663897345054353,
522     -0.671342263020609,
523   -0.678720047320012, -0.686029960180282, -0.693271270616224,
524     -0.700443254502829, -0.707545194647683, -0.714576380862692,
525     -0.721536110035093, -0.728423686197768, -0.735238420598841,
526     -0.741979631770551,
527   -0.748646645597399, -0.755238795383558, -0.76175542191954,
528     -0.768195873548125, -0.774559506229517, -0.780845683605749,
529     -0.787053777064324, -0.793183165801068, -0.799233236882215,
530     -0.8052033853057,
531   -0.811093014061656, -0.816901534192113, -0.8226283648499,
532     -0.828272933356724, -0.833834675260437, -0.839313034391484,
533     -0.844707462918517, -0.850017421403178, -0.855242378854046,
534     -0.860381812779727,
535   -0.865435209241112, -0.870402062902767, -0.875281877083464,
536     -0.880074163805853, -0.884778443845253, -0.889394246777581,
537     -0.893921111026392, -0.898358583909032, -0.90270622168191,
538     -0.906963589584872,
539   -0.911130261884677, -0.915205821917566, -0.919189862130932,
540     -0.923081984124074, -0.926881798688036, -0.930588925844528,
541     -0.934202994883924, -0.937723644402332, -0.941150522337732,
542     -0.944483286005189,
543   -0.947721602131112, -0.950865146886587, -0.953913605919758,
544     -0.956866674387264, -0.959724056984716, -0.962485467976237,
545     -0.965150631223029, -0.967719280210989, -0.970191158077357,
546     -0.972566017636408,
547   -0.974843621404164, -0.977023741622146, -0.97910616028015,
548     -0.981090669138045, -0.982977069746599, -0.984765173467324,
549     -0.986454801491336, -0.988045784857242, -0.989537964468031,
550     -0.990931191106986,
551   -0.992225325452603, -0.993420238092527, -0.994515809536489,
552     -0.995511930228257, -0.996408500556594, -0.997205430865212,
553     -0.997902641461745, -0.998500062625715, -0.998997634615504,
554     -0.999395307674325,
555   -0.999693042035206, -0.999890807924959, -0.999988585567158,
556     -0.999986365184122, -0.999884146997886, -0.999681941230185,
557     -0.999379768101426, -0.998977657828671, -0.998475650622611,
558     -0.99787379668355,
559   -0.997172156196378, -0.996370799324562, -0.995469806203119,
560     -0.994469266930611, -0.993369281560131, -0.992169960089301,
561     -0.990871422449267, -0.989473798492712, -0.987977227980866,
562     -0.986381860569534,
563   -0.984687855794127, -0.982895383053711, -0.981004621594066,
564     -0.979015760489763, -0.976928998625255, -0.974744544674989,
565     -0.97246261708254, -0.970083444038766, -0.967607263458988,
566     -0.965034322959201,
567   -0.96236487983131, -0.959599201017404, -0.95673756308306,
568     -0.953780252189686, -0.950727564065908, -0.947579803977993,
569     -0.944337286699328, -0.941000336478938, -0.937569287009064,
570     -0.934044481391795,
571   -0.930426272104753, -0.926715020965855, -0.922911099097119,
572     -0.919014886887564, -0.915026773955164, -0.910947159107888,
573     -0.906776450303821, -0.902515064610368, -0.898163428162546,
574     -0.893721976120377,
575   -0.889191152625361, -0.884571410756073, -0.879863212482849,
576     -0.875067028621594, -0.870183338786697, -0.865212631343072,
577     -0.86015540335732, -0.855012160548026, -0.849783417235186,
578     -0.844469696288772
579 };
580 #endif
581