Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Phasers locked on target, Captain.


devel / comp.lang.python / Are Floating Point Numbers still a Can of Worms?

SubjectAuthor
* Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
+* Re: Are Floating Point Numbers still a Can of Worms?Julio Di Egidio
|`- Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
`* Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
 `* Re: Are Floating Point Numbers still a Can of Worms?Pieter van Oostrum
  +- Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
  `* RE: Are Floating Point Numbers still a Can of Worms?Schachner, Joseph (US)
   +- Re: Are Floating Point Numbers still a Can of Worms?Dennis Lee Bieber
   `* Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
    `* Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
     `* Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse
      `- Re: Are Floating Point Numbers still a Can of Worms?Mostowski Collapse

1
Are Floating Point Numbers still a Can of Worms?

<acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:5a4e:0:b0:39c:db78:1975 with SMTP id o14-20020ac85a4e000000b0039cdb781975mr1547573qta.518.1665758574701;
Fri, 14 Oct 2022 07:42:54 -0700 (PDT)
X-Received: by 2002:a4a:e587:0:b0:47f:7e7c:f7e5 with SMTP id
o7-20020a4ae587000000b0047f7e7cf7e5mr2107548oov.52.1665758574436; Fri, 14 Oct
2022 07:42:54 -0700 (PDT)
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.python
Date: Fri, 14 Oct 2022 07:42:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
Subject: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 14 Oct 2022 14:42:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1144
 by: Mostowski Collapse - Fri, 14 Oct 2022 14:42 UTC

On Windows Platform:

Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>> 396** -1
0.002525252525252525
>>> 1/396
0.0025252525252525255

Re: Are Floating Point Numbers still a Can of Worms?

<7fa02919-ce69-4a05-9acc-13013561a5den@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:622a:651:b0:398:5034:9e85 with SMTP id a17-20020a05622a065100b0039850349e85mr7803239qtb.277.1665997182484;
Mon, 17 Oct 2022 01:59:42 -0700 (PDT)
X-Received: by 2002:a05:6870:a7a5:b0:131:886b:214f with SMTP id
x37-20020a056870a7a500b00131886b214fmr4928932oao.83.1665997182282; Mon, 17
Oct 2022 01:59:42 -0700 (PDT)
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.python
Date: Mon, 17 Oct 2022 01:59:42 -0700 (PDT)
In-Reply-To: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.98.242; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.98.242
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7fa02919-ce69-4a05-9acc-13013561a5den@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: jul...@diegidio.name (Julio Di Egidio)
Injection-Date: Mon, 17 Oct 2022 08:59:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1708
 by: Julio Di Egidio - Mon, 17 Oct 2022 08:59 UTC

On Friday, 14 October 2022 at 16:43:05 UTC+2, Mostowski Collapse wrote:
> On Windows Platform:
>
> Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
> >>> 396** -1
> 0.002525252525252525
> >>> 1/396
> 0.0025252525252525255

Numerics: another thing you have never known shit
about and still manage to write bullshit across all
groups ad nauseam.

You really don't understand the damage you are doing,
here as elsewhere, do you, you piece of retarded shit,
or you too just working for the nazi monster??

*Troll-spammer-crank alert*

Julio

Re: Are Floating Point Numbers still a Can of Worms?

<2f398622-e600-4218-85e2-d4d6ab08ab09n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:5c03:0:b0:39c:ee08:157f with SMTP id i3-20020ac85c03000000b0039cee08157fmr2337729qti.436.1666104097240;
Tue, 18 Oct 2022 07:41:37 -0700 (PDT)
X-Received: by 2002:a05:6808:17a9:b0:354:f034:a965 with SMTP id
bg41-20020a05680817a900b00354f034a965mr1506688oib.83.1666104097023; Tue, 18
Oct 2022 07:41:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 18 Oct 2022 07:41:36 -0700 (PDT)
In-Reply-To: <7fa02919-ce69-4a05-9acc-13013561a5den@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com> <7fa02919-ce69-4a05-9acc-13013561a5den@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f398622-e600-4218-85e2-d4d6ab08ab09n@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 18 Oct 2022 14:41:37 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Tue, 18 Oct 2022 14:41 UTC

Nazi Monster. Do you mean Putin?

LoL

ju...@diegidio.name schrieb am Montag, 17. Oktober 2022 um 10:59:52 UTC+2:
> On Friday, 14 October 2022 at 16:43:05 UTC+2, Mostowski Collapse wrote:
> > On Windows Platform:
> >
> > Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
> > >>> 396** -1
> > 0.002525252525252525
> > >>> 1/396
> > 0.0025252525252525255
> Numerics: another thing you have never known shit
> about and still manage to write bullshit across all
> groups ad nauseam.
>
> You really don't understand the damage you are doing,
> here as elsewhere, do you, you piece of retarded shit,
> or you too just working for the nazi monster??
>
> *Troll-spammer-crank alert*
>
> Julio

Re: Are Floating Point Numbers still a Can of Worms?

<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ad4:5cad:0:b0:4b1:c5e2:bf4d with SMTP id q13-20020ad45cad000000b004b1c5e2bf4dmr21243913qvh.15.1666474402034;
Sat, 22 Oct 2022 14:33:22 -0700 (PDT)
X-Received: by 2002:a05:6870:d61e:b0:132:bc09:4b8c with SMTP id
a30-20020a056870d61e00b00132bc094b8cmr32961344oaq.32.1666474401783; Sat, 22
Oct 2022 14:33:21 -0700 (PDT)
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.python
Date: Sat, 22 Oct 2022 14:33:21 -0700 (PDT)
In-Reply-To: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 22 Oct 2022 21:33:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1629
 by: Mostowski Collapse - Sat, 22 Oct 2022 21:33 UTC

