From: Scott H. <hug...@ho...> - 2014-04-23 13:34:42
|
Firstly, I'm not a programmer and only recently started to use Maxima (command line). I don't know anything about lisp. I'm running Maxima on a Mac but also on a PC through Windows. Both are the command line version. I only need to use Maxima for a few basic operations, primarily small numbers raised to large (at least 8) exponents. Aside from that, I'm using the round and asksign commands. I'm encountering "heap exhausted" errors once my exponents get beyond about 60000000 and have looked in manual and forums for help. There is reference to changing heap size but I didn't understand the command or even how to enter it. Can anyone help me with very explicit instructions ? I'm not concerned with the length of time the calculations take, just don't want them to crash before they complete. |
From: Richard F. <fa...@be...> - 2014-04-23 18:11:42
|
what do you plan to do with a number raised to the power 60,000,000? If you are computing it in order to then reduce it modulo some other number, then there is a better way to do it. On 4/23/2014 6:34 AM, Scott Hughes wrote: > > Firstly, I'm not a programmer and only recently started to use Maxima > (command line). I don't know anything about lisp. I'm running Maxima > on a Mac but also on a PC through Windows. Both are the command line > version. > > I only need to use Maxima for a few basic operations, primarily small > numbers raised to large (at least 8) exponents. Aside from that, I'm > using the round and asksign commands. > > I'm encountering "heap exhausted" errors once my exponents get beyond > about 60 000 000 and have looked in manual and forums for help. There > is reference to changing heap size but I didn't understand the command > or even how to enter it. Can anyone help me with very explicit > instructions ? I'm not concerned with the length of time the > calculations take, just don't want them to crash before they complete. > > |
From: Gunter K. <gu...@pe...> - 2014-04-23 18:57:02
|
On windows I seem to remember that you can use a whole gigabyte before maxima gives up. This could mean you are dealing with numbers that might exceed any amount of RAM your computer might have installed. If you just want to know the length of the result of the calculation you might want to calculate a logarithm of the result: the logarithm atva base of ten tells you how many digits a number needs. If your problem is that you want to keep too many but numbers in memory you might want to look at the nolabels flag, too. On 23. April 2014 20:11:26 MESZ, Richard Fateman <fa...@be...> wrote: >what do you plan to do with a number raised to the power 60,000,000? > >If you are computing it in order to then reduce it modulo some other >number, >then there is a better way to do it. > > > >On 4/23/2014 6:34 AM, Scott Hughes wrote: >> >> Firstly, I'm not a programmer and only recently started to use Maxima > >> (command line). I don't know anything about lisp. I'm running Maxima >> on a Mac but also on a PC through Windows. Both are the command line >> version. >> >> I only need to use Maxima for a few basic operations, primarily small > >> numbers raised to large (at least 8) exponents. Aside from that, I'm >> using the round and asksign commands. >> >> I'm encountering "heap exhausted" errors once my exponents get beyond > >> about 60 000 000 and have looked in manual and forums for help. There > >> is reference to changing heap size but I didn't understand the >command >> or even how to enter it. Can anyone help me with very explicit >> instructions ? I'm not concerned with the length of time the >> calculations take, just don't want them to crash before they >complete. >> >> > > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >Start Your Social Network Today - Download eXo Platform >Build your Enterprise Intranet with eXo Platform Software >Java Based Open Source Intranet - Social, Extensible, Cloud Ready >Get Started Now And Turn Your Intranet Into A Collaboration Platform >http://p.sf.net/sfu/ExoPlatform > >------------------------------------------------------------------------ > >_______________________________________________ >Maxima-discuss mailing list >Max...@li... >https://lists.sourceforge.net/lists/listinfo/maxima-discuss -- Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. |
From: Gunter K. <gu...@pe...> - 2014-04-23 18:58:04
|
Another question: How do you calculate the powers? I get a different error message, if I Try. On 23. April 2014 20:11:26 MESZ, Richard Fateman <fa...@be...> wrote: >what do you plan to do with a number raised to the power 60,000,000? > >If you are computing it in order to then reduce it modulo some other >number, >then there is a better way to do it. > > > >On 4/23/2014 6:34 AM, Scott Hughes wrote: >> >> Firstly, I'm not a programmer and only recently started to use Maxima > >> (command line). I don't know anything about lisp. I'm running Maxima >> on a Mac but also on a PC through Windows. Both are the command line >> version. >> >> I only need to use Maxima for a few basic operations, primarily small > >> numbers raised to large (at least 8) exponents. Aside from that, I'm >> using the round and asksign commands. >> >> I'm encountering "heap exhausted" errors once my exponents get beyond > >> about 60 000 000 and have looked in manual and forums for help. There > >> is reference to changing heap size but I didn't understand the >command >> or even how to enter it. Can anyone help me with very explicit >> instructions ? I'm not concerned with the length of time the >> calculations take, just don't want them to crash before they >complete. >> >> > > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >Start Your Social Network Today - Download eXo Platform >Build your Enterprise Intranet with eXo Platform Software >Java Based Open Source Intranet - Social, Extensible, Cloud Ready >Get Started Now And Turn Your Intranet Into A Collaboration Platform >http://p.sf.net/sfu/ExoPlatform > >------------------------------------------------------------------------ > >_______________________________________________ >Maxima-discuss mailing list >Max...@li... >https://lists.sourceforge.net/lists/listinfo/maxima-discuss -- Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. |
From: Scott H. <hug...@ho...> - 2014-04-23 19:09:42
|
An example... a: 50000000; b: 60000000; c: 40000000; round ((6^a-2^b-3^b)/(6^(a-7)-4^b-5^b)); From: Gunter Königsmann [mailto:gu...@pe...] Sent: April-23-14 2:58 PM To: fa...@be...; Scott Hughes; <max...@li...> Subject: Re: [Maxima-discuss] Maxima (lisp on Mac) - heap exhausted Another question: How do you calculate the powers? I get a different error message, if I Try. On 23. April 2014 20:11:26 MESZ, Richard Fateman <fa...@be...> wrote: what do you plan to do with a number raised to the power 60,000,000? If you are computing it in order to then reduce it modulo some other number, then there is a better way to do it. On 4/23/2014 6:34 AM, Scott Hughes wrote: Firstly, I’m not a programmer and only recently started to use Maxima (command line). I don’t know anything about lisp. I’m running Maxima on a Mac but also on a PC through Windows. Both are the command line version. I only need to use Maxima for a few basic operations, primarily small numbers raised to large (at least 8) exponents. Aside from that, I’m using the round and asksign commands. I’m encountering “heap exhausted” errors once my exponents get beyond about 60 000 000 and have looked in manual and forums for help. There is reference to changing heap size but I didn’t understand the command or even how to enter it. Can anyone help me with very explicit instructions ? I’m not concerned with the length of time the calculations take, just don’t want them to crash before they complete. _____ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform _____ Maxima-discuss mailing list Max...@li... https://lists.sourceforge.net/lists/listinfo/maxima-discuss -- Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. |
From: Richard F. <fa...@be...> - 2014-04-23 19:26:49
|
On 4/23/2014 12:09 PM, Scott Hughes wrote: > > An example... > > a: 50000000; > > b: 60000000; > > c: 40000000; > > round ((6^a-2^b-3^b)/(6^(a-7)-4^b-5^b)); > The result of the calculation, before rounding, is appx -1.815603675821045b-3030638 this is easily computed using 2.0b0 etc instead of 2 etc. That is, it has over 3 million digits . Before computing and displaying them, it may make sense to ask.... what do you plan to do with them? > *From:*Gunter Königsmann [mailto:gu...@pe...] > *Sent:* April-23-14 2:58 PM > *To:* fa...@be...; Scott Hughes; > <max...@li...> > *Subject:* Re: [Maxima-discuss] Maxima (lisp on Mac) - heap exhausted > > Another question: > How do you calculate the powers? I get a different error message, if I > Try. > > On 23. April 2014 20:11:26 MESZ, Richard Fateman <fa...@be... > <mailto:fa...@be...>> wrote: > > what do you plan to do with a number raised to the power 60,000,000? > > If you are computing it in order to then reduce it modulo some other > number, > then there is a better way to do it. > > > > On 4/23/2014 6:34 AM, Scott Hughes wrote: > > Firstly, I’m not a programmer and only recently started to use > Maxima (command line). I don’t know anything about lisp. I’m > running Maxima on a Mac but also on a PC through Windows. Both are > the command line version. > > I only need to use Maxima for a few basic operations, primarily > small numbers raised to large (at least 8) exponents. Aside from > that, I’m using the round and asksign commands. > > I’m encountering “heap exhausted” errors once my exponents get > beyond about 60 000 000 and have looked in manual and forums for > help. There is reference to changing heap size but I didn’t > understand the command or even how to enter it. Can anyone help me > with very explicit instructions ? I’m not concerned with the > length of time the calculations take, just don’t want them to > crash before they complete. > > ------------------------------------------------------------------------ > Start Your Social Network Today - Download eXo Platform > Build your Enterprise Intranet with eXo Platform Software > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > Get Started Now And Turn Your Intranet Into A Collaboration Platform > http://p.sf.net/sfu/ExoPlatform > ------------------------------------------------------------------------ > Maxima-discuss mailing list > Max...@li... <mailto:Max...@li...> > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > -- > Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. > |
From: Stavros M. <mac...@al...> - 2014-04-23 19:48:07
|
You can calculate the correct rounded result using bfloats. The easiest way to do that is a:50000000.0b0$ b:60000000.0b0$ round ((6^a-2^b-3^b)/(6^(a-7)-4^b-5^b)); This gives 0. You can tell Maxima how many digits to carry in the calculation using fpprec:1000, for example, to calculate to 1000 digits of precision. This will get slow if you want, say, 10000 digits of precision, but that's probably not necessary. The result of 'round' may also turn out to be a very large integer, which may be too big to manipulate (e.g. you might get an out of memory error) and for that matter most of its digits may be meaningless. Why do you want to do these calculations? Another way to put it: what are you going to do with the results of these calculations? If you're looking at the behavior of these sorts of expressions as a and b get large, the 'taylor' function may help. For example, if you assume that b=6/5*a, then as a gets large, the expression has the value (3/5)^(6/5*a). -s On Wed, Apr 23, 2014 at 3:09 PM, Scott Hughes <hug...@ho...>wrote: > An example... > > > > a: 50000000; > > b: 60000000; > > c: 40000000; > > round ((6^a-2^b-3^b)/(6^(a-7)-4^b-5^b)); > > > > *From:* Gunter Königsmann [mailto:gu...@pe...] > *Sent:* April-23-14 2:58 PM > *To:* fa...@be...; Scott Hughes; < > max...@li...> > *Subject:* Re: [Maxima-discuss] Maxima (lisp on Mac) - heap exhausted > > > > Another question: > How do you calculate the powers? I get a different error message, if I Try. > > > > On 23. April 2014 20:11:26 MESZ, Richard Fateman <fa...@be...> > wrote: > > what do you plan to do with a number raised to the power 60,000,000? > > If you are computing it in order to then reduce it modulo some other > number, > then there is a better way to do it. > > > > On 4/23/2014 6:34 AM, Scott Hughes wrote: > > Firstly, I’m not a programmer and only recently started to use Maxima > (command line). I don’t know anything about lisp. I’m running Maxima on a > Mac but also on a PC through Windows. Both are the command line version. > > > > I only need to use Maxima for a few basic operations, primarily small > numbers raised to large (at least 8) exponents. Aside from that, I’m using > the round and asksign commands. > > > > I’m encountering “heap exhausted” errors once my exponents get beyond > about 60 000 000 and have looked in manual and forums for help. There is > reference to changing heap size but I didn’t understand the command or even > how to enter it. Can anyone help me with very explicit instructions ? I’m > not concerned with the length of time the calculations take, just don’t > want them to crash before they complete. > > > > > > > > > > ------------------------------ > > > Start Your Social Network Today - Download eXo Platform > Build your Enterprise Intranet with eXo Platform Software > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > Get Started Now And Turn Your Intranet Into A Collaboration Platform > http://p.sf.net/sfu/ExoPlatform > > ------------------------------ > > > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > -- > Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. > > > ------------------------------------------------------------------------------ > Start Your Social Network Today - Download eXo Platform > Build your Enterprise Intranet with eXo Platform Software > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > Get Started Now And Turn Your Intranet Into A Collaboration Platform > http://p.sf.net/sfu/ExoPlatform > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > |
From: Richard F. <fa...@be...> - 2014-04-23 19:14:38
|
On 4/23/2014 11:31 AM, Scott Hughes wrote: > > Thanks for answering. I am comparing the results to other similar > calculations. Unfortunately I need to be able to review both rounded > and full results. eg. (7^12345678+8^2345678) / (9^5678901 + 3^2334555) > You can get an approximate result by using bigfloats. If you write (7.0b0^12345678+8.0b0^2345678) / (9.0b0^5678901 + 3.0b0^2334555); The answer comes out 3.462179964245316b5014259 That is, 3.46 ... X 10^5014259 If you compute the numerator and denominator separately, you learn they have 10433308 and 5014259 decimal digits, respectively. So an exact answer will probably display with some 15 million characters. How do you plan to compare these characters with other "similar calculations"? You can easily calculate the last few digits, say: modulus:100 rat(7)^12345678 gives -11 so the last 2 digits are 89. Good luck with your numerology. RJF > *From:*Richard Fateman [mailto:fa...@be...] > *Sent:* April-23-14 2:11 PM > *To:* Scott Hughes; <max...@li...> > *Subject:* Re: [Maxima-discuss] Maxima (lisp on Mac) - heap exhausted > > what do you plan to do with a number raised to the power 60,000,000? > > If you are computing it in order to then reduce it modulo some other > number, > then there is a better way to do it. > > > > On 4/23/2014 6:34 AM, Scott Hughes wrote: > > Firstly, I'm not a programmer and only recently started to use > Maxima (command line). I don't know anything about lisp. I'm > running Maxima on a Mac but also on a PC through Windows. Both are > the command line version. > > I only need to use Maxima for a few basic operations, primarily > small numbers raised to large (at least 8) exponents. Aside from > that, I'm using the round and asksign commands. > > I'm encountering "heap exhausted" errors once my exponents get > beyond about 60 000 000 and have looked in manual and forums for > help. There is reference to changing heap size but I didn't > understand the command or even how to enter it. Can anyone help me > with very explicit instructions ? I'm not concerned with the > length of time the calculations take, just don't want them to > crash before they complete. > |
From: Robert D. <rob...@gm...> - 2014-04-23 19:38:50
|
On 2014-04-23, Scott Hughes <hug...@ho...> wrote: > I'm encountering "heap exhausted" errors once my exponents get beyond about > 60000000 and have looked in manual and forums for help. "Heap exhausted" means that the underlying Lisp implementation has run out of memory trying to accomplish some operation. In this case, it may be trying to construct extremely large integers (just guessing). Different Lisp implementations manage memory differently. My experience is that GCL runs into out-of-memory errors more often than other implementations. Unfortunately the Windows installers are built with GCL so that is the usual implementation. What Lisp implementation is your Mac using? build_info(); tells that. By the way, can you give an example that provokes the error so we can try it? best Robert Dodier |