next_normal_dp Interface

public interface next_normal_dp

Draw a normal deviate with mean mu and standard deviation sigma.

Box-Muller. The transform naturally yields two independent deviates per pair of uniforms, and the usual implementation caches the second for the next call. This one discards it.

That halves the throughput and is deliberate. A cache makes the generator state depend on whether the call count is odd or even, so two runs that draw the same number of normals but interleave them differently with other draws diverge. Without it, the generator’s position is a plain function of how many times it has been asked for anything, which is far easier to reason about – and it keeps this function pure in spirit: no hidden state between calls.

Calls

interface~~next_normal_dp~~CallsGraph interface~next_normal_dp next_normal_dp proc~pcg32_next_normal_dp pcg32_next_normal_dp interface~next_normal_dp->proc~pcg32_next_normal_dp proc~splitmix64_next_normal_dp splitmix64_next_normal_dp interface~next_normal_dp->proc~splitmix64_next_normal_dp interface~next_real_dp next_real_dp proc~pcg32_next_normal_dp->interface~next_real_dp proc~splitmix64_next_normal_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_normal_dp(gen, mu, sigma) result(r)

Normal deviate from a SplitMix64 generator.

Arguments

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

Generator, advanced by exactly two draws.

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

Mean.

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

Standard deviation.

Return Value real(kind=dp)

private function pcg32_next_normal_dp(gen, mu, sigma) result(r)

Normal deviate from a PCG32 generator.

Arguments

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

Generator, advanced by exactly two draws.

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

Mean.

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

Standard deviation.

Return Value real(kind=dp)