public static float[] findRange(Function1D f,float[] minmax){
  if (minmax == null)   minmax=new float[2];
  float min=0, max=0;
  for (float x=-100; x < 100; x+=1.27139) {
    float n=f.evaluate(x);
    min=Math.min(min,n);
    max=Math.max(max,n);
  }
  minmax[0]=min;
  minmax[1]=max;
  return minmax;
}

public static float [ ] findRange ( Function1D f , float [ ] minmax ) { if ( minmax == null ) minmax = new float [ 2 ] ; float min = 0 , max = 0 ; for ( float x = - 100 ; x < 100 ; x += 1.27139 ) { float n = f . evaluate ( x ) ; min = Math . min ( min , n ) ; max = Math . max ( max , n ) ; } minmax [ 0 ] = min ; minmax [ 1 ] = max ; return minmax ; }
returns the minimum and maximum of a number of random values of the given function . this is useful for making some stab at normalising the function .
