|
From: Barton W. <wi...@un...> - 2019-06-10 15:03:47
|
Pretty good guess--the value from the book is correctly rounded to all shown decimal places. Using purely binary64 numbers, Maxima's value is wrong in the last few digits. Evidence: (%i1851) q(k):= (%e)^(-%pi * elliptic_kc(1-k^2)/elliptic_kc(k^2))$ (%i1852) X : q(sin(%pi * 86/180))$ (%i1855) float(block([fpprec : 15], bfloat(X))); (%o1855) 0.2954883855586909 (%i1856) float(block([fpprec : 45], bfloat(X))); (%o1856) 0.2954883855586914 (%i1857) float(block([fpprec : 85], bfloat(X))); (%o1857) 0.2954883855586914 As the author of some numerical code, I know how difficult it is to balance speed and accuracy--in general it's fairly changeling to get the last few digits correct and to do the calculation in purely using hardware floats. --Barton ________________________________ From: Peter van Summeren <pet...@gm...> Sent: Monday, June 10, 2019 8:54:41 AM To: max...@li... Subject: [Maxima-discuss] significant difference? Hello, I am checking a book from Miroslav Lutovac for the nomen q(k)=e^(-pi * K'/K) of the elliptic functions. He gives for k=sin(86degrees) a q of 0.2954883855586914 on page 512. I did: q(k):= (%e)^(-%pi * elliptic_kc(1-k^2)/elliptic_kc(k^2)); q(sin(%pi * 86/180)),numer; And got: 0.2954883855586907 It is a very small difference - only in the last two digits, but is it significant for something wrong? Can anyone check this result? with friendly greetings, Peter |