Re: Slaying the HYPOTamus
| От | Sam Mason |
|---|---|
| Тема | Re: Slaying the HYPOTamus |
| Дата | |
| Msg-id | 20090824175938.GL5407@samason.me.uk обсуждение исходный текст |
| Ответ на | Re: Slaying the HYPOTamus (David Fetter <david@fetter.org>) |
| Ответы |
Re: Slaying the HYPOTamus
|
| Список | pgsql-hackers |
On Mon, Aug 24, 2009 at 07:07:13AM -0700, David Fetter wrote:
> These next two lines are a teensy bit baroque. Is there some
> significant speed increase that would justify them?
Just noticed with your revised code that the following check:
> On Mon, Aug 24, 2009 at 11:14:19PM +1000, Paul Matthews wrote:
> > if (x == 0.0)
> > return 0.0;
> > else {
> > yx = y/x;
is preventing a divide by zero on the line above. So it's not a
performance hack, it's just allowing it to remain correct as a result of
changing the maths around.
> > return x*sqrt(1.0+yx*yx);
> > }
> > }
-- Sam http://samason.me.uk/
В списке pgsql-hackers по дате отправления: