function getZero_double(negSwitches, posSwitches, bVal, double) &
result(zeroWeight)
real(dp), intent(in) :: posSwitches, negSwitches, bVal
type(WeightData_t), intent(in) :: double
real(dp) :: zeroWeight
character(*), parameter :: this_routine = "getZero_double"
ASSERT(negSwitches >= 0.0_dp)
ASSERT(posSwitches >= 0.0_dp)
! UPDATE: cant set it to one, because there are cases, when a 0
! branch comes to a 2 in a double excitation, where one has to
! compare against the -2 branch, which can also be non-zero
! so to have the correct weights, just ignore b
zeroWeight = 1.0_dp + &
(negSwitches * double%G + posSwitches * double%F) / max(1.0_dp, bVal)
ASSERT(zeroWeight >= 0.0_dp)
end function getZero_double