EPS equals 0 problem for single precision

Open discussion regarding features, bugs, issues, vendors, etc.

EPS equals 0 problem for single precision

Postby alanwilliams1 » Tue Sep 24, 2013 12:06 am

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
alanwilliams1
 
Posts: 3
Joined: Mon Sep 23, 2013 11:44 pm

Re: EPS equals 0 problem for single precision

Postby alanwilliams1 » Tue Nov 26, 2013 3:45 pm

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?
alanwilliams1
 
Posts: 3
Joined: Mon Sep 23, 2013 11:44 pm

Re: EPS equals 0 problem for single precision

Postby Julien Langou » Tue Nov 26, 2013 3:59 pm

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.
Julien Langou
 
Posts: 727
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests