We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da6370e commit fde9348Copy full SHA for fde9348
lib/node_modules/@stdlib/math/base/special/cidentityf/benchmark/c/native/benchmark.c
@@ -91,20 +91,17 @@ static float rand_float( void ) {
91
* @return elapsed time in seconds
92
*/
93
static double benchmark( void ) {
94
- float v[ 100 ];
95
float complex x;
96
float complex y;
97
double elapsed;
98
double t;
+ float v;
99
int i;
100
101
- for ( i = 0; i < 100; i++ ) {
102
- v[ i ] = ( 1000.0f*rand_float() ) - 500.0f;
103
- }
104
-
105
t = tic();
106
for ( i = 0; i < ITERATIONS; i++ ) {
107
- x = v[ i%100 ] + v[ i%100 ]*I;
+ v = ( 1000.0f*rand_float() ) - 500.0f;
+ x = v + v*I;
108
y = stdlib_base_cidentityf( x );
109
if ( crealf( y ) != v ) {
110
printf( "unexpected result\n" );
0 commit comments