New implementations of erf and lgamma based on SPECFUN package so that 16-bit builds are now possible.