When eigenvalues are nearly degenerate, numerical accumulation in
the divide-and-conquer merge can push w[i] slightly above zero.
The subsequent sqrt(-w[i]) then produces NaN, which propagates
through the entire eigenvector output of DSYEVD/DSTEDC.
Use fmax(-w[i], 0.0) to safely clamp the sqrt argument, yielding
zero instead of NaN for spuriously positive w[i]. The fmax call
maps to a single vmaxsd instruction on x86_64 with zero overhead.
Add test/test_laed3_nan.c which exercises DSYEVD on a rank-1
perturbed identity matrix designed to create near-degenerate
eigenvalue clusters.