Function for calculating divided difference table
static void dividedDiffTable ( float [ ] x , float [ , ] y , int n ) { for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < n - i ; j ++ ) { y [ j , i ] = ( y [ j , i - 1 ] - y [ j + 1 , i - 1 ] ) / ( x [ j ] - x [ i + j ] ) ; } } }