fstats_special_functions Module



Functions

public pure elemental function beta(a, b) result(rst)

Computes the beta function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The first argument of the function.

real(kind=real64), intent(in) :: b

The second argument of the function.

Return Value real(kind=real64)

The value of the beta function at and .

public pure elemental function digamma(x) result(rst)

Computes the digamma function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x

The value at which to evaluate the function.

Return Value real(kind=real64)

The function value.

public pure elemental function incomplete_beta(a, b, x) result(rst)

Computes the incomplete beta function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The first argument of the function.

real(kind=real64), intent(in) :: b

The second argument of the function.

real(kind=real64), intent(in) :: x

The upper limit of the integration.

Return Value real(kind=real64)

The value of the incomplete beta function.

public pure elemental function incomplete_gamma_lower(a, x) result(rst)

Computes the lower incomplete gamma function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The coefficient value.

real(kind=real64), intent(in) :: x

The value at which to evaluate the function.

Return Value real(kind=real64)

The function value.

public pure elemental function incomplete_gamma_upper(a, x) result(rst)

Computes the upper incomplete gamma function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The coefficient value.

real(kind=real64), intent(in) :: x

The value at which to evaluate the function.

Return Value real(kind=real64)

The function value.

public pure elemental function log_regularized_beta(a, b, x, max_iterations) result(rst)

Log regularized beta; invalid inputs or nonconvergence return NaN. The leading factor and complementary branch are evaluated in log space.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

Finite, positive beta shape parameters.

real(kind=real64), intent(in) :: b

Finite, positive beta shape parameters.

real(kind=real64), intent(in) :: x

Integration limit on [0, 1].

integer(kind=int32), intent(in), optional :: max_iterations

Continued-fraction iteration limit; default 1000.

Return Value real(kind=real64)

Log ratio; x = 0 gives -infinity, x = 1 gives zero.

public pure elemental function log_regularized_gamma_lower(a, x, max_iterations) result(rst)

Log lower gamma ratio; invalid inputs or nonconvergence return NaN.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

Finite, positive gamma shape parameter.

real(kind=real64), intent(in) :: x

Nonnegative integration limit; +infinity is accepted.

integer(kind=int32), intent(in), optional :: max_iterations

Series/continued-fraction iteration limit; default 10000.

Return Value real(kind=real64)

Log P(a, x); x = 0 gives -infinity, x = +infinity gives zero.

public pure elemental function log_regularized_gamma_upper(a, x, max_iterations) result(rst)

Log upper gamma ratio; invalid inputs or nonconvergence return NaN.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

Finite, positive gamma shape parameter.

real(kind=real64), intent(in) :: x

Nonnegative integration limit; +infinity is accepted.

integer(kind=int32), intent(in), optional :: max_iterations

Series/continued-fraction iteration limit; default 10000.

Return Value real(kind=real64)

Log Q(a, x); x = 0 gives zero, x = +infinity gives -infinity.

public pure elemental function regularized_beta(a, b, x, max_iterations) result(rst)

Computes the regularized beta function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The first argument of the function.

real(kind=real64), intent(in) :: b

The second argument of the function.

real(kind=real64), intent(in) :: x

The upper limit of the integration.

integer(kind=int32), intent(in), optional :: max_iterations

Iteration limit; nonconvergence returns NaN.

Return Value real(kind=real64)

The value of the regularized beta function.

public pure elemental function regularized_gamma_lower(a, x, max_iterations) result(rst)

Computes the regularized lower incomplete gamma function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The coefficient value. The value must be positive.

real(kind=real64), intent(in) :: x

The value at which to evaluate the function. The value must be non-negative.

integer(kind=int32), intent(in), optional :: max_iterations

Iteration limit; nonconvergence returns NaN.

Return Value real(kind=real64)

The function value, which lies on the interval [0, 1].

public pure elemental function regularized_gamma_upper(a, x, max_iterations) result(rst)

Computes the regularized upper incomplete gamma function.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

The coefficient value. The value must be positive.

real(kind=real64), intent(in) :: x

The value at which to evaluate the function. The value must be non-negative.

integer(kind=int32), intent(in), optional :: max_iterations

Iteration limit; nonconvergence returns NaN.

Return Value real(kind=real64)

The function value, which lies on the interval [0, 1].

public pure elemental function stable_expm1(x) result(rst)

Computes exp(x) - 1 without subtractive cancellation near zero.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x

Exponent argument.

Return Value real(kind=real64)

Difference; overflow gives +infinity and NaN inputs propagate.

public pure elemental function stable_log1p(x) result(rst)

Computes log(1 + x) accurately when x is near zero.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x

Argument on [-1, infinity); NaN inputs propagate.

Return Value real(kind=real64)

Logarithm; x = -1 gives -infinity, x < -1 gives NaN.