View Full Version : OpenCL spec -- Table 7.1: Where do the ULP values come from?

11-30-2009, 08:39 AM
Hi --

I'm perusing the OpenCL spec as a source of information regarding modern floating point math specifications. In section 7.4, there is a table (table 7.1) listing the minimum accuracy required of various math functions in the OpenCL API. Each function has a required ULP which must be obeyed.

My question: Where do the ULP values come from? For example, the table calls out that exp(x) must be accurate to within 3 ULPs of the mathematically correct result. Fair enough, but what information was used to create the spec of 3 ULPs? I'm looking for pointers to the literature, estimates based on the "best" implementation of the function, or other considerations which led to this spec.



11-30-2009, 11:43 PM
My understanding is that those specs were a compromise between the ultimate goal of exact and what the hardware vendors could do with reasonable performance. I would expect that over time the requirements will improve in accuracy, with the native and fast versions existing for greater speed. As for implementations, that's a really tricky subject. I know a lot of system math libraries have difficulty meeting those standards across the full range, so it's really quite difficult to get it right. Unfortunately I'm not a numerics guy so I can't be more helpful than that.