fixed.unifiedErrorCalculator.bitsOfError
Syntax
Description
fixed.unifiedErrorCalculator.bitsOfError(
returns the bits of error between the approximate value approxValue
,refValue
)approxValue
and
the reference value refValue
given by
(refValue-approxValue)/eps(approxValue)
.
fixed.unifiedErrorCalculator.bitsOfError(
specifies whether to keep the calculated error as approxValue
,refValue
,keepNaN
)NaN
. By default, to
indicate the calculated error is significant, the function returns Inf
if
the calculated error is NaN
.
Examples
Input Arguments
Algorithms
If both
refValue
andapproxValue
areNaN
,Inf
, or-Inf
, they are treated as equal, and the calculated error is zero.If
approxValue
is floating point, theneps(approxValue)
returns the floating-point relative accuracy.If
approxValue
is an integer data type, theneps(approxValue)
returns1
.If
approxValue
is afi
object, theneps(approxValue)
returns the quantized relative accuracy for thefi
object.
Version History
Introduced in R2023b