Better adaptive rejection sampling - now on log scale and on normal scale, whichever is possible