Elementary mathematical functions
Factorial of integer n; wrapper around intrinsic gamma function. Output is real to increase overflow threshold. For overflow case, result = Infinity; for n < 0, result = NaN.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
Integer to take the factorial of |
Gaussian exp[-(x-x0)^2/wx^2]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=FP), | intent(in) | :: | x0 |
Center of Gaussion |
||
| real(kind=FP), | intent(in) | :: | wx |
Width of Gaussion |
||
| real(kind=FP), | intent(in) | :: | x |
Position where Gaussian is evaluated |
Smooth step function based on hyperbolic tangent
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=FP), | intent(in) | :: | x0 |
Position of center of step |
||
| real(kind=FP), | intent(in) | :: | x |
Position where function is evaluated |
||
| real(kind=FP), | intent(in), | optional | :: | wx |
Width of step, if set to zero yields heaviside function |
Heaviside function, i.e. discontinuous step function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=FP), | intent(in) | :: | x0 |
Position of step |
||
| real(kind=FP), | intent(in) | :: | x |
Position where function is evaluated |
Smooth step function based on Hermite interpolation exactly zero for x < wx/2 and one for x > wx/2 see https://en.wikipedia.org/wiki/Smoothstep
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=FP), | intent(in) | :: | x0 |
Position of step |
||
| real(kind=FP), | intent(in) | :: | x |
Position where function is evaluated |
||
| real(kind=FP), | intent(in), | optional | :: | wx |
Width of step |
|
| integer, | intent(in), | optional | :: | order |
Order of smoothstep function Default value 2 |
Computes binomial coefficient n over k Returns -1 for invalid input, i.e. n or k < 0 or k > n
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
Top number of binomal coefficient |
||
| integer, | intent(in) | :: | k |
Bottom number of binomal coefficient |