Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

It is surely a great calamity for a human being to have no obsessions. -- Robert Bly


devel / comp.lang.forth / Pollard revisited

SubjectAuthor
* Pollard revisitednone
+* Re: Pollard revisitedMarcel Hendrix
|`* Re: Pollard revisitedlehs
| `* Re: Pollard revisitedminf...@arcor.de
|  `- Re: Pollard revisitedlehs
`* Re: Pollard revisitedminf...@arcor.de
 `* Re: Pollard revisitedPaul Rubin
  +- Re: Pollard revisitedlehs
  `* Re: Pollard revisitednone
   `* Re: Pollard revisitedPaul Rubin
    `* Re: Pollard revisitedminf...@arcor.de
     +* Re: Pollard revisitedMarcel Hendrix
     |`* Re: Pollard revisitedminf...@arcor.de
     | `- Re: Pollard revisitedMarcel Hendrix
     `* Re: Pollard revisitedPaul Rubin
      +* Re: Pollard revisitednone
      |`* Re: Pollard revisitedMarcel Hendrix
      | +- Re: Pollard revisitedminf...@arcor.de
      | `- Re: Pollard revisitednone
      `- Re: Pollard revisitedminf...@arcor.de

1
Pollard revisited

<nnd$0dba1fef$56eb104c@2c34d2caae6323b6>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21563&group=comp.lang.forth#21563

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Pollard revisited
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
Organization: KPN B.V.
Date: Wed, 07 Dec 2022 15:17:57 +0100
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 48
Injection-Date: Wed, 07 Dec 2022 15:17:57 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2216
 by: none - Wed, 7 Dec 2022 14:17 UTC

In Forth Dimensions 6 number 6, Grossman published an article
about the pollard method of factoring numbers.
See the excellent explanation via
http://soton.mpeforth.com/flag/fd/index.html

He was obliged to implement quad precision operators.
The example 4225910033 was at the limit, gaining a factor
2 from using unsigned numbers. This took 40 seconds.

The same example takes less that 400 uS on my AMD 64 bit.
More over this implementation can handle double the amount
of digits (64 bit signed) despite it has no need to resort
to double precision except the standard UM/MOD UM* .

\ ----------------------------------
\ Pollard (rho) factoring method

: GCD BEGIN OVER MOD DUP WHILE SWAP REPEAT DROP ;

VARIABLE n
VARIABLE b 1 b !
VARIABLE x 6 x !

: next DUP UM* n @ UM/MOD DROP b @ + ;

: try SWAP next SWAP next next 2DUP = ABORT" failure" ;

: factorize DUP n ! x @ DUP next
BEGIN 2DUP - ABS n @ GCD DUP 1 = WHILE DROP try REPEAT
NIP NIP GCD ;
\ REGRESS 4294967297 factorize S: 641
\ REGRESS 4225910033 factorize S: 65011
\ REGRESS 1,000,000,007 DUP * factorize S: 1,000,000,007

\ ----------------------------------

The REGRESS lines are tests or examples.
This is a Monte Carlo program. You may not succeed with
the values of x and b given. You can change them as long
as b is not 0 or -2 .

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Pollard revisited

<0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21566&group=comp.lang.forth#21566

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:6090:b0:3a6:9a4e:e376 with SMTP id hf16-20020a05622a609000b003a69a4ee376mr20833521qtb.415.1670440551922;
Wed, 07 Dec 2022 11:15:51 -0800 (PST)
X-Received: by 2002:ac8:5145:0:b0:3a5:4544:a46e with SMTP id
h5-20020ac85145000000b003a54544a46emr72912906qtn.305.1670440551777; Wed, 07
Dec 2022 11:15:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 7 Dec 2022 11:15:51 -0800 (PST)
In-Reply-To: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
Injection-Info: google-groups.googlegroups.com; posting-host=84.30.53.30; posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 84.30.53.30
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>
Subject: Re: Pollard revisited
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Wed, 07 Dec 2022 19:15:51 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2328
 by: Marcel Hendrix - Wed, 7 Dec 2022 19:15 UTC

On Wednesday, December 7, 2022 at 3:18:01 PM UTC+1, none albert wrote:
[..]
> This is a Monte Carlo program. You may not succeed with
> the values of x and b given. You can change them as long
> as b is not 0 or -2 .

FORTH> 1111 factorize . 11 ok
FORTH> 1111 11 /mod . . 101 0 ok
FORTH> 11111 dup factorize /mod . . 271 0 ok
FORTH> 111111 dup factorize /mod . . 10101 0 ok
FORTH> 1111111 dup factorize /mod . . 4649 0 ok
FORTH> 11111111 dup factorize /mod . . 1010101 0 ok
FORTH> 111111111 dup factorize /mod . . 12345679 0 ok
FORTH> 1111111111 dup factorize /mod . . 101010101 0 ok
FORTH> 11111111111 dup factorize /mod . . 513239 0 ok
FORTH> 111111111111 dup factorize /mod . . 10101010101 0 ok
FORTH> 1111111111111 dup factorize /mod . . 20964360587 0 ok
FORTH> 11111111111111 dup factorize /mod . . 1010101010101 0 ok
FORTH> 111111111111111 dup factorize /mod . . 3584229390681 0 ok
FORTH> 1111111111111111 dup factorize /mod . . 101010101010101 0 ok
FORTH> 11111111111111111 dup factorize /mod . . 5363222357 0 ok
FORTH> 111111111111111111 dup factorize /mod . . 10101010101010101 0 ok
FORTH> 1111111111111111111 dup factorize /mod . .

Hmmm, apparently it's not only 0 and -2 that are special ...

-marcel

Re: Pollard revisited

<fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21575&group=comp.lang.forth#21575

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:13c7:b0:6fc:acb4:58b5 with SMTP id g7-20020a05620a13c700b006fcacb458b5mr24080042qkl.578.1670488944832;
Thu, 08 Dec 2022 00:42:24 -0800 (PST)
X-Received: by 2002:ae9:e412:0:b0:6fa:30f1:c1ba with SMTP id
q18-20020ae9e412000000b006fa30f1c1bamr84063961qkc.117.1670488944610; Thu, 08
Dec 2022 00:42:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 8 Dec 2022 00:42:24 -0800 (PST)
In-Reply-To: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc2d:4c58:c7a2:b65d:6409;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc2d:4c58:c7a2:b65d:6409
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Thu, 08 Dec 2022 08:42:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3074
 by: minf...@arcor.de - Thu, 8 Dec 2022 08:42 UTC

none albert schrieb am Mittwoch, 7. Dezember 2022 um 15:18:01 UTC+1:
> In Forth Dimensions 6 number 6, Grossman published an article
> about the pollard method of factoring numbers.
> See the excellent explanation via
> http://soton.mpeforth.com/flag/fd/index.html
>
> He was obliged to implement quad precision operators.
> The example 4225910033 was at the limit, gaining a factor
> 2 from using unsigned numbers. This took 40 seconds.
>
> The same example takes less that 400 uS on my AMD 64 bit.
> More over this implementation can handle double the amount
> of digits (64 bit signed) despite it has no need to resort
> to double precision except the standard UM/MOD UM* .
>
> \ ----------------------------------
> \ Pollard (rho) factoring method
>
> : GCD BEGIN OVER MOD DUP WHILE SWAP REPEAT DROP ;
>
> VARIABLE n
> VARIABLE b 1 b !
> VARIABLE x 6 x !
>
> : next DUP UM* n @ UM/MOD DROP b @ + ;
>
> : try SWAP next SWAP next next 2DUP = ABORT" failure" ;
>
> : factorize DUP n ! x @ DUP next
> BEGIN 2DUP - ABS n @ GCD DUP 1 = WHILE DROP try REPEAT
> NIP NIP GCD ;
> \ REGRESS 4294967297 factorize S: 641
> \ REGRESS 4225910033 factorize S: 65011
> \ REGRESS 1,000,000,007 DUP * factorize S: 1,000,000,007
>
> \ ----------------------------------
>
> The REGRESS lines are tests or examples.
> This is a Monte Carlo program. You may not succeed with
> the values of x and b given. You can change them as long
> as b is not 0 or -2 .

Your Forth code is very concise, congrats!

A long while ago I experimented with Brent's algorithm with
128-bit integers, but did not pursue it because I did not find
good ways to select modified start parameters and function
(your next) after factorization failure.

You are probably more versed in mathematics than I am,
so what do you suggest: simply stepping parameters up, random
generation, or?

Re: Pollard revisited

<78239a14-1b2e-4622-a0a9-73639f057c97n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21578&group=comp.lang.forth#21578

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:c3cc:0:b0:4c6:a05d:f67e with SMTP id p12-20020a0cc3cc000000b004c6a05df67emr67142170qvi.4.1670490439222;
Thu, 08 Dec 2022 01:07:19 -0800 (PST)
X-Received: by 2002:a05:622a:4d94:b0:3a5:fb6c:d96a with SMTP id
ff20-20020a05622a4d9400b003a5fb6cd96amr86463679qtb.185.1670490439010; Thu, 08
Dec 2022 01:07:19 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 8 Dec 2022 01:07:18 -0800 (PST)
In-Reply-To: <0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=90.231.68.104; posting-account=SyAImgoAAADqgKhPsN0hVfixtMRRZ8fs
NNTP-Posting-Host: 90.231.68.104
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78239a14-1b2e-4622-a0a9-73639f057c97n@googlegroups.com>
Subject: Re: Pollard revisited
From: skydda.b...@gmail.com (lehs)
Injection-Date: Thu, 08 Dec 2022 09:07:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 29
 by: lehs - Thu, 8 Dec 2022 09:07 UTC

onsdag 7 december 2022 kl. 20:15:53 UTC+1 skrev Marcel Hendrix:
> On Wednesday, December 7, 2022 at 3:18:01 PM UTC+1, none albert wrote:
> [..]
> > This is a Monte Carlo program. You may not succeed with
> > the values of x and b given. You can change them as long
> > as b is not 0 or -2 .
> FORTH> 1111 factorize . 11 ok
> FORTH> 1111 11 /mod . . 101 0 ok
> FORTH> 11111 dup factorize /mod . . 271 0 ok
> FORTH> 111111 dup factorize /mod . . 10101 0 ok
> FORTH> 1111111 dup factorize /mod . . 4649 0 ok
> FORTH> 11111111 dup factorize /mod . . 1010101 0 ok
> FORTH> 111111111 dup factorize /mod . . 12345679 0 ok
> FORTH> 1111111111 dup factorize /mod . . 101010101 0 ok
> FORTH> 11111111111 dup factorize /mod . . 513239 0 ok
> FORTH> 111111111111 dup factorize /mod . . 10101010101 0 ok
> FORTH> 1111111111111 dup factorize /mod . . 20964360587 0 ok
> FORTH> 11111111111111 dup factorize /mod . . 1010101010101 0 ok
> FORTH> 111111111111111 dup factorize /mod . . 3584229390681 0 ok
> FORTH> 1111111111111111 dup factorize /mod . . 101010101010101 0 ok
> FORTH> 11111111111111111 dup factorize /mod . . 5363222357 0 ok
> FORTH> 111111111111111111 dup factorize /mod . . 10101010101010101 0 ok
> FORTH> 1111111111111111111 dup factorize /mod . .
>
> Hmmm, apparently it's not only 0 and -2 that are special ...
>
> -marcel
Pollard rho will always give an answer if increasing start values at failure.

