diff options
author | e-q <eric.antonio.quintero@gmail.com> | 2016-04-12 11:26:05 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-06-12 12:08:54 -0600 |
commit | 76e2d4751294077cc4cafe155571ead8213133a8 (patch) | |
tree | 3a449a0337c637f1983a7570a3347ccfdaa7c347 /doc | |
parent | 76c27b5d2a28657062b2dcebba062f1941e4955f (diff) | |
download | numpy-76e2d4751294077cc4cafe155571ead8213133a8.tar.gz |
ENH: Add `polyrootval` to numpy.polynomial
As one can easily encounter when working with high-order signal processing
filters, converting a high-order polynomial from its roots to its polynomial
coefficients can be quite lossy, leading to inaccuracies in the filter's
properties.
This PR adds a new function, `polyrootval` - based on `polyval` - that
evaluates a polynomial given a list of its roots. The benefit of calculating it
this way can be seen at scipy/scipy:6059. Some tests are included, as well.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.12.0-notes.rst | 9 | ||||
-rw-r--r-- | doc/source/reference/routines.polynomials.polynomial.rst | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst index 028d77663..0049a1f6f 100644 --- a/doc/release/1.12.0-notes.rst +++ b/doc/release/1.12.0-notes.rst @@ -128,7 +128,7 @@ file that will remain empty (bar a docstring) in the standard numpy source, but that can be overwritten by people making binary distributions of numpy. New nanfunctions ``nancumsum`` and ``nancumprod`` added -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nanfunctions ``nancumsum`` and ``nancumprod`` have been added to compute ``cumsum`` and ``cumprod`` by ignoring nans. @@ -137,6 +137,13 @@ compute ``cumsum`` and ``cumprod`` by ignoring nans. ``np.lib.interp(x, xp, fp)`` now allows the interpolated array ``fp`` to be complex and will interpolate at ``complex128`` precision. +New polynomial evaluation function ``polyvalfromroots`` added +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The new function ``polyvalfromroots`` evaluates a polynomial at given points +from the roots of the polynomial. This is useful for higher order polynomials, +where expansion into polynomial coefficients is inaccurate at machine +precision. + Improvements ============ diff --git a/doc/source/reference/routines.polynomials.polynomial.rst b/doc/source/reference/routines.polynomials.polynomial.rst index 431856622..8194ca867 100644 --- a/doc/source/reference/routines.polynomials.polynomial.rst +++ b/doc/source/reference/routines.polynomials.polynomial.rst @@ -32,6 +32,7 @@ Basics polygrid3d polyroots polyfromroots + polyvalfromroots Fitting ------- |