Aw: Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,
newbie nullzwei via gnumeric-list <[email protected]> Sun, 29 May 2022 11:14:02 +0200
| Newsgroups | gmane.comp.gnome.apps.gnumeric |
|---|---|
| Message-ID | <trinity-ddc5af7c-45ec-4e8d-9f3d-1ebb5eaf3037-1653815642253@3c-app-gmx-bs67> |
--===============6416940898842000594== Content-Type: text/html; charset=UTF-8 <html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><br/> hello @John Denker, :-) <br/> <br/> thank you for your qualified answers, will review them in detail later. <br/> <br/> At the moment I'm less working on trig problems - but see below - but more on gnumeric and what it's doing. <br/> <br/> Thus why the trig.xls sheet is not evaluated by a test?, why it contains a reference not met by my system? ... <br/> <br/> Besides that I have an idea of how trig. calculations / results can possibly be improved, by: <br/> - a different understanding of the approximation of pi(), and<br/> - other ways to calculate, accounting the periodicity and substitutability of trig functions ...<br/> but that's more a mathematical than a gnumeric question. <br/> <br/> As you are intereted in / working on such, a simple example of the approach what I think what can be improved - WIP, provisoric! : <div>the result of sin(x) for x = pi() in gnumeric is 1.2246467991473532E-16, and thus somewhat off from the correct value '0'. <br/> If you use sin(mod(x,pi())) for the absolute value, you get the correct zero, and you can use '=if(isodd(x/pi()),-1,1)' to generate a suitable sign,<br/> thus '=if(isodd(x/pi()),-1,1)*sin(mod(x,pi()))' gives approximately the same results as sin(x), but is 'more correct' at and near the zeros. <br/> Yes, one can argue about 'more correct' since zero is of course also wrong based on the approximated value for pi() ...<br/> I think from a 'simple minded user'-POV it is quite acceptable if the error in the calculation of pi() for the argument of his formula cancels out with the error in the evaluation with mod-pi() and he gets a result what he expects ... one can certainly argue endlessly ...<br/> I throw this into the ring as a suggestion: wherever in the accuracy of the argument of a function influences of the inaccuracy of pi() may be assumed, the above or similar formulas may be used for reasonable results ... IMHO. <br/> my general POV: we need results that match the mathematical correct result for the formula / arguments originally given / intended, not for the devaiting approximations irrationality, FP-conversion or other influences made of it.</div> <div>:-)<br/> <br/> <br/> Bernhard<br/> <br/> ---<br/> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Sonntag, 29. Mai 2022 um 05:27 Uhr<br/> <b>Von:</b> "John Denker via gnumeric-list" <[email protected]><br/> <b>An:</b> "Gnumeric Forum" <[email protected]><br/> <b>Betreff:</b> Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,</div> <div>On 5/27/22 9:26 PM, newbie nullzwei via gnumeric-list wrote:<br/> <br/> > In my double version tan(pi()/2) fails with 16331239353195370 instead of the<br/> > reference 16324552277619072, tan(3/2*pi()) and the negative values fail too,<br/> > exotic processor? messed up system? updated libraries??? how reliable are the<br/> > references?<br/> <br/> 1) See my previous message from 5/28/22 12:43 AM.<br/> <br/> 2) Here is more detail about how I think about it.<br/> <br/> ...</div> </div> </div> </div></div></body></html> --===============6416940898842000594== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ gnumeric-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/gnumeric-list --===============6416940898842000594==--