The logarithm of the normal density, computed directly rather than as
log(dnorm(x)), so it stays finite far into the tails where the
density itself underflows to zero.
Examples
core_normal_logpdf(c(-1, 0, 1))
#> [1] -1.4189385 -0.9189385 -1.4189385
# Identical to stats::dnorm(log = TRUE).
all.equal(core_normal_logpdf(-2:2, 0.3, 1.7),
stats::dnorm(-2:2, 0.3, 1.7, log = TRUE))
#> [1] TRUE
# Still finite where the density itself underflows to zero.
stats::dnorm(50) # 0
#> [1] 0
core_normal_logpdf(50) # about -1251
#> [1] -1250.919