Math::Polynomial::Solve, version 2.85, 30 June 2018.
-------------------------------------------------------------------------------
As foretold (but half a year late), version 2.85 warns if you have not set
the coefficient order in your programs.
-------------------------------------------------------------------------------
Coming changes:
By release 3.00 (scheduled for mid-2019), the default order of the the
coefficients of the polynomials will be changed to an ascending order,
to match that of Math::Polynomial. To help with the change, the function
coefficients() is available.
Currently if your polynomial is the cubic x**3 + 3*x**2 + 11* x + 5,
then all functions are called with the polynomials in descending order.
For example,
my @cubic = (1, 3, 11, 5);
my @roots = cubic_roots(@cubic);
To get a jump on the change (or to just have less-confusing code if
you're also using Math::Polynomial), use coefficients(). For example,
coefficients order => 'ascending'; # Same as Math::Polynomial
my @cubic = (5, 11, 3, 1);
my @roots = cubic_roots(@cubic);
After version 3.00 is released, you can still maintain the old order
by calling coefficients():
coefficients order => 'descending'; # Keep it the old way.
my @cubic = (1, 3, 11, 5);
my @roots = cubic_roots(@cubic);
------------------------------------------------------------------------
This package provides a set of functions that find the roots of
polynomials up to degree 4 using the classical methods; a function
for solving polynomials of any degree by an implementation of the
QR Hessenberg algorithm; and functions that implement Sturm's
sequence for counting the number of real, unique roots in a range.
These functions can be exported by name or by tag (:classical, :numeric,
:sturm, and :utility). The utility tag exports the functions that
are used internally and which previously were private to the module.
See the documentation for more information.
Using the classical methods, the cubic may be solved by the method
described by R. W. D. Nickalls, "A New Approach to solving the cubic:
Cardan's solution revealed," The Mathematical Gazette, 77, 354-359, 1993.
Dr. Nickalls has made his paper available at
, one of his
many publications at
The solution for the quartic is based on Ferrari's method, as described
in the web page Karl's Calculus Tutor,
.
INSTALLATION:
The usual way. Unpack the archive:
gzip -d Math-Polynomial-Solve-2.85.tar.gz
tar xvf Math-Polynomial-Solve-2.85.tar
Go into the resulting directory, and type:
perl Build.PL
Build
Run the tests:
Build test
Install the module:
Build install
Copyright (c) 2015 John M. Gamble. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same
terms as Perl itself.