On Wed, Oct 21, 2015 at 11:24 PM, Paolo Giarrusso <p.giarru...@gmail.com> wrote:
> On 20 October 2015 at 16:44, Laurent <laurent.ors...@gmail.com> wrote: > > Thanks Paolo, yes, I saw that indeed and it is most likely relevant. I > was > > hoping my problem would be sufficiently more specific; in particular, I'd > > like to detect whether the value being above 0 is likely a rounding error > > (in which case I can just round it down to 0 again) or likely a mistake > on > > my part in my equations or in their implementation. > > I'm sorry, but your dichotomy seems a fallacy. Rounding errors are the > rule in floating point, and you need to account for them, otherwise > you have a bug, as every introduction to numerical analysis should > teach. > Thanks for your detailed explanation, Paolo. (I do use lgsum, lg1+, lg1-, etc. wherever I can, and try to rearrange my formulas to avoid worst cases, but I could probably use a bit more of error propagation analysis.) Maybe I forgot a piece of information though: I'm fine with getting sub-probabilities as the result of floating point errors, i.e. numbers that should sum to 1 (in normal space) but where the sum is actually 0.99998 for example. That's bad but for my purposes it's not too bad. However, I'm /not/ fine with super-probabilities. For what I do, ending with sub-probabilities mean my results could be better if I were more careful with my rounding errors. Super-probabilities mean I'm cheating and my results are likely to be better than they should be. So I was wondering if there was a way to make sure that whatever the operations I do, those rounding errors ensure that I never end up with super-probabilities. I was hoping that since this seems more specific than floating point error problems in general, there may something to be done. But maybe the former problem is just as bad as the latter. Laurent -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.