Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-12 Thread Stéphane Letz
Done.

Stéphane

> Le 12 févr. 2021 à 14:57, Till Bovermann  a écrit :
> 
> Dear Stéphane, all,
> 
> (to be super-nit-picky...)
> 
> At the given link [1], it states that 
> 
>   \forall t \in |N, y(t) = 0.95
> 
> shouldn't that be 
> 
>   \forall t \in |N^+, y(t) = 0.95
> 
> 
> Note the plus sign, which excludes negative t's for which y(t) = 0.
> This seems to me a rather important element of the faust language (e.g. used 
> in the famous "dirac" implementation `d = 1-1;')
> 
> cheers
>   Till
> 
> 
> 
> [1]  https://faustdoc.grame.fr/manual/syntax/#numbers
> 
> 
> 
> 
>> On 8. Feb 2021, at 19:33, Stéphane Letz  wrote:
>> 
>> The ‘pow' operation computed on integer arguments was indeed incorrect at 
>> compile time. Should be fixed in 2.30.12 version on master-dev.
>> 
>> The documentation has been completed for numbers: 
>> https://faustdoc.grame.fr/manual/syntax/#numbers
>> 
>> Stéphane  
>> 
>> 
>>> Le 8 févr. 2021 à 00:11, Dario Sanfilippo  a 
>>> écrit :
>>> 
>>> Thanks, Oleg. And sorry if I was a little lazy. :-)
>>> 
>>> I see that 2^32 gives 4.2949673e+09 as well; shouldn't we have the same 
>>> behaviour between a signal and its delayed version?
>>> 
>>> Dario
>>> 
>>> On Sun, 7 Feb 2021 at 20:26, Oleg Nesterov  wrote:
>>> On 02/07, Dario Sanfilippo wrote:
 
 Other than that, can you tell why -2 or 2 is producing -inf?
>>> 
>>> Runtime integer overflow, I guess. Why didn't you try to simplify
>>> your code ? ;)
>>> 
>>> Consider
>>> 
>>>   process = 2.0', 2' : par( i, 2, ^(32));
>>> 
>>> output:
>>> 
>>>   0   0
>>>   4.2949673e+09   0
>>>   ...
>>> 
>>> 
>>> this means that
>>> 
>>>   process = 2.0', 2' : par( i, 2, 1/^(32));
>>> 
>>> outputs
>>> 
>>>   inf inf
>>>   2.32830644e-10  inf
>>>   ...
>>> 
>>> Oleg.
>>> 
>>> 
>>> 
>>> -- 
>>> Dr Dario Sanfilippo
>>> http://dariosanfilippo.com
>>> ___
>>> Faudiostream-users mailing list
>>> Faudiostream-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>> 
>> 
>> 
>> ___
>> Faudiostream-users mailing list
>> Faudiostream-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> 



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-12 Thread Till Bovermann
Dear Stéphane, all,

(to be super-nit-picky...)

At the given link [1], it states that 

\forall t \in |N, y(t) = 0.95

shouldn't that be 

\forall t \in |N^+, y(t) = 0.95


Note the plus sign, which excludes negative t's for which y(t) = 0.
This seems to me a rather important element of the faust language (e.g. used in 
the famous "dirac" implementation `d = 1-1;')

cheers
Till



[1]  https://faustdoc.grame.fr/manual/syntax/#numbers

> On 8. Feb 2021, at 19:33, Stéphane Letz  wrote:
> 
> The ‘pow' operation computed on integer arguments was indeed incorrect at 
> compile time. Should be fixed in 2.30.12 version on master-dev.
> 
> The documentation has been completed for numbers: 
> https://faustdoc.grame.fr/manual/syntax/#numbers
> 
> Stéphane  
> 
> 
>> Le 8 févr. 2021 à 00:11, Dario Sanfilippo  a 
>> écrit :
>> 
>> Thanks, Oleg. And sorry if I was a little lazy. :-)
>> 
>> I see that 2^32 gives 4.2949673e+09 as well; shouldn't we have the same 
>> behaviour between a signal and its delayed version?
>> 
>> Dario
>> 
>> On Sun, 7 Feb 2021 at 20:26, Oleg Nesterov  wrote:
>> On 02/07, Dario Sanfilippo wrote:
>>> 
>>> Other than that, can you tell why -2 or 2 is producing -inf?
>> 
>> Runtime integer overflow, I guess. Why didn't you try to simplify
>> your code ? ;)
>> 
>> Consider
>> 
>>process = 2.0', 2' : par( i, 2, ^(32));
>> 
>> output:
>> 
>>0   0
>>4.2949673e+09   0
>>...
>> 
>> 
>> this means that
>> 
>>process = 2.0', 2' : par( i, 2, 1/^(32));
>> 
>> outputs
>> 
>>inf inf
>>2.32830644e-10  inf
>>...
>> 
>> Oleg.
>> 
>> 
>> 
>> -- 
>> Dr Dario Sanfilippo
>> http://dariosanfilippo.com
>> ___
>> Faudiostream-users mailing list
>> Faudiostream-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> 
> 
> 
> ___
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users

--
Till Bovermann

https://tai-studio.org | http://lfsaw.de | https://www.instagram.com/_lfsaw/













