From: SourceForge.net <no...@so...> - 2008-05-25 21:32:39
|
Bugs item #1220227, was opened at 2005-06-14 05:48 Message generated for change (Settings changed) made by dgildea You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1220227&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: To be reviewed >Status: Pending >Resolution: Works For Me Priority: 5 Private: No Submitted By: joe532 (joe532) Assigned to: Nobody/Anonymous (nobody) Summary: MIN is not correct (problem with "is" function) Initial Comment: I have the following problem with MIN : the graph of min below does not match the min of the curves on the second graph. session: f(h,k,l):=(h^k)*((1/h)*k*(1+l)+(d-k)*2*l); g(h,k,l):=2*d*l+(h^k)*((1/h)*k*(1-l)-(d-k)*2*l); d:2; l:0.5; plot2d([f((1-v)^(1/2),2,l), f((1-v),1,l), g(v^(1/2),2,l), g(v,1,l)], [v,0,1])$ plot2d(min(f((1-v)^(1/2),2,l), f((1-v),1,l), g(v^(1/2),2,l), g(v,1,l)), [v,0,1])$ on maxima Maxima 5.9.1 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.6 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2006-08-12 12:34 Message: Logged In: YES user_id=501686 Not observed in 5.9.3cvs / Clisp 2.38, GCL 2.6.7, SBCL 0.9.9 on Linux. Seems likely that recent modifications to min/max have fixed this. Marking this report to be retested on Windows -- if it does not appear there, we can close this report as fixed. For the record the following plot2d puts the 3 curves of interest together with the min of those 3 on one plot. Should find that the computed min coincides with whichever curve is lowest. f(h,k,l):=(h^k)*((1/h)*k*(1+l)+(d-k)*2*l); g(h,k,l):=2*d*l+(h^k)*((1/h)*k*(1-l)-(d-k)*2*l); d:2; l:0.5; plot2d([f((1-v)^(1/2),2,l), f((1-v),1,l), g(v^(1/2),2,l), g(v,1,l), min(f((1-v)^(1/2),2,l), f((1-v),1,l), g(v^(1/2),2,l), g(v,1,l))], [v,0,1])$ ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2005-06-14 10:20 Message: Logged In: YES user_id=501686 OK, I've narrowed the problem. aa: f((1-v)^(1/2),2,l); bb: f((1-v),1,l); cc: g(v^(1/2),2,l); dd: g(v,1,l); min (aa, bb, cc, dd) => min((0.5/v-1.0)*v+2.0, 3.0*sqrt(1-v)) OK, that's min (aa, dd). As for bb and dd, bb is equal to dd: ratsimp (bb - dd) => 0 What about cc ? is (cc > aa) => undecided (OK) is (cc > bb) => undecided (OK) is (cc > dd) => true (OOPS, should be undecided) is (cc > dd) => undecided (OK, but why is it different from first time?) trace (ratsimp), then is(cc > aa), is(cc > bb), is(cc > dd), shows ratsimp is called once by "is". On the second is(cc > dd), ratsimp is called twice by "is"; seems like the problem could be in "is". Given that bb is equal to dd, this is a work around: plot2d (min (aa, bb, cc), [v, 0, 1]); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1220227&group_id=4933 |