9 #include "sll_memory.h"
10 #include "sll_working_precision.h"
35 sll_real64,
dimension(:),
intent(inout) :: x
36 sll_real64,
intent(in) :: mean, mom2
37 sll_real64 :: meanx, mom2x
41 meanx = sum(x)/real(num, f64)
42 mom2x = sum(x**2)/real(num, f64)
44 x = (x - meanx)*sqrt((mom2 - mean**2)/(mom2x - meanx**2)) + mean
48 sll_real64,
dimension(:),
intent(inout) :: x
49 sll_real64,
dimension(:),
intent(in) :: w
50 sll_int32,
intent(in) :: num
51 sll_real64,
intent(in) :: mean, mom2
52 sll_real64 :: meanx, mom2x, sumw
54 meanx = sum(w*x)/real(num, f64)
55 mom2x = sum(w*x**2)/real(num, f64)
56 sumw = sum(w)/real(num, f64)
58 x = (x - meanx/sumw)*sqrt((sumw*mom2 - mean**2)/(sumw*mom2x - meanx**2)) + mean/sumw
!Match mean E[X] and E[X^2] = first and second order moment
!Match mean E[W X] and E[W X^2] = first and second order moment modifies only X, montecarlo estimate ...
subroutine match_moment_1d_linear_real64(x, mean, mom2)
subroutine, public sll_s_match_moment_1d_weight_linear_real64(x, w, mean, mom2, num)