Try this and I'm happy to explain if necessary:

public class Derivative {

    public static void main(final String[] args) {
        DerivativeStructure dsA = new DerivativeStructure(1, 1, 0, 1d);
        System.out.println("Derivative of constant^x wrt x");
        for (int a = -3; a < 3; a++) {
            final DerivativeStructure a_ds = new DerivativeStructure(1, 1,
a);
            final DerivativeStructure out = a_ds.pow(dsA);
            System.out.format("Derivative@%d=%f\n", a,
out.getPartialDerivative(new int[]{1}));
        }
    }
}



On Fri, Aug 23, 2013 at 7:59 AM, Gilles <gil...@harfang.homelinux.org>wrote:

> On Fri, 23 Aug 2013 07:17:35 -0700, Ajo Fod wrote:
>
>> Seems like the DerivativeCompiler returns NaN.
>>
>> IMHO it should return 0.
>>
>
> What should be 0?  And Why?
>
>
>
>> Is this worthy of an issue?
>>
>
> As is, no.
>
> Gilles
>
>
>> Thanks,
>> -Ajo
>>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> dev-unsubscribe@commons.**apache.org<dev-unsubscr...@commons.apache.org>
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to