Recent posts by Derek O'Connorhttps://sourceforge.net/u/derekroconnor/Recent posts by Derek O'ConnorenMon, 10 Sep 2012 14:04:09 -0000WikiPage Home modified by Derek O'Connorhttps://sourceforge.net/u/derekroconnor/wiki/Home/Welcome to your wiki!
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses [Markdown](/u/derekroconnor/wiki/markdown_syntax/) syntax.
[[project_admins]]
[[download_button]]
Derek O'ConnorMon, 10 Sep 2012 14:04:09 -0000https://sourceforge.netc90c1add458b3b79fe982d7762f8dcbdb8685de6sin(1e22) is wronghttps://sourceforge.net/p/maxima/bugs/2017/sin\(1e22\);
\(%o1\) 0.41214336710708
The correct answer is -8.522008497671888
Please note that 10^22 is exactly representable as an IEEE double precision floating point number, whose binary representation is
10^22 = 1000011110000110011110000011001001101110101011001001 x 2^22
This incorrect result suggests that the range-reduction step, where the argument x is reduced to lie in a small interval around 0, such as \[-pi/2,+pi/2\], has not been done properly. This means that the other trigonometric functions will be incorrect.
This value 10^22 was carefully chosen by Ng to uncover faulty range reduction:
http://www.derekroconnor.net/Software/Ng--ArgReduction.pdf
Maxima is not alone: R, Octave, Freemat, Euler, Python, and Lua have the same problem. Matlab used to have this problem but fixed it.
I am neither a systems programmer nor a Maxima developer so I don't know what is going on in the background. I suspect that the mingw32 system may be at fault. If so, this prompts the question: do Maxima developers not check the components they are using?
Maxima version: 5.21.1
Maxima build date: 8:13 4/26/2010
Host type: i686-pc-mingw32
Lisp implementation type: GNU Common Lisp \(GCL\)
Lisp implementation version: GCL 2.6.8
Dell Precision 690, Intel 2xQuad-Core E5345 @ 2.33GHz
16GB RAM, Windows7 64-bit Professional.
Derek O'ConnorDerek O'ConnorFri, 11 Jun 2010 14:10:52 -0000https://sourceforge.net75527b775e7c334972c26043d8d2d9169670cc0aSin(x) is Wronghttps://sourceforge.net/p/freemat/bugs/491/<div class="markdown_content"><p>FreeMat Version 4.0 on a<br />
Dell Precision 690, Intel 2xQuad-Core E5345 @ 2.33GHz<br />
16GB RAM, Windows7 64-bit Professional.<br />
-------------------------------------------</p>
<p>FreeMat4 gives<br />
--> sin(1e22)<br />
ans =<br />
4.12143367107085e-001</p>
<p>The correct result, rounded to 20 digits is</p>
<p>sin(10^22) = -8.5220 08497 67188 80177 e-001</p>
<p>Please note that 10^22 is exactly representable as an IEEE double precision floating point number, <br />
whose binary representation is</p>
<p>10^22 = 1000011110000110011110000011001001101110101011001001 x 2^22</p>
<p>Hence fl(10^22) = 10^22, whereas fl(10^23) ~= 10^23.</p>
<p>This incorrect result suggests that the range-reduction step, where the argument x<br />
is reduced to lie in a small interval around 0, such as [-pi/2,+pi/2], has not been done properly. <br />
This means that the other trigonometric functions will be incorrect.</p>
<p>Yours sincerely,</p>
<p>Derek O'Connor</p></div>Derek O'ConnorSat, 03 Apr 2010 22:56:19 -0000https://sourceforge.net770fa8f951f12aa23ff960429d48b33523e33d79Memory Allocation Errorhttps://sourceforge.net/p/freemat/bugs/444/<div class="markdown_content"><p>Freemat V 4 successfully allocates memory when I do this n=10^4; A = rand(n,n); (=8*10^8= 0.8GB)</p>
<p>but crashes when I do this n=2*10^4; A = rand(n,n); ( = 8*4*10^8=3.2GB)</p>
<p>I am using Vista 64bit on a Dell Precision 690, 2xQuad core, 16GB RAM.</p>
<p>An external debugger says that the error occurred in memcpy. I am not a C programmer so I cannot comment.</p>
<p>On the same machine Matlab 2008a successfully allocates memory for n=4*10^4; A = rand(n,n); (=8*16*10^8=12.8GB)</p></div>Derek O'ConnorFri, 25 Sep 2009 17:39:44 -0000https://sourceforge.netbb3f5d31283be349d5b7463a5bba9611adc64445