Post Reply 
HP-71B: 1^Inf Error
06-09-2023, 11:56 AM
Post: #5
RE: HP-71B: 1^Inf Error
The HP-71B is the first handheld to implement the proposed IEEE floating-point math standard.
Back then, IEEE treatment 1^Inf is not defined yet.

Current IEEE treatment of powers edge cases:

(−1.)^(anything, except  NaN) = 1.
(+1.)^(anything, *even* NaN) = 1.

https://en.cppreference.com/w/cpp/numeric/math/pow



But, HP71B IEEE implementation is not perfect ...

>E=1e-9 @ Z=0.
>acos((2,E))
(5.7735026919E-10,-1.31695789692)
>acos((2,Z))
(0,1.31695789692)      ! ???
>acos((2,-Z))
(0,1.31695789692)
>acos((2,-E))
(5.7735026919E-10,1.31695789692)

IEEE correctly implemented, it should be like this:

>>> from cmath import *
>>> E, Z = 1e-9, 0.
>>> acos(complex(2,E))
(5.7735026918962588e-10-1.3169578969248166j)
>>> acos(complex(2,Z))
-1.3169578969248166j
>>> acos(complex(2,-Z))
1.3169578969248166j
>>> acos(complex(2,-E))
(5.7735026918962588e-10+1.3169578969248166j)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-71B: 1^Inf Error - J-F Garnier - 06-09-2023, 08:17 AM
RE: HP-71B: 1^Inf Error - anetzer - 06-09-2023, 08:58 AM
RE: HP-71B: 1^Inf Error - Gilles - 06-09-2023, 10:06 AM
RE: HP-71B: 1^Inf Error - anetzer - 06-09-2023, 11:22 AM
RE: HP-71B: 1^Inf Error - Albert Chan - 06-09-2023 11:56 AM
RE: HP-71B: 1^Inf Error - J-F Garnier - 06-09-2023, 01:03 PM
RE: HP-71B: 1^Inf Error - Albert Chan - 06-09-2023, 02:22 PM
RE: HP-71B: 1^Inf Error - Werner - 06-09-2023, 12:21 PM
RE: HP-71B: 1^Inf Error - rprosperi - 06-09-2023, 11:38 PM
RE: HP-71B: 1^Inf Error - Werner - 06-10-2023, 08:55 AM
RE: HP-71B: 1^Inf Error - rprosperi - 06-10-2023, 12:11 PM
RE: HP-71B: 1^Inf Error - Albert Chan - 06-09-2023, 02:42 PM
RE: HP-71B: 1^Inf Error - J-F Garnier - 06-09-2023, 03:31 PM
RE: HP-71B: 1^Inf Error - Gilles - 06-09-2023, 03:45 PM
RE: HP-71B: 1^Inf Error - Guenter Schink - 06-09-2023, 06:44 PM
RE: HP-71B: 1^Inf Error - EdS2 - 06-09-2023, 07:32 PM
RE: HP-71B: 1^Inf Error - C.Ret - 06-10-2023, 10:50 AM
RE: HP-71B: 1^Inf Error - Gilles - 06-10-2023, 12:08 PM
RE: HP-71B: 1^Inf Error - EdS2 - 06-10-2023, 01:47 PM
RE: HP-71B: 1^Inf Error - Albert Chan - 06-10-2023, 02:40 PM
RE: HP-71B: 1^Inf Error - Valentin Albillo - 06-10-2023, 06:29 PM
RE: HP-71B: 1^Inf Error - Werner - 06-11-2023, 09:09 AM
RE: HP-71B: 1^Inf Error - J-F Garnier - 06-11-2023, 10:20 AM



User(s) browsing this thread: 2 Guest(s)