Skip to content

Commit f4f0f44

Browse files
authored
Update zscal.c
1 parent d33a9c5 commit f4f0f44

1 file changed

Lines changed: 30 additions & 13 deletions

File tree

kernel/arm/zscal.c

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,39 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
5151

5252
inc_x2 = 2 * inc_x;
5353
if (dummy2 == 0) {
54-
for (i = 0; i < n; i++)
54+
for ( i=0; i<n; i++ )
5555
{
56-
if (da_r == 0.0 && da_i == 0.0)
57-
{
58-
x[ip] = 0.0;
59-
x[ip+1] = 0.0;
60-
}
61-
else
62-
{
63-
temp = da_r * x[ip] - da_i * x[ip+1];
64-
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
65-
x[ip] = temp;
66-
}
56+
if ( da_r == 0.0 )
57+
{
58+
if ( da_i == 0.0 )
59+
{
60+
temp = 0.0;
61+
x[ip+1] = 0.0 ;
62+
}
63+
else
64+
{
65+
temp = - da_i * x[ip+1] ;
66+
x[ip+1] = da_i * x[ip] ;
67+
}
68+
}
69+
else
70+
{
71+
if ( da_i == 0.0 )
72+
{
73+
temp = da_r * x[ip] ;
74+
x[ip+1] = da_r * x[ip+1];
75+
}
76+
else
77+
{
78+
temp = da_r * x[ip] - da_i * x[ip+1] ;
79+
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
80+
}
81+
}
82+
x[ip] = temp;
6783

68-
ip += inc_x2;
84+
ip += inc_x2;
6985
}
86+
7087
return(0);
7188
}
7289
for (i = 0; i < n; i++)

0 commit comments

Comments
 (0)