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.
common_interface.h declares slamc3 as returning FLOATRET when
NEED_F2CCONV is enabled, but laed3_single.c and laed3_parallel.c
redeclared LAMC3 as returning FLOAT. This causes conflicting-type
errors in MinGW builds.
Use FLOATRET for the local LAMC3 prototype so it matches the shared
declaration. Also undefine the Windows max macro before the local
max definition in laed3_parallel.c to avoid macro redefinition
warnings.