anchor.diff:    integer, intent(in)            :: i,j,k,l
     integer(key_kind)              :: idx
     type(map_type), intent(inout)  :: map
  +  integer                        :: ii
     real(integral_kind)            :: tmp
  -  PROVIDE ao_bielec_integrals_in_map
  +  PROVIDE ao_bielec_integrals_in_map ao_integrals_cache ao_integrals_cache_min
     !DIR$ FORCEINLINE
     if (ao_overlap_abs(i,k)*ao_overlap_abs(j,l) < ao_integrals_threshold ) then
       tmp = 0.d0
     else if (ao_bielec_integral_schwartz(i,k)*ao_bielec_integral_schwartz(j,l) < ao_integrals_threshold) then
       tmp = 0.d0
     else
  -    if ( (i >= ao_integrals_cache_min) .and. &
  -        (j >= ao_integrals_cache_min) .and. &
  -        (k >= ao_integrals_cache_min) .and. &
  -        (l >= ao_integrals_cache_min) .and. &
  -        (i <= ao_integrals_cache_max) .and. &
  -        (j <= ao_integrals_cache_max) .and. &
  -        (k <= ao_integrals_cache_max) .and. &
  -        (l <= ao_integrals_cache_max) ) then
  -        tmp = ao_integrals_cache(i,j,k,l)
  -    else
  +    ii = l-ao_integrals_cache_min
  +    ii = ior(ii, k-ao_integrals_cache_min)
  +    ii = ior(ii, j-ao_integrals_cache_min)
  +    ii = ior(ii, i-ao_integrals_cache_min)
  +    if (iand(ii, -64) /= 0) then
         !DIR$ FORCEINLINE
         call bielec_integrals_index(i,j,k,l,idx)
  +      !DIR$ FORCEINLINE
         call map_get(map,idx,tmp)
  +      get_ao_bielec_integral = dble(tmp)
  +    else
  +      ii = l-ao_integrals_cache_min
  +      ii = ior( ishft(ii,6), k-ao_integrals_cache_min)
  +      ii = ior( ishft(ii,6), j-ao_integrals_cache_min)
  +      ii = ior( ishft(ii,6), i-ao_integrals_cache_min)
  +      get_ao_bielec_integral = ao_integrals_cache(ii)
       endif
     endif
  -  get_ao_bielec_integral = tmp
   end
   
   
  
positive.code:   END_DOC
    integer, intent(in)            :: i,j,k,l
    integer(key_kind)              :: idx
    type(map_type), intent(inout)  :: map
    real(integral_kind)            :: tmp
    PROVIDE mo_bielec_integrals_in_map mo_integrals_cache
    if ( (i >= mo_integrals_cache_min) .and. &
         (j >= mo_integrals_cache_min) .and. &
         (k >= mo_integrals_cache_min) .and. &
         (l >= mo_integrals_cache_min) .and. &
         (i <= mo_integrals_cache_max) .and. &
         (j <= mo_integrals_cache_max) .and. &
         (k <= mo_integrals_cache_max) .and. &
         (l <= mo_integrals_cache_max) ) then
         get_mo_bielec_integral = mo_integrals_cache(i,j,k,l)
    else
      !DIR$ FORCEINLINE
      call bielec_integrals_index(i,j,k,l,idx)
      !DIR$ FORCEINLINE
      call map_get(map,idx,tmp)
      get_mo_bielec_integral = dble(tmp)
    endif
  end
  
  
negative.code:          !DIR$ FORCEINLINE
           call bielec_integrals_index(i,j,k,l,idx)
           !DIR$ FORCEINLINE
           call map_get(mo_integrals_map,idx,integral)
           ii = l-mo_integrals_cache_min
           ii = ior( ishft(ii,6), k-mo_integrals_cache_min)
           ii = ior( ishft(ii,6), j-mo_integrals_cache_min)
           ii = ior( ishft(ii,6), i-mo_integrals_cache_min)
           mo_integrals_cache(ii) = integral
         enddo
       enddo
     enddo
  