These lines appear in the SampleArcTanh listing at the beginning of this section.
Suppose tmp = 0.5 * Log1Plus(2.0 * tmp / (1.0 - tmp));
return CopySign(tmp, x);
tmp
is 3, well outside the domain of arctanh. Then the argument to Log1Plus is
, resulting in the attempt to compute
, an invalid operation. The result is a NaN (with the invalid flag raised as a side effect), which passes through the multiplication by 0.5 unchanged and is assigned to tmp
. Operations on NaNs are defined as straightforwardly as possible. CopySign places the sign of x
onto the NaN in tmp
, and the return
coerces it to a double NaN.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.