Faster factor finder method for 42S
12-02-2019, 12:19 PM
Post: #13
 Dave Britten Senior Member Posts: 2,081 Joined: Dec 2013
RE: Faster factor finder method for 42S
(12-02-2019 07:17 AM)Werner Wrote:  Great idea, Dave!
Can't wait to rewrite my own routine using this idea! (using only the stack, and without flags ;-)
There's a simpler way of finding out whether there's a zero in your remainders: (and no need for the matrix R)

Code:
 SF 25  1/X  FC?C 25  GTO 02

Very clever! That won't tell you where in the matrix there was a zero, so you'll have to take additional steps to find it, but optimizing for the common case (i.e. no factors found) makes sense.

It's a shame that MOD won't work with matrices the same way division and 1/X will. In its current state, the matrix approach won't work with 12-digit numbers, since the fractional part will be lost with small divisors (any result where the fractional part rounds down to .0 will have the same issue).
 « Next Oldest | Next Newest »

 Messages In This Thread Faster factor finder method for 42S - Dave Britten - 11-26-2019, 04:24 PM RE: Faster factor finder method for 42S - Csaba Tizedes - 11-29-2019, 09:38 AM RE: Faster factor finder method for 42S - Dave Britten - 11-29-2019, 01:26 PM RE: Faster factor finder method for 42S - Paul Dale - 11-29-2019, 10:16 AM RE: Faster factor finder method for 42S - grsbanks - 11-29-2019, 11:27 AM RE: Faster factor finder method for 42S - Joe Horn - 11-29-2019, 01:12 PM RE: Faster factor finder method for 42S - grsbanks - 11-29-2019, 01:25 PM RE: Faster factor finder method for 42S - Joe Horn - 11-29-2019, 02:04 PM RE: Faster factor finder method for 42S - Dave Britten - 11-29-2019, 04:27 PM RE: Faster factor finder method for 42S - DMaier - 11-30-2019, 09:32 PM RE: Faster factor finder method for 42S - J-F Garnier - 12-01-2019, 08:02 PM RE: Faster factor finder method for 42S - Werner - 12-02-2019, 07:17 AM RE: Faster factor finder method for 42S - Dave Britten - 12-02-2019 12:19 PM

User(s) browsing this thread: 1 Guest(s)