Function

NumCosmoMathpoly_roots_real_quartic_or_lower

Declaration [src]

gint
ncm_poly_roots_real_quartic_or_lower (
  const gdouble* a,
  gdouble* roots
)

Description [src]

Same as ncm_poly_roots_real_quartic(), but safe to call with a leading coefficient that turns out to be (numerically) zero: trims from $a_4$ downward, relative to the scale of all five coefficients together, and dispatches to whichever degree is actually genuine. A polynomial with all five coefficients indistinguishable from zero returns 0 roots rather than dividing by zero.

Parameters

a

Type: An array of gdouble

Ascending coefficients $a_0+a_1x+\dots+a_4x^4$.

The array must have 5 elements.
The data is owned by the caller of the function.
roots

Type: An array of gdouble

The real roots found.

The argument will be set by the function.
The array must have 4 elements.
The returned data is owned by the function.

Return value

Type: gint

The number of real roots found (0 to 4).