Re: Review: Patch for phypot - Pygmy Hippotause

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Review: Patch for phypot - Pygmy Hippotause
Дата
Msg-id 27598.1279464632@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Review: Patch for phypot - Pygmy Hippotause  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> No. If x is 1e8 * y, then y will only affect the result in the 16th
> place. You can see this if you do a simple series expansion:

> sqrt(1+yx^2) = 1 + 1/2 yx^2 + O(yx^4)

Sigh, I went looking for that expansion yesterday and didn't find it.
Should've tried harder.  I was relying on a gut feeling that it would
behave approximately like ln(1+x).

> For most cases, the new algorithm is no more accurate than the old
> one. The exception is when *both* x and y are very small. In this
> case, it protects against incorrect underflows to 0.

Yeah, I think you're right.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: dividing money by money
Следующее
От: Tom Lane
Дата:
Сообщение: Parsing of aggregate ORDER BY clauses