next_exponential_dp Interface

public interface next_exponential_dp

Draw an exponential deviate with the given mean.

Inverse transform: -mean * log(u) with u uniform in (0, 1]. The uniform is taken as 1 - next_real_dp(gen) rather than next_real_dp(gen) because the latter can return exactly zero, and log(0) is minus infinity. Subtracting from one moves the excluded endpoint to the other side, where it is harmless.

A negative mean is not rejected; it simply mirrors the distribution about zero, which is occasionally what a caller wants.

Calls

interface~~next_exponential_dp~~CallsGraph interface~next_exponential_dp next_exponential_dp proc~pcg32_next_exponential_dp pcg32_next_exponential_dp interface~next_exponential_dp->proc~pcg32_next_exponential_dp proc~splitmix64_next_exponential_dp splitmix64_next_exponential_dp interface~next_exponential_dp->proc~splitmix64_next_exponential_dp interface~next_real_dp next_real_dp proc~pcg32_next_exponential_dp->interface~next_real_dp proc~splitmix64_next_exponential_dp->interface~next_real_dp proc~pcg32_next_real_dp pcg32_next_real_dp interface~next_real_dp->proc~pcg32_next_real_dp proc~splitmix64_next_real_dp splitmix64_next_real_dp interface~next_real_dp->proc~splitmix64_next_real_dp proc~pcg32_next_u64 pcg32_t%pcg32_next_u64 proc~pcg32_next_real_dp->proc~pcg32_next_u64 proc~real_from_word real_from_word proc~pcg32_next_real_dp->proc~real_from_word proc~splitmix64_next_real_dp->proc~real_from_word proc~splitmix64_next_u64 splitmix64_t%splitmix64_next_u64 proc~splitmix64_next_real_dp->proc~splitmix64_next_u64 proc~pcg32_step pcg32_step proc~pcg32_next_u64->proc~pcg32_step proc~splitmix64_next splitmix64_t%splitmix64_next proc~splitmix64_next_u64->proc~splitmix64_next

Module Procedures

private function splitmix64_next_exponential_dp(gen, mean) result(r)

Exponential deviate from a SplitMix64 generator.

Arguments

Type IntentOptional Attributes Name
type(splitmix64_t), intent(inout) :: gen

Generator, advanced by one draw.

real(kind=dp), intent(in) :: mean

Mean of the distribution.

Return Value real(kind=dp)

private function pcg32_next_exponential_dp(gen, mean) result(r)

Exponential deviate from a PCG32 generator.

Arguments

Type IntentOptional Attributes Name
type(pcg32_t), intent(inout) :: gen

Generator, advanced by one draw.

real(kind=dp), intent(in) :: mean

Mean of the distribution.

Return Value real(kind=dp)