[PATCH]: PR middle-end/30447 handle builtin csin

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Sat Jan 20 15:05:00 GMT 2007


On Fri, 19 Jan 2007, Ian Lance Taylor wrote:

> "Richard Guenther" <richard.guenther@gmail.com> writes:
>
> > As to the required precision you only need one more bit to compensate
> > for one intermediate rounding step.
>
> My understanding is that for some operations you need two guard bits
> and a sticky bit.  You can increase the precision of the intermediate
> operations all you want, but without a sticky bit you may not get the
> exact rounded result if all the extra bits are 1.
>
> http://docs.sun.com/source/806-3568/ncg_goldberg.html
>
> But I am not an expert either.
>
> Whether we care about a rare 1 ULP error in the implementation of csin
> is a different question.
> Ian

Thanks for the URL, it was informative.

However my understanding of MPFR math (mult in this case) is that it
handles the intricacies of getting the result exact given the supplied
aguments.  However I think it assumes that the arguments you supply are
exact as well.  In this case we have intermediate values of
sin/cos/sinh/cosh that are rounded to some precision we decide upon before
being multiplied once.

Assuming the mult is correctly calculated and exactly rounded, wouldn't
one extra bit in the intermediate values (as Richard suggested) be
sufficient to yield the same result after rounding as if the intermediate
values had infinite precision?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list