Re: Proposal: Trigonometric functions in degrees - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: Trigonometric functions in degrees
Date
Msg-id 2997.1453580534@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: Trigonometric functions in degrees  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> On Sat, Jan 23, 2016 at 12:08:40PM -0500, Tom Lane wrote:
>> So I pushed that, and tern/sungazer are still failing.  Noah, could you
>> trace through that and see exactly where it's going off the rails?

> The second sin() is a constant, so gcc computes it immediately but sends the
> first sin() to libm.  The libm sin() is slightly more accurate.

Ugh.  "compile-time simplification uses different version of sin()" was
one of the theories I had in mind, but I was hoping that wasn't it
because it'd be the hardest to work around reliably.  Still, I think it's
doable by caching the results of the should-be-constant subexpressions.
Will get on it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Proposal: Trigonometric functions in degrees
Next
From: Peter Eisentraut
Date:
Subject: Re: Proposal: Trigonometric functions in degrees