Post Reply 
HP-71B: 1^Inf Error
06-09-2023, 02:22 PM (This post was last modified: 06-10-2023 01:09 PM by Albert Chan.)
Post: #8
RE: HP-71B: 1^Inf Error
(06-09-2023 01:03 PM)J-F Garnier Wrote:  In this particular example [acos(2+0j)], the signed zero is not managed properly in the complex domain.
Maybe an additional reason for having abandoned it?

I believe it is asin/acos sign bug in code.
Calculate acos(2+0j) by "hand", I am getting correct answer.

Implementing the complex arcsine and arccosine functions ... (page 326 for acos(z) algorithm),

lua> x, y = 2, 0
lua> signy = signbit(y) and -1 or 1
lua> r = sqrt((x+1)^2 + y^2)
lua> s = sqrt((x-1)^2 + y^2)
lua> a = (r+s)/2
lua> b = x/a
lua> I.new(acos(b), -signy * acosh(a))      -- = acos(2+0j)
(0-1.3169578969248166*I)

sign(y) bug is in cpr.a, which sometimes use -sign(x) instead. (docasc code comment)
Because asin(z) + acos(z) = pi/2, this bug affected both asin and acos.
Code:
*      with sign(y,x)=sign(y) if y<>0, -sgn(x) if y=0

>acos((2,0))
(0,1.31695789692)      ✘
>acos((-2,0))
(3.14159265359,-1.31695789692)      ✔
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)