MoreMathLogOnePlus Method

Computes log(1+x).

Definition

Namespace: Meta.Numerics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static double LogOnePlus(
	double x
)

Parameters

x  Double
The argument.

Return Value

Double
The value of log(1+x).

Remarks

If x is close to 0, computing log(1+x) by Math.Log(1.0 + x) can result in a significant loss of accuracy. This function maintains full precision of all values of x by switching to a series expansion for values of x near zero.

See Also