Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Nuclear war can ruin your whole compile." -- Karl Lehenbauer


tech / sci.electronics.design / Re: 0.0 / 0.0 = -NAN ?

SubjectAuthor
* Re: 0.0 / 0.0 = -NAN ?jlarkin
`* Re: 0.0 / 0.0 = -NAN ?Ricky
 +* Re: 0.0 / 0.0 = -NAN ?legg
 |+- Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |+* Re: 0.0 / 0.0 = -NAN ?jlarkin
 ||`* Re: 0.0 / 0.0 = -NAN ?legg
 || `* Re: 0.0 / 0.0 = -NAN ?John Larkin
 ||  `* Re: 0.0 / 0.0 = -NAN ?whit3rd
 ||   +- Re: 0.0 / 0.0 = -NAN ?Ricky
 ||   `- Re: 0.0 / 0.0 = -NAN ?John Larkin
 |`* Re: 0.0 / 0.0 = -NAN ?whit3rd
 | `* Re: 0.0 / 0.0 = -NAN ?jlarkin
 |  +* Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |  |+- Re: 0.0 / 0.0 = -NAN ?jlarkin
 |  |`* Re: 0.0 / 0.0 = -NAN ?Joe Gwinn
 |  | +* Re: 0.0 / 0.0 = -NAN ?Lasse Langwadt Christensen
 |  | |`* Re: 0.0 / 0.0 = -NAN ?Joe Gwinn
 |  | | `- Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |  | +* Re: 0.0 / 0.0 = -NAN ?John Larkin
 |  | |`- Re: 0.0 / 0.0 = -NAN ?Ricky
 |  | +* Re: 0.0 / 0.0 = -NAN ?Ricky
 |  | |+- Re: 0.0 / 0.0 = -NAN ?Joe Gwinn
 |  | |`* Re: 0.0 / 0.0 = -NAN ?none
 |  | | `- Re: 0.0 / 0.0 = -NAN ?Joe Gwinn
 |  | `* Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |  |  +- Re: 0.0 / 0.0 = -NAN ?jlarkin
 |  |  `- Re: 0.0 / 0.0 = -NAN ?Joe Gwinn
 |  +* Re: 0.0 / 0.0 = -NAN ?whit3rd
 |  |`- Re: 0.0 / 0.0 = -NAN ?John Larkin
 |  `* Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |   +* Re: 0.0 / 0.0 = -NAN ?Lasse Langwadt Christensen
 |   |+* Re: 0.0 / 0.0 = -NAN ?Ricky
 |   ||`- Re: 0.0 / 0.0 = -NAN ?Lasse Langwadt Christensen
 |   |+- Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |   |`* Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |   | +* Re: 0.0 / 0.0 = -NAN ?jlarkin
 |   | |`* Re: 0.0 / 0.0 = -NAN ?John Walliker
 |   | | `- Re: 0.0 / 0.0 = -NAN ?jlarkin
 |   | +* Re: 0.0 / 0.0 = -NAN ?rbowman
 |   | |+* Re: 0.0 / 0.0 = -NAN ?Lasse Langwadt Christensen
 |   | ||`- Re: 0.0 / 0.0 = -NAN ?rbowman
 |   | |`* Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |   | | `* Re: 0.0 / 0.0 = -NAN ?jlarkin
 |   | |  `- Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |   | `* Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |   |  +* Re: 0.0 / 0.0 = -NAN ?whit3rd
 |   |  |`- Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |   |  `- Re: 0.0 / 0.0 = -NAN ?Martin Brown
 |   `* Re: 0.0 / 0.0 = -NAN ?John Larkin
 |    `* Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |     `* Re: 0.0 / 0.0 = -NAN ?jlarkin
 |      +* Re: 0.0 / 0.0 = -NAN ?Phil Hobbs
 |      |`- Re: 0.0 / 0.0 = -NAN ?jlarkin
 |      `- Re: 0.0 / 0.0 = -NAN ?Ricky
 `* Re: 0.0 / 0.0 = -NAN ?Ricky
  `* Re: 0.0 / 0.0 = -NAN ?Lasse Langwadt Christensen
   `- Re: 0.0 / 0.0 = -NAN ?Ricky

Pages:123
Re: 0.0 / 0.0 = -NAN ?

<1e11cb8f-dd79-4e5a-a43a-1319c636b6b1n@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96059&group=sci.electronics.design#96059

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a0c:fb4d:0:b0:456:3a15:30d7 with SMTP id b13-20020a0cfb4d000000b004563a1530d7mr12179548qvq.93.1651542518985;
Mon, 02 May 2022 18:48:38 -0700 (PDT)
X-Received: by 2002:a25:35c5:0:b0:641:dab1:5ef9 with SMTP id
c188-20020a2535c5000000b00641dab15ef9mr12642026yba.396.1651542518787; Mon, 02
May 2022 18:48:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.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: sci.electronics.design
Date: Mon, 2 May 2022 18:48:38 -0700 (PDT)
In-Reply-To: <nvr07hp4hb7fpjjbo6klmcqd5eok6k69ru@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=209.221.140.126; posting-account=vKQm_QoAAADOaDCYsqOFDAW8NJ8sFHoE
NNTP-Posting-Host: 209.221.140.126
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <196t6h9j8ejfg6dma4e3r78fv59pnl67vn@4ax.com>
<4am07hhrr4bq9lvfugn58jr2cpoa626fec@4ax.com> <nvr07hp4hb7fpjjbo6klmcqd5eok6k69ru@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e11cb8f-dd79-4e5a-a43a-1319c636b6b1n@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: whit...@gmail.com (whit3rd)
Injection-Date: Tue, 03 May 2022 01:48:38 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2263
 by: whit3rd - Tue, 3 May 2022 01:48 UTC

On Monday, May 2, 2022 at 5:01:46 PM UTC-7, John Larkin wrote:
> On Mon, 02 May 2022 18:23:38 -0400, legg <le...@nospam.magma.ca> wrote:
>
> >On Sun, 01 May 2022 07:29:30 -0700, jla...@highlandsniptechnology.com
> >wrote:
> >
> >>On Sat, 30 Apr 2022 16:24:03 -0400, legg <le...@nospam.magma.ca> wrote:

> >>>I would have expected 0/0=1 ie no rational difference.

> >>0 is the safest heater power.
> >
> >Is that possible, if it's ON ?

> If we have a broken thermocouple, or some cable disconnected, or a
> shorted mosfet, we want to kill heater power.

That comment belongs embedded in the code that handles NAN
for the particular case where it indicates a broken thermocouple.
Otherwise it's a write-only bit of a program, and hazard in future.

Re: 0.0 / 0.0 = -NAN ?

<05fc607f-0b2c-444f-a951-47243ea87350n@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96062&group=sci.electronics.design#96062

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a05:622a:2cb:b0:2f3:646b:54b6 with SMTP id a11-20020a05622a02cb00b002f3646b54b6mr13017517qtx.380.1651544441547;
Mon, 02 May 2022 19:20:41 -0700 (PDT)
X-Received: by 2002:a25:9f04:0:b0:649:c7a3:5560 with SMTP id
n4-20020a259f04000000b00649c7a35560mr2839172ybq.609.1651544441265; Mon, 02
May 2022 19:20:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.electronics.design
Date: Mon, 2 May 2022 19:20:41 -0700 (PDT)
In-Reply-To: <1e11cb8f-dd79-4e5a-a43a-1319c636b6b1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.138.223.107; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 24.138.223.107
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <196t6h9j8ejfg6dma4e3r78fv59pnl67vn@4ax.com>
<4am07hhrr4bq9lvfugn58jr2cpoa626fec@4ax.com> <nvr07hp4hb7fpjjbo6klmcqd5eok6k69ru@4ax.com>
<1e11cb8f-dd79-4e5a-a43a-1319c636b6b1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <05fc607f-0b2c-444f-a951-47243ea87350n@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: gnuarm.d...@gmail.com (Ricky)
Injection-Date: Tue, 03 May 2022 02:20:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 35
 by: Ricky - Tue, 3 May 2022 02:20 UTC

On Monday, May 2, 2022 at 9:48:42 PM UTC-4, whit3rd wrote:
> On Monday, May 2, 2022 at 5:01:46 PM UTC-7, John Larkin wrote:
> > On Mon, 02 May 2022 18:23:38 -0400, legg <le...@nospam.magma.ca> wrote:
> >
> > >On Sun, 01 May 2022 07:29:30 -0700, jla...@highlandsniptechnology.com
> > >wrote:
> > >
> > >>On Sat, 30 Apr 2022 16:24:03 -0400, legg <le...@nospam.magma.ca> wrote:
>
> > >>>I would have expected 0/0=1 ie no rational difference.
> > >>0 is the safest heater power.
> > >
> > >Is that possible, if it's ON ?
>
> > If we have a broken thermocouple, or some cable disconnected, or a
> > shorted mosfet, we want to kill heater power.
> That comment belongs embedded in the code that handles NAN
> for the particular case where it indicates a broken thermocouple.
> Otherwise it's a write-only bit of a program, and hazard in future.
1+

It's no different from a trap, really, except there is no opportunity to do anything unique given the code that is doing the calculation. It works the same in all uses, which, obviously may or may not be appropriate. In other words, very sloppy and hard to maintain.

--

Rick C.

+- Get 1,000 miles of free Supercharging
+- Tesla referral code - https://ts.la/richard11209

Re: 0.0 / 0.0 = -NAN ?

<t4rcj6$1av2$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96117&group=sci.electronics.design#96117

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!ljceHNIDS/PAZpOVaAATuQ.user.46.165.242.75.POSTED!not-for-mail
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 3 May 2022 10:01:11 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t4rcj6$1av2$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="44002"; posting-host="ljceHNIDS/PAZpOVaAATuQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
X-Notice: Filtered by postfilter v. 0.9.2
 by: Phil Hobbs - Tue, 3 May 2022 14:01 UTC

Lasse Langwadt Christensen wrote:
> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
>> jla...@highlandsniptechnology.com wrote:
>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>>> wrote:
>>>
>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>
>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>> what was most reasonable.
>>>>>>>
>>>>>>> 0/0 = 0
>>>>>>
>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>
>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>
>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>
>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>> best way to get a thinking human to understanding what the computer
>>>> is trying to express.
>>>
>>> What does a control system do when the heater voltage is computed to
>>> be NAN?
>> Log it, skip the update, and press on to the next measurement.
>
> hoping that that doesn't slow the system down to much
>

Well, if the error and the slope are both zero, it doesn't matter if the
update occurs or not.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<t4rcr6$1gd6$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96119&group=sci.electronics.design#96119

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!ljceHNIDS/PAZpOVaAATuQ.user.46.165.242.75.POSTED!not-for-mail
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 3 May 2022 10:05:26 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t4rcr6$1gd6$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<nnp07h98t97n4dd90kl58kie3ompm15d4g@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="49574"; posting-host="ljceHNIDS/PAZpOVaAATuQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
X-Notice: Filtered by postfilter v. 0.9.2
 by: Phil Hobbs - Tue, 3 May 2022 14:05 UTC

John Larkin wrote:
> On Mon, 2 May 2022 16:52:35 -0400, Phil Hobbs
> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>
>> jlarkin@highlandsniptechnology.com wrote:
>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>> wrote:
>>>
>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>
>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>> what was most reasonable.
>>>>>>>
>>>>>>> 0/0 = 0
>>>>>>
>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>
>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>
>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>
>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>> best way to get a thinking human to understanding what the computer
>>>> is trying to express.
>>>
>>> What does a control system do when the heater voltage is computed to
>>> be NAN?
>>
>> Log it, skip the update, and press on to the next measurement.

>
> Fine as long as I don't fry a few hundred kilobucks of gear.
>
> These systems didn't have anywhere to log errors. If things got scary,
> I'd shut down and light a red LED.

Well, horses for courses. If the temperature controller is trying to
hold something just above 0 C in a subzero environment, shutting down
might be exactly the wrong answer.

And a system that can produce NaNs in the normal operation of a control
system is just plain broken--it's got serious algorithmic problems, not
so much numerical ones.

> NAN wouldn't be useful. A saturating math package let me make range
> checks when prudent, but not every step of every expression. No traps
> to handle.
>
> The s32.32 saturating math package was fun to write, in 68332
> assembly. It was fast because it didn't need any normalizing. Well,
> divide was a nuisance.
>
> Integer in/out conversions were fast. As in zero.

Sure thing, but correctness is more important than efficiency.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96126&group=sci.electronics.design#96126

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 03 May 2022 09:26:51 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 03 May 2022 07:26:49 -0700
Message-ID: <jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com> <4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net> <nnp07h98t97n4dd90kl58kie3ompm15d4g@4ax.com> <t4rcr6$1gd6$1@gioia.aioe.org>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 86
X-Trace: sv3-Ig4vNqNy8edx3+fBy16L8MAAFlNwOGWKS9FCyr+2MpjsRRw4KSDnrXfyX4LABUoA0aYQJcI797uQsCz!A2fG7Gk+8xvNtklSaSfZT2R9PINQyQF8BkAmahqczaBMpzRh70RXfbyaog/hOwFX+4kVGCvGBXen!+lPmzQ==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 4565
 by: jlar...@highlandsniptechnology.com - Tue, 3 May 2022 14:26 UTC

On Tue, 3 May 2022 10:05:26 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>John Larkin wrote:
>> On Mon, 2 May 2022 16:52:35 -0400, Phil Hobbs
>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>
>>> jlarkin@highlandsniptechnology.com wrote:
>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>>> wrote:
>>>>
>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>
>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>
>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>> what was most reasonable.
>>>>>>>>
>>>>>>>> 0/0 = 0
>>>>>>>
>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>
>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>
>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>
>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>> best way to get a thinking human to understanding what the computer
>>>>> is trying to express.
>>>>
>>>> What does a control system do when the heater voltage is computed to
>>>> be NAN?
>>>
>>> Log it, skip the update, and press on to the next measurement.
>
>>
>> Fine as long as I don't fry a few hundred kilobucks of gear.
>>
>> These systems didn't have anywhere to log errors. If things got scary,
>> I'd shut down and light a red LED.
>
>Well, horses for courses. If the temperature controller is trying to
>hold something just above 0 C in a subzero environment, shutting down
>might be exactly the wrong answer.
>
>And a system that can produce NaNs in the normal operation of a control
>system is just plain broken--it's got serious algorithmic problems, not
>so much numerical ones.

Ergo, a math package that doesn't make NANs, doesn't trap, doesn't
crash.

>
>> NAN wouldn't be useful. A saturating math package let me make range
>> checks when prudent, but not every step of every expression. No traps
>> to handle.
>>
>> The s32.32 saturating math package was fun to write, in 68332
>> assembly. It was fast because it didn't need any normalizing. Well,
>> divide was a nuisance.
>>
>> Integer in/out conversions were fast. As in zero.
>
>Sure thing, but correctness is more important than efficiency.

My control code checked the things that really matter.

After the PWM mosfet, to the heater, there was a relay driven by a
one-shot.

The O***** I********** controller would fry NMR probes. Ours never
did.

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<t4re5t$1lm0$2@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96127&group=sci.electronics.design#96127

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!ljceHNIDS/PAZpOVaAATuQ.user.46.165.242.75.POSTED!not-for-mail
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 3 May 2022 10:28:14 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t4re5t$1lm0$2@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <t4opqv$1fvg$1@gioia.aioe.org>
<m7uv6ht5llvjffrcmfk5pau8erlnnrenaf@4ax.com>
<0aae20de-b6d1-497f-98c2-3136ec6113bfn@googlegroups.com>
<gp307hpk20vuoveqa7mjphn1mv26vcthcc@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54976"; posting-host="ljceHNIDS/PAZpOVaAATuQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
X-Notice: Filtered by postfilter v. 0.9.2
 by: Phil Hobbs - Tue, 3 May 2022 14:28 UTC

Joe Gwinn wrote:
> On Mon, 2 May 2022 09:05:37 -0700 (PDT), Lasse Langwadt Christensen
> <langwadt@fonz.dk> wrote:
>
>> mandag den 2. maj 2022 kl. 17.54.53 UTC+2 skrev Joe Gwinn:
>>> On Mon, 2 May 2022 15:28:46 +0100, Martin Brown
>>> <'''newspam'''@nonad.co.uk> wrote:
>>>> On 02/05/2022 15:10, jla...@highlandsniptechnology.com wrote:
>>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>>
>>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>>
>>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>>> what was most reasonable.
>>>>>>>>>
>>>>>>>>> 0/0 = 0
>>>>>>>>
>>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>>
>>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>>
>>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>>
>>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>>> best way to get a thinking human to understanding what the computer
>>>>>> is trying to express.
>>>>>
>>>>> What does a control system do when the heater voltage is computed to
>>>>> be NAN?
>>>>
>>>> Shut down. The situation should never arise if you have scaled the
>>>> problem correctly and you should never be dividing by zero anyway.
>>>>
>>>> If the denominator of a division is zero then you haven't thought out
>>>> the representation of your problem correctly. Testing for zero is
>>>> usually quick (and often implicitly available in integer arithmetic).
>>> Umm. Testing for zero doesn't necessarily change anything.
>>>
>>> I have a war story here. Many decades ago, I was the software
>>> architect for the mission software of a ship self defense system that
>>> shoots incoming cruise missiles down, if it can. From detection at
>>> the horizon to impact on ownship is maybe twenty seconds.
>>>
>>> One fine day, a mob of software engineers turned up, locked in
>>> argument about what to do if the engageability calculation suffered a
>>> divide-by-zero exception.
>>>
>>> This is not a coding error per se, it's a mathematical singularity in
>>> the equations - some engagement geometries will hit the singularity,
>>> and the embedded realtime computers of that day could not handle the
>>> more complicated math needed to avoid such things fast enough to
>>> matter.
>>>
>>> There were two schools: Just provide a very large number and proceed,
>>> praying. Stop and print out a bunch of diagnostic information.
>>>
>>> Hmm. So the user, an ordinary sailor operating the self-defense
>>> system is in the middle of an engagement with an incoming cruise
>>> missile, and is suddenly handed a bunch or error messages, with less
>>> than twenty seconds to live ... Really??? No! Just silently return
>>> the best answer possible given the situation and press on, praying.
>>
>> sorta like: <https://en.wikipedia.org/wiki/Battleshort>
>
> Yes, same kind of thinking.
>
> With software taking the world over battleshort is often an operating
> mode, not necessarily a bit of hardware.

So that's where Douglas Adams got the idea!

https://hitchhikers.fandom.com/wiki/Vl'Hurgs

Cheers

Phil Hobbs

Re: 0.0 / 0.0 = -NAN ?

<t4rens$e20$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96128&group=sci.electronics.design#96128

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!ljceHNIDS/PAZpOVaAATuQ.user.46.165.242.75.POSTED!not-for-mail
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 3 May 2022 10:37:49 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t4rens$e20$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<nnp07h98t97n4dd90kl58kie3ompm15d4g@4ax.com> <t4rcr6$1gd6$1@gioia.aioe.org>
<jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="14400"; posting-host="ljceHNIDS/PAZpOVaAATuQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
X-Notice: Filtered by postfilter v. 0.9.2
 by: Phil Hobbs - Tue, 3 May 2022 14:37 UTC

