flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > multiprecision calculator for win64

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4039
Location: vpcmpistri
bitRAKE 09 Aug 2013, 13:50
So, you just want to know if a number is a perfect square? If so, then return square root? Otherwise, I'm confused.

This thread seems to cover both fast exclusion and calculation:
http://board.flatassembler.net/topic.php?p=134231#134231

Multiple limb algorithms will use a fast approximation, and newtons method. A good initial guess is just to clip the binary string to half the length.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 09 Aug 2013, 13:50
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 09 Aug 2013, 14:54
Yes - if it is a perfect square, it should return the square root, otherwise fail.
I really though you had a purely integer clever solution...
Post 09 Aug 2013, 14:54
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4039
Location: vpcmpistri
bitRAKE 09 Aug 2013, 15:25
I do, but it's not faster unless (r) and (s) are needed. One use was for a modified Fermat factoring algorithm. The internal square root is faster for the single limb case, and newton's is faster for multi-limb, afaik. Anyhow my cleaver implementation is at the end of that thread.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 09 Aug 2013, 15:25
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 10 Aug 2013, 13:11
Alright, the new version checks if sqrt(x) and x/y are integers during evaluation. It also has an SSA-based optimizer which can speed up loops by about 30%.
Post 10 Aug 2013, 13:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.