Skip to content

Add implementations of logaddexp and logaddexp2 #249

Closed
@erikbrinkman

Description

@erikbrinkman

logaddexp(x, y) computes (x.exp() + y.exp()).log() more stably than doing those operations naively, and is particularly useful when doing floating point computations in log-space for better precision / stability.

Num-traits seems like the right place for this implementation, which is why I'm opening an issue., but it also seems like most things are just forwarded, so maybe it was decided here to only provide functionality that could be be forwarded, even if things like abs_sub aren't in std.

I'm happy to submit a PR, but wanted to verify that this was desired / in scope before putting more work into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions