Module ppm_module_util_cubeq_real

This module provides the routines that solve cubic equations with real roots.

Defined Types

name description

no types

Defined Module Interfaces

name description

ppm_util_cubeq_real

Defined Module Subroutines

name description

no subroutines

Interface ppm_util_cubeq_real

Subroutines contained in this interface:

name description

ppm_util_cubeq_real_s

This routine solves a cubic equation using the

ppm_util_cubeq_real_d

This routine solves a cubic equation using the

Subroutine ppm_util_cubeq_real_d

This routine solves a cubic equation using the explicit solution formula of Cardano. The equation must only have REAL roots. If complex roots are found, the routine returns info = ppm_error_error and exits.

[Note]Note

Two roots that are closer together than ppm_eps are considered equal and returned as exact bit-copy in order to allow comparisons outside this routine.

[Note]Note

For ppm_debug .GT. 1 the routine checks its own result. Maybe - after some time - this can be removed.

Arguments

name type dimension intent optional description

coef

real array

(4)

(IN)

Coefficients. The equation being solved is:

roots

real array

(3)

(OUT)

Contains the three real roots

qtol

real

(OUT)

Numerical tolerance (estimated) of result.

info

integer

(OUT)

Return status, ppm_error_error if it has complex roots

coef

real array, (4), (IN)

Coefficients. The equation being solved is:

coef(4)*x^3+coef(3)*x^2+coef(2)*x+coef(1) = 0
roots

real array, (3), (OUT)

Contains the three real roots

qtol

real, , (OUT)

Numerical tolerance (estimated) of result.

info

integer, , (OUT)

Return status, ppm_error_error if it has complex roots

Used Modules

ppm_module_data, ppm_module_error, ppm_module_write, ppm_module_substop, ppm_module_substart

Subroutine ppm_util_cubeq_real_s

This routine solves a cubic equation using the explicit solution formula of Cardano. The equation must only have REAL roots. If complex roots are found, the routine returns info = ppm_error_error and exits.

[Note]Note

Two roots that are closer together than ppm_eps are considered equal and returned as exact bit-copy in order to allow comparisons outside this routine.

[Note]Note

For ppm_debug .GT. 1 the routine checks its own result. Maybe - after some time - this can be removed.

Arguments

name type dimension intent optional description

coef

real array

(4)

(IN)

Coefficients. The equation being solved is:

roots

real array

(3)

(OUT)

Contains the three real roots

qtol

real

(OUT)

Numerical tolerance (estimated) of result.

info

integer

(OUT)

Return status, ppm_error_error if it has complex roots

coef

real array, (4), (IN)

Coefficients. The equation being solved is:

coef(4)*x^3+coef(3)*x^2+coef(2)*x+coef(1) = 0
roots

real array, (3), (OUT)

Contains the three real roots

qtol

real, , (OUT)

Numerical tolerance (estimated) of result.

info

integer, , (OUT)

Return status, ppm_error_error if it has complex roots

Used Modules

ppm_module_data, ppm_module_error, ppm_module_write, ppm_module_substop, ppm_module_substart

Defined Module Variables

name type dimension description

no variables

Used Modules

has no uses