public void pow(final double[] operand,final int operandOffset,final double p,final double[] result,final int resultOffset){
  if (p == 0) {
    result[resultOffset]=1.0;
    Arrays.fill(result,resultOffset + 1,resultOffset + getSize(),0);
    return;
  }
  if (operand[operandOffset] == 0) {
    Arrays.fill(result,resultOffset,resultOffset + getSize(),0);
    return;
  }
  double[] function=new double[1 + order];
  double xk=FastMath.pow(operand[operandOffset],p - order);
  for (int i=order; i > 0; --i) {
    function[i]=xk;
    xk*=operand[operandOffset];
  }
  function[0]=xk;
  double coefficient=p;
  for (int i=1; i <= order; ++i) {
    function[i]*=coefficient;
    coefficient*=p - i;
  }
  compose(operand,operandOffset,function,result,resultOffset);
}

public void pow ( final double [ ] operand , final int operandOffset , final double p , final double [ ] result , final int resultOffset ) { if ( p == 0 ) { result [ resultOffset ] = 1.0 ; Arrays . fill ( result , resultOffset + 1 , resultOffset + getSize ( ) , 0 ) ; return ; } if ( operand [ operandOffset ] == 0 ) { Arrays . fill ( result , resultOffset , resultOffset + getSize ( ) , 0 ) ; return ; } double [ ] function = new double [ 1 + order ] ; double xk = FastMath . pow ( operand [ operandOffset ] , p - order ) ; for ( int i = order ; i > 0 ; -- i ) { function [ i ] = xk ; xk *= operand [ operandOffset ] ; } function [ 0 ] = xk ; double coefficient = p ; for ( int i = 1 ; i <= order ; ++ i ) { function [ i ] *= coefficient ; coefficient *= p - i ; } compose ( operand , operandOffset , function , result , resultOffset ) ; }
compute power of a derivative structure .
