You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marcelo Damasceno <ma...@gmail.com> on 2013/05/31 22:45:14 UTC

[math] NaN value from evaluate method from PolynomialFunctionLagrangeForm class

Hi,

I'm getting a NaN value after call evaluate method from
PolynomialFunctionLagrangeForm class.

Code:

double[]x={0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 ,
10.0, ...}
//x.length=3540
double[]y={0.0 , 0.500213 , 4.3E-5 , 0.015038 , 0.237525 , 0.024837 ,
0.262735,...}
//y.length=3540.

So, calling System.out.println(PolynomialFunctionLagrangeForm.evaluate(x,
y, 0)) is returning NaN.
What's this value means?

May I post this to developers list?

Thanks.

Marcelo Damasceno
Professor do IFRN/São Gonçalo do Amarante
+55 84 9947-6324
http://about.me/marcelodamasceno


O Homem pode adquirir conhecimento ou se tornar um animal, como ele quiser.
Deus faz os animais, o homem faz a si próprio.
Georg Lichetnbery
"Computers are like air conditioners: they stop working properly when you
open windows". - EFR
--

Re: [math] NaN value from evaluate method from PolynomialFunctionLagrangeForm class

Posted by Gilles <gi...@harfang.homelinux.org>.
On Mon, 3 Jun 2013 15:37:06 -0300, Marcelo Damasceno wrote:
> The code was in the first e-mail.
>
>> double[]x={0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 
>> ,
>> 10.0, ...}
>> //x.length=3540
>> double[]y={0.0 , 0.500213 , 4.3E-5 , 0.015038 , 0.237525 , 0.024837 
>> ,
>> 0.262735,...}
>> //y.length=3540.
>>
>> System.out.println(PolynomialFunctionLagrangeForm.evaluate(x,y, 0))
>>
>
> The problem is: my x has 3540 elements. It's from a dataset. I debug 
> the
> evaluate method in PolynomialFunctionLagrangeForm. There is a array c
> there, and it's inicialized with -Infinity value.
> The NaN value happens when is processed the x[653]. The x[653] is a
> ordinary element, with any particularity.
>
> I changed the PolynomialFunctionLagrangeForm to Sline and worked 
> fine. The
> problem is that I would to know the degree and coefficients of the
> polynomial.
>
> How can I inform this bug to Apache community?

https://issues.apache.org/jira/browse/MATH

Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] NaN value from evaluate method from PolynomialFunctionLagrangeForm class

Posted by Marcelo Damasceno <ma...@gmail.com>.
The code was in the first e-mail.

> double[]x={0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 ,
> 10.0, ...}
> //x.length=3540
> double[]y={0.0 , 0.500213 , 4.3E-5 , 0.015038 , 0.237525 , 0.024837 ,
> 0.262735,...}
> //y.length=3540.
>
> System.out.println(PolynomialFunctionLagrangeForm.evaluate(x,y, 0))
>

The problem is: my x has 3540 elements. It's from a dataset. I debug the
evaluate method in PolynomialFunctionLagrangeForm. There is a array c
there, and it's inicialized with -Infinity value.
The NaN value happens when is processed the x[653]. The x[653] is a
ordinary element, with any particularity.

I changed the PolynomialFunctionLagrangeForm to Sline and worked fine. The
problem is that I would to know the degree and coefficients of the
polynomial.

How can I inform this bug to Apache community?

Thanks.

Marcelo Damasceno
Professor do IFRN/São Gonçalo do Amarante
+55 84 9947-6324
http://about.me/marcelodamasceno


O Homem pode adquirir conhecimento ou se tornar um animal, como ele quiser.
Deus faz os animais, o homem faz a si próprio.
Georg Lichetnbery
"Computers are like air conditioners: they stop working properly when you
open windows". - EFR
--


On Mon, Jun 3, 2013 at 5:53 AM, Gilles <gi...@harfang.homelinux.org> wrote:

> Hello.
>
>
>
>> I'm getting a NaN value after call evaluate method from
>> PolynomialFunctionLagrangeForm class.
>>
>> Code:
>>
>> double[]x={0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 ,
>> 10.0, ...}
>> //x.length=3540
>> double[]y={0.0 , 0.500213 , 4.3E-5 , 0.015038 , 0.237525 , 0.024837 ,
>> 0.262735,...}
>> //y.length=3540.
>>
>> So, calling System.out.println(**PolynomialFunctionLagrangeForm**
>> .evaluate(x,
>> y, 0)) is returning NaN.
>> What's this value means?
>>
>> May I post this to developers list?
>>
>
> This could be a bug, so, yes; but please create a test case that
> demonstrates the problem (i.e. a minimal code that compiles and
> runs).
>
> Regards,
> Gilles
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [math] NaN value from evaluate method from PolynomialFunctionLagrangeForm class

Posted by Gilles <gi...@harfang.homelinux.org>.
Hello.

>
> I'm getting a NaN value after call evaluate method from
> PolynomialFunctionLagrangeForm class.
>
> Code:
>
> double[]x={0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 
> ,
> 10.0, ...}
> //x.length=3540
> double[]y={0.0 , 0.500213 , 4.3E-5 , 0.015038 , 0.237525 , 0.024837 ,
> 0.262735,...}
> //y.length=3540.
>
> So, calling 
> System.out.println(PolynomialFunctionLagrangeForm.evaluate(x,
> y, 0)) is returning NaN.
> What's this value means?
>
> May I post this to developers list?

This could be a bug, so, yes; but please create a test case that
demonstrates the problem (i.e. a minimal code that compiles and
runs).

Regards,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org