anchor.diff:      end do
       xs = exp(xs)
       
  -    fxs = lfwa(xs)
  +    fxs = log_fwa(xs)
       ! find amax such that the weight in the integral - fwa(alpha) - is maximal
       i = maxloc(fxs,1,fxs < largest)
       amax = xs(i)
  
positive.code:     end do
      xs = exp(xs)
      
      fxs = lfwa(xs)
      amax = xs(maxloc(fxs,1,fxs < largest))
      log_fpxa_amax = log_fpxa(amax)
      fpa_amax = fpa(amax)
  
negative.code:     
    end function fpa
  
    elemental real(real64) function log_fwa(alpha)
      ! un-normalized weight for alpha in the integrals; prop. to p(alpha|x)
      use dirichlet_mod, only: log_fpxa
  
      real(real64), intent(in) :: alpha
  
      log_fwa = log(fpa(alpha)) - log(fpa_amax) + log_fpxa(alpha) - log_fpxa_amax
  
    end function log_fwa
  
    subroutine compute_integration_range()
      use dirichlet_mod, only: log_fpxa
  