use R's more stable log approach