What is the accuracy of log()? IEEE 754-2008 recommends log() to be "correctly rounded". However, if I run the following:
single(log(single(0.5423648357391357421875)))single(log(double(single(0.5423648357391357421875))))single(log(vpa(0.54236483573913574218751,100)))
There appears to be a >0.5ULP difference for the single precision version of log vs the double/variable versions:
-0.6118164 -0.6118163 -0.6118163
Does MatLab just call the OS's C libraries log/logf function? If that is the case, on Linux, for glibc, errors are specified here: http://www.gnu.org/software/libc/manual/html_node/Errors-in-Math-Functions.html#Errors-in-Math-Functions and logf has 1ULP error, whereas log should have none. But what about on Windows?
Best Answer