Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
06-18-2016, 06:29 PM
Post: #304
RE: newRPL: [UPDATED May-06-16] Firmware for testing available for download
(06-18-2016 06:10 PM)Claudio L. Wrote:  
(06-18-2016 03:17 PM)Guenter Schink Wrote:  Weird!

Consider this symbolic expression '(1+1/x)^x'. Store 1E9 in "x" then press EVAL while the expression is on the stack. It will take about 42sec until the expression is evaluated to '1000000001/1000000000'. If you key ->NUM instead, the expression is solved instantly to 2.7182818271.


Actually, the result I got is '(100000001/1000000000)^1000000000'.
Ah, you're right, my omission

Quote: What happens is you stored an exact value into X, therefore EVAL will try to compute only an exact result. This means the fraction 1+1/1e9 results in 100000001/100000000, then it does the power, which means multiplying this fraction by itself 1e9 is of the order of 2^29, so it does at least 29 fraction multiplications, each time simplifying the fraction and increasing the precision as needed to keep the result exact. After a while, it reaches a point where the maximum system precision of 2000 digits is not enough to produce an exact answer, so it gives up and presents the result in exact form.
Now if you store 1e9. (see the trailing dot there?) the system will know you are interested in approximated numbers, then it will instantly present you with the same answer as ->NUM, at the current system precision.

Thanks for the explanation, but

sorry, I still can't follow. I'd expect, that the "x" within the symbolic expression would simply be substituted by its stored value. I don't see, that anything has to be computed at this time . Seems I have an odd understanding of the symbolic expressions.

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

Messages In This Thread
RE: newRPL: [UPDATED May-06-16] Firmware for testing available for download - Guenter Schink - 06-18-2016 06:29 PM

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