Documentation of 'kcl.waterloo.math.fp' Java class
fp
kcl.waterloo.math

Class fp

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static double[] cusum(double[] in)
      Returns the cumulative sum of the elements of the input using Knuth's correction to accumulate the error.
      static double[] cusumi(double[] in)
      Returns the cumulative sum of the elements of the input using Knuth's correction to accumulate the error (in-place).
      static double dot(double[] a, double[] b)
      Returns the dot product.
      static double[] split(double val)
      Splits a double value into two double values where the sum of the two is the input.
      static double sum(double[] in)
      Returns the sum of in using Knuth's correction to accumulate the error.
      static double sum(double[] in, int idx0, int idx1)
      Returns the sum between two indices (inclusive).
      static boolean tolEquals(double a, double b, double tol) 
      static double[] twoProduct(double a, double b)
      Returns the product of two double values and a correction for loss of precision in the multiplication.
      static double[] twoSum(double a, double b)
      Returns the sum of two double values and a correction for loss of precision in the summation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • split

        public static double[] split(double val)
        Splits a double value into two double values where the sum of the two is the input. See T. J. Dekker, A floating-point technique for extending the available precision, Numer. Math., 18 (1971), pp. 224-242.
        Parameters:
        val - a double input
        Returns:
        a double[2] array - where the sum of values==the input.
      • twoProduct

        public static double[] twoProduct(double a,
                                          double b)
        Returns the product of two double values and a correction for loss of precision in the multiplication.
        Parameters:
        a - a double value.
        b - a double value.
        Returns:
        a double[2] array containing in [0]: the product, and in [1]: the required correction.
      • twoSum

        public static double[] twoSum(double a,
                                      double b)
        Returns the sum of two double values and a correction for loss of precision in the summation.
        Parameters:
        a - a double value.
        b - a double value.
        Returns:
        a double[2] array containing in [0]: the sum, and in [1]: the required correction.
      • sum

        public static double sum(double[] in)
        Returns the sum of in using Knuth's correction to accumulate the error. The accumulated error is added to the output.
        Parameters:
        in -
        Returns:
        the sum
      • sum

        public static double sum(double[] in,
                                 int idx0,
                                 int idx1)
        Returns the sum between two indices (inclusive).
        Parameters:
        in - input array
        idx0 - start index
        idx1 - end index
        Returns:
        the sum of in[idx0] thtough in[idx1]
      • cusum

        public static double[] cusum(double[] in)
        Returns the cumulative sum of the elements of the input using Knuth's correction to accumulate the error. The accumulated error for each element is added to the output.
        Parameters:
        in -
        Returns:
        a double[]
      • cusumi

        public static double[] cusumi(double[] in)
        Returns the cumulative sum of the elements of the input using Knuth's correction to accumulate the error (in-place). The accumulated error for each element is added to the output.
        Parameters:
        in -
        Returns:
        a double[]
      • dot

        public static double dot(double[] a,
                                 double[] b)
        Returns the dot product.
        Parameters:
        a - double[] input a
        b - double[] input b
        Returns:
        the sum of a[k]*b[k] for k = 0 .. length(a)-1
      • tolEquals

        public static boolean tolEquals(double a,
                                        double b,
                                        double tol)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.