public static double safeLog10(double x){
  boolean neg=(x < 0.0);
  if (neg) {
    x=-x;
  }
  if (x < 10.0) {
    x+=(10.0 - x) / 10;
  }
  x=Math.log(x) / LOG10;
  return neg ? -x : x;
}

public static double safeLog10 ( double x ) { boolean neg = ( x < 0.0 ) ; if ( neg ) { x = - x ; } if ( x < 10.0 ) { x += ( 10.0 - x ) / 10 ; } x = Math . log ( x ) / LOG10 ; return neg ? - x : x ; }
the " safe " base 10 logarithm of the input value , handling negative values by simply making them positive and then negating the return value .
