Test randomUniform to verify approximate distribution properties
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine testRandomUniform
!! Test randomUniform to verify approximate distribution properties
logical,dimension(4)::results
integer,parameter::N = 1000000
real(wp),dimension(N)::x
call setRandomSeed(1)
x = randomUniform(N)
results(1) = abs(mean(x))>5.0E-3_wp
results(2) = abs(stDev(x)-sqrt(3.0_wp)**(-1))>5.0E-3_wp
results(3) = any(x> 1.0_wp+epsilon(1.0_wp))
results(4) = any(x<-1.0_wp-epsilon(1.0_wp))
if( any(results) ) error stop "Failed randomUniform check"
end subroutine testRandomUniform