Posts

Showing posts from February, 2013

NAG Routines in Different Precisions

Written by David Sayers, NAG Principal Technical Consultant


How would you like to call a NAG routine and have the precision it computes in determined by the precision of the arguments? So, for example, your program might contain: r = s15adf(x,ifail) If x were single precision then a single precision would be returned to r. If x were double or quadruple precision then the corresponding double or quadruple computations would be performed. I can imagine a number of scenarios where this facility might be useful, but I invite your comments on how common these might be:
Single precision might be useful as once again single precision calculation becomes faster than double precision. So the user might want to trade accuracy for speed.Secondly, single precision used to be the natural interface to many graphics packages. I am not sure whether this is still the case. Would it be useful to have the capability for this reason?Double precision, the precision now offered, is generally ‘about right’ fo…