Skip to content

New ufuncs to add... #10

Description

@WarrenWeckesser

Some ideas for ufuncs and gufuncs to add to ufunclab.

  • fsum: sum floating point values while retaining as much precision as possible in the result. See, e.g. numpy.sum not stable enough sometimes (Kahan, math.fsum) numpy/numpy#8786.
    Note: kbnsum, a gufunc that computes the Kahan-Babuska-Neumaier summation, was added in c770a45.
  • barycentric_coords(x, simplex): a gufunc with shape signature that is effectively (n), (n + 1, n) -> (n + 1). x is a point in n-dimensional space, and simplex is a simplex (i.e. n+1 points) in that space.
  • Lehmer mean. Naive implementation is easy. Robust implementation that avoids potential overflow or underflow in intermediate calculations requires a bit more work.

Done:

  • ordered: check that a sequence is increasing, strictly increasing, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions