Common Lisp standard provides ISQRT, which satisfies
the documentation of approxSqrt, well, approxSqrt requires:
-1 < approxSqrt(n) - sqrt(n) < 1
but ISQRT is more accurate:
-1 < ISQRT(n)$Lisp - sqrt(n) <= 0
Further more, ISQRT is faster, at least in SBCL:
(35) -> [approxSqrt(x) for x in 10^21+(1..2*10^5)];
Type: List(Integer)
Time: 0.77 (EV) = 0.77 sec
(36) -> [ISQRT(x)$Lisp for x in 10^21+(1..2*10^5)];
Type: List(SExpression)
Time: 0.41 (EV) = 0.41 sec
Our definition for approxSqrt is unusual, compare with
Wikipedia: https://en.wikipedia.org/wiki/Integer_square_root
And as I said before, this is a big source of inaccuracy in
sqrt$Float.
So I want changes to approxSqrt, opinions?
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.