Menu

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

None
open
nobody
floor (7)
5
2021-01-12
2018-03-11
No

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]

Discussion

  • Stavros Macrakis

    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(***)

     
  • Robert Dodier

    Robert Dodier - 2021-01-12
    • labels: --> floor
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,9 +2,10 @@
     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
    -
    +```
    +1000000000000*(sqrt(100000000000000000000000010)-3*sqrt(11111111111111111111111110))
    + => 0
    +```
     Correct answer is 1.
    
     bfloat/floor is consistent starting with fpprec=72
    @@ -12,7 +13,7 @@
     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);
    @@ -24,3 +25,4 @@
       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]
    +```
    
     

Log in to post a comment.