rtoy / maxima

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

floor(sqrt(10^51+1)) => noun form #2656

Open rtoy opened 1 month ago

rtoy commented 1 month ago

Imported from SourceForge on 2024-07-06 17:11:26 Created by macrakis on 2018-03-11 21:48:14 Original: https://sourceforge.net/p/maxima/bugs/3408


Surprising, because we have isqrt. There also doesn't seem any way to force floor to try more bfloat digits.

Somewhat messier case:

1000000000000*(sqrt(100000000000000000000000010)-3*sqrt(11111111111111111111111110))
 => 0

Correct answer is 1.

bfloat/floor is consistent starting with fpprec=72

Why doesn't pretty-good-floor-or-ceiling look at whether the distance to an integer changes from one value of fpprec to the next rather than just whether floor(answer) is consistent?

Consider:

tt: 1000000000000*(sqrt(100000000000000000000000010)-3*sqrt(11111111111111111111111110))$

makelist(-float(round(bb:bfloat(tt))-bb),fpprec,60,100);

[ 2.35e-37, -1.07e-37, -2.12e-38,  2.17e-40, -4.51e-40, -3.34e-41,
  3.18e-42,  2.47e-43,  1.84e-45, -7.11e-46, -7.39e-47,  5.73e-48,
  7.51e-49,  1.29e-49,  1.22e-50,  8.30e-53,  1.30e-51,  1.26e-51,
  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,
  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,
  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,
  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51,  1.25e-51]
rtoy commented 1 month ago

Imported from SourceForge on 2024-07-06 17:11:28 Created by macrakis on 2018-12-10 19:12:50 Original: https://sourceforge.net/p/maxima/bugs/3408/#14aa


In Maxima 5.42.0 SBCL 1.4.2, the ^51 case works, but floor(sqrt(10^52+1)) does not. The "somewhat messier case" should be floor(***)