rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

abs(...) -> "bfloat: attempted conversion of floating-point infinity." #1138

Open rtoy opened 1 month ago

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:46:52 Created by tomasriker on 2016-01-25 16:23:15 Original: https://sourceforge.net/p/maxima/bugs/3081


I just came across something very strange: When doing abs(%e^(10000/3)+1);, I get the error "bfloat: attempted conversion of floating-point infinity."

OK, you might think, it's just a huge number. But when removing the /3, it works! It also works when removing the +1.

Maxima branch_5_37_base_407_g2af0c38 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) abs(%e^(10000/3)+1);

bfloat: attempted conversion of floating-point infinity.
 -- an error. To debug this try: debugmode(true);
(%i2) abs(%e^10000+1);
                                    10000
(%o2)                             %e      + 1
(%i3) abs(%e^(10000/3));
                                     10000/3
(%o3)                              %e
rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:46:54 Created by tomasriker on 2016-01-25 16:36:30 Original: https://sourceforge.net/p/maxima/bugs/3081/#e8db


This seems to be the cause:

Maxima branch_5_37_base_407_g2af0c38 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) float(%e^(10000/3));
(%o1)                             i.nfE-16128
(%i2) float(%e^10000);
(%o2)                       8.806818225658306b4342

For some reason, Maxima doesn't "promote" the first result to a big float, but it does do so with the second one.

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:46:57 Created by tomasriker on 2016-01-27 07:28:51 Original: https://sourceforge.net/p/maxima/bugs/3081/#f169


Fixed by https://sourceforge.net/p/maxima/code/ci/2c7bf01b64711c4823fa025995fda9dd9794c18c/

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:47:01 Created by tomasriker on 2016-01-27 07:29:22 Original: https://sourceforge.net/p/maxima/bugs/3081/#040f


rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:47:04 Created by robert_dodier on 2016-03-14 20:51:35 Original: https://sourceforge.net/p/maxima/bugs/3081/#af58


rtoy commented 1 month ago

Imported from SourceForge on 2024-07-04 00:47:08 Created by robert_dodier on 2016-03-14 20:51:35 Original: https://sourceforge.net/p/maxima/bugs/3081/#40b5


Note that since the float-to-bigfloat promotion code has been moved to branch promote-float-to-bigfloat and reverted on master, this bug report is no longer applicable. I've marked it "wont-fix" to distinguish it from "closed".