public static double deriv(double pred,double y,double eps){
  final double x=pred - y;
  if (eps < Math.abs(x))   return Math.signum(x);
 else   return 0;
}

public static double deriv ( double pred , double y , double eps ) { final double x = pred - y ; if ( eps < Math . abs ( x ) ) return Math . signum ( x ) ; else return 0 ; }
computes the first derivative of the & epsilon ; - insensitive loss
