% Test generalized eigenvalue function - symmetric matrices function t = test_eig5 % First the float version t1all = 1; for i=2:4:100 a = float(randn(i)); a = a + a'; b = float(randn(i)); b = b*b'; [v,d] = eig(a,b); emat = a*v - b*v*d; er = max(abs(emat(:))); bnd = 10*max(abs(eig(b)))*max(diag(abs(d)))*feps*i; t1 = (er < bnd); if (~t1) printf('test failed: er = %e bnd = %e (num %d)\n',er,bnd,i); end g = eig(a,b); e2 = max(abs(sort(g)-sort(diag(d)))); tb = e2