[Numpy-discussion] New ufuncs

Charles R Harris charlesr.harris at gmail.com
Wed Nov 5 01:29:31 EST 2008


On Tue, Nov 4, 2008 at 11:05 PM, T J <tjhnson at gmail.com> wrote:

> On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald
> <aarchiba at physics.mcgill.ca> wrote:
> > 2008/11/5 Charles R Harris <charlesr.harris at gmail.com>:
> >> Hi All,
> >>
> >> I'm thinking of adding some new ufuncs. Some possibilities are
> >>
> >> expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs:
> >
> > Surely this should be log(exp(a)+exp(b))? That would be extremely useful,
> yes.
> >
>
> +1
>
> But shouldn't it be called 'logadd', for adding values which are stored as
> logs?
>

Hmm... but I'm thinking one has to be clever here because the main reason I
heard for using logs was that normal floating point numbers had insufficient
range. So maybe something like

logadd(a,b) = a + log(1 + exp(b - a))

where a > b ?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081104/c794fec5/attachment.html>


More information about the NumPy-Discussion mailing list