drd/tests/Makefile.am: Use -faligned-new for C++ code if supported
[valgrind.git] / VEX / test / fpspeed.c
blob83996ea235320e1f5f8a331b18bd95eb4b467722
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <math.h>
6 int main ( void )
8 int i, j;
9 double s, r;
10 s = 0.0;
11 double* a1 = malloc(1000 * sizeof(double));
12 double* a2 = malloc(1000 * sizeof(double));
13 for (i = 0; i < 1000; i++) {
14 a1[i] = s;
15 s += 0.3374893482232;
16 a2[i] = s;
19 s = 0.0;
20 r = 0.0;
21 for (j = 0; j < 5000; j++) {
22 for (i = 0; i < 1000; i++) {
23 s += (a1[i] - a2[i]) * (a1[i] + a2[i]) - sqrt(r + 1.0);
24 r += 0.001;
27 printf("s = %f, r = %f\n", s, r );
28 return 0;