naginterfaces.library.zeros.quadratic_​real

naginterfaces.library.zeros.quadratic_real(a, b, c)[source]

quadratic_real determines the roots of a quadratic equation with real coefficients.

For full information please refer to the NAG Library document for c02aj

https://www.nag.com/numeric/nl/nagdoc_27.1/flhtml/c02/c02ajf.html

Parameters
afloat

Must contain , the coefficient of .

bfloat

Must contain , the coefficient of .

cfloat

Must contain , the constant coefficient.

Returns
z_smallcomplex

The smallest root in magnitude.

z_largecomplex

The largest root in magnitude.

Warns
NagAlgorithmicWarning
(errno )

On entry, .

(errno )

On entry, and .

(errno )

On entry, and the root overflows: , and .

(errno )

On entry, and the root overflows: , and .

(errno )

On entry, is so large that is indistinguishable from and the root overflows: , and .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

quadratic_real attempts to find the roots of the quadratic equation (where , and are real coefficients), by carefully evaluating the ‘standard’ closed formula

It is based on the function QDRTC from Smith (1967).

Note: it is not necessary to scale the coefficients prior to calling the function.

References

Smith, B T, 1967, ZERPOL: a zero finding algorithm for polynomials using Laguerre’s method, Technical Report, Department of Computer Science, University of Toronto, Canada