Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ACO: 48 faster than 49

2 views
Skip to first unread message

e_tom

unread,
Dec 27, 1999, 3:00:00 AM12/27/99
to
Here is a user RPL prog for fractal iteration.
It is much faster (about 5 times) on HP48 than HP49 (approx mode).
I don't know why? I need to know.

Try e.g.: 3.0 4.0 5.0 50.0 200.0 HOP

Well, I guess I use 48 for numeric/graphic/scientific,
and 49 for CAS,MK,... etc.

Source Code Listing (you can copy it and send to your 48/49):

%%HP: T(3)A(R)F(.);
@ HOP ( a b c s n -> ) for 48/49; plots HOP iteration pattern for
@ real parameters a, b, c & scale factor s & no. ierations n

\<<
RAD
\-> A B C S N
\<<
# 262d # 128d PDIM
S 2. * S R\->C DUP NEG PMIN PMAX
S NEG S 2. / R\->C PVIEW
.1 .2
\-> X Y
\<< 1. N
START
X Y R\->C PIXON
'Y-SIN(X)*\v/ABS(B*X-C)' EVAL 'A-X' EVAL 'Y' STO 'X' STO
NEXT
\>>
\>>
\>>


Sent via Deja.com http://www.deja.com/
Before you buy.

Jean-Yves Avenard

unread,
Dec 28, 1999, 3:00:00 AM12/28/99
to
Hello

Inside your code you're evaluating expression using the EVAL command.

EVAL performs a much more complex work than what it did on the HP48
(simplification, expanding etc...)

Either use ->NUM that should be slightly faster, or perform the calculation
in RPN directly so the CAS is not involved:
'Y-SIN(X)*\v/ABS(B*X-C)' EVAL

Becomes:
Y X SIN B X * C - ABS SQRT * -

And 'A-X' EVAL
becomes A X -

The speed will not change much on the HP48 (still compatible) but it will
make a significant speed difference on the HP49.
Be also sure to set APPROX mode.
As an example:
In exact mode:
Applying ABS on 'B*X-C' will take 1.14s
In approx mode it will take .05s

It will impact on the SQRT as well and many math functions..
Hope this help

Cheers
Jean-Yves

"e_tom" <e_...@my-deja.com> wrote in message
news:8475th$mi0$1...@nnrp1.deja.com...

e_tom

unread,
Dec 29, 1999, 3:00:00 AM12/29/99
to
Thanks :-).
I knew this on the 48, but had no idea of the huge difference it made
on the 49. This kind of stuff should really be in the AUG.
So it seems my 49 can do all that the 48 can, including numeric approx
performance :-)).
Viva la HP49G

In article <38687...@isoit370.bbn.hp.com>,

John H Meyers

unread,
Dec 30, 1999, 3:00:00 AM12/30/99
to Jean-Yves Avenard
Jean-Yves Avenard <aven...@epita.fr>:

> EVAL performs a much more complex work [for algebraic expressions]


> than what it did on the HP48 (simplification, expanding etc...)

> Either use ->NUM that should be slightly faster, or
> perform the calculation in RPN directly so the CAS is not involved:
> 'Y-SIN(X)*\v/ABS(B*X-C)' EVAL
> Becomes:
> Y X SIN B X * C - ABS SQRT * -

Can we do this directly (without re-writing) via:

'expression' COMP-> ->PRG EVAL ( or COMP-> ->LIST EVAL ) ?

[using library 256]

Or perhaps using COMPEVAL (via SYSEVAL) ?
(or does that still invoke the CAS?)

> The speed will not change much on the HP48 (still compatible)
> but it will make a significant speed difference on the HP49.
> Be also sure to set APPROX mode.
> As an example:
> In exact mode:
> Applying ABS on 'B*X-C' will take 1.14s
> In approx mode it will take .05s
> It will impact on the SQRT as well and many math functions..

-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu

John H Meyers

unread,
Dec 30, 1999, 3:00:00 AM12/30/99
to
JYA:

> > 'Y-SIN(X)*\v/ABS(B*X-C)' EVAL
> > Becomes:
> > Y X SIN B X * C - ABS SQRT * -

JHM:


> Can we do this directly (without re-writing) via:
> 'expression' COMP-> ->PRG EVAL ( or COMP-> ->LIST EVAL ) ?
> [using library 256]

Gee, ->LST or ->PRG can be used all by themselves,
so 'expression' ->PRG EVAL seems satisfactory

(I still do not know about COMPEVAL)

But ->NUM is easier :)

Pete M. Wilson

unread,
Dec 30, 1999, 3:00:00 AM12/30/99
to
With EVAL: 0.4894_s
With ->NUM: 0.5025_s
With ->PRG EVAL: 0.1087_s
With ->LST EVAL: 0.1080_s
With RPN: 0.0960_s

So there's a 0.0120_s penalty for using algebraic notation if you put
->LST before your EVAL.

BTW, why does ->LST say XLIB 274 817 in the error message when you
give it a single number on the stack as an argument?


Pete M. Wilson
Gamewood Data Systems Internet Service
wils...@gamewood.net

0 new messages