anchor.diff:    curs = 1d0 - stato
     do j = comb_teeth, 1, -1
       !DIR$ FORCEINLINE
  -    dets(j) = pt2_find(curs, pt2_cweight,size(pt2_cweight))
  +    dets(j) = pt2_find(curs, pt2_cweight,size(pt2_cweight), first_det_of_teeth(j), first_det_of_teeth(j+1))
       curs -= comb_step
     end do
   end subroutine
  
positive.code:   
    comb_step =  (1d0 - pt2_cweight(first_det_of_comb-1)) * comb_step
    
    stato = 1d0 - comb_step! + 1d-5
    do i=comb_teeth, 1, -1
      first_det_of_teeth(i) = pt2_find(stato, pt2_cweight, N_det_generators)
      stato -= comb_step
    end do
    first_det_of_teeth(comb_teeth+1) = N_det_generators + 1
  
negative.code: 
   BEGIN_PROVIDER [ double precision, pt2_weight, (N_det_generators) ]
  &BEGIN_PROVIDER [ double precision, pt2_cweight, (N_det_generators) ]
  &BEGIN_PROVIDER [ double precision, pt2_cweight_cache, (N_det_generators) ]
  &BEGIN_PROVIDER [ double precision, comb_step ]
  &BEGIN_PROVIDER [ integer, first_det_of_teeth, (comb_teeth+1) ]
  &BEGIN_PROVIDER [ integer, first_det_of_comb ]
  