*From*: newbie nullzwei <newbie-02 gmx de>*To*: Steven D'Aprano <steve pearwood info>, Gnumeric Forum <gnumeric-list gnome org>*Subject*: Aw: Re: Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,*Date*: Sun, 29 May 2022 23:01:13 +0200

hello @Steve D'Aprano,

I had - tried - in my mail to point out the only approximate accuracy of pi(), but assumed that pi() should basically represent 𝜋, and not be a deliberately deviating other value.

I think this view has its justification since:

- it intuitively imposes itself to 'simple minded users' ( which I like to use for evaluation of software quality ),

- the gnumeric manual in the functions section explicitly says: ' PI - the constant 𝜋 ' ( https://help.gnome.org/users/gnumeric/stable/gnumeric.html#CATEGORY_Mathematics ),

- pi() in the long version of gnumeric has the value

3.141592653589793238(5...) instead of the double variant

3.141592653589793(1...).

And with all that I thought it considerable to give a result to the users which - by error cancellation - is also school-mathematically meaningful. And would like that better than to argue whether sin(pi()) is 1.2246467991473532E-16 ( double version ) or -5.0165576126683320235E-20 ( gnumeric 'long' ).

With the substitution solution one gets consistent results between school mathematics and FP systems which calculate with different accuracy in a quite good range. This seems to me simply meaningful and the correct way.

Having the same result as MS Excel and LO Calc is considerable reg. compatibility, and a proof for not being totally wrong, it's not! a proof for being correct.

( LO Calc and MS Excel drop the decimal digits behind 15th as they are not guaranteed to be correct in all ranges. )

> If you use sin(mod(2.9, 2.9)) you get 0 too, but that doesn't mean that

sin(2.9) should give 0.

that's not qualified argumenting, the absolute value of sin( x ) is not periodical by 2.9

But - as I anticipated - one can argue about such for a long time ...

I think this view has its justification since:

- it intuitively imposes itself to 'simple minded users' ( which I like to use for evaluation of software quality ),

- the gnumeric manual in the functions section explicitly says: ' PI - the constant 𝜋 ' ( https://help.gnome.org/users/gnumeric/stable/gnumeric.html#CATEGORY_Mathematics ),

- pi() in the long version of gnumeric has the value

3.141592653589793238(5...) instead of the double variant

3.141592653589793(1...).

And with all that I thought it considerable to give a result to the users which - by error cancellation - is also school-mathematically meaningful. And would like that better than to argue whether sin(pi()) is 1.2246467991473532E-16 ( double version ) or -5.0165576126683320235E-20 ( gnumeric 'long' ).

With the substitution solution one gets consistent results between school mathematics and FP systems which calculate with different accuracy in a quite good range. This seems to me simply meaningful and the correct way.

Having the same result as MS Excel and LO Calc is considerable reg. compatibility, and a proof for not being totally wrong, it's not! a proof for being correct.

( LO Calc and MS Excel drop the decimal digits behind 15th as they are not guaranteed to be correct in all ranges. )

> If you use sin(mod(2.9, 2.9)) you get 0 too, but that doesn't mean that

sin(2.9) should give 0.

that's not qualified argumenting, the absolute value of sin( x ) is not periodical by 2.9

But - as I anticipated - one can argue about such for a long time ...

:-)

b.s.

---

On Sun, May 29, 2022 at 11:14:02AM +0200, newbie nullzwei via gnumeric-list wrote:

> the result of sin(x) for x = pi() in gnumeric is 1.2246467991473532E-16,

> and thus somewhat off from the correct value '0'.

That is incorrect.

sin(π) = 0 but pi != π, it is (approximately) 3.141592653589793... and

sin(pi) != 0.

...

> the result of sin(x) for x = pi() in gnumeric is 1.2246467991473532E-16,

> and thus somewhat off from the correct value '0'.

That is incorrect.

sin(π) = 0 but pi != π, it is (approximately) 3.141592653589793... and

sin(pi) != 0.

...

**References**:**no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,***From:*newbie nullzwei

**Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,***From:*John Denker

**Aw: Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,***From:*newbie nullzwei

**Re: Re: no tests for trigonometric functions? need help / hints how to adapt tests for gnumeric 'long' version,***From:*Steven D'Aprano

[Date Prev][Date Next] [Thread Prev][Thread Next] [Thread Index] [Date Index] [Author Index]