jlarkin@highlandsniptechnology.com wrote:
> On Tue, 3 May 2022 10:05:26 -0400, Phil Hobbs
> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>
>> John Larkin wrote:
>>> On Mon, 2 May 2022 16:52:35 -0400, Phil Hobbs
>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>
>>>> jlarkin@highlandsniptechnology.com wrote:
>>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>>
>>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>>
>>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>>> what was most reasonable.
>>>>>>>>>
>>>>>>>>> 0/0 = 0
>>>>>>>>
>>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>>
>>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>>
>>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>>
>>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>>> best way to get a thinking human to understanding what the computer
>>>>>> is trying to express.
>>>>>
>>>>> What does a control system do when the heater voltage is computed to
>>>>> be NAN?
>>>>
>>>> Log it, skip the update, and press on to the next measurement.
>>
>>>
>>> Fine as long as I don't fry a few hundred kilobucks of gear.
>>>
>>> These systems didn't have anywhere to log errors. If things got scary,
>>> I'd shut down and light a red LED.
>>
>> Well, horses for courses. If the temperature controller is trying to
>> hold something just above 0 C in a subzero environment, shutting down
>> might be exactly the wrong answer.
>>
>> And a system that can produce NaNs in the normal operation of a control
>> system is just plain broken--it's got serious algorithmic problems, not
>> so much numerical ones.
>
> Ergo, a math package that doesn't make NANs, doesn't trap, doesn't
> crash.

No, a temperature control algorithm that can be proved not to lead to
singularities. In some cases it can be as simple as

(small difference)
update = ------------------------------------
sgn(denom) * (epsilon + fabs(denom))

>
>
>
>>
>>> NAN wouldn't be useful. A saturating math package let me make range
>>> checks when prudent, but not every step of every expression. No traps
>>> to handle.
>>>
>>> The s32.32 saturating math package was fun to write, in 68332
>>> assembly. It was fast because it didn't need any normalizing. Well,
>>> divide was a nuisance.
>>>
>>> Integer in/out conversions were fast. As in zero.
>>
>> Sure thing, but correctness is more important than efficiency.
>
> My control code checked the things that really matter.

Sure, I'm not looking at your control system design.

> After the PWM mosfet, to the heater, there was a relay driven by a
> one-shot.
>
> The O***** I********** controller would fry NMR probes. Ours never
> did.

I believe that, but it wasn't on account of the NaN-handling strategy. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<heh27h149fo8643g9iv8jgktqmmbq4pc0p@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96131&group=sci.electronics.design#96131

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 03 May 2022 10:18:19 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 03 May 2022 08:18:17 -0700
Message-ID: <heh27h149fo8643g9iv8jgktqmmbq4pc0p@4ax.com>
References: <4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net> <nnp07h98t97n4dd90kl58kie3ompm15d4g@4ax.com> <t4rcr6$1gd6$1@gioia.aioe.org> <jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com> <t4rens$e20$1@gioia.aioe.org>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 122
X-Trace: sv3-M3WwW+o+vLnqcvtwjGJpJNiB0C/dgSx5TAQvRfS3uucBgldHF5wm4u6e3fNDNbXdA35UF3gl0pCaXST!u5PIkYsYwDy2wz1ncfXzgcXemz2MznO24vSdVYmf9BGTJBA29/8KZ6ixh4WjYPE549xhOdWHU46v!JMtvAw==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 5872
 by: jlar...@highlandsniptechnology.com - Tue, 3 May 2022 15:18 UTC

On Tue, 3 May 2022 10:37:49 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>jlarkin@highlandsniptechnology.com wrote:
>> On Tue, 3 May 2022 10:05:26 -0400, Phil Hobbs
>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>
>>> John Larkin wrote:
>>>> On Mon, 2 May 2022 16:52:35 -0400, Phil Hobbs
>>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>>
>>>>> jlarkin@highlandsniptechnology.com wrote:
>>>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>>>
>>>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>>>> what was most reasonable.
>>>>>>>>>>
>>>>>>>>>> 0/0 = 0
>>>>>>>>>
>>>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>>>
>>>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>>>
>>>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>>>
>>>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>>>> best way to get a thinking human to understanding what the computer
>>>>>>> is trying to express.
>>>>>>
>>>>>> What does a control system do when the heater voltage is computed to
>>>>>> be NAN?
>>>>>
>>>>> Log it, skip the update, and press on to the next measurement.
>>>
>>>>
>>>> Fine as long as I don't fry a few hundred kilobucks of gear.
>>>>
>>>> These systems didn't have anywhere to log errors. If things got scary,
>>>> I'd shut down and light a red LED.
>>>
>>> Well, horses for courses. If the temperature controller is trying to
>>> hold something just above 0 C in a subzero environment, shutting down
>>> might be exactly the wrong answer.
>>>
>>> And a system that can produce NaNs in the normal operation of a control
>>> system is just plain broken--it's got serious algorithmic problems, not
>>> so much numerical ones.
>>
>> Ergo, a math package that doesn't make NANs, doesn't trap, doesn't
>> crash.
>
>No, a temperature control algorithm that can be proved not to lead to
>singularities. In some cases it can be as simple as
>
> (small difference)
>update = ------------------------------------
> sgn(denom) * (epsilon + fabs(denom))
>
>>
>>
>>
>>>
>>>> NAN wouldn't be useful. A saturating math package let me make range
>>>> checks when prudent, but not every step of every expression. No traps
>>>> to handle.
>>>>
>>>> The s32.32 saturating math package was fun to write, in 68332
>>>> assembly. It was fast because it didn't need any normalizing. Well,
>>>> divide was a nuisance.
>>>>
>>>> Integer in/out conversions were fast. As in zero.
>>>
>>> Sure thing, but correctness is more important than efficiency.
>>
>> My control code checked the things that really matter.
>
>Sure, I'm not looking at your control system design.

Well, my concern was physical reality, not mathematical elegance.
Checking for NAN after every math operation would be a nuisance. As
would writing a trap handler.

>
>> After the PWM mosfet, to the heater, there was a relay driven by a
>> one-shot.
>>
>> The O***** I********** controller would fry NMR probes. Ours never
>> did.
>
>I believe that, but it wasn't on account of the NaN-handling strategy. ;)

Part of the problem was absurd EMI sensitivity... in an NMR system! I
could shut one down from across the room with an old GR RF sig gen.
The controller had some very sharp, very sensitive resonances around
the thermocouple input.

But software bugs too.

We did things like this:

https://www.dropbox.com/s/noapeoyk10iayoz/Chimera_Ref_Junction.JPG?raw=1

>
>Cheers
>
>Phil Hobbs

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<d7c11581-1d29-4852-95f5-2859a71e4dd2n@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96132&group=sci.electronics.design#96132

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a0c:fd8d:0:b0:456:3481:603c with SMTP id p13-20020a0cfd8d000000b004563481603cmr14077603qvr.69.1651591732295;
Tue, 03 May 2022 08:28:52 -0700 (PDT)
X-Received: by 2002:a25:25cd:0:b0:648:5bce:5a45 with SMTP id
l196-20020a2525cd000000b006485bce5a45mr14879230ybl.349.1651591732020; Tue, 03
May 2022 08:28:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.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: sci.electronics.design
Date: Tue, 3 May 2022 08:28:51 -0700 (PDT)
In-Reply-To: <jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.138.223.107; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 24.138.223.107
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<nnp07h98t97n4dd90kl58kie3ompm15d4g@4ax.com> <t4rcr6$1gd6$1@gioia.aioe.org> <jme27h5lvg3064lbpoj56685sdip9qe4gl@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d7c11581-1d29-4852-95f5-2859a71e4dd2n@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: gnuarm.d...@gmail.com (Ricky)
Injection-Date: Tue, 03 May 2022 15:28:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Ricky - Tue, 3 May 2022 15:28 UTC

On Tuesday, May 3, 2022 at 10:27:03 AM UTC-4, jla...@highlandsniptechnology..com wrote:
> On Tue, 3 May 2022 10:05:26 -0400, Phil Hobbs
> <pcdhSpamM...@electrooptical.net> wrote:
>
> >John Larkin wrote:
> >> On Mon, 2 May 2022 16:52:35 -0400, Phil Hobbs
> >> <pcdhSpamM...@electrooptical.net> wrote:
> >>
> >>> jla...@highlandsniptechnology.com wrote:
> >>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
> >>>> wrote:
> >>>>
> >>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
> >>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
> >>>>>> <gnuarm.del...@gmail.com> wrote:
> >>>>>>
> >>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
> >>>>>
> >>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
> >>>>>>>> what was most reasonable.
> >>>>>>>>
> >>>>>>>> 0/0 = 0
> >>>>>>>
> >>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
> >>>>>>>
> >>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
> >>>>>
> >>>>>> I would have expected 0/0=1 ie no rational difference.
> >>>>>
> >>>>> That's the case if you consider lim x/x as x approaches zero. But,
> >>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
> >>>>> best way to get a thinking human to understanding what the computer
> >>>>> is trying to express.
> >>>>
> >>>> What does a control system do when the heater voltage is computed to
> >>>> be NAN?
> >>>
> >>> Log it, skip the update, and press on to the next measurement.
> >
> >>
> >> Fine as long as I don't fry a few hundred kilobucks of gear.
> >>
> >> These systems didn't have anywhere to log errors. If things got scary,
> >> I'd shut down and light a red LED.
> >
> >Well, horses for courses. If the temperature controller is trying to
> >hold something just above 0 C in a subzero environment, shutting down
> >might be exactly the wrong answer.
> >
> >And a system that can produce NaNs in the normal operation of a control
> >system is just plain broken--it's got serious algorithmic problems, not
> >so much numerical ones.
> Ergo, a math package that doesn't make NANs, doesn't trap, doesn't
> crash.

