FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math
New high precision scientific calculator
Post new topic   Reply to topic Page 1 of 1 [14 Posts] View previous topic :: View next topic
Author Message
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Tue Jul 04, 2006 9:26 pm    Post subject: New high precision scientific calculator Reply with quote

Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits
and exponents up to 1 billion. For multiplications, the Karatsuba
method is used, so it is not fast at extremely high precision.

Default precision is 500 digits.

You can see the applet at: http://www.alpertron.com.ar/BIGCALC.HTM

The calculator is still in alpha stage. The "solve" and "chi^2" buttons
still do not work. Please let me know the errors you find so I can
correct it.

I also plan to add an "integer mode" where the calculator will solve
simple number theoretic problems.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
mensanator@aol.compost
science forum Guru


Joined: 24 Mar 2005
Posts: 826

PostPosted: Tue Jul 04, 2006 9:31 pm    Post subject: Re: New high precision scientific calculator Reply with quote

alpert...@hotmail.com wrote:
Quote:
Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits
and exponents up to 1 billion. For multiplications, the Karatsuba
method is used, so it is not fast at extremely high precision.

Default precision is 500 digits.

You can see the applet at: http://www.alpertron.com.ar/BIGCALC.HTM

The calculator is still in alpha stage. The "solve" and "chi^2" buttons
still do not work. Please let me know the errors you find so I can
correct it.

It doesn't work, just displays a grey box,

Quote:

I also plan to add an "integer mode" where the calculator will solve
simple number theoretic problems.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Tue Jul 04, 2006 9:37 pm    Post subject: Re: New high precision scientific calculator Reply with quote

Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
Quote:
It doesn't work, just displays a grey box,
[...]
Back to top
Hugo Pfoertner
science forum addict


Joined: 02 May 2005
Posts: 51

PostPosted: Tue Jul 04, 2006 10:42 pm    Post subject: Re: New high precision scientific calculator Reply with quote

alpertron@hotmail.com wrote:
Quote:

Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]

You don't need the full Java distribution, just the run time
environment. On my old Win98 computer with
Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
the applet starts and shows some plausible results.

Hugo
Back to top
mensanator@aol.compost
science forum Guru


Joined: 24 Mar 2005
Posts: 826

PostPosted: Wed Jul 05, 2006 1:08 am    Post subject: Re: New high precision scientific calculator Reply with quote

alpertron@hotmail.com wrote:
Quote:
Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Ok, that worked. You might want to add a note to that effect
on the web page.

Quote:

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]
Back to top
Jeremy Boden
science forum Guru Wannabe


Joined: 28 Apr 2005
Posts: 144

PostPosted: Wed Jul 05, 2006 1:34 am    Post subject: Re: New high precision scientific calculator Reply with quote

On Tue, 2006-07-04 at 18:08 -0700, mensanator@aol.compost wrote:
Quote:
alpertron@hotmail.com wrote:
Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Ok, that worked. You might want to add a note to that effect
on the web page.


Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]

It partially works [on Linux] - however when I tried to get it to fill

in the value of Pi to the claimed million digits, it sent my java-vm
into a loop which claimed to be using 55MB of my main memory.
So I had to kill the process.

--
Jeremy Boden
Back to top
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Wed Jul 05, 2006 1:47 am    Post subject: Re: New high precision scientific calculator Reply with quote

Jeremy Boden wrote:
Quote:
On Tue, 2006-07-04 at 18:08 -0700, mensanator@aol.compost wrote:
alpertron@hotmail.com wrote:
Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Ok, that worked. You might want to add a note to that effect
on the web page.


Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]

It partially works [on Linux] - however when I tried to get it to fill
in the value of Pi to the claimed million digits, it sent my java-vm
into a loop which claimed to be using 55MB of my main memory.
So I had to kill the process.

--
Jeremy Boden

Jeremy,

One million digits is a lot for computing transcendental functions. I
suggest you to first compute pi with 10000 digits, then with 50000
digits, so you can extrapolate the time needed for one million digits.

