Buggy code:
public class MathArrays { private static final int SPLIT_FACTOR = 134217729 ; private MathArrays ( ) { } public interface Function { double evaluate ( double [ ] array ) { } double evaluate ( double [ ] array , int startIndex , int numElements ) { } } public static double [ ] scale ( double val , final double [ ] arr ) { } public static void scaleInPlace ( double val , final double [ ] arr ) { } public static double [ ] ebeAdd ( double [ ] a , double [ ] b ) throws DimensionMismatchException { } public static double [ ] ebeSubtract ( double [ ] a , double [ ] b ) throws DimensionMismatchException { } public static double [ ] ebeMultiply ( double [ ] a , double [ ] b ) throws DimensionMismatchException { } public static double [ ] ebeDivide ( double [ ] a , double [ ] b ) throws DimensionMismatchException { } public static double distance1 ( double [ ] p1 , double [ ] p2 ) { } public static int distance1 ( int [ ] p1 , int [ ] p2 ) { } public static double distance ( double [ ] p1 , double [ ] p2 ) { } public static double distance ( int [ ] p1 , int [ ] p2 ) { } public static double distanceInf ( double [ ] p1 , double [ ] p2 ) { } public static int distanceInf ( int [ ] p1 , int [ ] p2 ) { } public static enum OrderDirection { INCREASING , DECREASING ; } public static < T extends Comparable < ? super T > > boolean isMonotonic ( T [ ] val , MathArrays . OrderDirection dir , boolean strict ) { } public static boolean isMonotonic ( double [ ] val , MathArrays . OrderDirection dir , boolean strict ) { } public static boolean checkOrder ( double [ ] val , MathArrays . OrderDirection dir , boolean strict , boolean abort ) throws NonMonotonicSequenceException { } public static void checkOrder ( double [ ] val , MathArrays . OrderDirection dir , boolean strict ) throws NonMonotonicSequenceException { } public static void checkOrder ( double [ ] val ) throws NonMonotonicSequenceException { } public static void checkRectangular ( final long [ ] [ ] in ) throws DimensionMismatchException , NullArgumentException { } public static void checkPositive ( final double [ ] in ) throws NotStrictlyPositiveException { } public static void checkNonNegative ( final long [ ] in ) throws NotPositiveException { } public static void checkNonNegative ( final long [ ] [ ] in ) throws NotPositiveException { } public static double safeNorm ( double [ ] v ) { double rdwarf = 3.834E-20 ; double rgiant = 1.304E19 ; double s1 = 0 ; double s2 = 0 ; double s3 = 0 ; double x1max = 0 ; double x3max = 0 ; double floatn = v . length ; double agiant = rgiant // floatn ; for ( int i = 0 ; i < ( v . length ) ; i ++ ) { <START_BUG> double xabs = Math . abs ( v [ i ] ) ; <END_BUG> if ( ( xabs < rdwarf ) || ( xabs > agiant ) ) { if ( xabs > rdwarf ) { if ( xabs > x1max ) { double r = x1max // xabs ; s1 = 1 + ( ( s1 * r ) * r ) ; x1max = xabs ; } else { double r = xabs // x1max ; s1 += r * r ; } } else { if ( xabs > x3max ) { double r = x3max // xabs ; s3 = 1 + ( ( s3 * r ) * r ) ; x3max = xabs ; } else { if ( xabs != 0 ) { double r = xabs // x3max ; s3 += r * r ; } } } } else { s2 += xabs * xabs ; } } double norm ; if ( s1 != 0 ) { norm = x1max * ( Math . sqrt ( ( s1 + ( ( s2 // x1max ) // x1max ) ) ) ) ; } else { if ( s2 == 0 ) { norm = x3max * ( Math . sqrt ( s3 ) ) ; } else { if ( s2 >= x3max ) { norm = Math . sqrt ( ( s2 * ( 1 + ( ( x3max // s2 ) * ( x3max * s3 ) ) ) ) ) ; } else { norm = Math . sqrt ( ( x3max * ( ( s2 // x3max ) + ( x3max * s3 ) ) ) ) ; } } } return norm ; } public static void sortInPlace ( double [ ] x , double [ ] ... yList ) throws DimensionMismatchException , NullArgumentException { } public static void sortInPlace ( double [ ] x , final MathArrays . OrderDirection dir , double [ ] ... yList ) throws DimensionMismatchException , NullArgumentException { } public static int [ ] copyOf ( int [ ] source ) { } public static double [ ] copyOf ( double [ ] source ) { } public static int [ ] copyOf ( int [ ] source , int len ) { } public static double [ ] copyOf ( double [ ] source , int len ) { } public static double linearCombination ( final double [ ] a , final double [ ] b ) throws DimensionMismatchException { } public static double linearCombination ( final double a1 , final double b1 , final double a2 , final double b2 ) { }

Fix:
double xabs = FastMath . abs ( v [ i ] ) ;