How is reporting an invalid answer not a "crash"? Oh, it's just an error.... that can lead to a crash depending on the skill level of the pilots to recognize and override the system.

Yeah, maybe an inconsequential heater would do fine. This is not a general solution to the math issues in a system.

What Hobbs is talking about if designing the algorithm so the NAN never happens in the first place. That also works and works for every type of system.

--

Rick C.

++ Get 1,000 miles of free Supercharging
++ Tesla referral code - https://ts.la/richard11209

Re: 0.0 / 0.0 = -NAN ?

<33n27hp5pjrhgd4pcm51gbfcdgevfrdnl4@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96134&group=sci.electronics.design#96134

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 03 May 2022 11:49:04 -0500
From: jlar...@highland_atwork_technology.com (John Larkin)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Tue, 03 May 2022 09:49:02 -0700
Organization: Highland Tech
Reply-To: xx@yy.com
Message-ID: <33n27hp5pjrhgd4pcm51gbfcdgevfrdnl4@4ax.com>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com> <4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <196t6h9j8ejfg6dma4e3r78fv59pnl67vn@4ax.com> <4am07hhrr4bq9lvfugn58jr2cpoa626fec@4ax.com> <nvr07hp4hb7fpjjbo6klmcqd5eok6k69ru@4ax.com> <1e11cb8f-dd79-4e5a-a43a-1319c636b6b1n@googlegroups.com>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 37
X-Trace: sv3-o0PtbnE70Z0vtvw3Ww+N/da2pW2EMw5qBhd/e84rbHAAKQQobO+6zA3VTXUw2rUNWNP0AvaiCOM86Ye!TusBRQqpLEWM4/epQIpWJoRzLYDNy/hkVA7pCyZSCt+U5ha9OP8Mit8hnetxeYRv7mvMJre5xBXI!V5deFw==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 2671
 by: John Larkin - Tue, 3 May 2022 16:49 UTC

On Mon, 2 May 2022 18:48:38 -0700 (PDT), whit3rd <whit3rd@gmail.com>
wrote:

>On Monday, May 2, 2022 at 5:01:46 PM UTC-7, John Larkin wrote:
>> On Mon, 02 May 2022 18:23:38 -0400, legg <le...@nospam.magma.ca> wrote:
>>
>> >On Sun, 01 May 2022 07:29:30 -0700, jla...@highlandsniptechnology.com
>> >wrote:
>> >
>> >>On Sat, 30 Apr 2022 16:24:03 -0400, legg <le...@nospam.magma.ca> wrote:
>
>> >>>I would have expected 0/0=1 ie no rational difference.
>
>> >>0 is the safest heater power.
>> >
>> >Is that possible, if it's ON ?
>
>> If we have a broken thermocouple, or some cable disconnected, or a
>> shorted mosfet, we want to kill heater power.
>
>That comment belongs embedded in the code that handles NAN
>for the particular case where it indicates a broken thermocouple.
>Otherwise it's a write-only bit of a program, and hazard in future.

My code is well commented. The saturating math package doesn't have
NAN.

We sold thousands of controllers and never fried a probe. Other
peoples' controllers did.

--

If a man will begin with certainties, he shall end with doubts,
but if he will be content to begin with doubts he shall end in certainties.
Francis Bacon

Re: 0.0 / 0.0 = -NAN ?

<t4tcmq$kno$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96213&group=sci.electronics.design#96213

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!woWShB6DIQvlDBD7PkJe+g.user.46.165.242.75.POSTED!not-for-mail
From: '''newsp...@nonad.co.uk (Martin Brown)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 4 May 2022 09:15:20 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t4tcmq$kno$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="21240"; posting-host="woWShB6DIQvlDBD7PkJe+g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin Brown - Wed, 4 May 2022 08:15 UTC

On 02/05/2022 22:02, Lasse Langwadt Christensen wrote:
> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
>> jla...@highlandsniptechnology.com wrote:
>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>>> wrote:
>>>
>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>
>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>> what was most reasonable.
>>>>>>>
>>>>>>> 0/0 = 0
>>>>>>
>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>
>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>
>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>
>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>> best way to get a thinking human to understanding what the computer
>>>> is trying to express.
>>>
>>> What does a control system do when the heater voltage is computed to
>>> be NAN?

It should worry about the skill of the programmer who wrote the code.

>> Log it, skip the update, and press on to the next measurement.

+1
Or maybe just count it. Not doing the divide saves enough time to do
something else that is *directly* under the programmers control.

Divides particularly and sometimes multiplies have the possibility of
overflow or underflow if their inputs are unfriendly.

> hoping that that doesn't slow the system down to much

Division even on the current crop of fast processors is already so slow
that explicitly defending against division by zero and the resulting
trap handling recovery is invariably faster than the alternative.

Many times you can prove that the divisor will not ever be zero but if
you can't then you should decide exactly how to handle that exception.

Division is roughly an order of magnitude slower than any of the other
primitive operations on today's CPU's - it was even worse in the past.

+,-,* now execute in a single cycle and in combination with branch
prediction and speculative execution can appear to execute in fractions
of a cycle provided that the data they need is available quickly enough.

--
Regards,
Martin Brown

Re: 0.0 / 0.0 = -NAN ?

<t4tem2$1e99$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96216&group=sci.electronics.design#96216

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!rocksolid2!i2pn.org!aioe.org!woWShB6DIQvlDBD7PkJe+g.user.46.165.242.75.POSTED!not-for-mail
From: '''newsp...@nonad.co.uk (Martin Brown)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 4 May 2022 09:49:04 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t4tem2$1e99$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <t4opqv$1fvg$1@gioia.aioe.org>
<m7uv6ht5llvjffrcmfk5pau8erlnnrenaf@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="47401"; posting-host="woWShB6DIQvlDBD7PkJe+g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin Brown - Wed, 4 May 2022 08:49 UTC

On 02/05/2022 16:54, Joe Gwinn wrote:
> On Mon, 2 May 2022 15:28:46 +0100, Martin Brown
> <'''newspam'''@nonad.co.uk> wrote:
>
>> On 02/05/2022 15:10, jlarkin@highlandsniptechnology.com wrote:
>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>> wrote:
>>>
>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>
>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>
>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>> what was most reasonable.
>>>>>>>
>>>>>>> 0/0 = 0
>>>>>>
>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>
>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>
>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>
>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>> best way to get a thinking human to understanding what the computer
>>>> is trying to express.
>>>
>>> What does a control system do when the heater voltage is computed to
>>> be NAN?
>>
>> Shut down. The situation should never arise if you have scaled the
>> problem correctly and you should never be dividing by zero anyway.
>>
>> If the denominator of a division is zero then you haven't thought out
>> the representation of your problem correctly. Testing for zero is
>> usually quick (and often implicitly available in integer arithmetic).
>
> Umm. Testing for zero doesn't necessarily change anything.

Yes it does. If you know you are about to divide by zero you can do
something else instead and still save time. Divides are remarkably slow.
(even today that still holds true)

I'm presently working on an algorithm that minimises divides to obtain
higher speed - at least that was the original aim. Serendipitously I
also found that then new schema simultaneously made the whole thing
considerably more accurate as well as faster.

Basically I can sometimes trade a hardware divide for a much more
horrible algebraic expression involving the other fast primitive
operations and still come out ahead on execution time and accuracy.
>
> I have a war story here. Many decades ago, I was the software
> architect for the mission software of a ship self defense system that
> shoots incoming cruise missiles down, if it can. From detection at
> the horizon to impact on ownship is maybe twenty seconds.
>
> One fine day, a mob of software engineers turned up, locked in
> argument about what to do if the engageability calculation suffered a
> divide-by-zero exception.

The important question here is is the divide by zero a real singularity
or as seems likely a coordinate transform singularity from taking
bearings and ranges into and out of x,y,z Cartesian coordinates.

Altaz telescope mounts have exactly the same problems as gun turrets.
Limited slew rates and allowable angles. It gets singular near the
zenith since the scope cannot spin fast enough to track the sky there.
This is a weak singularity but it has to be avoided.

Observation plans were always checked in simulated operation prior to
the actual telescope run to avoid that zone.

> This is not a coding error per se, it's a mathematical singularity in
> the equations - some engagement geometries will hit the singularity,
> and the embedded realtime computers of that day could not handle the
> more complicated math needed to avoid such things fast enough to
> matter.

But is it a true singularity or an artefact of how you are doing the
computing? My instinct is that it is the latter or else it could only
arise so rarely that taking the next set of measurements and processing
them would get you out of the bind. I can see that there might be cases
where the matrix inversion was singular for a single instant but that
would only be true for that time slice.

> There were two schools: Just provide a very large number and proceed,
> praying. Stop and print out a bunch of diagnostic information.

Clearly in a combat situation you can't afford to do anything other than
reset the calculation and try again. Or if it is because you are naively
calculating a value of tan(x) then set it to >10^18 and pray. That value
being more than enough to ensure that x = pi to double precision.

> Hmm. So the user, an ordinary sailor operating the self-defense
> system is in the middle of an engagement with an incoming cruise
> missile, and is suddenly handed a bunch or error messages, with less
> than twenty seconds to live ... Really??? No! Just silently return
> the best answer possible given the situation and press on, praying.

Every division in safety critical or mission critical code should be
checked for whether or not it can fail divide by zero and what if
anything should be done about it if it does.

--
Regards,
Martin Brown

Re: 0.0 / 0.0 = -NAN ?

<t9v47hpoolg0p5elnkdb5mq2223bu43kim@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96246&group=sci.electronics.design#96246

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 08:26:50 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 04 May 2022 06:26:48 -0700
Message-ID: <t9v47hpoolg0p5elnkdb5mq2223bu43kim@4ax.com>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com> <4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <t4opqv$1fvg$1@gioia.aioe.org> <m7uv6ht5llvjffrcmfk5pau8erlnnrenaf@4ax.com> <t4tem2$1e99$1@gioia.aioe.org>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 72
X-Trace: sv3-aD4IrBSHIvDFjgDs5iJJP69ykMI7TUrEplFvvsBHalCJUjGipMcEwvosjD8dGjoeswd2rGdVXC3jQY0!zn7ly5JdnftlLuul5n1liv1rCuZcbyX0fQ1OTljBe9tvI+cr+s2Lk0tiPf/55DWU0zCcJyiEAQ2X!24Qq/A==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 4628
 by: jlar...@highlandsniptechnology.com - Wed, 4 May 2022 13:26 UTC

On Wed, 4 May 2022 09:49:04 +0100, Martin Brown
<'''newspam'''@nonad.co.uk> wrote:

>On 02/05/2022 16:54, Joe Gwinn wrote:
>> On Mon, 2 May 2022 15:28:46 +0100, Martin Brown
>> <'''newspam'''@nonad.co.uk> wrote:
>>
>>> On 02/05/2022 15:10, jlarkin@highlandsniptechnology.com wrote:
>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whit3rd@gmail.com>
>>>> wrote:
>>>>
>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>
>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>
>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>> what was most reasonable.
>>>>>>>>
>>>>>>>> 0/0 = 0
>>>>>>>
>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>
>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>
>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>
>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>> best way to get a thinking human to understanding what the computer
>>>>> is trying to express.
>>>>
>>>> What does a control system do when the heater voltage is computed to
>>>> be NAN?
>>>
>>> Shut down. The situation should never arise if you have scaled the
>>> problem correctly and you should never be dividing by zero anyway.
>>>
>>> If the denominator of a division is zero then you haven't thought out
>>> the representation of your problem correctly. Testing for zero is
>>> usually quick (and often implicitly available in integer arithmetic).
>>
>> Umm. Testing for zero doesn't necessarily change anything.
>
>Yes it does. If you know you are about to divide by zero you can do
>something else instead and still save time. Divides are remarkably slow.
>(even today that still holds true)
>
>I'm presently working on an algorithm that minimises divides to obtain
>higher speed - at least that was the original aim. Serendipitously I
>also found that then new schema simultaneously made the whole thing
>considerably more accurate as well as faster.
>
>Basically I can sometimes trade a hardware divide for a much more
>horrible algebraic expression involving the other fast primitive
>operations and still come out ahead on execution time and accuracy.

In my heater code I divided by the square of the unregulated supply
voltage to get fast line regulation onto the heater PWM. Since that
voltage doesn't change much, I guess I could have multiplied by
2*(32-V) or something, namely just correct for slope around the
nominal supply voltage. Would have saved coding the divide, which I
only used once.

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<9qv47hpccghgj48060t8fdtbhf7gv8ookf@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96247&group=sci.electronics.design#96247

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 08:31:25 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 04 May 2022 06:31:24 -0700
Message-ID: <9qv47hpccghgj48060t8fdtbhf7gv8ookf@4ax.com>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com> <4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net> <be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 60
X-Trace: sv3-I5acP03uIwaotmvTa8vOz0dCZ3Q+3rXK6ryIO8vffpwudD1jlfT3coE/YdXbf70luSiHvofeTnEiefv!5PRq7fm20Z7Z1hQCua/wXAVy8ug6c8rAJRCSQ5zL/nr9R5eJiOVH8QmZMlznBhC2lXMnbzr+e5hR!82f4Sw==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 3765
 by: jlar...@highlandsniptechnology.com - Wed, 4 May 2022 13:31 UTC

On Wed, 4 May 2022 09:15:20 +0100, Martin Brown
<'''newspam'''@nonad.co.uk> wrote:

>On 02/05/2022 22:02, Lasse Langwadt Christensen wrote:
>> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
>>> jla...@highlandsniptechnology.com wrote:
>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>>>> wrote:
>>>>
>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>
>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>>>>>
>>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>>>>>>>> what was most reasonable.
>>>>>>>>
>>>>>>>> 0/0 = 0
>>>>>>>
>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>
>>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>>>>>
>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>
>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>> best way to get a thinking human to understanding what the computer
>>>>> is trying to express.
>>>>
>>>> What does a control system do when the heater voltage is computed to
>>>> be NAN?
>
>It should worry about the skill of the programmer who wrote the code.
>
>>> Log it, skip the update, and press on to the next measurement.
>
>+1
>Or maybe just count it.

No, count the number of superconductive magnets that were damaged. The
big ones had a spiral staircase to let users get to the top.

>Not doing the divide saves enough time to do
>something else that is *directly* under the programmers control.
>
>Divides particularly and sometimes multiplies have the possibility of
>overflow or underflow if their inputs are unfriendly.

Or use a saturating math package.

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<36140c05-61f6-499a-8d85-cf12a6c12174n@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96250&group=sci.electronics.design#96250

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a05:622a:181:b0:2e1:e70a:ec2a with SMTP id s1-20020a05622a018100b002e1e70aec2amr19175574qtw.42.1651673346158;
Wed, 04 May 2022 07:09:06 -0700 (PDT)
X-Received: by 2002:a0d:dd16:0:b0:2f4:dc1e:e0d8 with SMTP id
g22-20020a0ddd16000000b002f4dc1ee0d8mr19901214ywe.413.1651673345904; Wed, 04
May 2022 07:09:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.electronics.design
Date: Wed, 4 May 2022 07:09:05 -0700 (PDT)
In-Reply-To: <9qv47hpccghgj48060t8fdtbhf7gv8ookf@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8b0:fb4e:0:8286:f2ff:fe6b:6c87;
posting-account=de11ZAoAAACBQRb2jWnaIkHYK2q9mRvs
NNTP-Posting-Host: 2001:8b0:fb4e:0:8286:f2ff:fe6b:6c87
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org>
<9qv47hpccghgj48060t8fdtbhf7gv8ookf@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <36140c05-61f6-499a-8d85-cf12a6c12174n@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: jrwalli...@gmail.com (John Walliker)
Injection-Date: Wed, 04 May 2022 14:09:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 97
 by: John Walliker - Wed, 4 May 2022 14:09 UTC

On Wednesday, 4 May 2022 at 14:31:37 UTC+1, jla...@highlandsniptechnology.com wrote:
> On Wed, 4 May 2022 09:15:20 +0100, Martin Brown
> <'''newspam'''@nonad.co.uk> wrote:
>
> >On 02/05/2022 22:02, Lasse Langwadt Christensen wrote:
> >> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
> >>> jla...@highlandsniptechnology.com wrote:
> >>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
> >>>> wrote:
> >>>>
> >>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
> >>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
> >>>>>> <gnuarm.del...@gmail.com> wrote:
> >>>>>>
> >>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
> >>>>>
> >>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
> >>>>>>>> what was most reasonable.
> >>>>>>>>
> >>>>>>>> 0/0 = 0
> >>>>>>>
> >>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
> >>>>>>>
> >>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
> >>>>>
> >>>>>> I would have expected 0/0=1 ie no rational difference.
> >>>>>
> >>>>> That's the case if you consider lim x/x as x approaches zero. But,
> >>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
> >>>>> best way to get a thinking human to understanding what the computer
> >>>>> is trying to express.
> >>>>
> >>>> What does a control system do when the heater voltage is computed to
> >>>> be NAN?
> >
> >It should worry about the skill of the programmer who wrote the code.
> >
> >>> Log it, skip the update, and press on to the next measurement.
> >
> >+1
> >Or maybe just count it.
> No, count the number of superconductive magnets that were damaged. The
> big ones had a spiral staircase to let users get to the top.
> >Not doing the divide saves enough time to do
> >something else that is *directly* under the programmers control.
> >
> >Divides particularly and sometimes multiplies have the possibility of
> >overflow or underflow if their inputs are unfriendly.
> Or use a saturating math package.

A more spectacular example of what can go wrong is the failure of
an Ariane 5 rocket:
https://web.archive.org/web/20000815230639/http://www.esrin.esa.it/htdocs/tidc/Press/Press96/ariane5rep.html

"On 4 June 1996, the maiden flight of the Ariane 5 launcher ended in a failure. Only about 40 seconds
after initiation of the flight sequence, at an altitude of about 3700 m, the launcher veered off
its flight path, broke up and exploded.
....
The internal SRI software exception was caused during execution of a data conversion
from 64-bit floating point to 16-bit signed integer value. The floating point number which
was converted had a value greater than what could be represented by a 16-bit signed integer.
This resulted in an Operand Error.
....
Although the source of the Operand Error has been identified, this in itself did not cause the
mission to fail. The specification of the exception-handling mechanism also contributed to
the failure. In the event of any kind of exception, the system specification stated that: the
failure should be indicated on the databus, the failure context should be stored in an EEPROM
memory (which was recovered and read out for Ariane 501), and finally, the SRI processor
should be shut down.
It was the decision to cease the processor operation which finally proved fatal."

John

Re: 0.0 / 0.0 = -NAN ?

<jdffvgFqm82U1@mid.individual.net>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96251&group=sci.electronics.design#96251

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bow...@montana.com (rbowman)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 4 May 2022 08:13:07 -0600
Lines: 20
Message-ID: <jdffvgFqm82U1@mid.individual.net>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net fe32QYcv/OUBPVe0jo/KZQLQH4ShAQyDgWp6qyVVWM+wYYrnjs
Cancel-Lock: sha1:bsGaYG/HtDwjepewpheqsRv+TWs=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.6.0
In-Reply-To: <t4tcmq$kno$1@gioia.aioe.org>
 by: rbowman - Wed, 4 May 2022 14:13 UTC

On 05/04/2022 02:15 AM, Martin Brown wrote:
> Division even on the current crop of fast processors is already so slow
> that explicitly defending against division by zero and the resulting
> trap handling recovery is invariably faster than the alternative.
>
> Many times you can prove that the divisor will not ever be zero but if
> you can't then you should decide exactly how to handle that exception.
>
> Division is roughly an order of magnitude slower than any of the other
> primitive operations on today's CPU's - it was even worse in the past.
>
> +,-,* now execute in a single cycle and in combination with branch
> prediction and speculative execution can appear to execute in fractions
> of a cycle provided that the data they need is available quickly enough.

https://www.hpmuseum.org/srw.htm

The Fridens had no protection for a divide by zero operation despite its
sophistication. It would churn away until you unplugged it. I would hope
we've learned something in 70 years.

Re: 0.0 / 0.0 = -NAN ?

<9d29805b-968f-496e-8258-7d048a0e211dn@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96255&group=sci.electronics.design#96255

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a05:622a:648:b0:2f3:642d:c12a with SMTP id a8-20020a05622a064800b002f3642dc12amr19587895qtb.464.1651675451725;
Wed, 04 May 2022 07:44:11 -0700 (PDT)
X-Received: by 2002:a25:d4c2:0:b0:649:5630:5fef with SMTP id
m185-20020a25d4c2000000b0064956305fefmr15208102ybf.631.1651675451507; Wed, 04
May 2022 07:44:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.electronics.design
Date: Wed, 4 May 2022 07:44:11 -0700 (PDT)
In-Reply-To: <jdffvgFqm82U1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=130.225.196.250; posting-account=mW5JKwkAAAAMyuWOVeLp8yffyAkVx0g7
NNTP-Posting-Host: 130.225.196.250
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org>
<jdffvgFqm82U1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9d29805b-968f-496e-8258-7d048a0e211dn@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: langw...@fonz.dk (Lasse Langwadt Christensen)
Injection-Date: Wed, 04 May 2022 14:44:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 21
 by: Lasse Langwadt Chris - Wed, 4 May 2022 14:44 UTC

onsdag den 4. maj 2022 kl. 16.13.11 UTC+2 skrev rbowman:
> On 05/04/2022 02:15 AM, Martin Brown wrote:
> > Division even on the current crop of fast processors is already so slow
> > that explicitly defending against division by zero and the resulting
> > trap handling recovery is invariably faster than the alternative.
> >
> > Many times you can prove that the divisor will not ever be zero but if
> > you can't then you should decide exactly how to handle that exception.
> >
> > Division is roughly an order of magnitude slower than any of the other
> > primitive operations on today's CPU's - it was even worse in the past.
> >
> > +,-,* now execute in a single cycle and in combination with branch
> > prediction and speculative execution can appear to execute in fractions
> > of a cycle provided that the data they need is available quickly enough.
> https://www.hpmuseum.org/srw.htm
>
> The Fridens had no protection for a divide by zero operation despite its
> sophistication. It would churn away until you unplugged it. I would hope
> we've learned something in 70 years.

https://youtu.be/7Kd3R_RlXgc

Re: 0.0 / 0.0 = -NAN ?

<j6457h5k3slvoqtl1or9v1o7js358c346q@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96256&group=sci.electronics.design#96256

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 09:45:24 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 04 May 2022 07:45:22 -0700
Message-ID: <j6457h5k3slvoqtl1or9v1o7js358c346q@4ax.com>
References: <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net> <be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org> <9qv47hpccghgj48060t8fdtbhf7gv8ookf@4ax.com> <36140c05-61f6-499a-8d85-cf12a6c12174n@googlegroups.com>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 92
X-Trace: sv3-yGoEzSQY0gn/R0QtEv0GMqq9bDpU5z8hPK4J+j53RgIxue+Il9KCt3gBZmQwlVYBYJGxcqXEx+cWovx!wvJQgd6fTgLPa+fwh87IkrAs4Wsrm+SgIfQUClU/ez9nQSYWIJS82rfQyAMptaWG3itjiVd+5RCN!OF5jUg==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 5768
 by: jlar...@highlandsniptechnology.com - Wed, 4 May 2022 14:45 UTC

On Wed, 4 May 2022 07:09:05 -0700 (PDT), John Walliker
<jrwalliker@gmail.com> wrote:

>On Wednesday, 4 May 2022 at 14:31:37 UTC+1, jla...@highlandsniptechnology.com wrote:
>> On Wed, 4 May 2022 09:15:20 +0100, Martin Brown
>> <'''newspam'''@nonad.co.uk> wrote:
>>
>> >On 02/05/2022 22:02, Lasse Langwadt Christensen wrote:
>> >> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
>> >>> jla...@highlandsniptechnology.com wrote:
>> >>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>> >>>> wrote:
>> >>>>
>> >>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>> >>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>> >>>>>> <gnuarm.del...@gmail.com> wrote:
>> >>>>>>
>> >>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4, jla...@highlandsniptechnology.com wrote:
>> >>>>>
>> >>>>>>>> I wrote an s32.32 saturating math package for the 68K that always did
>> >>>>>>>> what was most reasonable.
>> >>>>>>>>
>> >>>>>>>> 0/0 = 0
>> >>>>>>>
>> >>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does not represent just exactly zero. Just as 1 is the range from 1/2 to 1-1/2, zero is the range from -1/2 to +1/2.
>> >>>>>>>
>> >>>>>>> If the denominator is not zero, as the numerator approaches zero, yes, in the limit, the result approaches zero. But if the numerator is not zero, as the denominator approaches zero, in the limit, the result approaches infinity. So why would 0/0=0 make sense?
>> >>>>>
>> >>>>>> I would have expected 0/0=1 ie no rational difference.
>> >>>>>
>> >>>>> That's the case if you consider lim x/x as x approaches zero. But,
>> >>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>> >>>>> best way to get a thinking human to understanding what the computer
>> >>>>> is trying to express.
>> >>>>
>> >>>> What does a control system do when the heater voltage is computed to
>> >>>> be NAN?
>> >
>> >It should worry about the skill of the programmer who wrote the code.
>> >
>> >>> Log it, skip the update, and press on to the next measurement.
>> >
>> >+1
>> >Or maybe just count it.
>> No, count the number of superconductive magnets that were damaged. The
>> big ones had a spiral staircase to let users get to the top.
>> >Not doing the divide saves enough time to do
>> >something else that is *directly* under the programmers control.
>> >
>> >Divides particularly and sometimes multiplies have the possibility of
>> >overflow or underflow if their inputs are unfriendly.
>> Or use a saturating math package.
>
>A more spectacular example of what can go wrong is the failure of
>an Ariane 5 rocket:
>https://web.archive.org/web/20000815230639/http://www.esrin.esa.it/htdocs/tidc/Press/Press96/ariane5rep.html
>
>"On 4 June 1996, the maiden flight of the Ariane 5 launcher ended in a failure. Only about 40 seconds
>after initiation of the flight sequence, at an altitude of about 3700 m, the launcher veered off
>its flight path, broke up and exploded.
>...
>The internal SRI software exception was caused during execution of a data conversion
>from 64-bit floating point to 16-bit signed integer value. The floating point number which
>was converted had a value greater than what could be represented by a 16-bit signed integer.
>This resulted in an Operand Error.
>...
>Although the source of the Operand Error has been identified, this in itself did not cause the
>mission to fail. The specification of the exception-handling mechanism also contributed to
>the failure. In the event of any kind of exception, the system specification stated that: the
>failure should be indicated on the databus, the failure context should be stored in an EEPROM
>memory (which was recovered and read out for Ariane 501), and finally, the SRI processor
>should be shut down.
>It was the decision to cease the processor operation which finally proved fatal."
>
>John

Exception handling, like a trap/interrupt on divide by zero or
overflow, is a hazard. After all, the flight continues.

Best to prevent exceptions by understanding the physical process.

PC programs can announce the exception and crash. Planes and rockets
really do crash.

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<fc89999a-fda4-4161-c3bb-59e869c1e894@electrooptical.net>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96259&group=sci.electronics.design#96259

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 11:27:43 -0500
Subject: Re: 0.0 / 0.0 = -NAN ?
Newsgroups: sci.electronics.design
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org>
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Message-ID: <fc89999a-fda4-4161-c3bb-59e869c1e894@electrooptical.net>
Date: Wed, 4 May 2022 12:27:42 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
MIME-Version: 1.0
In-Reply-To: <t4tcmq$kno$1@gioia.aioe.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 90
X-Trace: sv3-DdmhVeFwoiwXlIY0D44QJWQlroi9GNlNnnjE+DjutySv7F/Vltq0fw7Kd04cK6CrYAXv8MwCZ2TRX6u!VRuBk1nvf1wp/IKJXTwh9V2lzTR4MZ7RuIdbnw53qCyj9nlECzH3Yz+1icgVqHb/tL9Umo1JHaBP!/dCV4HmxybAjLlgxXyn9XD4=
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 5082
 by: Phil Hobbs - Wed, 4 May 2022 16:27 UTC

Martin Brown wrote:
> On 02/05/2022 22:02, Lasse Langwadt Christensen wrote:
>> mandag den 2. maj 2022 kl. 22.52.48 UTC+2 skrev Phil Hobbs:
>>> jla...@highlandsniptechnology.com wrote:
>>>> On Sun, 1 May 2022 20:27:33 -0700 (PDT), whit3rd <whi...@gmail.com>
>>>> wrote:
>>>>
>>>>> On Saturday, April 30, 2022 at 1:23:21 PM UTC-7, legg wrote:
>>>>>> On Sat, 30 Apr 2022 10:47:30 -0700 (PDT), Ricky
>>>>>> <gnuarm.del...@gmail.com> wrote:
>>>>>>
>>>>>>> On Saturday, April 30, 2022 at 12:11:41 PM UTC-4,
>>>>>>> jla...@highlandsniptechnology.com wrote:
>>>>>
>>>>>>>> I wrote an s32.32 saturating math package for the 68K that
>>>>>>>> always did
>>>>>>>> what was most reasonable.
>>>>>>>>
>>>>>>>> 0/0 = 0
>>>>>>>
>>>>>>> I'm sure no one can explain why 0/0 = 0 makes sense. Zero does
>>>>>>> not represent just exactly zero. Just as 1 is the range from 1/2
>>>>>>> to 1-1/2, zero is the range from -1/2 to +1/2.
>>>>>>>
>>>>>>> If the denominator is not zero, as the numerator approaches zero,
>>>>>>> yes, in the limit, the result approaches zero. But if the
>>>>>>> numerator is not zero, as the denominator approaches zero, in the
>>>>>>> limit, the result approaches infinity. So why would 0/0=0 make
>>>>>>> sense?
>>>>>
>>>>>> I would have expected 0/0=1 ie no rational difference.
>>>>>
>>>>> That's the case if you consider lim x/x as x approaches zero. But,
>>>>> what of the limit of 2x/x, or -x/x, as x approaches zero? NAN is the
>>>>> best way to get a thinking human to understanding what the computer
>>>>> is trying to express.
>>>>
>>>> What does a control system do when the heater voltage is computed to
>>>> be NAN?
>
> It should worry about the skill of the programmer who wrote the code.
>
>>> Log it, skip the update, and press on to the next measurement.
>
> +1
> Or maybe just count it. Not doing the divide saves enough time to do
> something else that is *directly* under the programmers control.
>
> Divides particularly and sometimes multiplies have the possibility of
> overflow or underflow if their inputs are unfriendly.
>
>> hoping that that doesn't slow the system down to much
>
> Division even on the current crop of fast processors is already so slow
> that explicitly defending against division by zero and the resulting
> trap handling recovery is invariably faster than the alternative.

And if it's _nearly_ singular, you can get denormals, which are really
really slow.

(I expect that Lasse was thinking more about the control loop stability
problem--with constant coefficients, all the pole and zero frequencies
are proportional to the update rate.)

>
> Many times you can prove that the divisor will not ever be zero but if
> you can't then you should decide exactly how to handle that exception.
>
> Division is roughly an order of magnitude slower than any of the other
> primitive operations on today's CPU's - it was even worse in the past.
>
> +,-,* now execute in a single cycle and in combination with branch
> prediction and speculative execution can appear to execute in fractions
> of a cycle provided that the data they need is available quickly enough.
>

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<ac5a02ba-668d-5dd2-3408-553f17ff87d3@electrooptical.net>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96260&group=sci.electronics.design#96260

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 11:30:14 -0500
Subject: Re: 0.0 / 0.0 = -NAN ?
Newsgroups: sci.electronics.design
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org> <jdffvgFqm82U1@mid.individual.net>
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Message-ID: <ac5a02ba-668d-5dd2-3408-553f17ff87d3@electrooptical.net>
Date: Wed, 4 May 2022 12:30:14 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
MIME-Version: 1.0
In-Reply-To: <jdffvgFqm82U1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 38
X-Trace: sv3-vFNH4p1z5qJ3gZVjXM3us9LFmNoWWnIb/1fZV3OKW1YKJCmfIPJMcJExfceJ/ZRVPIOTC2r2IO0hKQg!Xi8YoqBe6zYqcKG207NMonfXWqDzMJRgJF/k46Ef/H8Ae4KvrfdhSe5L/VQTdT2LSF+9DLAd/w/B!g6SJ9kNHeM2neATgkRLZsds=
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 3012
 by: Phil Hobbs - Wed, 4 May 2022 16:30 UTC

rbowman wrote:
> On 05/04/2022 02:15 AM, Martin Brown wrote:
>> Division even on the current crop of fast processors is already so slow
>> that explicitly defending against division by zero and the resulting
>> trap handling recovery is invariably faster than the alternative.
>>
>> Many times you can prove that the divisor will not ever be zero but if
>> you can't then you should decide exactly how to handle that exception.
>>
>> Division is roughly an order of magnitude slower than any of the other
>> primitive operations on today's CPU's - it was even worse in the past.
>>
>> +,-,* now execute in a single cycle and in combination with branch
>> prediction and speculative execution can appear to execute in fractions
>> of a cycle provided that the data they need is available quickly enough.
>
> https://www.hpmuseum.org/srw.htm
>
> The Fridens had no protection for a divide by zero operation despite its
> sophistication. It would churn away until you unplugged it. I would hope
> we've learned something in 70 years.

Wow, an Italian tune-up for a desk calculator. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<5fb57h5njh0fkfaiqm2p00nrgtju7235gi@4ax.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96262&group=sci.electronics.design#96262

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 11:54:21 -0500
From: jlar...@highlandsniptechnology.com
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 04 May 2022 09:54:19 -0700
Message-ID: <5fb57h5njh0fkfaiqm2p00nrgtju7235gi@4ax.com>
References: <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com> <jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com> <lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net> <be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org> <jdffvgFqm82U1@mid.individual.net> <ac5a02ba-668d-5dd2-3408-553f17ff87d3@electrooptical.net>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 52
X-Trace: sv3-QVzVky18BkgpzmojEumSiLLNtSQlGYZN2wNAztLQdjfidtJgVJOuljZSV5R7K9BZQxoOFET7ZYELI4U!7R3CHfI02akaA9soj4/Uyqoydm9oZbRpQCcDA53oRBBQULeZOpjxq+w/h+LuHTiL+clzfR3BGhDT!GQC1Vg==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 3322
 by: jlar...@highlandsniptechnology.com - Wed, 4 May 2022 16:54 UTC

On Wed, 4 May 2022 12:30:14 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>rbowman wrote:
>> On 05/04/2022 02:15 AM, Martin Brown wrote:
>>> Division even on the current crop of fast processors is already so slow
>>> that explicitly defending against division by zero and the resulting
>>> trap handling recovery is invariably faster than the alternative.
>>>
>>> Many times you can prove that the divisor will not ever be zero but if
>>> you can't then you should decide exactly how to handle that exception.
>>>
>>> Division is roughly an order of magnitude slower than any of the other
>>> primitive operations on today's CPU's - it was even worse in the past.
>>>
>>> +,-,* now execute in a single cycle and in combination with branch
>>> prediction and speculative execution can appear to execute in fractions
>>> of a cycle provided that the data they need is available quickly enough.
>>
>> https://www.hpmuseum.org/srw.htm
>>
>> The Fridens had no protection for a divide by zero operation despite its
>> sophistication. It would churn away until you unplugged it. I would hope
>> we've learned something in 70 years.
>
>Wow, an Italian tune-up for a desk calculator. ;)
>
>Cheers
>
>Phil Hobbs

I worked two summers at UNO, in a microwave spectroscopy project. I
designed hv pulsers for Stark effect spectroscopy, with big hard tubes
and thyratrons.

Two grad students spent the entire summer in a tiny room with two
Friden calculators calculating resonances. They did everything twice
and cross-checked. My PC would do that now in milliseconds.

I made 50 cents per hour and learned a lot. They could only pay
students so they gave me fake student ID number 20,000 on the theory
that they would never get that high. Some poor person is now confused
with me.

--

Anybody can count to one.

- Robert Widlar

Re: 0.0 / 0.0 = -NAN ?

<abfb4435-af65-f7b4-56a3-a642a71e7749@electrooptical.net>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96263&group=sci.electronics.design#96263

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 04 May 2022 12:32:07 -0500
Subject: Re: 0.0 / 0.0 = -NAN ?
Newsgroups: sci.electronics.design
References: <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org> <jdffvgFqm82U1@mid.individual.net>
<ac5a02ba-668d-5dd2-3408-553f17ff87d3@electrooptical.net>
<5fb57h5njh0fkfaiqm2p00nrgtju7235gi@4ax.com>
From: pcdhSpam...@electrooptical.net (Phil Hobbs)
Message-ID: <abfb4435-af65-f7b4-56a3-a642a71e7749@electrooptical.net>
Date: Wed, 4 May 2022 13:32:07 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.0
MIME-Version: 1.0
In-Reply-To: <5fb57h5njh0fkfaiqm2p00nrgtju7235gi@4ax.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 63
X-Trace: sv3-a5ypGVQoxBuMFqIKRD9/KBS6YAyOOeZ8wH/k/VR7yRV9UVvCYyw4y+buGRTEVCAg6dTDL5ad+t/WB+I!Xqyf4+3BVSdUqL1cQmFx9X9T431NMM/M2nLdffhZbgDbUZhKqDJzOJHlr3E0bUSay4zLUFySLxOc!Jq3kO6CKW0SoXJxomI6f4TE=
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/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
X-Original-Bytes: 3927
 by: Phil Hobbs - Wed, 4 May 2022 17:32 UTC

