Avoid taking root of negative number in symv_thread.c
This is similar to fixes in but there was one remaining
occurance of this type of pattern in the driver/level2/*_thread.c
files.
@@ -166,7 +166,11 @@ int CNAME(BLASLONG m, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG i
if (nthreads - num_cpu > 1) {
double di = (double)i;
- width = ((BLASLONG)(sqrt(di * di + dnum) - di) + mask) & ~mask;
+ if (di * di - dnum > 0) {
+ width = ((BLASLONG)(-sqrt(di * di - dnum) + di) + mask) & ~mask;
+ } else {
+ width = m - i;
+ }
if (width < 4) width = 4;
if (width > m - i) width = m - i;
