cubic_roots_rosendo Subroutine

public subroutine cubic_roots_rosendo(parameters, real_roots, complex_roots, flag)

Uses

  • proc~~cubic_roots_rosendo~~UsesGraph proc~cubic_roots_rosendo cubic_roots_rosendo module~yaeos__auxiliar yaeos__auxiliar proc~cubic_roots_rosendo->module~yaeos__auxiliar module~yaeos__constants yaeos__constants module~yaeos__auxiliar->module~yaeos__constants iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env

cubic_roots_rosendo

Description

Solve a cubic polynomial using the trigonometric/Cardano formulation. This alternate implementation evaluates intermediate values in extended precision and returns real roots plus a root-case flag.

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: parameters(4)

Coefficients of .

real(kind=pr), intent(out) :: real_roots(3)

Real roots; unused entries are not populated by this routine.

complex(kind=pr), intent(out) :: complex_roots(3)

Present for interface compatibility; not assigned here.

integer, intent(out) :: flag

-1 for three real roots, 1 for one real root.


Calls

proc~~cubic_roots_rosendo~~CallsGraph proc~cubic_roots_rosendo cubic_roots_rosendo proc~sort sort proc~cubic_roots_rosendo->proc~sort std std proc~sort->std

Variables

Type Visibility Attributes Name Initial
real(kind=16), public :: A
real(kind=16), public :: B
real(kind=16), public :: Q
real(kind=16), public :: R

Cardano intermediate (not the gas constant).

real(kind=16), public :: alp
real(kind=16), public :: bet
real(kind=16), public :: d1
real(kind=16), public :: d2
real(kind=16), public :: d3
real(kind=16), public :: gam
integer, public :: i

Loop/index variable.

real(kind=pr), public, parameter :: pi = atan(1.0_pr)*4.0_pr
real(kind=16), public :: theta