[PATCH]: Remove special case for log(e) -> 1

Richard Guenther richard.guenther@gmail.com
Mon Dec 29 17:09:00 GMT 2008


On Tue, Dec 23, 2008 at 5:08 PM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> Prior to the MPFR integration, GCC had a bunch of code to handle
> special-case values for various math functions, e.g. sin(0), atan(1),
> exp(0), etc.
>
> I removed most of them once MPFR was available to solve every case.
> However one got left behind, it was for solving log(e) -> 1.  This case
> was protected by -ffast-math because at low precision (i.e. float) logf(e)
> actually should resolve to 0.9999... due to truncation of 'e'.  (The
> higher precisions (double, long double) did actually return exactly 1).
> Removing this bit of code can be considered a bugfix since it increases
> the accuracy of the result.
>
> In doing so, there were a couple of tests that assumed all precisions of
> log{,f,l} functions resolved to exactly 1 and had to be removed.
>
> Tested on mainline and 4.3 branch on x86_64-unknown-linux-gnu, no
> regressions.  (The 4.3 version is slightly different because "dconste" was
> renamed to "dconst_e()", but is otherwise the same).
>
> Okay for mainline and 4.3?

Ok for 4.5 - this is not a bug nor a regression and so not appropriate at this
stage or for the branch.

Thanks,
Richard.



More information about the Gcc-patches mailing list