Please notice that Java claims memory to the operating system, but then
it does not release it. I'm sure my code does not need 55 MB in order
to compute pi to the requested precision.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
Jeremy Boden
science forum Guru Wannabe


Joined: 28 Apr 2005
Posts: 144

PostPosted: Wed Jul 05, 2006 11:57 am    Post subject: Re: New high precision scientific calculator Reply with quote

On Tue, 2006-07-04 at 18:47 -0700, alpertron@hotmail.com wrote:
Quote:
Jeremy Boden wrote:
On Tue, 2006-07-04 at 18:08 -0700, mensanator@aol.compost wrote:
alpertron@hotmail.com wrote:
Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Ok, that worked. You might want to add a note to that effect
on the web page.


Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]

It partially works [on Linux] - however when I tried to get it to fill
in the value of Pi to the claimed million digits, it sent my java-vm
into a loop which claimed to be using 55MB of my main memory.
So I had to kill the process.

--
Jeremy Boden

Jeremy,

One million digits is a lot for computing transcendental functions. I
suggest you to first compute pi with 10000 digits, then with 50000
digits, so you can extrapolate the time needed for one million digits.

Please notice that Java claims memory to the operating system, but then
it does not release it. I'm sure my code does not need 55 MB in order
to compute pi to the requested precision.

Point taken - but since it is provided as a constant I expected a

pre-calculated value to be provided. Computing Pi to 1,000,000 places
(with java) on my ancient 600Mhz PC is definitely a non-trivial
exercise!

I suspect that you provide Pi precalculated for 500 digits as there was
no noticable delay.
--
Jeremy Boden
Back to top
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Wed Jul 05, 2006 12:02 pm    Post subject: Re: New high precision scientific calculator Reply with quote

Jeremy Boden ha escrito:

Quote:
On Tue, 2006-07-04 at 18:47 -0700, alpertron@hotmail.com wrote:
Jeremy Boden wrote:
On Tue, 2006-07-04 at 18:08 -0700, mensanator@aol.compost wrote:
alpertron@hotmail.com wrote:
Do you have the latest Java plugin installed? If not you will not be
able to see the applet.

You can download the Java plugin from http://www.java.com

Ok, that worked. You might want to add a note to that effect
on the web page.


Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM

mensanator@aol.compost wrote:
[...]
It doesn't work, just displays a grey box,
[...]

It partially works [on Linux] - however when I tried to get it to fill
in the value of Pi to the claimed million digits, it sent my java-vm
into a loop which claimed to be using 55MB of my main memory.
So I had to kill the process.

--
Jeremy Boden

Jeremy,

One million digits is a lot for computing transcendental functions. I
suggest you to first compute pi with 10000 digits, then with 50000
digits, so you can extrapolate the time needed for one million digits.

Please notice that Java claims memory to the operating system, but then
it does not release it. I'm sure my code does not need 55 MB in order
to compute pi to the requested precision.

Point taken - but since it is provided as a constant I expected a
pre-calculated value to be provided. Computing Pi to 1,000,000 places
(with java) on my ancient 600Mhz PC is definitely a non-trivial
exercise!

I suspect that you provide Pi precalculated for 500 digits as there was
no noticable delay.
--
Jeremy Boden

Jeremy,

There are no precomputed constants in the applet, since they would
increment download time. Remember that the applet runs on your
computer.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
Felix Rawlings
science forum beginner


Joined: 19 May 2005
Posts: 48

PostPosted: Wed Jul 05, 2006 3:08 pm    Post subject: Re: New high precision scientific calculator Reply with quote

On Tue, 04 Jul 2006 14:26:50 -0700, alpertron wrote:

Quote:
Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits and
exponents up to 1 billion. For multiplications, the Karatsuba method is
used, so it is not fast at extremely high precision.

I would have thought that the culprit is Java. Even if you used FFT
methods, it would probably still be slow. High performance arbitrary
precision libraries written in C (which results in code that runs much
faster than Java, JIT compiler regardless) usually have their core
integer vector multiplication code written in assembly language. This
makes an absolutely dramatic performance difference - modular
exponentiation functions, widely used in RSA cryptography, when
using such assembly language core routinely are one order of magnitude
faster than their all C counterparts.
Back to top
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Wed Jul 05, 2006 4:35 pm    Post subject: Re: New high precision scientific calculator Reply with quote

Felix Rawlings ha escrito:

Quote:
On Tue, 04 Jul 2006 14:26:50 -0700, alpertron wrote:

Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits and
exponents up to 1 billion. For multiplications, the Karatsuba method is
used, so it is not fast at extremely high precision.

http://www.alpertron.com.ar/BIGCALC.HTM

I would have thought that the culprit is Java. Even if you used FFT
methods, it would probably still be slow. High performance arbitrary
precision libraries written in C (which results in code that runs much
faster than Java, JIT compiler regardless) usually have their core
integer vector multiplication code written in assembly language. This
makes an absolutely dramatic performance difference - modular
exponentiation functions, widely used in RSA cryptography, when
using such assembly language core routinely are one order of magnitude
faster than their all C counterparts.

Felix,

You are right, but unfortunately applets cannot be written in C.

In the other hand, since the calculator is interactive, we are not
interested in extremely fast results. For example, if a calculation is
done in less than about 0.2 sec the user will think that the applet
does it instantaneously.

The problem occur for transcendental functions when thousands of digits
are required. Since I used the AGM method, the number of
multiplications needed to compute them is related to the logarithm of
the number of digits, except for the Gamma or factorial functions for
non-integer arguments where the number of multiplications needed is
proportional to the number of digits, so they are very slow.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
Felix Rawlings
science forum beginner


Joined: 19 May 2005
Posts: 48

PostPosted: Wed Jul 05, 2006 9:25 pm    Post subject: Re: New high precision scientific calculator Reply with quote

On Wed, 05 Jul 2006 09:35:42 -0700, alpertron wrote:

Quote:
Felix Rawlings ha escrito:

On Tue, 04 Jul 2006 14:26:50 -0700, alpertron wrote:

Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits
and exponents up to 1 billion. For multiplications, the Karatsuba
method is used, so it is not fast at extremely high precision.

http://www.alpertron.com.ar/BIGCALC.HTM

I would have thought that the culprit is Java. Even if you used FFT
methods, it would probably still be slow. High performance arbitrary
precision libraries written in C (which results in code that runs much
faster than Java, JIT compiler regardless) usually have their core
integer vector multiplication code written in assembly language. This
makes an absolutely dramatic performance difference - modular
exponentiation functions, widely used in RSA cryptography, when using
such assembly language core routinely are one order of magnitude faster
than their all C counterparts.

Felix,

You are right, but unfortunately applets cannot be written in C.

In the other hand, since the calculator is interactive, we are not
interested in extremely fast results. For example, if a calculation is
done in less than about 0.2 sec the user will think that the applet does
it instantaneously.

The problem occur for transcendental functions when thousands of digits
are required. Since I used the AGM method, the number of multiplications
needed to compute them is related to the logarithm of the number of
digits, except for the Gamma or factorial functions for non-integer
arguments where the number of multiplications needed is proportional to
the number of digits, so they are very slow.

Maybe you should consider limiting the precision? I mean, for an
interactive tool a billion digits is overkill, and probably so is a
million digits. If I wanted to compute something with a precision beyond,
say, 10^5 digits, I wouldn't use a Java applet anyway.
Back to top
Mike1161
science forum addict


Joined: 14 Oct 2005
Posts: 50

PostPosted: Wed Jul 05, 2006 11:31 pm    Post subject: Re: New high precision scientific calculator Reply with quote

In article <1152117342.237645.301510@75g2000cwc.googlegroups.com>, alpertron@hotmail.com says...
Quote:
Felix Rawlings ha escrito:

On Tue, 04 Jul 2006 14:26:50 -0700, alpertron wrote:

Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits and
exponents up to 1 billion. For multiplications, the Karatsuba method is
used, so it is not fast at extremely high precision.

http://www.alpertron.com.ar/BIGCALC.HTM

Very nice.

One 'feature' that doesn't appear so nice is that if you change the no of digits then immediately do a memory recall,
the memory is recalled to the digits edit box. I would suggest that only direct keyboard input to the digits editbox
would be more narural behaviour (and that memory recall should only go into the main entry window). Another feature: If
you enter '12345' and hit backspace you get '1234' - all well and good. But if you enter 2, hit cos, move the cursor to
the end of the answer (i.e. with 100 digit precision you have "...948 067 5|", where '|' marks the cursor) and now
press backspace, the entire expression is deleted.
Just noticed that cut and paste from the result window doesnt work either.

But as I said, v. nice overall.
Back to top
alpertron@hotmail.com
science forum beginner


Joined: 04 Jul 2006
Posts: 6

PostPosted: Thu Jul 06, 2006 1:30 am    Post subject: Re: New high precision scientific calculator Reply with quote

Felix Rawlings wrote:
Quote:
On Wed, 05 Jul 2006 09:35:42 -0700, alpertron wrote:

Felix Rawlings ha escrito:

On Tue, 04 Jul 2006 14:26:50 -0700, alpertron wrote:

Hello folks,

I've written a scientific calculator in Java. This high-precision
calculator features complex numbers, precision up to 1 million digits
and exponents up to 1 billion. For multiplications, the Karatsuba
method is used, so it is not fast at extremely high precision.

http://www.alpertron.com.ar/BIGCALC.HTM

I would have thought that the culprit is Java. Even if you used FFT
methods, it would probably still be slow. High performance arbitrary
precision libraries written in C (which results in code that runs much
faster than Java, JIT compiler regardless) usually have their core
integer vector multiplication code written in assembly language. This
makes an absolutely dramatic performance difference - modular
exponentiation functions, widely used in RSA cryptography, when using
such assembly language core routinely are one order of magnitude faster
than their all C counterparts.

Felix,

You are right, but unfortunately applets cannot be written in C.

In the other hand, since the calculator is interactive, we are not
interested in extremely fast results. For example, if a calculation is
done in less than about 0.2 sec the user will think that the applet does
it instantaneously.

The problem occur for transcendental functions when thousands of digits
are required. Since I used the AGM method, the number of multiplications
needed to compute them is related to the logarithm of the number of
digits, except for the Gamma or factorial functions for non-integer
arguments where the number of multiplications needed is proportional to
the number of digits, so they are very slow.

Maybe you should consider limiting the precision? I mean, for an
interactive tool a billion digits is overkill, and probably so is a
million digits. If I wanted to compute something with a precision beyond,
say, 10^5 digits, I wouldn't use a Java applet anyway.

Please notice that the precision is limited to 1 million digits. The
timing for the elementary operations (+, -, *, /) should not take too
long. The problem is with the transcendental functions.

Anyway, what is missing on the applet is an indication of progress of
the current operation and a way to stop the computation in progress.

Best regards,

Dario Alejandro Alpern
Buenos Aires - Argentina
http://www.alpertron.com.ar/ENGLISH.HTM
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [14 Posts] View previous topic :: View next topic
The time now is Thu Dec 14, 2017 12:43 am | All times are GMT
Forum index » Science and Technology » Math
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Indole stinks like human kakaa at high concentrations Radium Chem 0 Fri Jul 21, 2006 3:16 am
No new posts RF Welders from Europe (High Frequency Generators) website@hf-welders.com Mechanics 0 Mon Jul 17, 2006 11:56 am
No new posts Scientific calculator - clear breach of GPL Dave (from the UK) Symbolic 12 Tue Jul 11, 2006 2:18 pm
No new posts A scientific approach to proving whether man landed on th... polaris431@gmail.com Math 235 Sat Jul 08, 2006 2:35 pm
No new posts What distinguishes a high-energy bond from a low energy ... Sam Malone Chem 9 Sat Jul 01, 2006 8:26 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums  |  send newsletters
 


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0333s ][ Queries: 16 (0.0048s) ][ GZIP on - Debug on ]