On Mon, 25 Oct 2021 05:26:31 +0200
Ichthyostega <p...@ichthyostega.de> wrote:

>Am 25.10.21 um 05:18 schrieb Ichthyostega:
>> When compiled with -O0, then the expf()-version yields the slightly more
>> correct numbers
>
>Nah, I mean of course the generic pow()-version yields the more correct 
>numbers;
>probably because it uses doubles internally for the computation -- we
>could consider to do the same (modern 64-bit CPUs aren't faster anymore
>when computing floats vs computing doubles. Just floats require only half
>the storage...)
>
>-- Hermann

I hadn't realised just how much these functions were used :o
The *potential* for inconsistent results across platforms is indeed quite high.

Looking around I found that there is additional inconsistency that I tried to
remove a long time ago. This was with TWOPI and HALFPI. These are not used
everywhere because either I missed some, or they've been added later. My reason
for setting these was that it had previously been written as any one of:
2 * PI, PI * 2, PI * 2.0f, 2 * (some calculation) * PI, etc.

I was concerned that due to rounding errors and unknown compiler optimisation
there could be problems.

Today I've noticed that M_PI has also been added in some places, and looking
that up on 'net it seems it's not formally defined but is generally implemented
as a double length value for PI.

So, should we leave these alone, or bring them into general consistency too?

PS. The value we use for PI goes right back to Zyn 2.2.1

-- 
Will J Godfrey
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to