The following warnings occurred:
Warning [2] Undefined array key 113830 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113853 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113886 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113925 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113928 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113964 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 114303 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113853 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113925 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 113964 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 114303 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Determining significand length of the HP 33s



#8

When dealing with numerical programming, one often is confronted with a conditional statement that requires a decision to be made based upon the difference or ratio between two variables being reasonably close to zero. The question then arises: how close is reasonably close? At first impulse, one may simply choose to select a tiny arbitrary value, say 10-6 or better yet 10-20 based upon the user's desire for precision. While this may seem like a acceptable method, it ignores the realities of the floating point representation being used by the machine.


Floating point numbers are ususally represented in binary as follows:

SE1E2...EmT1T2...Tn



where 'S' is the sign bit, the 'Ei' are the exponent bits, and the 'Tj' are the significand bits (also known as the mantissa). This implies that there is a maximum relative spacing between any two numbers for a given floating point representation. Given a common floating point representation such as double precision IEEE found on standard personal computers, this maximum relative spacing is 2.22E-16, yielding 16 digits of precision. This value can be determined from the formula:


maximum relative spacing (epsilon) = 21-n


where 'n' is the number of bits in the significand (note that IEEE uses a "hidden bit method" so that while there are only 52 bits in a 64-bit number dedicated to the significand, the value of 'n' in that case is really 53).

So for programmable calculators like the HP 33s, knowing what epsilon is important. The manual states that typical calculations are accurate to 12 decimal digits. This would imply an epsilon value of around 10-12 to 10-13 or the number of significand bits being as low as 39 up to 41 bits. Mr. Hanson mentioned in his article about a "Cadillac" quadratic solver for the HP 33s that the "tricky properties" of the statistical operations allow precision up to 15 digits; more in line with the 52 to 53 bit significand used in the IEEE floats.

I attempted to ask HP directly about the number of bits used for the significand in the HP 33s for both sets of operations to no avail. I'm trying to come up with a nifty program to determine the appropriate value for 'n' for standard operations. If anyone comes up with something, please post it.

For the time being, the few programs I have written (Mr. Hanson's program translation being the exception) use:

epsilon=2-39=1.819E-12



Stay tuned for some programs that I've successfully translated to the HP 33s!

#9

I stay tuned.

-- Antonio

Edited: 17 May 2007, 2:27 a.m.

#10

I'd just add that most calculators use decimal, not binary, floating point arithmetic. An excellent resource for information on decimal arithmetic is Mike Cowlishaw's web page at IBM Hursley (http://www2.hursley.ibm.com/decimal/).


#11

Thank you Mr. Limpert. That's a piece of information that I obviously was unaware of. I'll definitely check that website out!

#12

I must admit that in pretty all of my RPN program that require convergence to equality of some sort, whether it is to zero or to something else, I simply go until actual equality and don't use epsilon in the same way one does in C, Visual Basic, or Pascal code.

My understanding is that even though the RPN calculators I use carry internal guard digits, these extra digits are lost when a value is returned to the stack. Therefore, in virtually all cases where I need a desired value to stop changing in the 12 (or 10) displayed digits before exiting a loop, simply testing for non-equality is the way I do it. If "old" and "new" values of the desired parameter are not equal, I loop back to the beginning of the loop, otherwise I skip the GTO after the conditional test and carry on.

This almost always works in cases where I am computing a convergent series or continued fraction representation of a desired function. In root solving, though, there may be some "wiggle" in the last digit which I can see if I display interim approximations. In those cases the loop ends when I do specify some desired epsilon, such as 1e-8.

Les


#13

hi guys,

there's an interesting method to calculate the net accuracy in bits and as decimal equivalent. its not rigorous, but helpful. i first saw this in Jean Meeus' book (the astronomer).

here's a lua version (easier to see what's going on):

function precision()
x = 1
j = 0
while (1)
do
x = x*2
if x + 1 == x then
print(j, j*0.30103)
return;
end
j = j + 1
end
end

transcript (hplua hp50g):

hplua -i acc.lua
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
HPLua version 0.4
=precision()
> 83 24.98549
first number is bits, second is decimal equivalent. so i'm seeing a payload of nearly 25 decimals on my 50g with this.

running this on a PC (IEEE754 doubles) as:

#include <stdio.h>
void showPrecision()
{
double x = 1;
int j = 0;
while (1)
{
x = x*2;
if (x + 1.0 == x)
{
printf("%d %f\n", j, (double)j*0.30103);
return;
}
j = j + 1;
}
}
int main()
{
showPrecision();
return 0;
}
i get, 52 15.653560 which is 52 bits and 15.6 decimals. maybe someone would like to try this method in RPL (i don't RPL anymore).

#14

I believe this link answers my original question quite well.

Given the BCD operation of these calculators, the epsilon value is 5.00000000001E-12.
Oddly enough, 5.0E-12(exact) when added to 1.0(exact) doesn't add up to 1.00000000001, go figure...


Possibly Related Threads…
Thread Author Replies Views Last Post
  New Blog Post: Length of a Polynomial Segment Eddie W. Shore 1 1,171 01-17-2013, 08:56 PM
Last Post: Namir
  OT - Length of day question Cristian Arezzini 20 4,484 12-14-2011, 09:28 AM
Last Post: M. Joury
  Determining HP 48sx ROM version by SN? megarat 27 6,262 04-15-2010, 04:09 AM
Last Post: Ignazio Cara (Italy)
  Function arc length on 50G Hal Bitton in Boise 5 1,654 08-26-2008, 06:27 AM
Last Post: Marcus von Cube, Germany
  Which EPROM box to use with two equal length EPROMS PeterP 2 1,003 04-25-2008, 10:30 PM
Last Post: PeterP
  Integration Times "Old" 33s vs "New" 33s John Smitherman 21 5,077 12-14-2005, 12:04 AM
Last Post: Karl Schneider
  Length of 34C battery pack? Karl Schneider 0 616 04-20-2002, 09:04 PM
Last Post: karl schneider

Forum Jump: