parquet_debug_normal_path Subroutine

public subroutine parquet_debug_normal_path(seed, i, draw, portable, x, path, pairs)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: seed

the stream family's seed

integer(kind=int64), intent(in) :: i

stream index

integer(kind=int64), intent(in) :: draw

1-based value index

logical, intent(in) :: portable

.true. for the polar form, .false. Ziggurat

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

the draw, equal to the ordinary call's

integer(kind=int32), intent(out) :: path

1 rectangle, 2 wedge, 3 tail

integer(kind=int64), intent(out) :: pairs

word pairs the rejection loop consumed


Source Code

    subroutine parquet_debug_normal_path(seed, i, draw, portable, x, path, pairs)
        integer(int64), intent(in) :: seed          !! the stream family's seed
        integer(int64), intent(in) :: i             !! stream index
        integer(int64), intent(in) :: draw          !! 1-based value index
        logical, intent(in) :: portable             !! `.true.` for the polar form, `.false.` Ziggurat
        real(real64), intent(out) :: x              !! the draw, equal to the ordinary call's
        integer(int32), intent(out) :: path         !! 1 rectangle, 2 wedge, 3 tail
        integer(int64), intent(out) :: pairs        !! word pairs the rejection loop consumed
        ! `draw_or_1` rather than `draw`, so a clamped draw reports what the ordinary call does.
        ! Without it, `draw = 0` derives label 0 here and label 1 there, and the hook silently
        ! describes a different construction than the one it is meant to observe.
        if (portable) then
            path = 1
            call polar_normal(pf_random_key(pf_random_key(seed, normal_polar_label), draw_or_1(draw)), &
                              i, 1_int64, x, pairs)
        else
            call zig_normal(pf_random_key(pf_random_key(seed, normal_zig_label), draw_or_1(draw)), &
                            i, 1_int64, x, pairs, path)
        end if
    end subroutine parquet_debug_normal_path