Post Reply 
Cadillac Quadratic Solver behaving like an Edsel - Problem solved!!
09-16-2014, 03:14 PM
Post: #21
RE: Cadillac Quadratic Solver behaving like an Edsel - Problem solved!!
(09-16-2014 12:33 PM)Dieter Wrote:  
(09-16-2014 01:20 AM)Gerson W. Barbosa Wrote:  You can try
RCLx F
RCL F
ABS
/

Instead of

RCLF
SGN
x

starting at step B0014, assuming F is never zero.

If I understand correctly, the sequence

RCL F
SGN
x

shall be replaced by something that does not require a sign function and that also does not use more than one stack level. Your suggestion will do so, but the combination of a multiplication and a subsequent division may degrade accuracy, and, more important, it will not work for F = 0.

So how about this one?

RCL F
ABS
X≠0?
RCL/ F
x

Dieter

In order to address the case F=0, which seems to be a consequence of B=0, I had suggested later in the thread the insertion of x=0? x! between ABS and /. Your suggestion is one step shorter and more efficient, so I would go for it. That's what I was able to come up with while watching an interview on TV. When memory is not an issue (sometimes it is on the 32S-II), I'll definitely use the SGN subroutine replacement, since no stack analysis is necessary.

Regards,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Cadillac Quadratic Solver behaving like an Edsel - Problem solved!! - Gerson W. Barbosa - 09-16-2014 03:14 PM



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