Post Reply 
Extended precision library
05-25-2019, 10:27 AM
Post: #1
Extended precision library
This is a library of functions to allow unlimited floating point precision for all arithmetic and most transcendental functions on the Prime.

Explanations can be found (in French...) in the 11th issue of the french journal "La Gazette des Pocketicaires" available for free download at :
http://silicium.org/site/index.php/telec...keticaires.

Very shortly, all function names start with the letter x.
To start type xinit(7) for example where 7 is the number of slices of 6 digits that you want to have available.
Here 7 means you calculate on 42 digits.
Values are stored as lists.
To convert from/to the readable representation which is a string, you use two functions.
Example :
xtof("1256.23589") returns a list
xtostr(that list) gives you back the string "1256.23589".

Then you can use the lists created this way to calculate, see the examples in the test file attached.

Feedback welcome.


Attached File(s)
.hpprgm  multiprecision.hpprgm (Size: 14.1 KB / Downloads: 38)
.hpprgm  multiprecision2.hpprgm (Size: 10.46 KB / Downloads: 30)
.hpprgm  testmulti.hpprgm (Size: 8.38 KB / Downloads: 35)
Find all posts by this user
Quote this message in a reply
05-25-2019, 10:15 PM (This post was last modified: 05-26-2019 08:35 AM by StephenG1CMZ.)
Post: #2
RE: Extended precision library
Just an idea on the user interface
I am wondering whether users might find it more natural to specify the number of digits they want to use, rather than the number of slices.
As xinit(42) seems more intuitive than xinit(7) when the user wants 42 digits.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
05-26-2019, 04:18 PM
Post: #3
RE: Extended precision library
Hello,
Sure good idea, that's fairly simple.

List of changes to do :
- add an xversion function
- use Newton methode for division
- change xinit so that it takes a number of digits and not slices
- add cos, asin, acos
- normalize angles as input to sin/cos/tan
- (hard) fix precision issues in cordic functions

G.E.
Find all posts by this user
Quote this message in a reply
04-08-2021, 07:03 AM
Post: #4
RE: Extended precision library
Maybe I'm doing something wrong?

xinit(5) -> 5
xtostr(xlog(xtof("0.01"))) -> "-999997697417.20959.....

while

LN(0.01) -> -4.6051....
Find all posts by this user
Quote this message in a reply
08-22-2021, 08:38 PM
Post: #5
RE: Extended precision library
Hello, I find it difficult to make ”Extended Precision Library” work.
In fact, after having transferred the three programs in the HP PRIME virtual calculator, ie "multiprecision", "mutiprecision2" and "testmulti", and after having opened them (shift program, EDIT), I get an error message:
1) In “multiprecision”, I get an error on line 265;
2) In “multiprecision2”, I get an error on line 170;
3) In “testmulti”, I get an error on line 108;
Where am I doing wrong?
Yours sincerely, Roberto Mioni
Find all posts by this user
Quote this message in a reply
Post Reply 




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