<div><div dir="auto">Well said, naive summation of numbers with errors built into the geometry / representation of real numbers are def non associative when restricted to bounded / fixed size finite reps! (I like to point out to folks that if you take the log_2 transformation of each half of the real line and then do a uniform grid, then truncate that grid to a finite width interval on each half real line , that roughly gives you the floating point numbers ). </div></div><div dir="auto"><br></div><div dir="auto">There’s a few different algorithms you can do for extended / high precision summation, though I don’t think they have the nice associative incremental algorithm we associate (hah!) with the summation and product monoids.  But I would love to be wrong.  Can we use some clever trick to have a higher precision constant space summation alg? Perhaps using eds compensated lib or something else under the covers ?</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 5:41 PM Dannyu NDos <<a href="mailto:ndospark320@gmail.com">ndospark320@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Imprecise calculation shouldn't be considered as a bug. Topologically speaking, floating point types are regarded as if they had countably infinite precision. So the elements in domain are positive reals, negative reals, the zeros, the infinities, and the NaN.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2019년 11월 7일 (목) 07:29, Brent Yorgey <<a href="mailto:byorgey@gmail.com" target="_blank">byorgey@gmail.com</a>>님이 작성:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hint: the problem has nothing to do with zeros.</div><div><br></div><div>λ> 0.1 + (0.2 + 0.3) == (0.1 + 0.2) + 0.3<br>False<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 4:20 PM Dannyu NDos <<a href="mailto:ndospark320@gmail.com" rel="noreferrer" target="_blank">ndospark320@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">Omg, addition is not even associative? The zeros truly ruined everything.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2019년 11월 7일 (목) 06:58, Brent Yorgey <<a href="mailto:byorgey@gmail.com" rel="noreferrer" target="_blank">byorgey@gmail.com</a>>님이 작성:<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"><div>How is that worse than the fact that addition is already not associative for floating point types?  At least +0 is really the identity up to (==).<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019, 3:49 PM Dannyu NDos <<a href="mailto:ndospark320@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">ndospark320@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">Sum has bug with floating points. Current definition states +0 as the identity element, while the actual identity is -0 since +0 + -0 = +0.</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>
</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>