Function

NumCosmoMathpoly_roots_real_cubic

Declaration [src]

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

Description [src]

Real roots of a genuine cubic ($a_3\neq0$ required), via bracket-and- bisect on its derivative’s (quadratic) real roots — see NcmPolyRoots.

Parameters

a

Type: An array of gdouble

Ascending coefficients $a_0+a_1x+\dots+a_3x^3$, $a_3\neq0$.

The array must have 4 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 3 elements.
The returned data is owned by the function.

Return value

Type: gint

The number of real roots found (1, 2, or 3).