Re: 35s and SQRT of Negative Numbers (UPDATED) Message #9 Posted by Karl Schneider on 4 Oct 2008, 2:07 a.m., in response to message #1 by Les Wright
Les 
When you posted that, I immediately thought of a similar post from last year, which I had bookmarked. It was Egan Ford's post of similar results; please see his reply before mine in this thread.
If you scroll a bit further in that archived post, you'll see my analysis of reasons for the behavior of that functionality in the HP35s, along with a philosophical discussion.
Here's a moredirect explanation, incorporating Egan's findings:
Quote:
 sqrt(1) returns: SQRT(NEG)
 1 .5 y^x returns: INVALID y^x
 sqrt(1i0) returns: INVALID DATA
 1i0 .5 y^x returns: 0i1, finally.
It should not be this hard.
On the HP35s (as well as on the HP33s, HP32SII, and HP32S):
The square root function is defined only for a domain (input) and range (output) of realvalued numbers in that format. This has the effect of restricting valid input to nonnegative real values.
Thus, tests 1 and 3 fail for obvious reasons.
y^x  which also provides a generalpurpose capability for complexvalued sqrt, x^{2}, and y^(1/x)  is programmed so as to give only realvalued output (where mathematically defined) for realvalued input 'y', and only complexvalued output in that format for complexvalued input 'y'. (Input 'x' can be either realvalued or complexvalued on the HP35s.) The user does not have the option of obtaining complexvalued output for realvalued input 'y', as the HP15C and HP42S provide.
Internally, y^x is calculated using the familiar theorem: y^x = exp(ln(y^x)) = exp(x ln y)
The data type of 'y'  complex or real  determines what algorithm is used to calculate 'ln y'.
Test 2 fails because 'y' is realvalued, but 'ln y' has no realvalued result.
 KS
Edited: 4 Oct 2008, 5:11 p.m.
