function getMinus_overlapLowering(nSwitches, bVal, dat) result(minusWeight)
real(dp), intent(in) :: nSwitches, bVal
type(WeightData_t), intent(in) :: dat
real(dp) :: minusWeight
character(*), parameter :: this_routine = "getMinus_overlapLowering"
ASSERT(nSwitches >= 0.0_dp)
! if at the current spot b is 0, only the -1 branch is technically
! possible and the +1 branch always is forbidden. so i essentially
! just have to check if the -1 branch has a non-zero weight, and
! set the +1 branch to 0 probability
! if non-zero, wird die -1 wahrscheinlichkeit dann eh zu eins
! normalisiert.
if (near_zero(bVal)) then
minusWeight = dat%G * dat%minus + dat%F * (1.0_dp - dat%G) * dat%plus + &
nSwitches * (dat%F * dat%plus + dat%G * (1.0_dp - dat%F) * dat%minus)
else
minusWeight = dat%G * dat%minus + dat%F * (1.0_dp - dat%G) * dat%plus + &
nSwitches / bVal * (dat%F * dat%plus + dat%G * (1.0_dp - dat%F) * dat%minus)
end if
ASSERT(minusWeight >= 0.0_dp)
end function getMinus_overlapLowering