Skip to content

improve accuracy of logaddexp.reduce #4260

@juliantaylor

Description

@juliantaylor

scipy has the logsumexp function which avoids unnecessary calls to log and thus probably saves a couple ulp of rounding errors.
The underflow avoidance should already be present in numpys current version.

I don't see a reason why we couldn't do this directly in logaddexp.reduce. The only possible issue is that the reduce loop is blocked to a few thousand elements by nditer so the maximum in the kernel is no global maximum. But I don't think that makes a big difference in numeric terms as only the largest terms even contribute to the sum.
But I would appreciate input of an expert in this regard.

A prototype implementation is available here:
https://github.com/juliantaylor/numpy/tree/logaddexp

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy