[Cfp-interest] Functions and infinity

Fred J. Tydeman tydeman at tybor.com
Sun Jun 17 17:48:14 PDT 2018


An action item I have had for some time.

IEEE 754 vs 18661 (and C17) for infinity

roundeven - ok
round - ok
trunc - ok
ceil - ok
floor - ok
rint - ok

nextup - ok
nextdown - ok
remainder - 
  754: remainder(x,inf) for finite x; 
  cfp: x not infinite
   => x=NaN is different.

  754: remainder(x,inf) for finite normal x
  cfp: x not infinite

  754: remainder(subnormal,inf) signals underflow
  cfp: x not infinite
remquo - Not in 754.

quantize - ok
quantum - ok

scaleb - ok
logb - ok

fadd - ok
fsub - ok
fmul - ok
fdiv - ok
sqrt - ok
fma - ok
convertfromint - ok

fromfp - ok
ufromfp - ok
fromfpx - ok
ufromfpx - ok
lround - ok

canonicalize - ok

scanf,... - ok
printf,... - ok

copy - ok
negate - ok
fabs - ok
copysign - ok

encode - ok
decode - ok

compares - ok

is754* - ok

fpclassify - ok (except for sign; except for qNaN vs sNaN)
signbit - ok
isnormal - ok
isfinite - ok
iszero - ok
issubnormal - ok
isinf - ok
isnan - ok
issignaling - ok
iscanonical - ok
iseqsig - ok
samequantum - ok

radix - ok

totalorder - differ for NaN payloads
totalordermag - differ for NaN payloads

payload - ok for inf; differ on error return

*flags - ok
*rounddir - ok
*modes - ok

================

exp - ok
expm1 - ok
exp2 - ok
exp2m1 - ok
exp10 - ok
exp10m1 - ok
log - ok
log2 - ok
log10 - ok
logp1 - ok
log2p1 - ok
log10p1 - ok
hypot - ok
rsqrt - ok
compound - 
 754: compound(+inf,0) is 1
 cfp: not explicit

 754: compound(quiet NaN,0) is 1
 cfp: compound(NaN,0) is 1

 754 is missing overflow and underflow
rootn - 
 754 is missing rootn(+/-inf, n) special case
 rootn( 1, n ) special case missing from both
 rootn( 1, 0 ): is it covered by rootn(1,n) or rootn(x,0)?
pown - 
 754 is missing pown(+/-inf, n) special case
pow - 
 754: pow(qNaN,0)
 cfp: pow( NaN,0)

 754: pow(+/-0,-inf) no exception
 cfp: pow(+/-0,-inf) may raise div-by-zero
powr - 
 cfp is missing powr(x,qNaN) is qNaN for x>=0
 cfp is missing powr(qNaN,y) is qNaN
sin - ok
cos - ok
tan - ok
sinpi - ok
cospi - ok
tanpi - ok
asin - ok
acos - ok
atan - ok
atan2 - ok
asinpi - ok
acospi - ok
atanpi - ok
atan2pi - ok
sinh - ok
cosh - ok
tanh - ok
asinh - ok
acosh - ok
atanh - ok

It appears to me that 754 requires intermediate computations to not
overflow or underflow.  That contradicts [1] in 7.12.13b.

reducsum - ok
reducdot - ok
reducsumsq - ok
reducsumabs - ok
scaledprod - ok
scaledprodsum - ok
scaledproddiff - ok

augadd - missing from cfp
augsub - missing from cfp
augmul - missing from cfp

min - missing from cfp
max - missing from cfp
minnummagnum - missing from cfp
maxnummagnum - missing from cfp
minnum=fmin - ok; differ for signed zeros
maxnum=fmax - ok; differ for signed zeros
minnummag=fminmag - ok
maxnummag=fmaxmag - ok


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list