Re: Solve never calls Equal?

*To*: mathgroup at smc.vnet.net*Subject*: [mg120310] Re: Solve never calls Equal?*From*: Richard Fateman <fateman at cs.berkeley.edu>*Date*: Mon, 18 Jul 2011 06:14:17 -0400 (EDT)*References*: <201107150118.VAA23606@smc.vnet.net> <ivovvt$qpa$1@smc.vnet.net> <201107160941.FAA08237@smc.vnet.net> <7BBB2BCC-0234-4BDA-A129-3270EBA623CE@mimuw.edu.pl> <ivuc93$gth$1@smc.vnet.net>

On 7/17/2011 3:07 AM, Andrzej Kozlowski wrote: ... snipped .. Andrzej's various claims that I was joking (no, I was exposing a flaw in his example, as Bill Rowe realized); Andrzej's claim that he meant to do that. > > Great, now let's try Richard's "improved" Mathematica: Actually, I did not propose to improve Mathematica by replacing Equal by SameQ. I observed that it was not a good substitute, and that in any case Solve did not, apparently, use Equal on 2 numbers. Someone else asked what would happen if you simply replaced Equal by SameQ. I proposed this fix for Equal: Unprotect[Equal] Equal[a_Real, b_] := Equal[Rationalize[SetAccuracy[a, Infinity]], b] Equal[a_, b_Real] := Equal[a, Rationalize[SetAccuracy[b, Infinity]]] >(AK wrote...) Reduce[Exp[x]-x==1/2&&Abs[x]<1,x] > Reduce::nsmet: This system cannot be solved with the methods available to Reduce.>> With my "fix" Reduce obtains an answer. Now I do not expect that all routines written will operate satisfactorily if the programmer originally wrote the code consciously adapted to the particular effects of significance arithmetic. Clearly one cannot, in general, find an exact solution to a transcendental equation using rational arithmetic, so I was a little surprised by Reduce working just fine, here. > > > Bummer! It took ages to get to decide that it could no longer do it!. But it works fine, with the actual suggested fix. > The ability to solve such kind of equations is for me one of the major advances in > Mathematica's capabilities in tis decade. (I am even teaching a course centered >around explaining how this sort of thing is done). I too think that Reduce is very nice feature, especially when it works. > > Would I give this up to please Richard Fateman and his imaginary "naive users"? Would anyone? It appears not to be necessary to give it up. And one could, as mentioned, simply not use == in your own user code, but define NumericallyClose[a,b] or some such thing. Perhaps define =~=. > (I don't think this really needs an answer). Because it is a "straw man"? > Is WRI right to ignore all Richard's "helpful" code that "improves" Mathematica in various ways? > (I think the answer is also obvious). How would you know if they ignore all my suggestions? RJF

**Follow-Ups**:**Re: Solve never calls Equal?***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>

**References**:**Re: Numerical accuracy/precision - this is a bug or a feature?***From:*"Christoph Lhotka" <christoph.lhotka@univie.ac.at>

**Solve never calls Equal?***From:*Richard Fateman <fateman@cs.berkeley.edu>