Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-1746

Fix: mxA ^ 2, mxA ^ 0.5 to mean the same thing as mxA * mxA and mxA ::= sqrt _

    XMLWordPrintableJSON

Details

    • Blog - New Blog Request
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.10.2
    • None
    • None

    Description

      it so happens that in java, if x is of double type, Math.pow(x,2.0) and x * x produce different values approximately once in million random values.

      This is extremely annoying as it creates rounding errors, especially with things like euclidean distance computations, which eventually may produce occasional NaNs.

      This issue suggests to get special treatment on vector and matrix dsl to make sure identical fpu algorithms are running as follows:

      x ^ 2 <=> x * x
      x ^ 0.5 <=> sqrt

      Attachments

        Activity

          People

            dlyubimov Dmitriy Lyubimov
            dlyubimov Dmitriy Lyubimov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: