On 13 September 2016 at 17:10, Waldek Hebisch <[email protected]> wrote: > Bill Page wrote: >> ... >> Are 0$DFLOAT and 1$DFLOAT really only approximate in FriCAS? >> In general I thought the most consistent approach to floats was to >> treat all (representable) floating point numbers as exact but to admit >> that floating point operations are often necessarily approximate. > > If a function gets 0 as an argument, then there is good chance to > this 0 is mathematically correct. But when mathematically you > should get 0, rounding error may lead to small nonzero number. > Given that x^y is discontinous at (0,0), depending on definition > of x^y at (0, 0) is error prone. So it makes sense to "undefine" > it and signal error. >
Presumably this argument should apply to any situation where the result of a calculation is discontinuous, right? But for example what about the case of a logical condition like x < 0$DFLOAT Would you argue that this also should be undefined? >> Apparently before SBCL 1.0.41.47, SBCL used to return >> >> (expt 0.0 0.0) -> 1.0 >> >> https://bugs.launchpad.net/sbcl/+bug/571581 >> >> But is there any good reason that FriCAS should follow this >> "standard"? > > I do not understand your position here. First you argue that > we should treat it as exact case, so return 1. Then you > apparently have opposite position... > My position is that the older version of SBCL was right and that the other Lisps were/are wrong. I think that (0$DFLOAT)^(0$DFLOAT) should equal 1$DFLOAT exactly. In the situation that you describe where rounding error may lead to a small nonzero number I think it is up to the user to take care of the fact that floating point operations may sometimes only approximate the corresponding mathematical function. It is not the result of the operation that is approximate but rather the operation itself. In other words, the rounding is inherent in the operation. But I think we should expect all floating point operations to make the best effort to be accurate and in this case we know exactly what the result of ^ should be. Bill Page. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
