otbenchmark.ReliabilityLibrary.ComputeRelativeError

ComputeRelativeError(exact, computed)

Compute relative error between exact and computed.

The relative error is defined by:

relativeError = abs(exact - computed) / abs(exact)

if exact is different from zero.

Parameters:
exact: float

The exact value.

computed: float

The computed value.

Returns:
relativeError: float

The relative error.