Apache Commons logo Apache Commons Numbers

CPD Results

The following document contains the results of PMD's CPD 6.21.0.

Duplications

File Line
org/apache/commons/numbers/core/Norm.java 289
org/apache/commons/numbers/core/Norm.java 354
        }

        // compute the scale and rescale values
        final double scale;
        final double rescale;
        if (max > LARGE_THRESH) {
            scale = SCALE_DOWN;
            rescale = SCALE_UP;
        } else if (max < SAFE_SCALE_UP_THRESH) {
            scale = SCALE_UP;
            rescale = SCALE_DOWN;
        } else {
            scale = 1d;
            rescale = 1d;
        }

        double sum = 0d;
        double comp = 0d;

        // add scaled x
        double sx = xabs * scale;
        final double px = sx * sx;
        comp += ExtendedPrecision.squareLowUnscaled(sx, px);
        final double sumPx = sum + px;
        comp += ExtendedPrecision.twoSumLow(sum, px, sumPx);
        sum = sumPx;

        // add scaled y
        double sy = yabs * scale;
        final double py = sy * sy;
        comp += ExtendedPrecision.squareLowUnscaled(sy, py);
        final double sumPy = sum + py;
        comp += ExtendedPrecision.twoSumLow(sum, py, sumPy);
        sum = sumPy;