https://forthmath.blogspot.com/2020/01/about-pollard-rho.html

Re: Pollard revisited

<eac8e496-e046-4d03-b28e-eb5624d7db13n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21580&group=comp.lang.forth#21580

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:192a:b0:4c7:4ec8:d616 with SMTP id es10-20020a056214192a00b004c74ec8d616mr20379100qvb.55.1670491643896;
Thu, 08 Dec 2022 01:27:23 -0800 (PST)
X-Received: by 2002:a05:6214:16f:b0:4c6:ed60:798 with SMTP id
y15-20020a056214016f00b004c6ed600798mr47887528qvs.88.1670491643767; Thu, 08
Dec 2022 01:27:23 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 8 Dec 2022 01:27:23 -0800 (PST)
In-Reply-To: <78239a14-1b2e-4622-a0a9-73639f057c97n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc2d:4c58:c7a2:b65d:6409;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc2d:4c58:c7a2:b65d:6409
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>
<78239a14-1b2e-4622-a0a9-73639f057c97n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eac8e496-e046-4d03-b28e-eb5624d7db13n@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Thu, 08 Dec 2022 09:27:23 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: minf...@arcor.de - Thu, 8 Dec 2022 09:27 UTC

lehs schrieb am Donnerstag, 8. Dezember 2022 um 10:07:20 UTC+1:
> Pollard rho will always give an answer if increasing start values at failure.
>
> https://forthmath.blogspot.com/2020/01/about-pollard-rho.html

Thanks! I did not see "the tree in the forest". I am now gathering that with unchanged
function (x^2+1)mod n, simply stepping up x0 after failure guarantees to get
a factorization. So after max 2 rounds there is a result, correct?

BTW I like your web page, I did not know it existed.

Re: Pollard revisited

<d456fc41-ef2e-4b23-a38b-58c86c37c0dan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21582&group=comp.lang.forth#21582

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1a82:b0:6fa:19a4:ab6f with SMTP id bl2-20020a05620a1a8200b006fa19a4ab6fmr84763181qkb.759.1670492874899;
Thu, 08 Dec 2022 01:47:54 -0800 (PST)
X-Received: by 2002:a37:88c7:0:b0:6ec:537f:3d94 with SMTP id
k190-20020a3788c7000000b006ec537f3d94mr65270420qkd.376.1670492874057; Thu, 08
Dec 2022 01:47:54 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 8 Dec 2022 01:47:53 -0800 (PST)
In-Reply-To: <eac8e496-e046-4d03-b28e-eb5624d7db13n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=90.231.68.104; posting-account=SyAImgoAAADqgKhPsN0hVfixtMRRZ8fs
NNTP-Posting-Host: 90.231.68.104
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <0a571b2f-b357-436b-b319-ba623e0b306bn@googlegroups.com>
<78239a14-1b2e-4622-a0a9-73639f057c97n@googlegroups.com> <eac8e496-e046-4d03-b28e-eb5624d7db13n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d456fc41-ef2e-4b23-a38b-58c86c37c0dan@googlegroups.com>
Subject: Re: Pollard revisited
From: skydda.b...@gmail.com (lehs)
Injection-Date: Thu, 08 Dec 2022 09:47:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2768
 by: lehs - Thu, 8 Dec 2022 09:47 UTC

torsdag 8 december 2022 kl. 10:27:25 UTC+1 skrev minf...@arcor.de:
> lehs schrieb am Donnerstag, 8. Dezember 2022 um 10:07:20 UTC+1:
> > Pollard rho will always give an answer if increasing start values at failure.
> >
> > https://forthmath.blogspot.com/2020/01/about-pollard-rho.html
> Thanks! I did not see "the tree in the forest". I am now gathering that with unchanged
> function (x^2+1)mod n, simply stepping up x0 after failure guarantees to get
> a factorization. So after max 2 rounds there is a result, correct?
>
> BTW I like your web page, I did not know it existed.
Thanks! You may have to increase several times.

Here is the code I use (all singles unsigned):

2 value start

: func \ n numb -- m
swap dup um* 1 0 d+ rot um/mod drop ;

: pollard1 \ numb start -- pfac flag numb is an odd composite
swap locals| numb | dup 1
begin drop numb func swap
numb func numb func swap
2dup - abs
numb ugcd dup numb = \ gcd flag
if 2drop false exit
then dup 1 = 0= \ gcd<>1
until nip nip true ;

: pollard2 \ numb -- prime numb>1
dup 1 and 0= if drop 2 exit then
dup isprime if exit then
dup sqrtf dup * over =
if sqrtf exit then -1 start \ numb 100 0
do dup i pollard1 \ numb pfac flag
if leave \ numb pfac
then drop \ numb
loop nip ; \ pfac

Re: Pollard revisited

<871qpab3oo.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21585&group=comp.lang.forth#21585

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Pollard revisited
Date: Thu, 08 Dec 2022 02:16:55 -0800
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <871qpab3oo.fsf@nightsong.com>
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
<fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="eb26dd6e4acd6b4912ff7b75fc55a7cb";
logging-data="905718"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/y8jeTyX0BJVsPFU3Ltu2J"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:S0X0G7ctvYsL7bXTdbdPGKO6e/M=
sha1:QOWolC7DXFoxdhSLkFqLcJRqnCU=
 by: Paul Rubin - Thu, 8 Dec 2022 10:16 UTC

"minf...@arcor.de" <minforth@arcor.de> writes:
> You are probably more versed in mathematics than I am,
> so what do you suggest: simply stepping parameters up, random
> generation, or?

Pollard's rho is conceptually simple but runs out of gas sooner than
other, fancier algorithms do. I think the satisfying thing to do is
implement the fancier algorithms. I confess I've implemented Pollard
Rho (not in Forth) but haven't gone further.