jlarkin@highlandsniptechnology.com wrote:
> On Wed, 4 May 2022 12:30:14 -0400, Phil Hobbs
> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>
>> rbowman wrote:
>>> On 05/04/2022 02:15 AM, Martin Brown wrote:
>>>> Division even on the current crop of fast processors is already so slow
>>>> that explicitly defending against division by zero and the resulting
>>>> trap handling recovery is invariably faster than the alternative.
>>>>
>>>> Many times you can prove that the divisor will not ever be zero but if
>>>> you can't then you should decide exactly how to handle that exception.
>>>>
>>>> Division is roughly an order of magnitude slower than any of the other
>>>> primitive operations on today's CPU's - it was even worse in the past.
>>>>
>>>> +,-,* now execute in a single cycle and in combination with branch
>>>> prediction and speculative execution can appear to execute in fractions
>>>> of a cycle provided that the data they need is available quickly enough.
>>>
>>> https://www.hpmuseum.org/srw.htm
>>>
>>> The Fridens had no protection for a divide by zero operation despite its
>>> sophistication. It would churn away until you unplugged it. I would hope
>>> we've learned something in 70 years.
>>
>> Wow, an Italian tune-up for a desk calculator. ;)
>>
>> Cheers
>>
>> Phil Hobbs
>
> I worked two summers at UNO, in a microwave spectroscopy project. I
> designed hv pulsers for Stark effect spectroscopy, with big hard tubes
> and thyratrons.
>
> Two grad students spent the entire summer in a tiny room with two
> Friden calculators calculating resonances. They did everything twice
> and cross-checked. My PC would do that now in milliseconds.
>
> I made 50 cents per hour and learned a lot. They could only pay
> students so they gave me fake student ID number 20,000 on the theory
> that they would never get that high. Some poor person is now confused
> with me.
>
>
>
I doubt they issued any 1099s anyway, so no harm, no foul. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Re: 0.0 / 0.0 = -NAN ?

<a63c87e1-e726-4733-b977-63c3588eda32n@googlegroups.com>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96272&group=sci.electronics.design#96272

  copy link   Newsgroups: sci.electronics.design
X-Received: by 2002:a05:622a:1111:b0:2f3:a419:4e05 with SMTP id e17-20020a05622a111100b002f3a4194e05mr15490886qty.657.1651694605562;
Wed, 04 May 2022 13:03:25 -0700 (PDT)
X-Received: by 2002:a05:690c:97:b0:2f1:9582:6685 with SMTP id
be23-20020a05690c009700b002f195826685mr21596517ywb.395.1651694605416; Wed, 04
May 2022 13:03:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.electronics.design
Date: Wed, 4 May 2022 13:03:25 -0700 (PDT)
In-Reply-To: <fc89999a-fda4-4161-c3bb-59e869c1e894@electrooptical.net>
Injection-Info: google-groups.googlegroups.com; posting-host=209.221.140.126; posting-account=vKQm_QoAAADOaDCYsqOFDAW8NJ8sFHoE
NNTP-Posting-Host: 209.221.140.126
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com> <9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com> <e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com> <31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com> <t4tcmq$kno$1@gioia.aioe.org>
<fc89999a-fda4-4161-c3bb-59e869c1e894@electrooptical.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a63c87e1-e726-4733-b977-63c3588eda32n@googlegroups.com>
Subject: Re: 0.0 / 0.0 = -NAN ?
From: whit...@gmail.com (whit3rd)
Injection-Date: Wed, 04 May 2022 20:03:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: whit3rd - Wed, 4 May 2022 20:03 UTC

On Wednesday, May 4, 2022 at 9:27:55 AM UTC-7, Phil Hobbs wrote:
> Martin Brown wrote:

> > Division even on the current crop of fast processors is already so slow
> > that explicitly defending against division by zero and the resulting
> > trap handling recovery is invariably faster than the alternative.
> And if it's _nearly_ singular, you can get denormals, which are really
> really slow.
>
> (I expect that Lasse was thinking more about the control loop stability
> problem--with constant coefficients, all the pole and zero frequencies
> are proportional to the update rate.)

If you care about updating frequently, and if there's an issue with division,
just... don't divide. Do everything with a lookup table; memory is cheap.
Or, it's possible to take a multivariable equation into linear operation
(a matrix operation instead of special functions) and a matrix operates on
very simple formulae that don't include division or allow overflow.

Re: 0.0 / 0.0 = -NAN ?

<jdgtc3F4dpdU1@mid.individual.net>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96299&group=sci.electronics.design#96299

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bow...@montana.com (rbowman)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Wed, 4 May 2022 21:07:50 -0600
Lines: 35
Message-ID: <jdgtc3F4dpdU1@mid.individual.net>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org> <jdffvgFqm82U1@mid.individual.net>
<9d29805b-968f-496e-8258-7d048a0e211dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vLhgrTwKWMoSeNmstYnWxAmPkuwNWv+Z7G2ICDSWCY5zeD51Gl
Cancel-Lock: sha1:DULtNZNcMc6+QS+xZ8YRKSpHW8g=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.6.0
In-Reply-To: <9d29805b-968f-496e-8258-7d048a0e211dn@googlegroups.com>
 by: rbowman - Thu, 5 May 2022 03:07 UTC

On 05/04/2022 08:44 AM, Lasse Langwadt Christensen wrote:
> onsdag den 4. maj 2022 kl. 16.13.11 UTC+2 skrev rbowman:
>> On 05/04/2022 02:15 AM, Martin Brown wrote:
>>> Division even on the current crop of fast processors is already so slow
>>> that explicitly defending against division by zero and the resulting
>>> trap handling recovery is invariably faster than the alternative.
>>>
>>> Many times you can prove that the divisor will not ever be zero but if
>>> you can't then you should decide exactly how to handle that exception.
>>>
>>> Division is roughly an order of magnitude slower than any of the other
>>> primitive operations on today's CPU's - it was even worse in the past.
>>>
>>> +,-,* now execute in a single cycle and in combination with branch
>>> prediction and speculative execution can appear to execute in fractions
>>> of a cycle provided that the data they need is available quickly enough.
>> https://www.hpmuseum.org/srw.htm
>>
>> The Fridens had no protection for a divide by zero operation despite its
>> sophistication. It would churn away until you unplugged it. I would hope
>> we've learned something in 70 years.
>
> https://youtu.be/7Kd3R_RlXgc
>

That's the animal. I don't remember the div stop but it's been a long
time. I worked for the NYS Education Department summers in the mid-60's.
NYS has state wide Regents exams which are designed from question pools
to basically get a nice bell curve from the results. All the statistical
number crunching was done on Fridens at the time.

To answer the obvious question they sometimes did blow it and wind up
flunking a lot of students leading to some post hoc juggling.

Re: 0.0 / 0.0 = -NAN ?

<t515od$cgt$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/tech/article-flat.php?id=96347&group=sci.electronics.design#96347

  copy link   Newsgroups: sci.electronics.design
Path: i2pn2.org!i2pn.org!aioe.org!woWShB6DIQvlDBD7PkJe+g.user.46.165.242.75.POSTED!not-for-mail
From: '''newsp...@nonad.co.uk (Martin Brown)
Newsgroups: sci.electronics.design
Subject: Re: 0.0 / 0.0 = -NAN ?
Date: Thu, 5 May 2022 19:41:17 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t515od$cgt$1@gioia.aioe.org>
References: <85f22bc1-17c7-46d9-b933-4c6238863740n@googlegroups.com>
<4knq6h5avvjpbkd2c4mgblr3o0ns4q1tpg@4ax.com>
<9607d68a-ec3b-473c-a30d-856beac3233bn@googlegroups.com>
<jl6r6htkcvjsfcu27ai1ag1mp7ad2goij7@4ax.com>
<e7d06869-d567-4145-ad01-f222a028033cn@googlegroups.com>
<lgpv6hdhqkl6071e651cb4dd1qkf94aa48@4ax.com>
<31cd75e7-2c72-6923-1c33-dde5e74f13e7@electrooptical.net>
<be9971b0-243c-44bf-8cc9-a50d19905af8n@googlegroups.com>
<t4tcmq$kno$1@gioia.aioe.org>
<fc89999a-fda4-4161-c3bb-59e869c1e894@electrooptical.net>
<a63c87e1-e726-4733-b977-63c3588eda32n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="12829"; posting-host="woWShB6DIQvlDBD7PkJe+g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin Brown - Thu, 5 May 2022 18:41 UTC

On 04/05/2022 21:03, whit3rd wrote:
> On Wednesday, May 4, 2022 at 9:27:55 AM UTC-7, Phil Hobbs wrote:
>> Martin Brown wrote:
>
>>> Division even on the current crop of fast processors is already so slow
>>> that explicitly defending against division by zero and the resulting
>>> trap handling recovery is invariably faster than the alternative.
>> And if it's _nearly_ singular, you can get denormals, which are really
>> really slow.
>>
>> (I expect that Lasse was thinking more about the control loop stability
>> problem--with constant coefficients, all the pole and zero frequencies
>> are proportional to the update rate.)
>
> If you care about updating frequently, and if there's an issue with division,
> just... don't divide. Do everything with a lookup table; memory is cheap.

Back then memory was (VERY) expensive and in short supply and machines
with a hardware divide always had the advantage if you needed to use it.

> Or, it's possible to take a multivariable equation into linear operation
> (a matrix operation instead of special functions) and a matrix operates on
> very simple formulae that don't include division or allow overflow.

Most of the tricks I know for special functions - some of which I still
use rely on precisely one divide but with a bit of luck you can ensure
that the parameters it is passed will never result in that happening.

Polynomial functions with lousy convergence like eg log(x)

log2(1+x) = x - x^2/2 + x^3/3 - ...

x = -1/2 polysum3 = -2/3 -0.6666'
x=1 Polysum3 = 5/6 0.8333'

Pade approximation 3,2 of the above with one divide

log2(1+x) = x*(6+x)/(6+4x)
x = -1/2 pade3,2 = -11/16 -0.6875
x = 1 PADE3,2 = 7/10 0.7

The exact answer to 6 sig fig is 0.69315 so the Pade approximation is
already good to 1% over the range -1/2 to 1 and <0.2% on -1/3 to +1/2.

Something that has changed recently is that when a divide is pending
other FP instructions that have no dependency on that particular result
can execute in parallel making timing predictions very tricky indeed.

--
Regards,
Martin Brown

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor