Page 1 of 1

EPS equals 0 problem for single precision

PostPosted: Tue Sep 24, 2013 12:06 am
by alanwilliams1
Hi there,

When I run the tests and examples for single precision, they all fail because EPS is evaluated to zero. I've changed the code manually so that EPS = 5E-8 and it runs correctly.

The double precision tests and examples run fine.

Does anyone know why EPS might be evaluating to zero in the single precision case?

Thanks!
Alan

Re: EPS equals 0 problem for single precision

PostPosted: Tue Nov 26, 2013 3:45 pm
by alanwilliams1
oops. My system is OSX Mavericks, accelerate framework, gcc 4.8 and now 4.9. I think it's something to do with the accelerate framework as I don't have this problem on fedora 19/gcc 4.8 / openblas?

Re: EPS equals 0 problem for single precision

PostPosted: Tue Nov 26, 2013 3:59 pm
by Julien Langou
The main difference with veclib is that (as far as I know) veclib is based of CLAPACK, while most others LAPACK library are based of netlib fortran LAPACK.

There is a MAJOR difference between LAPACK and CLAPACK. For FUNCTION returning a REAL in LAPACK, CLAPACK will always return a DOUBLE PRECISION. (Same for COMPLEX, veclib and CLAPACK will return DOUBLE COMPLEX.)

In FORTAN, if you call CDOT( ) and you use CLAPACK (or veclib) the return value will be a DOUBLE PRECISION. (The standard interface would be REAL.) In C, if you call cdot( ) and you use CLAPACK (or veclib) the return value will be a double. (The standard interface would be float.)

Bottom line if you call SLAMCH(), I think you should expect the return value to DOUBLE PRECISION.

That might be your problem.

This is really a pain, we sent a few emails to Apple so that they address this, and they do not seem interested in fixing this problem.

Julien.