___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-08 Thread Stéphane Letz
Indeed, the compiler is full of « not correctly solved corner-cases » ((-; 
You’ve found many, Dario also. They are probably still a lot we are even not 
aware of. 

We try to prioritise what we can possibly fix in a reasonable time, since some 
other much mode interesting developments take our time..

Guys if you can recrut an army of compiler competent developers, we would be 
interested… In the meantime having an extensive list of all the issues you have 
discovered can help ! 

Thanks.

Stéphane

> Le 8 févr. 2021 à 20:42, Oleg Nesterov  a écrit :
> 
> On 02/08, Stéphane Letz wrote:
>> 
>> The ‘pow' operation computed on integer arguments was indeed incorrect at 
>> compile time. Should be fixed in 2.30.12 version on master-dev.
> 
> commit bb0bf13334e9a1320f0f90b6ae56da277b9d96a5 adds
> 
> +Type1 ipow(Type1 a, Type2 ex)
> +{
> +if (0 == ex) return 1;
> +else {
> +Type1 z = a;
> +Type1 y = 1;
> +while (true) {
> +if (ex & 1) y *= z;
> +ex /= 2;
> +if (0 == ex) break;
> +z *= z;
> +}
> +return y;
> +}
> +}
> 
> Perhaps this is what PowPrim::generateCode() should generate when arg1 is 
> int/const?
> 
> Just look at the c++ code generated from
> 
>   process = ^(10);
>   
> to me mydsp_faustpower10_f() makes no sense.
> 
> ---
> and to remind,
> 
>   process = 100;
> 
> outputs 276447232 ;)
> 
> IIRC, simply because faust uses atoi() without any check, but I am not sure.
> 
> Oleg.
> 



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-08 Thread Oleg Nesterov
On 02/08, Stéphane Letz wrote:
>
> The ‘pow' operation computed on integer arguments was indeed incorrect at 
> compile time. Should be fixed in 2.30.12 version on master-dev.

commit bb0bf13334e9a1320f0f90b6ae56da277b9d96a5 adds

+Type1 ipow(Type1 a, Type2 ex)
+{
+if (0 == ex) return 1;
+else {
+Type1 z = a;
+Type1 y = 1;
+while (true) {
+if (ex & 1) y *= z;
+ex /= 2;
+if (0 == ex) break;
+z *= z;
+}
+return y;
+}
+}

Perhaps this is what PowPrim::generateCode() should generate when arg1 is 
int/const?

Just look at the c++ code generated from

process = ^(10);

to me mydsp_faustpower10_f() makes no sense.

---
and to remind,

process = 100;

outputs 276447232 ;)

IIRC, simply because faust uses atoi() without any check, but I am not sure.

Oleg.



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-08 Thread Stéphane Letz
The ‘pow' operation computed on integer arguments was indeed incorrect at 
compile time. Should be fixed in 2.30.12 version on master-dev.

The documentation has been completed for numbers: 
https://faustdoc.grame.fr/manual/syntax/#numbers

Stéphane  


> Le 8 févr. 2021 à 00:11, Dario Sanfilippo  a 
> écrit :
> 
> Thanks, Oleg. And sorry if I was a little lazy. :-)
> 
> I see that 2^32 gives 4.2949673e+09 as well; shouldn't we have the same 
> behaviour between a signal and its delayed version?
> 
> Dario
> 
> On Sun, 7 Feb 2021 at 20:26, Oleg Nesterov  wrote:
> On 02/07, Dario Sanfilippo wrote:
> >
> > Other than that, can you tell why -2 or 2 is producing -inf?
> 
> Runtime integer overflow, I guess. Why didn't you try to simplify
> your code ? ;)
> 
> Consider
> 
> process = 2.0', 2' : par( i, 2, ^(32));
> 
> output:
> 
> 0   0
> 4.2949673e+09   0
> ...
> 
> 
> this means that
> 
> process = 2.0', 2' : par( i, 2, 1/^(32));
> 
> outputs
> 
> inf inf
> 2.32830644e-10  inf
> ...
> 
> Oleg.
> 
> 
> 
> -- 
> Dr Dario Sanfilippo
> http://dariosanfilippo.com
> ___
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-07 Thread Dario Sanfilippo
Thanks, Oleg. And sorry if I was a little lazy. :-)

I see that 2^32 gives 4.2949673e+09 as well; shouldn't we have the same
behaviour between a signal and its delayed version?

Dario

On Sun, 7 Feb 2021 at 20:26, Oleg Nesterov  wrote:

> On 02/07, Dario Sanfilippo wrote:
> >
> > Other than that, can you tell why -2 or 2 is producing -inf?
>
> Runtime integer overflow, I guess. Why didn't you try to simplify
> your code ? ;)
>
> Consider
>
> process = 2.0', 2' : par( i, 2, ^(32));
>
> output:
>
> 0   0
> 4.2949673e+09   0
> ...
>
>
> this means that
>
> process = 2.0', 2' : par( i, 2, 1/^(32));
>
> outputs
>
> inf inf
> 2.32830644e-10  inf
> ...
>
> Oleg.
>
>

-- 
Dr Dario Sanfilippo
http://dariosanfilippo.com
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] When do int or float numerical entries make a difference?

2021-02-07 Thread Oleg Nesterov
On 02/07, Dario Sanfilippo wrote:
>
> Other than that, can you tell why -2 or 2 is producing -inf?

Runtime integer overflow, I guess. Why didn't you try to simplify
your code ? ;)

Consider

process = 2.0', 2' : par( i, 2, ^(32));

output:

0   0
4.2949673e+09   0
...


this means that

process = 2.0', 2' : par( i, 2, 1/^(32));

outputs

inf inf
2.32830644e-10  inf
...

Oleg.



___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users