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,&nbsp; :-)&nbsp;<br/>
&nbsp;<br/>
thank you for your qualified answers, will review them in detail later.&nbsp;<br/>
&nbsp;<br/>
At the moment I&#39;m less working on trig problems - but see below - but more on gnumeric and what it&#39;s doing.&nbsp;<br/>
&nbsp;<br/>
Thus why the trig.xls sheet is not evaluated by a test?, why it contains a reference not met by my system? ...&nbsp;<br/>
&nbsp;<br/>
Besides that I have an idea of how trig. calculations / results can possibly be improved, by:&nbsp;<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&#39;s more a mathematical than a gnumeric question.&nbsp;<br/>
&nbsp;<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 &#39;0&#39;. &nbsp;<br/>
If you use sin(mod(x,pi())) for the absolute value, you get the correct zero, and you can use &#39;=if(isodd(x/pi()),-1,1)&#39; to generate a suitable sign,<br/>
thus &#39;=if(isodd(x/pi()),-1,1)*sin(mod(x,pi()))&#39; gives approximately the same results as sin(x), but is &#39;more correct&#39; at and near the zeros. &nbsp;<br/>
Yes, one can argue about &#39;more correct&#39; since zero is of course also wrong based on the approximated value for pi() ...<br/>
I think from a &#39;simple minded user&#39;-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.&nbsp;<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>
&nbsp;

<div>:-)<br/>
<br/>
<br/>
Bernhard<br/>
<br/>
---<br/>
&nbsp;
<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>&nbsp;Sonntag, 29. Mai 2022 um 05:27 Uhr<br/>
<b>Von:</b>&nbsp;&quot;John Denker via gnumeric-list&quot; &lt;[email protected]&gt;<br/>
<b>An:</b>&nbsp;&quot;Gnumeric Forum&quot; &lt;[email protected]&gt;<br/>
<b>Betreff:</b>&nbsp;Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric &#39;long&#39; version,</div>

<div>On 5/27/22 9:26 PM, newbie nullzwei via gnumeric-list wrote:<br/>
<br/>
&gt; In my double version tan(pi()/2) fails with 16331239353195370 instead of the<br/>
&gt; reference 16324552277619072, tan(3/2*pi()) and the negative values fail too,<br/>
&gt; exotic processor? messed up system? updated libraries??? how reliable are the<br/>
&gt; 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==--