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) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)