[Numpy-discussion] New ufuncs
Charles R Harris
charlesr.harris@gmail....
Wed Nov 5 00:29:31 CST 2008
On Tue, Nov 4, 2008 at 11:05 PM, T J <tjhnson@gmail.com> wrote:
> On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald
> <aarchiba@physics.mcgill.ca> wrote:
> > 2008/11/5 Charles R Harris <charlesr.harris@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://projects.scipy.org/pipermail/numpy-discussion/attachments/20081104/c794fec5/attachment.html
More information about the Numpy-discussion
mailing list