I also get:

Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>> 2.718281828459045**0.8618974796837966
2.367649

Nice try, but isn't this one the more correct?

?- X is 2.718281828459045**0.8618974796837966.
X = 2.3676489999999997.

Mostowski Collapse schrieb am Freitag, 14. Oktober 2022 um 16:43:05 UTC+2:
> On Windows Platform:
>
> Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
> >>> 396** -1
> 0.002525252525252525
> >>> 1/396
> 0.0025252525252525255

Re: Are Floating Point Numbers still a Can of Worms?

<m2bkq24nyd.fsf@vanoostrum.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!news.mind.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: piete...@vanoostrum.org (Pieter van Oostrum)
Newsgroups: comp.lang.python
Subject: Re: Are Floating Point Numbers still a Can of Worms?
Date: Sun, 23 Oct 2022 16:24:58 +0200
Lines: 53
Message-ID: <m2bkq24nyd.fsf@vanoostrum.org>
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net xOieiPdEK8ja+RgTnXq3MgzKX+WKj9B4mnp8jx6zkwxmnUQKIB
Cancel-Lock: sha1:4M4bMfAnj4WTNTrM0gpVrrRlLN4= sha1:CozXKNV7vmd3trdhh4kQXz5b05c=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
 by: Pieter van Oostrum - Sun, 23 Oct 2022 14:24 UTC

Mostowski Collapse <bursejan@gmail.com> writes:

> I also get:
>
> Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>>> 2.718281828459045**0.8618974796837966
> 2.367649
>
> Nice try, but isn't this one the more correct?
>
> ?- X is 2.718281828459045**0.8618974796837966.
> X = 2.3676489999999997.
>

That's probably the accuracy of the underlying C implementation of the exp function.

In [25]: exp(0.8618974796837966)
Out[25]: 2.367649

But even your answer can be improved:

Maxima:

(%i1) fpprec:30$

(%i2) bfloat(2.718281828459045b0)^bfloat(.8618974796837966b0);
(%o2) 2.36764899999999983187397393143b0

but:

(%i7) bfloat(%e)^bfloat(.8618974796837966b0);
(%o7) 2.3676490000000000085638369695b0
surprisingly closer to Python's answer.

but 2.718281828459045 isn't e. Close but no cigar.

(%i10) bfloat(2.718281828459045b0) - bfloat(%e);
(%o10) - 2.35360287471352802147785151603b-16

Fricas:

(1) -> 2.718281828459045^0.8618974796837966

(1) 2.3676489999_999998319

(2) -> exp(0.8618974796837966)

(2) 2.3676490000_000000086

--
Pieter van Oostrum <pieter@vanoostrum.org>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]

Re: Are Floating Point Numbers still a Can of Worms?

<9ee5b6cd-d143-4f10-a6de-bff87cf6bc5en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ad4:5be1:0:b0:498:79dc:d3ff with SMTP id k1-20020ad45be1000000b0049879dcd3ffmr25790311qvc.87.1666602037695;
Mon, 24 Oct 2022 02:00:37 -0700 (PDT)
X-Received: by 2002:aca:e009:0:b0:355:13be:dbd2 with SMTP id
x9-20020acae009000000b0035513bedbd2mr16349965oig.212.1666602037427; Mon, 24
Oct 2022 02:00:37 -0700 (PDT)
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.python
Date: Mon, 24 Oct 2022 02:00:37 -0700 (PDT)
In-Reply-To: <m2bkq24nyd.fsf@vanoostrum.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <m2bkq24nyd.fsf@vanoostrum.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9ee5b6cd-d143-4f10-a6de-bff87cf6bc5en@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 24 Oct 2022 09:00:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3608
 by: Mostowski Collapse - Mon, 24 Oct 2022 09:00 UTC

Was using the microsoft calculator accessory. Maybe not
extremly correct in the last digits. But we can check which
one is the nearer float. Problem is the floats itself in decimal
representation are not that accurate. So lets first show them a
little more accorater in decimal, using yet another tool:

?- X is decimal(2.367649).
X = 0d2.367649000000000114596332423388957977294921875.

?- X is decimal(2.3676489999999997).
X = 0d2.367648999999999670507122573326341807842254638671875.

Now lets see what the microsoft calculator accessory gives:

2.718281828459045 ^ 0.8618974796837966 =
2.3676489999999998318739739314273

Which float is closer? Lets use microsoft calculator accessory again:

2.3676490000000001145963324233890 - 2.3676489999999998318739739314273 =
0.0000000000000002827223584919617

2.3676489999999998318739739314273 - 2.3676489999999996705071225733263 =
0.000000000000000161366851358101

So I guess the second float is the to_nearest result.

