| >NaN breaks x==x which is a pretty fundamental relationship for numbers to have NaN is not a number, so it should NOT satisfy "fundamental relationships for numbers to have". >+-Inf sound useful in theory, but in practice they rarely give you a more useful resu There are algorithms that are more performant using infs, and without having a way to denote overflow, you'd have to pre-check evedry operation to do serious numerical work, which basically cuts your performance in half. >Once you've gotten rid of -Inf, it becomes clear that -0.0 is a mistake >It breaks the identity 0+x==x and 0-x==-x. No, you have some fundamental misunderstanding. IEEE explicitly guarantees these hold, even for -0. > Furthermore, IEEE specifies sqrt(-0.0)==-0.0 and log(-0.0)==-Inf which are both nonsensical if you consider -0.0 as a limit from the negatives. You're making up strawmen. -0 is not a "limit from the negatives" any more than +0 is a limit form the positives, which would break other made up requirements. That is why making up stuff that has zero bearing on what IEEE 754 specifies is arguing strawmen. >Floats also have the unfortunate property that inv(x) can be infinite for finite x. Integers have the same property: -(X) can not be the negative of X. So this is not a problem except in made up goofiness. Every objection you post is a lack of understanding numerical analysis and the needs of actual scientific software. So you're skeptical- do you write numerical software professionally? I do, and have, and will do it in the future. There are very, very good reasons for all of those pieces you don't see the need for. There's a reason unums have not caught on with the field of numerical software or numerical analysis - they simply don't allow writing robust, performant software, they solve no real issues, and add significant problems. |
If you have a list with a NaN in it, how should you make sort terminate (and where should the NaN end up)? I understand that in theory it is kind of arguable that NaN should be different, but breaking the total order is a really dumb decision.
>you'd have to pre-check evedry operation to do serious numerical work, which basically cuts your performance in half.
Can you give an example? Saturating overflow tends to do the same thing.
>IEEE explicitly guarantees these hold
This is kind of true. -0.0+0.0==0.0 and 0.0-0.0==0.0. IEEE does define -0.0==0.0 so IEEE does technically make this hold, but only by redefining == so that two different numbers are ==
> -0 is not a "limit from the negatives" Then what is it? it's not a real number, and Kahan's justification of them comes from branch cuts of analytic functions which is only makes sense in the context of limits https://homes.cs.washington.edu/~ztatlock/599z-17sp/papers/b...
> Integers have the same property Yeah and it sucks there too. In the fp case it makes it really annoying to do things like calculate divide an array by a float quickly and accurately. You would want to take the inverse of the divisor and multiply by that, but doing so isn't safe if the divisor is subnormal.
Yes. My day job is in solving Differential Algebraic equations, but I also have written a bunch of Julia's Libm.