<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Prof Kahan's Floating Point Test Program - the original from his and his students in his computer arithmetic seminar wrote during my days at UCB: <a href="https://www.netlib.org/paranoia/">https://www.netlib.org/paranoia/</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Kahan  was always miffed at how bad the different floating point units were - (Seymour was notorious for being fast but not very precise on most of his FP units).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Here is an updated FORTRAN 90 version: <a href="https://people.math.sc.edu/Burkardt/f_src/paranoia/paranoia.html">https://people.math.sc.edu/Burkardt/f_src/paranoia/paranoia.html</a></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY2xlbWNAY2NjLmNvbQ%3D%3D&type=zerocontent&guid=698fb5e6-4672-4bab-b819-0ff649edbaa3"><font color="#ffffff" size="1">ᐧ</font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2024 at 4:25 PM Rob Pike <<a href="mailto:robpike@gmail.com">robpike@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif">Norm Schryer wrote a (nearly?) exhaustive floating-point tester that he ran when a new CPU arrived, always with wrong results. Doug McIlroy probably knows more about it than I do, who only observed it from afar.</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">-rob</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2024 at 4:18 AM ron minnich <<a href="mailto:rminnich@gmail.com" target="_blank">rminnich@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Got the name wrong: Computer Engineering: A DEC View of Hardware Systems Design</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2024 at 9:41 AM ron minnich <<a href="mailto:rminnich@gmail.com" target="_blank">rminnich@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">by the way, I realize that random number urban legend sounds ridiculous, in light of how hardware design is done today, but those of you who did hardware design in those days (guilty!), and had access to -11 schematics and boards, might wonder if it's not possible. There was a habit, in those days,  for performance reasons, of subbing transparent latches for flip-flops to gain a little time. An engineer I knew at Amdahl said that was a pretty hot topic there. Certainly, the technique of design for testability was not really in wide use in the -11 days. Gordon Bell's book "Computer Design" is particularly instructive. <div><br></div><div>E.g., how did you verify the floating point on your new machine? Put an older machine next to a new machine, do lots of computation, see if there is disagreement, you've found a bug in the new machine, right? Maybe. Sometimes,  you discover the older machine had a bug the newer one did not ... happened more than once, including on the 360 to 370 transition.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2024 at 6:09 PM ron minnich <<a href="mailto:rminnich@gmail.com" target="_blank">rminnich@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">There used to be an urban legend about multiply overflow and the PDP 11.</div><div dir="auto"><br></div><div dir="auto">This would’ve been circa 1976. Someone from DEC told us that on a multiply overflow, the contents of the destination register would be “kind of” random. I was never able to verify that claim. But that might explain this code. </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2024 at 16:05 Jonathan Gray <<a href="mailto:jsg@jsg.id.au" target="_blank">jsg@jsg.id.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Mar 12, 2024 at 08:55:02AM -0400, Russ Cox wrote:<br>
> Hi all (and TUHS),<br>
> <br>
> The Third Edition rand(III) page [1] ends with<br>
> <br>
> WARNING  The author of this routine has been writing<br>
>     random-number generators for many years and has<br>
>     never been known to write one that worked.<br>
> <br>
> My understanding is that Ken wrote the rand implementation.<br>
> But I'm curious about the origin of this warning.<br>
> I had assumed that Ken wrote it as a combination warning+joke,<br>
> but Rob suggested that to him it didn't sound like Ken and<br>
> perhaps Doug or Dennis had written it. Does anyone remember?<br>
> <br>
> Separately, I am trying to find out what the very first<br>
> Unix rand implementation was. In the TUHS archives,<br>
> the incomplete V2 sources contain a reference to srand<br>
> in cmd/bas0.s [2], but there is no definition in the tree.<br>
> The V3 man pages list it, but as far as I can tell full<br>
> library sources do not appear in the TUHS archives<br>
> until the V6 snapshot. The V6 rand [3] is:<br>
> <br>
> rand:<br>
>     mov r1,-(sp)<br>
>     mov ranx,r1<br>
>     mpy $13077.,r1<br>
>     add $6925.,r1<br>
>     mov r1,r0<br>
>     mov r0,ranx<br>
>     bic $100000,r0<br>
>     mov (sp)+,r1<br>
>     rts pc<br>
<br>
matches V5:<br>
<a href="https://www.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s3/rand.sDistributions/Research/Dennis_v5/v5root.tar.gz" rel="noreferrer" target="_blank">https://www.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s3/rand.s<br>
Distributions/Research/Dennis_v5/v5root.tar.gz</a><br>
<br>
> <br>
> Perhaps this is the original rand as well? It is hard to imagine<br>
> a much simpler one, other than perhaps removing the addition,<br>
> but doing so would create a sequence of only odd numbers.<br>
> >From the man page description it sounds like this has to be the<br>
> original generator, perhaps with different constants.<br>
> <br>
> Thanks!<br>
> <br>
> Best,<br>
> Russ<br>
> <br>
> [1]<br>
> <a href="https://github.com/dspinellis/unix-history-repo/blob/Research-V3/man/man3/rand.3" rel="noreferrer" target="_blank">https://github.com/dspinellis/unix-history-repo/blob/Research-V3/man/man3/rand.3</a><br>
> [2]<br>
> <a href="https://github.com/dspinellis/unix-history-repo/blob/Research-V2/cmd/bas0.s" rel="noreferrer" target="_blank">https://github.com/dspinellis/unix-history-repo/blob/Research-V2/cmd/bas0.s</a><br>
> [3]<br>
> <a href="https://github.com/dspinellis/unix-history-repo/blob/Research-V6/usr/source/s3/rand.s" rel="noreferrer" target="_blank">https://github.com/dspinellis/unix-history-repo/blob/Research-V6/usr/source/s3/rand.s</a><br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>