Pieter van Oostrum schrieb am Sonntag, 23. Oktober 2022 um 16:25:21 UTC+2:
> Mostowski Collapse <burs...@gmail.com> writes:
>
> > I also get:
> >
> > Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
> >>>> 2.718281828459045**0.8618974796837966
> > 2.367649
> >
> > Nice try, but isn't this one the more correct?
> >
> > ?- X is 2.718281828459045**0.8618974796837966.
> > X = 2.3676489999999997.
> >
> That's probably the accuracy of the underlying C implementation of the exp function.
>
> In [25]: exp(0.8618974796837966)
> Out[25]: 2.367649
>
> But even your answer can be improved:
>
> Maxima:
>
> (%i1) fpprec:30$
>
> (%i2) bfloat(2.718281828459045b0)^bfloat(.8618974796837966b0);
> (%o2) 2.36764899999999983187397393143b0
>
> but:
>
> (%i7) bfloat(%e)^bfloat(.8618974796837966b0);
> (%o7) 2.3676490000000000085638369695b0
> surprisingly closer to Python's answer.
>
> but 2.718281828459045 isn't e. Close but no cigar.
>
> (%i10) bfloat(2.718281828459045b0) - bfloat(%e);
> (%o10) - 2.35360287471352802147785151603b-16
>
> Fricas:
>
> (1) -> 2.718281828459045^0.8618974796837966
>
> (1) 2.3676489999_999998319
>
> (2) -> exp(0.8618974796837966)
>
> (2) 2.3676490000_000000086
>
> --
> Pieter van Oostrum <pie...@vanoostrum.org>
> www: http://pieter.vanoostrum.org/
> PGP key: [8DAE142BE17999C4]

RE: Are Floating Point Numbers still a Can of Worms?

<mailman.794.1666623225.20444.python-list@python.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Joseph.S...@Teledyne.com (Schachner, Joseph (US))
Newsgroups: comp.lang.python
Subject: RE: Are Floating Point Numbers still a Can of Worms?
Date: Mon, 24 Oct 2022 14:52:28 +0000
Lines: 74
Message-ID: <mailman.794.1666623225.20444.python-list@python.org>
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com>
<m2bkq24nyd.fsf@vanoostrum.org>
<BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de XMrp3Vt/UWYrYwQ9dal8nANHYYy1thbTDLLgS1aivrXQ==
Return-Path: <prvs=289fc4fc8=Joseph.Schachner@teledyne.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=teledyne.com header.i=@teledyne.com header.b=beiwH8Le;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '2022': 0.05; 'is.': 0.05;
'joseph': 0.05; "python's": 0.05; 'aug': 0.07; 'correct?': 0.07;
'underlying': 0.07; 'van': 0.07; 'float': 0.09; 'floating': 0.09;
'received:nam11-bn8-obe.outbound.protection.outlook.com': 0.09;
'received:namprd14.prod.outlook.com': 0.09; 'writes:': 0.09;
'2022,': 0.16; '>>>>': 0.16; 'algorithms': 0.16; 'answer.': 0.16;
'enough,': 0.16; 'key:': 0.16; 'precision.': 0.16;
'subject:still': 0.16; 'values,': 0.16; 'python': 0.16; 'october':
0.17; 'values': 0.17; 'probably': 0.17; 'to:addr:python-list':
0.20; 'to:name:python-list@python.org': 0.24; 'skip:- 10': 0.25;
'pgp': 0.26; 'sensitive': 0.26; 'skip:2 30': 0.26; "isn't": 0.27;
'expect': 0.28; 'subject:Can': 0.32; 'skip:2 10': 0.32; 'but':
0.32; 'there': 0.33; 'header:In-Reply-To:1': 0.34; 'skip:2 20':
0.35; 'close': 0.35; 'people': 0.36; 'change': 0.36; 'way': 0.38;
'two': 0.39; 'received:unknown': 0.39; 'still': 0.40; 'try': 0.40;
'skip:b 30': 0.61; 'from:': 0.62; 'to:': 0.62; 'limited': 0.62;
'skip:b 20': 0.63; 're:': 0.64; 'your': 0.64; 'less': 0.65;
'numbers': 0.67; 'skip:e 20': 0.67; 'and,': 0.69; 'accuracy':
0.74; 'business': 0.77; 'sent:': 0.78; '10:25': 0.84; 'exhibit':
0.84; 'exp': 0.84; 'tiny': 0.84; 'collapse': 0.91; 'skip:b 50':
0.93
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
d=teledyne.com; i=@teledyne.com; q=dns/txt; s=TDY-1;
t=1666623225; x=1698159225;
h=from:to:subject:date:message-id:references:in-reply-to:
content-transfer-encoding:mime-version;
bh=ZrJMvPED5FoTODBiwmez5O+PNJdgJ+DC3v7Ir12h1Gw=;
b=beiwH8LeOBBYnpBuNaHA25uM7cHdAH6myYS9blJLWRGjBhAVO9+5IwOY
0nkefSGsFpf/joZSEEVUxDPXk5ujta6B0uSI3z4ta66iigS0r9hicxDSn
kHPV/oVeMbVHB6lbh/OuTIexlHhmi284PI1eT1T7vhArwDMSF7ozqWsZ9 8=;
IronPort-Data: A9a23:Yx55PqDlMHq6vxVW/5Xhw5YqxClBgxIJ4kV8jS/XYbTApD4qhTRVm
jEWX2DUb62IY2Snfo0gYYzi/EICvpDRytBiTANkpHpgcS52pJueD7x1DG+pZ3nOdpWbFCqLz
O1HMoOcdJhsFhcwgj/3b9ANeFEljfngqoLUUbKCYGYoLeNdYH9JoQp5nOIkiZJfj9G8Agec0
fv/uMS31GWNglaYD0pPg069gEI21BjNkGNA1rAOTagjlEPTkXATEKUeKcmZR5cvatAJdgISb
7+rIICRpgs1zT90Yj+Wuu+Tnnkxf1LnFVTmZky6+USVqkMqSiQais7XPReHAKtdo23hc9tZk
b2huXEsIOuA02KldOk1CnFl/y9C0aJu4oLrESixqZSqn2KdcFnjyvthL3sJIthNkgp3KTkmG
f0wFQtXKy67otmZhZeRerE1wNgvPY/3MYcStmBmwHfSCvNOrZLrGv6So4IAmm1s24YVRZ4yZ
OJAAdZrRDbHeBBXOhEsA5I3l+eui2PXbzBcpV6Eo6dx6G/WpOB0+Oe2a4qNIIXaLSlTtmmml
F7k+mj+OBsLd4PE7zC76XaGttaayEsXX6pXTtVU7MVCmEyPxmsVTRkXTkeTueilikm4HdVFJ
CQpFjEG9PNqshHzCIOhAlvj+BZooyIhZjaZKMVigCnl90Yey1/x6rQsJtKZVOEbiQ==
IronPort-HdrOrdr: A9a23:S3LwNKA6mTEUxj/lHegosceALOsnbusQ8zAXPh9KJiC9I/b1qy
nxppkmPEfP+U0ssQIb6Kq90c67MDnhHP9OkMIs1NiZLW7bUQeTTL2KqLGSuwEIeBeOu9K1t5
0QFZSWYeeYZTMR46fHCUuDYq8dKbG8geeVbIzlvhVQpHRRGsVdBnBCe2Om+yNNNWp7LKt8MK
DZyttMpjKmd3hSRN+8HGM5U+/KoMCOvI76YDYdbiRXpDWmvHeN0vrXAhKY1hARX3dk2rE561
XIlAT/++GKr+y78BnBzGXehq4m1+cJi+EzSvBkuPJlagkEuTzYJ7iJnIfy/gzdldvfqWrCVu
O85ivIcf4Dr085NVvF3CcFkzOQrArGrUWSj2NwyEGT3/AQSF8BerV8rJMcfR3D50U6utZglK
pNwmKCrpJSSQjNhSLn+rHzJmdXf2eP0A4feNQo/gtieJpbbKUUoZ0U/UtTHptFFCXm6Jo/GO
0rCM3H/v5ZfV6Tcnic5wBUsZSRd2V2Gg3DTlkJu8ST3TQTlHdlz1EAzMhamnsb7poyR5RN+u
yBOKV1k7NFSNMQcMtGda48aNryDnaITQPHMWqUL1iiHKYbO2jVo5qy+7kx7PHCQu188HLzou
WybLp1jx9AR6u1M7z+4HRiyGG8fFmA
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=fYjf1s1QI2WOEfGJlv8yLXC19rWKSytwxH+e0Y5qpEu+gpOO0QQjViY+AJw8tJiEK4tQNQRirEfk3zsEO2/76TvDnFVghkjPtf0Ub3tHpyC+xp4TKQriQnLNboV/gjGNyWsp+INBUaPNHlLsgJewSF7hg2UYrs6KCj/PqfGs8jqDE6NHhjHjvf3CF3JUfJtiQAoeUCPRQz0PAzptZZeS5U/+UT3t64g123zQlaZbgSIyw4qLeTOyHVtOWaotFjrbbsFKw41OD4UvS47speYJREQmN7cAjIKu2DmVFhc/Fm4JMF8/6OPBt9q66UPkTbP4LHl/J+nCr7NIvjokuBxjlQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=KU8J2U5+6ze/zDqsGbHLWgCE60OSgm28ibRop0vPJsI=;
b=iS9cIQBKpBIaocPskZnR2LeSou6B8iQxkuyek7djt8FsHpyPhjtyPmlY1XwYSWfy6vh7p/3YZRF0Yknqtv7fW/hfeCggff9JaPZJajBt60NPLkLYhpRGdDxzBlX9fMnf831DnijC0fMpMNaGN2DuNJVBwvWAv3SLcK4ZrPZyQhdllBMWp2hS1HurCF26ZK5H4wqa0f4VWM6k/pyTQKq1mnE19RR6FQmxSvQqqrFGF9S+D5M/ALu9fsicuTjj4LIUFOhvmEmaNLWsDz5nzs79mbmd+LgzplAkhmz2WILmuq/tS3v14fXih2Ttd8dxXjn6iATbMDF3H08Ji2uQeDQKDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=teledyne.com; dmarc=pass action=none header.from=teledyne.com;
dkim=pass header.d=teledyne.com; arc=none
Thread-Topic: Are Floating Point Numbers still a Can of Worms?
Thread-Index: AQHY57GOPDu+vPVSq0S8JIrgxfQP7K4dnuRA
In-Reply-To: <m2bkq24nyd.fsf@vanoostrum.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_Enabled=true;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_SetDate=2022-10-24T14:52:27Z;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_Method=Standard;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_Name=Company Sensitive;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_SiteId=e324592a-2653-45c7-9bfc-597c36917127;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_ActionId=8fc60e01-3321-4e5c-bb68-657923b1769d;
MSIP_Label_0d178f3f-9d62-4d87-b8af-200399509a39_ContentBits=2
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=Teledyne.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BN8PR14MB2851:EE_|PH0PR14MB4437:EE_
x-ms-office365-filtering-correlation-id: a5000328-393e-4b6a-4abc-08dab5cf5f36
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: xlLIAVc0wG/0yMNXmAckXnqw7lpZHKU0cxzopjmf5A1VZaapVmR9b6ONPv2SLnS8WYG59TqaSGlulvmz/W8HtbtbZb2h/APGIaWATdpUij8xHru/gR8/3QUb1Cc0WwYYhU7cgaX0Cyra39JtXMAUGhetVQ7VVihcUtWclmKxYqqHbzZ56pfgHc/HlNlHK9bt3MoaoASwG/JoUGxOWcjUp6h9fjqImf99/Bm7TV2J+OQxeyXH59zBVv7yUQaWzOUGRjzNlSR64iLA/Ltn6oodhR+RdZw0XzQrSYf84RHrEABQStpojI86yFM6cE6uktdlp6MdSZaA61Rh/ZZ8z3LGvkbKkzVGG+GAgnDGcwPoQmf2VlVwWNzafv0LGHvgY77syU24SgpgRxoJZp/dXu51dUtcYXLzYTZCGUnaOdbH7UtJT2WemNav6oAOP3oiwZSXr9uuCMOmWSNf7nSpnHNJ955RIM/f80xQnNeBu1AivbRTXyvjyaqz2ZIVi5Sls5AnIpanDeyvFVV6w7HzcDwd8Dw8RmhlADWXAAtDwQczAHe1GESfdtet0WAzVxSEZNQYJOKHpPlfW5lAVrV7DOgJp9ZEYFvPhgIi1AkM6psOwgoFndr+qQLdRiTBEDzkezTUAjIi+tHUbi1ORFKZu1ZJ5ox+o02B11Kh0kJIRy5eg3ciStckTVXhu4CpM65YQKQpivO5u3d3x3/qCXU8e9dbzzS8LmuNcEu6GjGOfM4YrpfylUbu61HhDmRqPvv60bBs//e2CeK6KyxIzKXh1C96HGbSCs9KvGORhz4F61dpmfY=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN8PR14MB2851.namprd14.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230022)(4636009)(366004)(39850400004)(136003)(396003)(346002)(376002)(451199015)(2906002)(5660300002)(186003)(9686003)(26005)(52536014)(41300700001)(8936002)(38070700005)(122000001)(38100700002)(55016003)(33656002)(86362001)(83380400001)(6916009)(316002)(71200400001)(478600001)(966005)(76116006)(6506007)(8676002)(7696005)(53546011)(66946007)(66556008)(64756008)(66446008)(66476007);
DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: rW9vWhLpNRnWMqZ6+Gq1pOjb8gyh5VD5xYw4CZykCTGFiadYsDmhlyx3bArq
CnwcqKPzmTuL62mNF7/5p8ejdNf9Fin1PhCeuJZEQlIIK2CHFnqpSBPmhqEo
3LuXwWWExWhVl/Y5BscATYIrWYWfaDrNyM/mvYgS7Iq1Vi+iwSYajA55pfnl
vwVPXQ6Ibc7nsa4Yqcc7GZi86VjITfk29u9kiv3Q6NSlO21Yg7lPRsfbPp7m
0+7GJyqLLJBNdAF0P5i5Gu2j6D4vCL4fOGw94SlKr8EOOEpcGMlzbtZmalT2
J+oD0b0/G3+hQxCk6DrQEa+KeiMIQsl5+F13f/w9t6gQP2wkOCvjCIZhswme
u+lWv3G8snloNpELXq3nKPob86ZFvqohZD+lAf+Xj1USnPG634gTkYoJGgGB
dlysMm6DW9jDXKlItQ2rGvIUy8paA4P/thvmvrbBpZtM8p3ojBz9fonEM1y+
F+iVTM0lqSIIZxfFjKAner8BZD+MMNVDsVG7P07TURV1x+5NF/zHtevCjD4x
24z1tKCxOR+UjUU4BXPNzdRonE1/S3H5Rfz1F7EyQVXmM2lc/KEmTVnKxjDt
eFdzYfgSyIcU/ujnzXKOVTNBt4hUKvT0Ignqg6Y4JLZdmOQOX5pB+xh8xUBo
fYQ8kqFUDCjhhTLfgO68Xtck1DmpEDfNPPzqxfx7tHcwJLehrDxMEo3vCrVA
K8TVblIxPO7mihKTk8wBfS7Epps2piLREIRFRNdPZpwLb1FxQNm2VdtbxSys
YxbgasrC/b8RezYY/o9X3hC+aVXsX6MAD0wnVj1llxgm/oh0ySqIDVqUt9Wj
+1BETp0X3L/BW7BFGge+5fj0Al0FDZe0PF8PKy1IlkrSEHfotmzO0WtSeFY7
BaO5F9QsUvkf+o2FPkyNLMHmKp/An0KimqyN7BsIFuTmq0OwKuS79MBpmmrb
TuTi99LXoRkYBA2zBjrMpdWIuCfBXRnI+XoRwlNIlvq5BO4OY9dDxss+tVuU
lsUQOgmr2o1+aZ9UfXHbsihmR1ozbM0VtwUgJJniKWh5/smFI2gHgklRc5q+
6dydo+Bxx5KwuEnWHg9N9sGBjP7ey9pbI57tGcA0PKdphdk1ZO+/HsSZ+e+2
jlmNGZdBlfqYX6oLJvw2yRqJ7V+H80mmMysg9/iBqw1cxM6TIAmKC1MPShmC
tmsOlRCmSI1xsISuOHW6f1UWKbmF04NKlS1k193nWUTWPf1GNX0jPUUWFXqd
KXfLrQHuZX+Yx2GY4aJcyw8UobPdMI/gcqmFhE8A4vUFF9v83p5BwG67LzjK
zEhy3MPhuecy4o7lK8bxbyL8U4RZvSwXYMIuaUgAsdWOE/41kJtsXZyqrVQJ
DOhMDugUQTY3Ziy6pbLefmRHvHEX9+ica1fJ55JoZBgMHBeMkevCl9dtkKaz
O0c4zHwhRHpvRR4YM1q11sA3j5yrPyE9gYLrzDFrVun/bu/Ngy5aAYCN53+s
y4wQldhev9sawnrhUwwWmARDdwQ1kM5jsW6XK9PZX/Lz/LWVi3pd9VbmjtMh
gfmAgfUJubomFDwAufnw+dn26vzh/tMYJf0x/v3yjyLNRIjziJFwGBwOR0C6
EA==
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BN8PR14MB2851.namprd14.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a5000328-393e-4b6a-4abc-08dab5cf5f36
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2022 14:52:28.6129 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: e324592a-2653-45c7-9bfc-597c36917127
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: qzCOcsH0szXFHSWk43fYVbrpP6nuXLDmjFVIeXqcqj9eeIcsdoAvNEuR9lq56lWfVBAS+j0qEM+v9mrGemgCaqvXu40xHBfSvzg9jth9M4s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR14MB4437
X-OriginatorOrg: Teledyne.com
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
X-Mailman-Original-References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com>
<m2bkq24nyd.fsf@vanoostrum.org>
 by: Schachner, Joseph (U - Mon, 24 Oct 2022 14:52 UTC

Floating point will always be a can of worms, as long as people expect it to represent real numbers with more precision that float has. Usually this is not an issue, but sometimes it is. And, although this example does not exhibit subtractive cancellation, that is the surest way to have less precision that the two values you subtracted. And if you try to add up lots of values, if your sum grows large enough, tiny values will not change it anymore, even if there are many of them - there are simple algorithms to avoid this effect. But all of this is because float has limited precision.

--- Joseph S.

Teledyne Confidential; Commercially Sensitive Business Data

-----Original Message-----
From: Pieter van Oostrum <pieter-l@vanoostrum.org>
Sent: Sunday, October 23, 2022 10:25 AM
To: python-list@python.org
Subject: Re: Are Floating Point Numbers still a Can of Worms?

Mostowski Collapse <bursejan@gmail.com> writes:

> I also get:
>
> Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>>> 2.718281828459045**0.8618974796837966
> 2.367649
>
> Nice try, but isn't this one the more correct?
>
> ?- X is 2.718281828459045**0.8618974796837966.
> X = 2.3676489999999997.
>

That's probably the accuracy of the underlying C implementation of the exp function.

In [25]: exp(0.8618974796837966)
Out[25]: 2.367649

But even your answer can be improved:

Maxima:

(%i1) fpprec:30$

(%i2) bfloat(2.718281828459045b0)^bfloat(.8618974796837966b0);
(%o2) 2.36764899999999983187397393143b0

but:

(%i7) bfloat(%e)^bfloat(.8618974796837966b0);
(%o7) 2.3676490000000000085638369695b0
surprisingly closer to Python's answer.

but 2.718281828459045 isn't e. Close but no cigar.

(%i10) bfloat(2.718281828459045b0) - bfloat(%e);
(%o10) - 2.35360287471352802147785151603b-16

Fricas:

(1) -> 2.718281828459045^0.8618974796837966

(1) 2.3676489999_999998319

(2) -> exp(0.8618974796837966)

(2) 2.3676490000_000000086

--
Pieter van Oostrum <pieter@vanoostrum.org>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]

Re: Are Floating Point Numbers still a Can of Worms?

<rmkdlh5hc561dptkan4u67ei4pq1tar1a5@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 24 Oct 2022 18:02:32 +0000
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: Are Floating Point Numbers still a Can of Worms?
Date: Mon, 24 Oct 2022 14:02:33 -0400
Organization: IISS Elusive Unicorn
Message-ID: <rmkdlh5hc561dptkan4u67ei4pq1tar1a5@4ax.com>
References: <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com> <769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <m2bkq24nyd.fsf@vanoostrum.org> <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com> <mailman.794.1666623225.20444.python-list@python.org>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 15
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-6cE5HRJ4hnVjWwl5BB+kKB6w+vHLNBFS6EA4n25vPxPicCh3TIzWqG/2xxJJRO9snPE1rg0frXolL4U!pChta+FEApsqvHYrd38hWnqH1yKdXrbQJavzXacJwR/UgCMU23Ok5VtFCC/8TGTbiy+H1V3d
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Dennis Lee Bieber - Mon, 24 Oct 2022 18:02 UTC

On Mon, 24 Oct 2022 14:52:28 +0000, "Schachner, Joseph (US)"
<Joseph.Schachner@Teledyne.com> declaimed the following:

>Floating point will always be a can of worms, as long as people expect it to represent real numbers with more precision that float has. Usually this is not an issue, but sometimes it is. And, although this example does not exhibit subtractive cancellation, that is the surest way to have less precision that the two values you subtracted. And if you try to add up lots of values, if your sum grows large enough, tiny values will not change it anymore, even if there are many of them - there are simple algorithms to avoid this effect. But all of this is because float has limited precision.
>

Might I suggest this to those affected...
https://www.amazon.com/Real-Computing-Made-Engineering-Calculations/dp/0486442217/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1666634371&sr=8-1

(Wow -- they want a fortune for the original hard-cover, which I own)

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Are Floating Point Numbers still a Can of Worms?

<f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:5902:0:b0:39c:e440:6adb with SMTP id 2-20020ac85902000000b0039ce4406adbmr31208446qty.18.1666697440431;
Tue, 25 Oct 2022 04:30:40 -0700 (PDT)
X-Received: by 2002:a05:6870:169e:b0:136:7f6a:1de0 with SMTP id
j30-20020a056870169e00b001367f6a1de0mr7713833oae.71.1666697440176; Tue, 25
Oct 2022 04:30:40 -0700 (PDT)
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.python
Date: Tue, 25 Oct 2022 04:30:40 -0700 (PDT)
In-Reply-To: <mailman.794.1666623225.20444.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <AQHY57GOPDu+vPVSq0S8JIrgxfQP7K4dnuRA> <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
<m2bkq24nyd.fsf@vanoostrum.org> <mailman.794.1666623225.20444.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 11:30:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3493
 by: Mostowski Collapse - Tue, 25 Oct 2022 11:30 UTC

Is this the same Schachner, Joseph that posted:

> Subject: ANN: Dogelog Runtime, Prolog to the Moon (2021)
> Message-ID: <BN8PR14MB28516E1052F60F2A924B55B7F5DA9@BN8PR14MB2851.namprd14.prod.outlook.com>
> Opinion: Anyone who is counting on Python for truly fast
> compute speed is probably using Python for the wrong purpose.
> Here, we use Python to control Test Equipment, to set up the
> equipment and ask for a measurement, get it, and proceed to
> the next measurement; and at the end produce a nice formatted
> report. If we wrote the test script in C or Rust or whatever it could
> not run substantially faster because it is communicating with
> the test equipment, setting it up and waiting for responses, and
> that is where the vast majority of the time goes. Especially
> if the measurement result requires averaging it can take a while.
> In my opinion this is an ideal use for Python, not just because
> the speed of Python is not important, but also because we can
> easily find people who know Python, who like coding in Python,
> and will join the company to program in Python ... and stay with us.

--- Joseph S.

Congratulations you already communicated in 2021 that speed is not
necessecary. So whats your opinion now in 2022, precision is not necessary?
Well, well, you are surely an expert in lowering the bar.

LMAO!

Schachner, Joseph (US) schrieb am Montag, 24. Oktober 2022 um 16:54:04 UTC+2:
> Floating point will always be a can of worms, as long as
people expect it to represent real numbers with more precision
that float has. Usually this is not an issue, but sometimes it is.
And, although this example does not exhibit subtractive cancellation,
that is the surest way to have less precision that the two values
you subtracted. And if you try to add up lots of values, if your sum
grows large enough, tiny values will not change it anymore, even
if there are many of them - there are simple algorithms to avoid
this effect. But all of this is because float has limited precision.
>
> --- Joseph S.

Re: Are Floating Point Numbers still a Can of Worms?

<b3de9405-e3f8-48fc-bb46-48d0e981528an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:29c9:b0:4b3:fcfe:3731 with SMTP id gh9-20020a05621429c900b004b3fcfe3731mr31390777qvb.29.1666698598337;
Tue, 25 Oct 2022 04:49:58 -0700 (PDT)
X-Received: by 2002:a05:6870:f152:b0:13a:f34a:9f35 with SMTP id
l18-20020a056870f15200b0013af34a9f35mr16647347oac.142.1666698598063; Tue, 25
Oct 2022 04:49:58 -0700 (PDT)
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.python
Date: Tue, 25 Oct 2022 04:49:57 -0700 (PDT)
In-Reply-To: <f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <AQHY57GOPDu+vPVSq0S8JIrgxfQP7K4dnuRA> <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
<m2bkq24nyd.fsf@vanoostrum.org> <mailman.794.1666623225.20444.python-list@python.org>
<f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b3de9405-e3f8-48fc-bb46-48d0e981528an@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 11:49:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4984
 by: Mostowski Collapse - Tue, 25 Oct 2022 11:49 UTC

For the stalkers information, maybe the more correct word is not
precision, but accuracy. The below result has the expected
precision, i.e. the pow() function produces 53 bits mantissa of

the floating point value, the decimal representation might not
show that, but I guess a C double precision floating point
functions computes 53 bits of some mantiassa, and the

Python floats we see below are the same as the
C double precision floating point values:

Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>> 2.718281828459045**0.8618974796837966
2.367649

Unfortunately its not accurate up to 0.5 ULP. Lets compute the
error in terms of ULP via microsoft calculator. What errors do we
have for the two floating point numbers?

0.0000000000000002827223584919617 /
2.3676489999999998318739739314273 * 2^52 =
0.53777747814549647686988825277067

0.000000000000000161366851358101 /
2.3676489999999998318739739314273 * 2^52 =
0.30694232618360826777706134718012

So the second floating point value, not the number
returned by Python, has a relative error less than 0.5 ULP,
and the first floating point value has a relative error

above 0.5 ULP. If the error is more than 0.5 ULP its not
anymore correctly rounded only nearly rounded.

Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 13:30:52 UTC+2:
> Is this the same Schachner, Joseph that posted:
>
> > Subject: ANN: Dogelog Runtime, Prolog to the Moon (2021)
> > Message-ID: <BN8PR14MB28516E1052...@BN8PR14MB2851.namprd14.prod.outlook.com>
> > Opinion: Anyone who is counting on Python for truly fast
> > compute speed is probably using Python for the wrong purpose.
> > Here, we use Python to control Test Equipment, to set up the
> > equipment and ask for a measurement, get it, and proceed to
> > the next measurement; and at the end produce a nice formatted
> > report. If we wrote the test script in C or Rust or whatever it could
> > not run substantially faster because it is communicating with
> > the test equipment, setting it up and waiting for responses, and
> > that is where the vast majority of the time goes. Especially
> > if the measurement result requires averaging it can take a while.
> > In my opinion this is an ideal use for Python, not just because
> > the speed of Python is not important, but also because we can
> > easily find people who know Python, who like coding in Python,
> > and will join the company to program in Python ... and stay with us.
>
> --- Joseph S.
>
> Congratulations you already communicated in 2021 that speed is not
> necessecary. So whats your opinion now in 2022, precision is not necessary?
> Well, well, you are surely an expert in lowering the bar.
>
> LMAO!
> Schachner, Joseph (US) schrieb am Montag, 24. Oktober 2022 um 16:54:04 UTC+2:
> > Floating point will always be a can of worms, as long as
> people expect it to represent real numbers with more precision
> that float has. Usually this is not an issue, but sometimes it is.
> And, although this example does not exhibit subtractive cancellation,
> that is the surest way to have less precision that the two values
> you subtracted. And if you try to add up lots of values, if your sum
> grows large enough, tiny values will not change it anymore, even
> if there are many of them - there are simple algorithms to avoid
> this effect. But all of this is because float has limited precision.
> >
> > --- Joseph S.

Re: Are Floating Point Numbers still a Can of Worms?

<359216ed-c8f7-49fa-9638-acaf0f9a74b3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:5902:0:b0:39c:e440:6adb with SMTP id 2-20020ac85902000000b0039ce4406adbmr1956278qty.18.1667003513187;
Fri, 28 Oct 2022 17:31:53 -0700 (PDT)
X-Received: by 2002:aca:b05:0:b0:355:70c3:5c4a with SMTP id
5-20020aca0b05000000b0035570c35c4amr1073733oil.142.1667003512834; Fri, 28 Oct
2022 17:31:52 -0700 (PDT)
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.python
Date: Fri, 28 Oct 2022 17:31:52 -0700 (PDT)
In-Reply-To: <b3de9405-e3f8-48fc-bb46-48d0e981528an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <AQHY57GOPDu+vPVSq0S8JIrgxfQP7K4dnuRA> <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
<m2bkq24nyd.fsf@vanoostrum.org> <mailman.794.1666623225.20444.python-list@python.org>
<f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com> <b3de9405-e3f8-48fc-bb46-48d0e981528an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <359216ed-c8f7-49fa-9638-acaf0f9a74b3n@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 29 Oct 2022 00:31:53 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1941
 by: Mostowski Collapse - Sat, 29 Oct 2022 00:31 UTC

Doing a little failure sweep for X**Y where the bits of
X and Y are in total 20 bit, gives a little different picture,
everything tested on Windows:

% sweep1, JDK 19: 1756
% sweep2, JDK 19: 666

% sweep1, PyPy: 2930
% sweep2, PyPy: 2174

% sweep1, nodejs: 78264
% sweep2, nodejs: 98698

sweep1: 15 bits X plus sign bit, 3 bits Y plus sign bit
sweep2: 12 bits X plus sign bit, 6 bits Y plus sign bit

Re: Are Floating Point Numbers still a Can of Worms?

<a4845dbe-e744-49f3-90fd-5b59af318072n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:598a:b0:4c6:8cac:1c22 with SMTP id ll10-20020a056214598a00b004c68cac1c22mr16879384qvb.60.1669050433278;
Mon, 21 Nov 2022 09:07:13 -0800 (PST)
X-Received: by 2002:a05:6870:5789:b0:13b:83c0:e27a with SMTP id
i9-20020a056870578900b0013b83c0e27amr10530713oap.284.1669050432961; Mon, 21
Nov 2022 09:07:12 -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.python
Date: Mon, 21 Nov 2022 09:07:12 -0800 (PST)
In-Reply-To: <359216ed-c8f7-49fa-9638-acaf0f9a74b3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <AQHY57GOPDu+vPVSq0S8JIrgxfQP7K4dnuRA> <acba3501-fe4b-496d-8ebc-90eb2dc81c54n@googlegroups.com>
<769f670e-92b4-401e-8d9e-4b8d12a0925dn@googlegroups.com> <BN8PR14MB28516217D40F209CD968E434F52E9@BN8PR14MB2851.namprd14.prod.outlook.com>
<m2bkq24nyd.fsf@vanoostrum.org> <mailman.794.1666623225.20444.python-list@python.org>
<f8338351-e729-4c06-8e97-01228dc7634fn@googlegroups.com> <b3de9405-e3f8-48fc-bb46-48d0e981528an@googlegroups.com>
<359216ed-c8f7-49fa-9638-acaf0f9a74b3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a4845dbe-e744-49f3-90fd-5b59af318072n@googlegroups.com>
Subject: Re: Are Floating Point Numbers still a Can of Worms?
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 21 Nov 2022 17:07:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2003
 by: Mostowski Collapse - Mon, 21 Nov 2022 17:07 UTC

Ha Ha, these Machin like formulas are
undershooting and overshooting:

Python 3.11.0rc1
>>> import math
>>> 28*math.atan(1/9)+4*math.atan(4765/441284)
3.1415926535897927
>>> 20*math.atan(1/7)+8*math.atan(3/79)
3.141592653589793
>>> 48*math.atan(1/16)+4*math.atan(14818029403841/407217467325761)
3.1415926535897936

Credits: Machin's Merit
https://www.mathpages.com/home/kmath373/kmath373.htm

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor