# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.function.polynomial.root

## Class QuarticRootFerrari

• java.lang.Object
• com.numericalmethod.suanshu.analysis.function.polynomial.root.QuarticRootFerrari
• All Implemented Interfaces:
QuarticRoot.QuarticSolver

public class QuarticRootFerrari
extends Object
implements QuarticRoot.QuarticSolver
This is a quartic equation solver that solves $$ax^4 + bx^3 + cx^2 + dx + e = 0$$ using the Ferrari method.
• ### Constructor Summary

Constructors
Constructor and Description
QuarticRootFerrari()
• ### Method Summary

All Methods
Modifier and Type Method and Description
List<Number> solve(double a, double b, double c, double d, double e)
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
List<Number> solve(double a, double b, double c, double d, double e, double epsilon)
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
List<Number> solve(Polynomial polynomial)
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### QuarticRootFerrari

public QuarticRootFerrari()
• ### Method Detail

• #### solve

public List<Number> solve(double a,
double b,
double c,
double d,
double e,
double epsilon)
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
Parameters:
a - a
b - b
c - c
d - d
e - e
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
the list of roots
Wikipedia: Ferrari's solution
• #### solve

public List<Number> solve(double a,
double b,
double c,
double d,
double e)
Description copied from interface: QuarticRoot.QuarticSolver
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
Specified by:
solve in interface QuarticRoot.QuarticSolver
Parameters:
a - a
b - b
c - c
d - d
e - e
Returns:
the list of roots
• #### solve

public List<Number> solve(Polynomial polynomial)
Solve $$ax^4 + bx^3 + cx^2 + dx + e = 0$$.
Parameters:
polynomial - a quartic equation to be solved
Returns:
the roots of the quartic equation
Throws:
IllegalArgumentException - if the polynomial degree is not 4