SciPy

darkhistory.utilities.log_1_plus_x

darkhistory.utilities.log_1_plus_x(x)

Computes log(1+x) with greater floating point accuracy.

Unlike scipy.special.log1p, this can take float128. However the performance is certainly slower. See [1]_ for details. If that trick does not work, the code reverts to a Taylor expansion.

Parameters:
xfloat or ndarray

The input value.

Returns:
ndarray

log(1+x).

This Page