add log1mexp and log1pexp functions