/[opencvs]/eyes/table_based_stuff/gensin.c
ViewVC logotype

Contents of /eyes/table_based_stuff/gensin.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri Nov 4 02:27:03 2011 UTC (8 years, 8 months ago) by hib
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
GPU - got the sin to work better but alas.  The 6770 does not do double precision
I will try to rework with single precision.

1 #include <stdio.h>
2 #include <math.h>
3
4 #define PI 3.1415926535897932384626433832795028
5
6 int main() {
7 double twopi = PI*2.0;
8 double constant = twopi / (512.);
9 constant = constant / (1024.);
10 constant = constant / (1024.);
11
12 int size= 1024*1024*512;
13 int i;
14 for (i=0;i<size;i++) {
15 double x;
16 x=sin(((double)(i)) * constant);
17 fwrite(&x,sizeof(double),1,stdout);
18 }
19 }

  ViewVC Help
Powered by ViewVC 1.1.26