Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Inquiry is fatal to certainty." -- Will Durant


devel / comp.lang.forth / Re: Circumference of an ellipse

SubjectAuthor
* Circumference of an ellipseHans Bezemer
`* Re: Circumference of an ellipsenone
 `* Re: Circumference of an ellipseHans Bezemer
  +* Re: Circumference of an ellipseMarcel Hendrix
  |`- Re: Circumference of an ellipseHans Bezemer
  `* Re: Circumference of an ellipseminforth
   `- Re: Circumference of an ellipseHans Bezemer

1
Circumference of an ellipse

<930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24648&group=comp.lang.forth#24648

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4e42:0:b0:655:d807:bd13 with SMTP id eb2-20020ad44e42000000b00655d807bd13mr113753qvb.8.1695389322174;
Fri, 22 Sep 2023 06:28:42 -0700 (PDT)
X-Received: by 2002:a05:6808:1527:b0:3a4:3c6c:27a1 with SMTP id
u39-20020a056808152700b003a43c6c27a1mr4636298oiw.5.1695389321953; Fri, 22 Sep
2023 06:28:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Fri, 22 Sep 2023 06:28:41 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
Subject: Circumference of an ellipse
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Fri, 22 Sep 2023 13:28:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1794
 by: Hans Bezemer - Fri, 22 Sep 2023 13:28 UTC

Just some quick doodles concerning this subject:

: fperi-ellipse ( a b -- peri)
fover fover f+ frot frot f- \ (a+b) (a-b)
fdup f* fover fdup f* \ (a+b) (a-b)^2 (a+b)^2
f/ 3 s>f f* \ (a+b) 3h
4 s>f fover f- fsqrt \ (a+b) 3h sqrt(4-3h)
10 s>f f+ f/ \ (a+b) (3h/(10+sqrt(4-3h)))
1 s>f f+ f* pi f* \ pi*(a+b)*(1+(3h/(10+sqrt(4-3h))))
; ( a b -- peri)
: fperi-ellipse-fast 75 s>f f* fswap 120 s>f f* f+ 100 s>f f/ pi f* ;

The first is of Ramanujan - with excellent accuracy. The second has allegedly
better properties than the more familiar 2PI (SQRT((a*a+b*b)/2)) and doesn't
need an expensive FSQRT.

Hans Bezemer

Re: Circumference of an ellipse

<nnd$58e57626$60643965@f780d7d068ac98bf>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24649&group=comp.lang.forth#24649

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
Subject: Re: Circumference of an ellipse
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$58e57626$60643965@f780d7d068ac98bf>
Organization: KPN B.V.
Date: Fri, 22 Sep 2023 15:53:25 +0200
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 44
Injection-Date: Fri, 22 Sep 2023 15:53:25 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2266
 by: none - Fri, 22 Sep 2023 13:53 UTC

In article <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>,
Hans Bezemer <the.beez.speaks@gmail.com> wrote:
>Just some quick doodles concerning this subject:
>
>: fperi-ellipse ( a b -- peri)
> fover fover f+ frot frot f- \ (a+b) (a-b)
> fdup f* fover fdup f* \ (a+b) (a-b)^2 (a+b)^2
> f/ 3 s>f f* \ (a+b) 3h
> 4 s>f fover f- fsqrt \ (a+b) 3h sqrt(4-3h)
> 10 s>f f+ f/ \ (a+b) (3h/(10+sqrt(4-3h)))
> 1 s>f f+ f* pi f* \ pi*(a+b)*(1+(3h/(10+sqrt(4-3h))))
>;
> ( a b -- peri)
>: fperi-ellipse-fast 75 s>f f* fswap 120 s>f f* f+ 100 s>f f/ pi f* ;
>
>The first is of Ramanujan - with excellent accuracy. The second has allegedly
>better properties than the more familiar 2PI (SQRT((a*a+b*b)/2)) and doesn't
>need an expensive FSQRT.

What?
\ --------------------------------
WANT -fp- MARK-TIME
FINIT

: test 1.0E100 1,000,000 0 DO FSQRT 1.0E0 F+ LOOP ;

MARK-TIME test FS. ELAPSED .uS
\ --------------------------------

INCLUDE /tmp/fp.frt
test : ISN'T UNIQUE
2.618033988749894687E0 26701 uS OK
27 ns for a FSQRT with an increment thrown in.
Even with a 1 KWatt machine an .25 per KWh that is
astronomically inexpensive.

>
>Hans Bezemer
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Circumference of an ellipse

<eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24650&group=comp.lang.forth#24650

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:48c8:0:b0:649:7b86:8aaa with SMTP id v8-20020ad448c8000000b006497b868aaamr39039qvx.0.1695394329142;
Fri, 22 Sep 2023 07:52:09 -0700 (PDT)
X-Received: by 2002:a05:6870:1844:b0:1d6:3c76:e1c9 with SMTP id
u4-20020a056870184400b001d63c76e1c9mr3322585oaf.6.1695394328758; Fri, 22 Sep
2023 07:52:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.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: Fri, 22 Sep 2023 07:52:08 -0700 (PDT)
In-Reply-To: <nnd$58e57626$60643965@f780d7d068ac98bf>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com> <nnd$58e57626$60643965@f780d7d068ac98bf>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
Subject: Re: Circumference of an ellipse
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Fri, 22 Sep 2023 14:52:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 12
 by: Hans Bezemer - Fri, 22 Sep 2023 14:52 UTC

On Friday, September 22, 2023 at 3:53:29 PM UTC+2, none albert wrote:
> >The first is of Ramanujan - with excellent accuracy. The second has allegedly
> >better properties than the more familiar 2PI (SQRT((a*a+b*b)/2)) and doesn't
> >need an expensive FSQRT.
> What?
If you leech a CPU instruction - sure. If you do it in high level Forth, it's more expensive.
That goes for everything a CISC processor delivers.

Hans Bezemer

Re: Circumference of an ellipse

<401188c6-8640-4850-8082-c54229b6f224n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24651&group=comp.lang.forth#24651

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:246:b0:410:9089:6b5e with SMTP id c6-20020a05622a024600b0041090896b5emr3571qtx.3.1695407496290;
Fri, 22 Sep 2023 11:31:36 -0700 (PDT)
X-Received: by 2002:a05:6808:f0a:b0:3a7:7e66:2197 with SMTP id
m10-20020a0568080f0a00b003a77e662197mr282720oiw.2.1695407496110; Fri, 22 Sep
2023 11:31:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Fri, 22 Sep 2023 11:31:35 -0700 (PDT)
In-Reply-To: <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f18:6d00:1c91:20f3:a04f:7c65;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f18:6d00:1c91:20f3:a04f:7c65
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
<nnd$58e57626$60643965@f780d7d068ac98bf> <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <401188c6-8640-4850-8082-c54229b6f224n@googlegroups.com>
Subject: Re: Circumference of an ellipse
From: mhx@iae.nl (Marcel Hendrix)
Injection-Date: Fri, 22 Sep 2023 18:31:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1756
 by: Marcel Hendrix - Fri, 22 Sep 2023 18:31 UTC

On Friday, September 22, 2023 at 4:52:10 PM UTC+2, Hans Bezemer wrote:
> On Friday, September 22, 2023 at 3:53:29 PM UTC+2, none albert wrote:
[..]

A single fsqrt is 6.308 ns, a single fperi-ellipse 15.3 ns, and fperi-ellipse-fast is 6.07 ns.

1. fsqrt is so fast that we can't test it with a simple DO ... LOOP.
2. fsqrt's properties are no excuse for the horribly inaccurate fperi-ellipse-fast.

-marcel

Re: Circumference of an ellipse

<19d33e76-4456-4a4a-9afd-fff72ece5717n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24652&group=comp.lang.forth#24652

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:58a2:0:b0:656:22c3:cf23 with SMTP id ea2-20020ad458a2000000b0065622c3cf23mr1474qvb.11.1695410462858;
Fri, 22 Sep 2023 12:21:02 -0700 (PDT)
X-Received: by 2002:a05:6820:125:b0:56d:72ca:c4dc with SMTP id
i5-20020a056820012500b0056d72cac4dcmr1439888ood.0.1695410462429; Fri, 22 Sep
2023 12:21:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!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: Fri, 22 Sep 2023 12:21:01 -0700 (PDT)
In-Reply-To: <401188c6-8640-4850-8082-c54229b6f224n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
<nnd$58e57626$60643965@f780d7d068ac98bf> <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
<401188c6-8640-4850-8082-c54229b6f224n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <19d33e76-4456-4a4a-9afd-fff72ece5717n@googlegroups.com>
Subject: Re: Circumference of an ellipse
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Fri, 22 Sep 2023 19:21:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 20
 by: Hans Bezemer - Fri, 22 Sep 2023 19:21 UTC

On Friday, September 22, 2023 at 8:31:37 PM UTC+2, Marcel Hendrix wrote:
> On Friday, September 22, 2023 at 4:52:10 PM UTC+2, Hans Bezemer wrote:
> > On Friday, September 22, 2023 at 3:53:29 PM UTC+2, none albert wrote:
> [..]
>
> A single fsqrt is 6.308 ns, a single fperi-ellipse 15.3 ns, and fperi-ellipse-fast is 6.07 ns.
>
> 1. fsqrt is so fast that we can't test it with a simple DO ... LOOP.
> 2. fsqrt's properties are no excuse for the horribly inaccurate fperi-ellipse-fast.
I never claimed the fast one is very accurate. I just claimed it was more accurate
than the usual 2Pi*(sqrt((a*a+b*b)/2)) ALLEGEDLY.

Some people really have a problem reading a post properly.. sigh.

Hans Bezemer

Re: Circumference of an ellipse

<83cc686e-7138-4801-8f30-f312d0d78e2dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24653&group=comp.lang.forth#24653

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5b87:0:b0:412:233d:39dc with SMTP id a7-20020ac85b87000000b00412233d39dcmr9284qta.0.1695425385235;
Fri, 22 Sep 2023 16:29:45 -0700 (PDT)
X-Received: by 2002:a05:6808:189c:b0:3a7:2570:dd11 with SMTP id
bi28-20020a056808189c00b003a72570dd11mr550864oib.6.1695425385058; Fri, 22 Sep
2023 16:29:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Fri, 22 Sep 2023 16:29:44 -0700 (PDT)
In-Reply-To: <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=79.224.99.246; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 79.224.99.246
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
<nnd$58e57626$60643965@f780d7d068ac98bf> <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <83cc686e-7138-4801-8f30-f312d0d78e2dn@googlegroups.com>
Subject: Re: Circumference of an ellipse
From: minforth@arcor.de (minforth)
Injection-Date: Fri, 22 Sep 2023 23:29:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1888
 by: minforth - Fri, 22 Sep 2023 23:29 UTC

Hans Bezemer schrieb am Freitag, 22. September 2023 um 16:52:10 UTC+2:
> On Friday, September 22, 2023 at 3:53:29 PM UTC+2, none albert wrote:
> > >The first is of Ramanujan - with excellent accuracy. The second has allegedly
> > >better properties than the more familiar 2PI (SQRT((a*a+b*b)/2)) and doesn't
> > >need an expensive FSQRT.
> > What?
> If you leech a CPU instruction - sure. If you do it in high level Forth, it's more expensive.
> That goes for everything a CISC processor delivers.

BTW high level C offers the hypot library function. It should be efficient enough.

Re: Circumference of an ellipse

<e87fd9f3-2e64-4ada-85ac-076778858a3en@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24671&group=comp.lang.forth#24671

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:7f42:0:b0:403:c200:cd07 with SMTP id g2-20020ac87f42000000b00403c200cd07mr35818qtk.4.1695559853720;
Sun, 24 Sep 2023 05:50:53 -0700 (PDT)
X-Received: by 2002:a05:6870:e901:b0:1dc:709b:4d3a with SMTP id
l1-20020a056870e90100b001dc709b4d3amr1930301oan.11.1695559853453; Sun, 24 Sep
2023 05:50:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!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: Sun, 24 Sep 2023 05:50:52 -0700 (PDT)
In-Reply-To: <83cc686e-7138-4801-8f30-f312d0d78e2dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <930c944c-c7d4-4ad6-9c4c-cb4e07604b30n@googlegroups.com>
<nnd$58e57626$60643965@f780d7d068ac98bf> <eb27f04f-4fc9-458b-b055-6efc16dbb07bn@googlegroups.com>
<83cc686e-7138-4801-8f30-f312d0d78e2dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e87fd9f3-2e64-4ada-85ac-076778858a3en@googlegroups.com>
Subject: Re: Circumference of an ellipse
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Sun, 24 Sep 2023 12:50:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 7
 by: Hans Bezemer - Sun, 24 Sep 2023 12:50 UTC

On Saturday, September 23, 2023 at 1:29:46 AM UTC+2, minforth wrote:
> BTW high level C offers the hypot library function. It should be efficient enough.
If you mean by efficient "faster" - are you very sure about that? I have my doubts.

Hans Bezemer

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor