|
From: Stavros M. <mac...@gm...> - 2025-11-23 13:34:01
|
equal tries to do the "right thing" , but for "interesting" cases, you may need to think a bit about what you intend. For example, is(equal(float(%pi),%pi)) => true But is(equal(bfloat(%pi),%pi)) => false for all values of fpprec. And is(equal(bfloat(%pi),float(%pi)))) is true for fpprec = 3-7,11,12,14,15, and false otherwise. On Sun, Nov 23, 2025, 16:38 David Scherfgen via Maxima-discuss < max...@li...> wrote: > Rubey, Martin <mar...@tu...> schrieb am So., 23. Nov. 2025, > 03:03: > >> is(equal(a, b)) returns true (or false) if and only if a and b are equal >> (or not equal) for all possible values of their variables, as determined by >> evaluating ratsimp(a - b); >> >> Does this mean that is(equal(a, b)) is false if and only if the function >> (a, b) \mapsto a-b does not have any zeros? >> > > Yes. > > As far as I know, this is how it works: > - If ratsimp(a-b) gives 0, then is(equal(a,b)) is true. > - If ratsimp(a-b) gives a non-zero constant (no variables), then > is(equal(a,b)) is false. > - Otherwise, is(equal(a,b)) is unknown. > > Of course, this is quite limited, because it only works reliably with > rational expressions due to relying on ratsimp. > > To get better results, first convert trigonometric/hyperbolic functions to > exponential form using "exponentialize" and inverse > trigonometric/hyperbolic functions to logarithmic form using "logarc". You > may also want to denest roots using "sqrtdenest". > > Best regards > David > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |