HP Forums

Full Version: 50 digits precision handheld calculator is it achievable or not?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This is a hypothetical question. Can a 50 digits precision handheld calculator be achievable with today's technology? I am not a programmer. I was just curious to know the numerous hurdles to accomplish such a task.

This is an open discussion. Software requirement and hardware that would be the size of a mobile phone. My interest is pure entertainment. This was sparked by my new found interest in homebrew calculators and the complexity of the technology.

I think that the hp42s has 25 digits internal precision. Please correct me if I am wrong and the hp 50g is 15 digits.
Hmmh, "achievable" is a lot nowadays. Even such a calculator, I guess. The more interesting questions are: In which time? At what cost? Which leads to the question: Is there an economical basis for making such a device (based on parts and products available)? I know too little about HW to be able to tell you the answers to those questions.

(01-17-2014 10:53 AM)Jean-Marc Wrote: [ -> ]I think that the hp42s has 25 digits internal precision.

How do you get to assume that? Source of information??

d:-?
(01-17-2014 10:53 AM)Jean-Marc Wrote: [ -> ]I think that the hp42s has 25 digits internal precision.
Probably mixed that up with the Free42 simulator.
What do you get with:

1E-24 ENTER
1 +
1 -

The result is 1E-24 on the Free42 app on the iPhone.

Cheers
Thomas
Plenty of hardware and libraries are available for implementing such a calculator.
The effort is probably moderated. The question is: is it worth it?

Regards
(01-17-2014 10:53 AM)Jean-Marc Wrote: [ -> ]This is a hypothetical question. Can a 50 digits precision handheld calculator be achievable with today's technology? I am not a programmer. I was just curious to know the numerous hurdles to accomplish such a task.

Yes and it can be done with yesterday's technology too. There are no "numerous hurdles", just space and time.

More precision = more space and [much] more time. That's all. It's not a technology capability problem, but a cost and need problem. Time to solution is also a factor and possibly energy consumption (battery life). The later two are more about marketability and the user experience.
(01-17-2014 10:53 AM)Jean-Marc Wrote: [ -> ]Can a 50 digits precision handheld calculator be achievable with today's technology?

In double precision mode, the WP 34S provides 34 digits of precision. Given the hardware limitations forced on the WP 34S team, I think that this proves the case that it is possible--even likely.

Mark Hardman
It's been available for many years. It's called the HP 50g with the free LongFloat library installed. LongFloat lets you specify how many digits of precision you want, up to 9999 (really!) and it gives you new functions which use that precision, with guaranteed accuracy. It brilliantly uses the "long real" object type which HP built into the 50g and then never got around to supporting. (N.B. its header is 0263A, not 02955 which is the "extended real" type which only has 15-digit mantissas).

50-digit arithmetic with the LongFloat library is very fast. 50 digits times 50 digits takes 0.076 seconds. More digits takes longer. For example, finding 500 digits of the square root of 2 takes 2 seconds.

If you want a calculator that does 50 digit math, but you don't want to bother installing software on it, I'd be happy to install LongFloat in a 50g and sell it to you. ;-)

The LongFloat library functions are fully programmable. Accuracy is both globally and locally programmable. The functions include:
  • Add, subtract, multiply, divide
  • Square root, Fast Integer Part of Square Root, Square
  • 1/x, -x, |x|, sign(x)
  • IP, FP
  • y^x, e^x, ln, ln(x+1), Gamma
  • sin, cos, tan, and their inverses & hyperbolic versions
  • real<>complex, conjugate, LongFloat i, LongFloat pi
  • LongFloat<>Normal real
  • Split LongFloat into mantissa and exponent
  • Programming test functions (equal, not equal, less than, etc)
  • LongFloat<>Continued Fraction (!!!)
  • Unit support
  • Matrix support, CON, IDN, DOT, TRN, DET
  • LongFloat root finder
  • Interval math support
  • PSLQ (!!!)
  • 5 input/output modes: Std, Floor, Ceil, Trunc, and Interval
(01-17-2014 10:56 PM)Joe Horn Wrote: [ -> ]It's been available for many years. It's called the HP 50g with the free LongFloat library installed. LongFloat lets you specify how many digits of precision you want, up to 9999 (really!) and it gives you new functions which use that precision, with guaranteed accuracy. It brilliantly uses the "long real" object type which HP built into the 50g and then never got around to supporting. (N.B. its header is 0263A, not 02955 which is the "extended real" type which only has 15-digit mantissas).

50-digit arithmetic with the LongFloat library is very fast. 50 digits times 50 digits takes 0.076 seconds. More digits takes longer. For example, finding 500 digits of the square root of 2 takes 2 seconds.

If you want a calculator that does 50 digit math, but you don't want to bother installing software on it, I'd be happy to install LongFloat in a 50g and sell it to you. ;-)

The LongFloat library functions are fully programmable. Accuracy is both globally and locally programmable. The functions include:
  • Add, subtract, multiply, divide
  • Square root, Fast Integer Part of Square Root, Square
  • 1/x, -x, |x|, sign(x)
  • IP, FP
  • y^x, e^x, ln, ln(x+1), Gamma
  • sin, cos, tan, and their inverses & hyperbolic versions
  • real<>complex, conjugate, LongFloat i, LongFloat pi
  • LongFloat<>Normal real
  • Split LongFloat into mantissa and exponent
  • Programming test functions (equal, not equal, less than, etc)
  • LongFloat<>Continued Fraction (!!!)
  • Unit support
  • Matrix support, CON, IDN, DOT, TRN, DET
  • LongFloat root finder
  • Interval math support
  • PSLQ (!!!)
  • 5 input/output modes: Std, Floor, Ceil, Trunc, and Interval

Will a 50 digits precission be ever required? I don't have a need for it but who can really tell. Someone else might have a need for this requirement. I like fast cars and some of them can go as fast as 200km/hr or more. Will I ever go that fast? The answer is no but I like the idea that I could if I wanted too.

Reading the above post 50 digits internal precision is an immediate possibility with an ARM chip. We don't need to wait for the next Grapheen transistors Wow! Will the battery life be adequate. This is subjective. People feel happy and expect to charge their electronic devices everyday. I don't! What if they could charge it once a year or be solar powered and never requiring batteries.

Making a device and packing more into a smaller area would make it hotter to operate. One solution would be to insulate. The second is to have hardware that emit less heat.

A handheld calculator will remain a part of our electronic inventry because it provides convenience. We have an expectation for accuracy, reliability and portability. Devices that exceed our expectations such as been customised to our personal need will sell. Software can be customised to display the commonly used functions for a particular field or situation. A range of covers, colours, display screen that is esthetic and pleasing will sell. The over half of our population is female and has a strong influence on us all. We have computer and yet we are still using pencil and paper. The tactile interactions to put thoughts in writting is still best provided on paper.

All you smart guys don't ever stop pushing the boundaries. Hope you like my ranting! Smile Smile .
I am intrigue and will download the long float library. I can get an hp50g to try this out. 2 seconds might not be practical with an ARM chip it will just be for fun. Might need a faster chip for real world application.
(01-17-2014 11:52 PM)Jean-Marc Wrote: [ -> ]I am intrigue and will download the long float library. I can get an hp50g to try this out. 2 seconds might not be practical with an ARM chip it will just be for fun. Might need a faster chip for real world application.

Pi is hard-coded into the Long Float Library, but you can compute it to one thousand places (and more) just for fun, if you wish (see the last message in this thread). Alg48 includes an arbitrary precision package for the HP-48 as well. But if 34 digits are enough for your needs, then you can try wp34s in DOUBLE precision mode.
(01-17-2014 11:31 PM)Jean-Marc Wrote: [ -> ]Making a device and packing more into a smaller area would make it hotter to operate. One solution would be to insulate.

J'excuse, mais c'est contradicting physics in sentence 2. Sad Insulating keeps the heat in. Undecided

(Edited to correct a typo in a foreign language.)
(01-18-2014 08:02 AM)walter b Wrote: [ -> ]
(01-17-2014 11:31 PM)Jean-Marc Wrote: [ -> ]Making a device and packing more into a smaller area would make it hotter to operate. One solution would be to insulate.

J'excuse, mais c'est contradicting physics in sentence 2. Sad Insulting Smile "insulating" Smile keeps the heat in. Undecided
Oui/yes you are correct I meant insulate so that you don't feel the heat on your hand. As for the electronic I guess they would fry or have an automated shut off. I have a laptop that sit on a cooling portable table because the heat is uncomfortable on my lap. Didn't put a lot of thought writing this down this is just chit chat it's relative "insulating". Good pick up on the physics Smile .
If you can feel the heat, batteries won't last long at all, and the unit certainly won't be able to run off the power it gets from a little solar cell in the front.

The number of digits is limited mainly by how long you want to wait for answers and how much memory you can allow for variables, stack cells, etc.. 50 digits would be no problem for a 1980 home computer except that it would be very slow and you might not have enough storage to be useful. The time required for addition and subtraction will be more-or-less proportional to the precision, but other functions will suffer far more from an increase in precision. The extent of my work in this kind of thing was to write 16-bit trig and log scaled-integer functions, so I'm no expert at this, but I can't imagine how long it would take on a given processor to get 50 correct digits for the ln(1+x) or tangent functions for example, as the infinite series converges prohibitively slowly, and suitable polynomial substitutes would probably be super long.
(01-17-2014 10:53 AM)Jean-Marc Wrote: [ -> ]This is a hypothetical question. Can a 50 digits precision handheld calculator be achievable with today's technology? I am not a programmer. I was just curious to know the numerous hurdles to accomplish such a task.

This is an open discussion. Software requirement and hardware that would be the size of a mobile phone. My interest is pure entertainment. This was sparked by my new found interest in homebrew calculators and the complexity of the technology.

I think that the hp42s has 25 digits internal precision. Please correct me if I am wrong and the hp 50g is 15 digits.

I don't see why a calculator could not handle 50 digit precision.
This type of calculator is already exists! It's HP 100(200)LX with installed Derive(TM) Smile

Here is mine:

http://maxes.ho.ua/Pics/Calcs/HP512.jpg
The 34S exposes a 34 digit double precision real to the user, as was noted earlier.

Internally, most operations on the 34S are performed using 39 digits. A number of operations (e.g. complex multiplication) were easiest to perform using 72 digit numbers rather than try to cleverly work around possible cancellation issues.

Then we get onto the huge stuff. Modulo reduction is done using 450 digits due to the way the decNumber library does this operation. Modulo reduction of radian arguments to trigonometric functions is done using 820 digits -- this guarantees the correct reduction of all single precision arguments but not all double precision ones. Reduction in gradians and degrees modes are done before conversion to radians and avoid this expensive step.

So, the answer to your question is yes it would be possible. The cost is memory -- the 34S firmware couldn't increase the number of carried digits without running out of RAM for some operations. A little more memory would make a big difference here.


- Pauli
(01-19-2014 02:21 AM)Paul Dale Wrote: [ -> ]So, the answer to your question is yes it would be possible. The cost is memory -- the 34S firmware couldn't increase the number of carried digits without running out of RAM for some operations. A little more memory would make a big difference here.

Oh yes!

d:-I
(01-18-2014 12:41 AM)Gerson W. Barbosa Wrote: [ -> ]Pi is hard-coded into the Long Float Library, but you can compute it to one thousand places (and more) just for fun, if you wish (see the last message in this thread).

Actually, only the first 126 digits of pi are hard-coded in LongFloat library. If you set 'DIGITS' to anything > 126, then pi is calculated to that many digits ("using Werner Huysegom's implementation of Chudnowsky") and stored in the 'FLOATpar' Library Data object for later fast retrieval. For example, the first time you tell LongFloat to give you 1000 digits of pi, it takes 42 seconds. Afterwards, asking for 1000 digits of pi (or less) takes less than a tenth of a second.
(01-19-2014 03:37 PM)Joe Horn Wrote: [ -> ]
(01-18-2014 12:41 AM)Gerson W. Barbosa Wrote: [ -> ]Pi is hard-coded into the Long Float Library, but you can compute it to one thousand places (and more) just for fun, if you wish (see the last message in this thread).

Actually, only the first 126 digits of pi are hard-coded in LongFloat library. If you set 'DIGITS' to anything > 126, then pi is calculated to that many digits ("using Werner Huysegom's implementation of Chudnowsky") and stored in the 'FLOATpar' Library Data object for later fast retrieval. For example, the first time you tell LongFloat to give you 1000 digits of pi, it takes 42 seconds. Afterwards, asking for 1000 digits of pi (or less) takes less than a tenth of a second.
I stand corrected. Thank you, Joe!

Gerson.
Thanks to everyone's contribution to this thread. Now I know that it is possible with far more than what I expected Smile .

I tried the "Pi" "quickarch" program for 50 digits and got 7510 as the last trailing digits. (display set to mini fonts) I had no idea how to get the numbers to wrap around on the HP50g display so I had to go to TOOLS then VIEW and scroll through all the numbers. It took only a few seconds with the "longfloat" library loaded, WOW!

I tried for 1000 digits with the display set to mini fonts and it ran for 4 minutes before I decided to cancel the program. I was getting impatient.
Pages: 1 2
Reference URL's