Test randomNormal 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 testRandomNormal
!! Test randomNormal to verify approximate distribution properties
logical,dimension(4)::results
integer,parameter::N = 1000000
real(wp),dimension(N)::x
call setRandomSeed(1)
x = randomNormal(N)
results(1) = abs(mean(x))>5.0E-3_wp
results(2) = abs(stdev(x)-1.0_wp)>5.0E-3_wp
results(3) = any(x> 6.0_wp+12.0_wp*epsilon(1.0_wp))
results(4) = any(x<-6.0_wp-12.0_wp*epsilon(1.0_wp))
if( any(results) ) error stop "Failed randomNormal check"
end subroutine testRandomNormal