
Hello, there would be interest in adding a floating point accurate summation function like Python's math.fsum() in the form of an ufunc to NumPy? I had a look at the algorithm (http://code.activestate.com/recipes/393090-binary-floating-point-summation-a...) and it looks quite straightforward to implement. I can try to submit a patch for it. Cheers, Daniele

I think that would be great. Technically what you'd want is a "gufunc". -n On Mon, Dec 2, 2013 at 9:44 AM, Daniele Nicolodi <daniele@grinta.net> wrote:
Hello,
there would be interest in adding a floating point accurate summation function like Python's math.fsum() in the form of an ufunc to NumPy?
I had a look at the algorithm (http://code.activestate.com/recipes/393090-binary-floating-point-summation-a...) and it looks quite straightforward to implement. I can try to submit a patch for it.
Cheers, Daniele _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Nathaniel J. Smith Postdoctoral researcher - Informatics - University of Edinburgh http://vorpus.org

related this PR attempts to improve the accuracy of summation: https://github.com/numpy/numpy/pull/3685 but math.fsum gives the exact result so it would a valuable ufunc even when that PR is merged. python3.4 will have yet another accurate summation in the statistics module: http://www.python.org/dev/peps/pep-0450/ On 02.12.2013 19:07, Nathaniel Smith wrote:
I think that would be great. Technically what you'd want is a "gufunc".
-n
On Mon, Dec 2, 2013 at 9:44 AM, Daniele Nicolodi <daniele@grinta.net> wrote:
Hello,
there would be interest in adding a floating point accurate summation function like Python's math.fsum() in the form of an ufunc to NumPy?
I had a look at the algorithm (http://code.activestate.com/recipes/393090-binary-floating-point-summation-a...) and it looks quite straightforward to implement. I can try to submit a patch for it.
Cheers, Daniele _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
Daniele Nicolodi
-
Julian Taylor
-
Nathaniel Smith