From: SourceForge.net <no...@so...> - 2012-07-23 09:12:07
|
Bugs item #3547315, was opened at 2012-07-22 09:34 Message generated for change (Comment added) made by chrisrein You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547315&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 - Floating point Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: christoph reineke (chrisrein) Assigned to: Nobody/Anonymous (nobody) Summary: Problems with bfloat Initial Comment: Enter: (%i2) fpprec:30; (%o2) 30 (%i3) bfloat((45.12*34.78923)^2); (%o3) 2.46392687692829128354787826538b6 2.46392687692829131776b6 is the correct value. build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") Regards Chris ---------------------------------------------------------------------- >Comment By: christoph reineke (chrisrein) Date: 2012-07-23 02:12 Message: Sorry, but I don’t understand you. <Can you explain why you think the value you give is the correct value?> Which value? (45.12*34.78923)^2=2.46392687692829131776b6=the correct value. Since I expect that the correct value has more than 16 digits after the comma, I use bfloat and fpprec=30. I quote from the documentation: “bfloat (expr) Function Converts all numbers and functions of numbers in expr to bigfloat numbers. The number of significant digits in the resulting bigfloats is specified by the global variable fpprec.” …all numbers…!! Now Maxima returns 30 digits, but the result is wrong. That’s all. <Thus, the simplifier has simplified the float expression…> Which simplifier? If a CAS computes a simple multiplication each digit of the displayed floating point number should be correct (apart from the last), no matter how many digits the user wants. Even if I erroneously “simplify” something, Maxima should never display a wrong result. That’s my opinion. How do I get the correct result? Thanks for your help! ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2012-07-22 13:07 Message: Can you explain why you think the value you give is the correct value? Consider this transcript: (%i1) fpprec:30; (%o1) 30 (%i2) trace(bfloat); (%o2) [bfloat] (%i3) bfloat((45.12*34.78923)^2); 1 Enter bfloat [2463926.876928291] 1 Exit bfloat 2.46392687692829128354787826538b6 (%o3) 2.46392687692829128354787826538b6 Thus, the simplifier has simplified the float expression before bfloat gets a chance to look at it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3547315&group_id=4933 |