Neal Koblitz's book "A Course in Number Theory and Cryptography" has a
good introduction to the subject, up through the Quadratic Sieve (QS).
It unfortunately doesn't discuss the Number Field Sieve.

Re: Pollard revisited

<485ec26c-0e7e-4669-afbf-d3dbd52ba875n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21586&group=comp.lang.forth#21586

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:716:b0:4c7:3b70:82f with SMTP id c22-20020a056214071600b004c73b70082fmr23322866qvz.25.1670496024349;
Thu, 08 Dec 2022 02:40:24 -0800 (PST)
X-Received: by 2002:a05:622a:1c0b:b0:3a6:a439:3a1 with SMTP id
bq11-20020a05622a1c0b00b003a6a43903a1mr18778358qtb.686.1670496024155; Thu, 08
Dec 2022 02:40:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 8 Dec 2022 02:40:23 -0800 (PST)
In-Reply-To: <871qpab3oo.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=90.231.68.104; posting-account=SyAImgoAAADqgKhPsN0hVfixtMRRZ8fs
NNTP-Posting-Host: 90.231.68.104
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <485ec26c-0e7e-4669-afbf-d3dbd52ba875n@googlegroups.com>
Subject: Re: Pollard revisited
From: skydda.b...@gmail.com (lehs)
Injection-Date: Thu, 08 Dec 2022 10:40:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1965
 by: lehs - Thu, 8 Dec 2022 10:40 UTC

torsdag 8 december 2022 kl. 11:16:58 UTC+1 skrev Paul Rubin:
> "minf...@arcor.de" <minf...@arcor.de> writes:
> > You are probably more versed in mathematics than I am,
> > so what do you suggest: simply stepping parameters up, random
> > generation, or?
> Pollard's rho is conceptually simple but runs out of gas sooner than
> other, fancier algorithms do. I think the satisfying thing to do is
> implement the fancier algorithms. I confess I've implemented Pollard
> Rho (not in Forth) but haven't gone further.
>
> Neal Koblitz's book "A Course in Number Theory and Cryptography" has a
> good introduction to the subject, up through the Quadratic Sieve (QS).
> It unfortunately doesn't discuss the Number Field Sieve.
I guess 64 bit singles is close to the limit for Pollard rho.

Re: Pollard revisited

<nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21587&group=comp.lang.forth#21587

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com> <871qpab3oo.fsf@nightsong.com>
Subject: Re: Pollard revisited
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
Organization: KPN B.V.
Date: Thu, 08 Dec 2022 12:26:38 +0100
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 36
Injection-Date: Thu, 08 Dec 2022 12:26:38 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2332
 by: none - Thu, 8 Dec 2022 11:26 UTC

In article <871qpab3oo.fsf@nightsong.com>,
Paul Rubin <no.email@nospam.invalid> wrote:
>"minf...@arcor.de" <minforth@arcor.de> writes:
>> You are probably more versed in mathematics than I am,
>> so what do you suggest: simply stepping parameters up, random
>> generation, or?
>
>Pollard's rho is conceptually simple but runs out of gas sooner than
>other, fancier algorithms do. I think the satisfying thing to do is
>implement the fancier algorithms. I confess I've implemented Pollard
>Rho (not in Forth) but haven't gone further.
>
>Neal Koblitz's book "A Course in Number Theory and Cryptography" has a
>good introduction to the subject, up through the Quadratic Sieve (QS).
>It unfortunately doesn't discuss the Number Field Sieve.

We (Forth fig) had a quadratic sieve running in 1996 on 4 transputers.
The charm of the simple algorithm presented that is short and easy
to understand. I can't fathom that you think that I present here the
end-all of factorization algorithms.

Implementing fancier algorithm is not satisfying at all.
You soon realize that you need to be a good mathematician (I
think I am) but that you need invest years of your life to get
at the frontier.

I challenge you to present an algorithm that has a better
performance to conciseness ratio than what I presented here.

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Pollard revisited

<87a63vyd84.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21624&group=comp.lang.forth#21624

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Pollard revisited
Date: Fri, 09 Dec 2022 22:39:07 -0800
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87a63vyd84.fsf@nightsong.com>
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
<fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com>
<nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="aa8763005288af76bb5af827370b4d2d";
logging-data="1698330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fUQ6nmx9uMBrBGyD4DHrZ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:/aUpvqcwbBXQGr/SFKnKwEMWVkg=
sha1:LKr/ACrB7gJNy2CCt00NosimodU=
 by: Paul Rubin - Sat, 10 Dec 2022 06:39 UTC

albert@cherry.(none) (albert) writes:
> I can't fathom that you think that I present here [Pollard rho] the
> end-all of factorization algorithms.

Of course I don't think that. It's a nice simple way to factor numbers
that are a little too big for trial division.

> Implementing fancier algorithm is not satisfying at all. You soon
> realize that you need to be a good mathematician (I think I am) but
> that you need invest years of your life to get at the frontier.

The book I mentioned discusses ECM and the Quadratic Sieve in addition
to the rho method and a few others. Those aren't the frontier and don't
take years to understand or implement, given a reasonable math
background (a long way from the frontier). The remaining algorithm is
the NFS which I don't understand, but which doesn't seem to be alien
technology either.

> I challenge you to present an algorithm that has a better
> performance to conciseness ratio than what I presented here.

I agree that the fancier methods take more code. But they have better
asymptotic performance so you can factor bigger numbers with them.

Re: Pollard revisited

<a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21625&group=comp.lang.forth#21625

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:40c5:0:b0:4c7:539d:8cd3 with SMTP id x5-20020ad440c5000000b004c7539d8cd3mr19689132qvp.103.1670659633836;
Sat, 10 Dec 2022 00:07:13 -0800 (PST)
X-Received: by 2002:ac8:7301:0:b0:3a7:ea0a:b995 with SMTP id
x1-20020ac87301000000b003a7ea0ab995mr10909207qto.478.1670659632389; Sat, 10
Dec 2022 00:07:12 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 10 Dec 2022 00:07:12 -0800 (PST)
In-Reply-To: <87a63vyd84.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc6b:9c39:1014:c744:9819;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc6b:9c39:1014:c744:9819
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com> <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3> <87a63vyd84.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 10 Dec 2022 08:07:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2988
 by: minf...@arcor.de - Sat, 10 Dec 2022 08:07 UTC

Paul Rubin schrieb am Samstag, 10. Dezember 2022 um 07:39:10 UTC+1:
> albert@cherry.(none) (albert) writes:
> > I can't fathom that you think that I present here [Pollard rho] the
> > end-all of factorization algorithms.
>
> Of course I don't think that. It's a nice simple way to factor numbers
> that are a little too big for trial division.
> > Implementing fancier algorithm is not satisfying at all. You soon
> > realize that you need to be a good mathematician (I think I am) but
> > that you need invest years of your life to get at the frontier.
> The book I mentioned discusses ECM and the Quadratic Sieve in addition
> to the rho method and a few others. Those aren't the frontier and don't
> take years to understand or implement, given a reasonable math
> background (a long way from the frontier). The remaining algorithm is
> the NFS which I don't understand, but which doesn't seem to be alien
> technology either.
> > I challenge you to present an algorithm that has a better
> > performance to conciseness ratio than what I presented here.
> I agree that the fancier methods take more code. But they have better
> asymptotic performance so you can factor bigger numbers with them.

The question is, when do numbers start becoming "bigger numbers"?
When I start thinking about elliptic curve methods for factorization e.g.
https://github.com/sethtroisi/gmp-ecm
and doing it in Forth, the lack of bignum math becomes apparent. Instead
of reinventing wheels, bignum library support a la GMP MP is required
plus an adequate I/O and API interface on Forth system side.
But well, this would still be far away from the alleged frontier I fear .. ;-)

Re: Pollard revisited

<1e3631f0-e26c-474d-a4b4-b0e259183df9n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21627&group=comp.lang.forth#21627

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:60c3:0:b0:3a5:f9ba:8c68 with SMTP id i3-20020ac860c3000000b003a5f9ba8c68mr84348072qtm.192.1670672061605;
Sat, 10 Dec 2022 03:34:21 -0800 (PST)
X-Received: by 2002:a37:88c7:0:b0:6ec:537f:3d94 with SMTP id
k190-20020a3788c7000000b006ec537f3d94mr66281992qkd.376.1670672061421; Sat, 10
Dec 2022 03:34:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 10 Dec 2022 03:34:21 -0800 (PST)
In-Reply-To: <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:c0fc:425:4380:6d51;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:c0fc:425:4380:6d51
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com> <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
<87a63vyd84.fsf@nightsong.com> <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e3631f0-e26c-474d-a4b4-b0e259183df9n@googlegroups.com>
Subject: Re: Pollard revisited
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 10 Dec 2022 11:34:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2499
 by: Marcel Hendrix - Sat, 10 Dec 2022 11:34 UTC

On Saturday, December 10, 2022 at 9:07:15 AM UTC+1, minf...@arcor.de wrote:
[..]
> The question is, when do numbers start becoming "bigger numbers"?
> When I start thinking about elliptic curve methods for factorization e.g.
> https://github.com/sethtroisi/gmp-ecm
> and doing it in Forth, the lack of bignum math becomes apparent. Instead
> of reinventing wheels, bignum library support a la GMP MP is required
> plus an adequate I/O and API interface on Forth system side.
> But well, this would still be far away from the alleged frontier I fear .. ;-)

iForth has three bignum math libraries (one of them in pure Forth), plus the
interfaces to gmp, mpc, and mpfr. I have to admit I never felt the need for
numbers with more than 2048 decimal places, but feel free.

I started out with iSPICE having arbitrary precision, but found out that there
are fundamental numerical decisions made in the SPICE foundations
that make that not a solution to anything. It is still possible to set a compile-time
constant to get 80-bit precision (native FPU format), but the only noticeable
difference is a 2x slowdown.

-marcel

Re: Pollard revisited

<a97c6092-c47a-4cf2-a5ec-449e04e06518n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21629&group=comp.lang.forth#21629

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:4899:b0:3a5:64a0:5eba with SMTP id fc25-20020a05622a489900b003a564a05ebamr73350523qtb.96.1670680058585;
Sat, 10 Dec 2022 05:47:38 -0800 (PST)
X-Received: by 2002:a05:6214:3683:b0:4b4:5664:6393 with SMTP id
nl3-20020a056214368300b004b456646393mr71539619qvb.51.1670680058350; Sat, 10
Dec 2022 05:47:38 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 10 Dec 2022 05:47:38 -0800 (PST)
In-Reply-To: <1e3631f0-e26c-474d-a4b4-b0e259183df9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc6b:9c39:1014:c744:9819;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc6b:9c39:1014:c744:9819
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com> <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
<87a63vyd84.fsf@nightsong.com> <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
<1e3631f0-e26c-474d-a4b4-b0e259183df9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a97c6092-c47a-4cf2-a5ec-449e04e06518n@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 10 Dec 2022 13:47:38 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2893
 by: minf...@arcor.de - Sat, 10 Dec 2022 13:47 UTC

Marcel Hendrix schrieb am Samstag, 10. Dezember 2022 um 12:34:22 UTC+1:
> On Saturday, December 10, 2022 at 9:07:15 AM UTC+1, minf...@arcor.de wrote:
> [..]
> > The question is, when do numbers start becoming "bigger numbers"?
> > When I start thinking about elliptic curve methods for factorization e.g.
> > https://github.com/sethtroisi/gmp-ecm
> > and doing it in Forth, the lack of bignum math becomes apparent. Instead
> > of reinventing wheels, bignum library support a la GMP MP is required
> > plus an adequate I/O and API interface on Forth system side.
> > But well, this would still be far away from the alleged frontier I fear .. ;-)
> I started out with iSPICE having arbitrary precision, but found out that there
> are fundamental numerical decisions made in the SPICE foundations
> that make that not a solution to anything. It is still possible to set a compile-time
> constant to get 80-bit precision (native FPU format), but the only noticeable
> difference is a 2x slowdown.

With that slowdown one could also use _float128 libraries like libquadmath.
But of course it would not help with arbitrary length integer factorization.

BTW there is also that funny double-double format that uses pairs of normal
_float64 numbers - f.ex. available for Julia and Python. It might present an interesting
exercise for Forth too because it could be implemented with already existing
fp-stack infrastructure.

Re: Pollard revisited

<7ce703f0-db3e-4311-a89e-3d1e0d2902b1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21631&group=comp.lang.forth#21631

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:b2a:b0:4c7:4c07:8036 with SMTP id w10-20020a0562140b2a00b004c74c078036mr21820015qvj.36.1670682917250;
Sat, 10 Dec 2022 06:35:17 -0800 (PST)
X-Received: by 2002:a37:512:0:b0:6fe:d1a0:ba88 with SMTP id
18-20020a370512000000b006fed1a0ba88mr11001144qkf.233.1670682917099; Sat, 10
Dec 2022 06:35:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 10 Dec 2022 06:35:16 -0800 (PST)
In-Reply-To: <a97c6092-c47a-4cf2-a5ec-449e04e06518n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:c0fc:425:4380:6d51;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:c0fc:425:4380:6d51
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com> <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
<87a63vyd84.fsf@nightsong.com> <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
<1e3631f0-e26c-474d-a4b4-b0e259183df9n@googlegroups.com> <a97c6092-c47a-4cf2-a5ec-449e04e06518n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7ce703f0-db3e-4311-a89e-3d1e0d2902b1n@googlegroups.com>
Subject: Re: Pollard revisited
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 10 Dec 2022 14:35:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2369
 by: Marcel Hendrix - Sat, 10 Dec 2022 14:35 UTC

On Saturday, December 10, 2022 at 2:47:39 PM UTC+1, minf...@arcor.de wrote:
> Marcel Hendrix schrieb am Samstag, 10. Dezember 2022 um 12:34:22 UTC+1:
> > On Saturday, December 10, 2022 at 9:07:15 AM UTC+1, minf...@arcor.de wrote:
[..]
> BTW there is also that funny double-double format that uses pairs of normal
> _float64 numbers - f.ex. available for Julia and Python. It might present an interesting
> exercise for Forth too because it could be implemented with already existing
> fp-stack infrastructure.

I have that, too. Julian Noble introduced it and I added a 112-bit FP library.
(The iForth vector-matrix module supports it as a plugin.) There are quite
some CLF postings about this variant.

I'm hoping that I can drop the exotics when hardware quad-precision
becomes available (although of course then somebody will publish a
240-bit package :--)

-marcel

Re: Pollard revisited

<875yehxxeu.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21645&group=comp.lang.forth#21645

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Pollard revisited
Date: Sun, 11 Dec 2022 16:45:13 -0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <875yehxxeu.fsf@nightsong.com>
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6>
<fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com>
<nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
<87a63vyd84.fsf@nightsong.com>
<a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e71119835ee490b73ed803e2b1058588";
logging-data="2158623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18H+OGpm0OR5obq5TZGbV4Y"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:kSMXS1xvCVVJnfRIpfjDNPDQ8Yw=
sha1:o1JasysbrjYQg30rUEJ3tRfJVUw=
 by: Paul Rubin - Mon, 12 Dec 2022 00:45 UTC

"minf...@arcor.de" <minforth@arcor.de> writes:
> The question is, when do numbers start becoming "bigger numbers"?
> When I start thinking about elliptic curve methods for factorization e.g.
> https://github.com/sethtroisi/gmp-ecm

To factor the number N by trial division, you need around sqrt(N)
operations. The rho method takes around 4throot(N), so you can probably
get out to 35 or 40 decimal digits with it if you can let it run for a
while. State of the art methods can do maybe 150 digits on a small
cluster of workstations. I believe the record was a big distributed
computation that took some months to factor a number of around 230
digits.

I agree that trying to do it in Forth probably gets in the way of the
math. You could look at the MIRACL library, that implements a bunch of
those algorthms, up through the Quadratic Sieve (QS) but not the Number
Field Sieve (NFS), iirc. https://github.com/miracl/MIRACL

Re: Pollard revisited

<nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21650&group=comp.lang.forth#21650

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Pollard revisited
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <87a63vyd84.fsf@nightsong.com> <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com> <875yehxxeu.fsf@nightsong.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838>
Organization: KPN B.V.
Date: Mon, 12 Dec 2022 11:46:04 +0100
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!94.232.112.245.MISMATCH!feed.abavia.com!abe005.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 38
Injection-Date: Mon, 12 Dec 2022 11:46:04 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Mon, 12 Dec 2022 10:46 UTC

In article <875yehxxeu.fsf@nightsong.com>,
Paul Rubin <no.email@nospam.invalid> wrote:
>"minf...@arcor.de" <minforth@arcor.de> writes:
>> The question is, when do numbers start becoming "bigger numbers"?
>> When I start thinking about elliptic curve methods for factorization e.g.
>> https://github.com/sethtroisi/gmp-ecm
>
>To factor the number N by trial division, you need around sqrt(N)
>operations. The rho method takes around 4throot(N), so you can probably
>get out to 35 or 40 decimal digits with it if you can let it run for a
>while. State of the art methods can do maybe 150 digits on a small
>cluster of workstations. I believe the record was a big distributed
>computation that took some months to factor a number of around 230
>digits.
>
>I agree that trying to do it in Forth probably gets in the way of the
>math. You could look at the MIRACL library, that implements a bunch of
>those algorthms, up through the Quadratic Sieve (QS) but not the Number
>Field Sieve (NFS), iirc. https://github.com/miracl/MIRACL

We have implemented the Multiple Polynomial Quadratic Sieve on
transputers. (1996)
It was more a demonstration of parallelism showing
the solutions found by the transputer in a triangular display
indicated by colors. However the primes involved in the sieve
are relatively small and can be handled by 32 bit processors,
such as the transputers.
To be honest I borrowed the polynomials from ucbasic and understood
them poorly.
(3 transputers sieving in parallel)

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Pollard revisited

<0d8b193d-f77a-49df-938e-64799a1274ecn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21653&group=comp.lang.forth#21653

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:fe90:0:b0:4c6:d886:2681 with SMTP id d16-20020a0cfe90000000b004c6d8862681mr61617568qvs.94.1670843419978;
Mon, 12 Dec 2022 03:10:19 -0800 (PST)
X-Received: by 2002:ac8:7513:0:b0:3a5:4442:80fa with SMTP id
u19-20020ac87513000000b003a5444280famr74267281qtq.233.1670843419802; Mon, 12
Dec 2022 03:10:19 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 12 Dec 2022 03:10:19 -0800 (PST)
In-Reply-To: <875yehxxeu.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc11:e43c:d548:748f:83fc;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc11:e43c:d548:748f:83fc
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <fc2cbabc-2267-42b7-bb20-1107707daf8dn@googlegroups.com>
<871qpab3oo.fsf@nightsong.com> <nnd$330c3bf0$7e1ad5e3@f60e21d0d52aa3c3>
<87a63vyd84.fsf@nightsong.com> <a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com>
<875yehxxeu.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d8b193d-f77a-49df-938e-64799a1274ecn@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Mon, 12 Dec 2022 11:10:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2694
 by: minf...@arcor.de - Mon, 12 Dec 2022 11:10 UTC

Paul Rubin schrieb am Montag, 12. Dezember 2022 um 01:45:16 UTC+1:
> "minf...@arcor.de" <minf...@arcor.de> writes:
> > The question is, when do numbers start becoming "bigger numbers"?
> > When I start thinking about elliptic curve methods for factorization e.g.
> > https://github.com/sethtroisi/gmp-ecm
> To factor the number N by trial division, you need around sqrt(N)
> operations. The rho method takes around 4throot(N), so you can probably
> get out to 35 or 40 decimal digits with it if you can let it run for a
> while. State of the art methods can do maybe 150 digits on a small
> cluster of workstations. I believe the record was a big distributed
> computation that took some months to factor a number of around 230
> digits.
>
> I agree that trying to do it in Forth probably gets in the way of the
> math. You could look at the MIRACL library, that implements a bunch of
> those algorthms, up through the Quadratic Sieve (QS) but not the Number
> Field Sieve (NFS), iirc. https://github.com/miracl/MIRACL

Acc to Wikipedia "In number theory, the general number field sieve (GNFS)
is the most efficient classical algorithm known for factoring integers
larger than 10^100." This is a bit heavy for Forth.

But there is a language with similar name: Fortran... ;-)

Re: Pollard revisited

<8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21655&group=comp.lang.forth#21655

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:540e:0:b0:3a7:f599:2208 with SMTP id b14-20020ac8540e000000b003a7f5992208mr3977145qtq.139.1670848922864;
Mon, 12 Dec 2022 04:42:02 -0800 (PST)
X-Received: by 2002:a05:6214:5f05:b0:4c7:62d6:b78d with SMTP id
lx5-20020a0562145f0500b004c762d6b78dmr16565541qvb.120.1670848922647; Mon, 12
Dec 2022 04:42:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 12 Dec 2022 04:42:02 -0800 (PST)
In-Reply-To: <nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:3405:cfd3:bae7:7422;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:3405:cfd3:bae7:7422
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <87a63vyd84.fsf@nightsong.com>
<a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com> <875yehxxeu.fsf@nightsong.com>
<nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>
Subject: Re: Pollard revisited
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Mon, 12 Dec 2022 12:42:02 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2484
 by: Marcel Hendrix - Mon, 12 Dec 2022 12:42 UTC

On Monday, December 12, 2022 at 11:46:07 AM UTC+1, none albert wrote:
[..]
> We have implemented the Multiple Polynomial Quadratic Sieve on
> transputers. (1996)
> It was more a demonstration of parallelism showing
> the solutions found by the transputer in a triangular display
> indicated by colors. However the primes involved in the sieve
> are relatively small and can be handled by 32 bit processors,
> such as the transputers.
> To be honest I borrowed the polynomials from ucbasic and understood
> them poorly.
> (3 transputers sieving in parallel)

According to the original source code, mpqss/config.frt,

\ The following defines the number of primes contained in the bit table
\ For a 32 bit processor multiply by 32.
\ The number of primes is related to the maximum prime MaxP
#40 =: MaxB \ Length in CELLs of a bit array

\ >> This may no longer be applicable to the new Vnumber system. <<
\ We want to handle 100 digit numbers, Maxv =20 allows squaring
\ #20 =: MaxV \ Length in CELLs of Vnumber
#40 =: MaxV \ Length in CELLs of Vnumber

So we used 1280 bits arbitrary precision to factor 100-digit numbers.

-marcel

Re: Pollard revisited

<effb0cdb-ba12-4056-9c31-8ca4d4da947cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21658&group=comp.lang.forth#21658

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:4293:b0:4c6:e4a3:df1e with SMTP id og19-20020a056214429300b004c6e4a3df1emr53798257qvb.15.1670850918662;
Mon, 12 Dec 2022 05:15:18 -0800 (PST)
X-Received: by 2002:a37:8783:0:b0:6fa:a2ce:ac27 with SMTP id
j125-20020a378783000000b006faa2ceac27mr82336684qkd.185.1670850918395; Mon, 12
Dec 2022 05:15:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 12 Dec 2022 05:15:18 -0800 (PST)
In-Reply-To: <8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f1d:cc11:e43c:d548:748f:83fc;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f1d:cc11:e43c:d548:748f:83fc
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <87a63vyd84.fsf@nightsong.com>
<a2ee2427-3aa8-46d6-b44f-65a0cfea3943n@googlegroups.com> <875yehxxeu.fsf@nightsong.com>
<nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838> <8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <effb0cdb-ba12-4056-9c31-8ca4d4da947cn@googlegroups.com>
Subject: Re: Pollard revisited
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Mon, 12 Dec 2022 13:15:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3104
 by: minf...@arcor.de - Mon, 12 Dec 2022 13:15 UTC

Marcel Hendrix schrieb am Montag, 12. Dezember 2022 um 13:42:04 UTC+1:
> On Monday, December 12, 2022 at 11:46:07 AM UTC+1, none albert wrote:
> [..]
> > We have implemented the Multiple Polynomial Quadratic Sieve on
> > transputers. (1996)
> > It was more a demonstration of parallelism showing
> > the solutions found by the transputer in a triangular display
> > indicated by colors. However the primes involved in the sieve
> > are relatively small and can be handled by 32 bit processors,
> > such as the transputers.
> > To be honest I borrowed the polynomials from ucbasic and understood
> > them poorly.
> > (3 transputers sieving in parallel)
> According to the original source code, mpqss/config.frt,
>
> \ The following defines the number of primes contained in the bit table
> \ For a 32 bit processor multiply by 32.
> \ The number of primes is related to the maximum prime MaxP
> #40 =: MaxB \ Length in CELLs of a bit array
>
> \ >> This may no longer be applicable to the new Vnumber system. <<
> \ We want to handle 100 digit numbers, Maxv =20 allows squaring
> \ #20 =: MaxV \ Length in CELLs of Vnumber
> #40 =: MaxV \ Length in CELLs of Vnumber
>
> So we used 1280 bits arbitrary precision to factor 100-digit numbers.
>

This is really impressive !!

Msieve has some info about number field sieves:
https://sourceforge.net/projects/msieve/files/msieve/Msieve%20v1.53/msieve153_src.tar.gz/download
in their Readme files. An interesting and sobering confirmation that I will
never reach more than better dilettantism in this numeric discipline.

And I don't own spare Nvidia cards for number crunching. ;-)
Bitcoin miners plundered the market...

Re: Pollard revisited

<nnd$2a2328be$7281e89e@88fac220ac2358e6>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21659&group=comp.lang.forth#21659

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <nnd$0dba1fef$56eb104c@2c34d2caae6323b6> <875yehxxeu.fsf@nightsong.com> <nnd$0f24f2bc$08e47d82@94f9c3e2a4c7b838> <8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>
Subject: Re: Pollard revisited
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$2a2328be$7281e89e@88fac220ac2358e6>
Organization: KPN B.V.
Date: Mon, 12 Dec 2022 16:11:20 +0100
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!94.232.112.246.MISMATCH!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 57
Injection-Date: Mon, 12 Dec 2022 16:11:20 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Mon, 12 Dec 2022 15:11 UTC

In article <8d18324e-e5c3-4ed6-a438-8a5be465bf62n@googlegroups.com>,
Marcel Hendrix <mhx@iae.nl> wrote:
>On Monday, December 12, 2022 at 11:46:07 AM UTC+1, none albert wrote:
>[..]
>> We have implemented the Multiple Polynomial Quadratic Sieve on
>> transputers. (1996)
>> It was more a demonstration of parallelism showing
>> the solutions found by the transputer in a triangular display
>> indicated by colors. However the primes involved in the sieve
>> are relatively small and can be handled by 32 bit processors,
>> such as the transputers.
>> To be honest I borrowed the polynomials from ucbasic and understood
>> them poorly.
>> (3 transputers sieving in parallel)
>
>According to the original source code, mpqss/config.frt,
>
>\ The following defines the number of primes contained in the bit table
>\ For a 32 bit processor multiply by 32.
>\ The number of primes is related to the maximum prime MaxP
>#40 =: MaxB \ Length in CELLs of a bit array
>
>\ >> This may no longer be applicable to the new Vnumber system. <<
>\ We want to handle 100 digit numbers, Maxv =20 allows squaring
>\ #20 =: MaxV \ Length in CELLs of Vnumber
>#40 =: MaxV \ Length in CELLs of Vnumber
>
>So we used 1280 bits arbitrary precision to factor 100-digit numbers.

You can download the code via
https://home.hccnet.nl/a.w.m.van.der.horst/transputer.html
I was mistaken, this was 1993. It won a (first?) prize at HCC-DAGEN
the legend Dutch computer fair, where it was demonstrated using a
24 kg 24 inch crt.
This was before the ISO 93 standard was stable.
VALUE's don't get an initialisation and
tons of idiosyncrasies
REVISION
/* comment
=:
:ABOUT

The example used was the 8-th Fermat number, 1 bit out of reach for
the Pollard example with a 274... factor.

There is a ton of comment, start reading with LINKS.FRT and MAIN.FRT.

>
>-marcel

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor