You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Anand Avati (JIRA)" <ji...@apache.org> on 2015/06/23 22:28:43 UTC

[jira] [Commented] (MAHOUT-1746) Fix: mxA ^ 2, mxA ^ 0.5 to mean the same thing as mxA * mxA and mxA ::= sqrt _

    [ https://issues.apache.org/jira/browse/MAHOUT-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14598320#comment-14598320 ] 

Anand Avati commented on MAHOUT-1746:
-------------------------------------

Is this proposal specifically for the values "2" and "0.5", or are they just serving as an example for a more generic solution?

> Fix: mxA ^ 2, mxA ^ 0.5 to mean the same thing as mxA * mxA and mxA ::= sqrt _
> ------------------------------------------------------------------------------
>
>                 Key: MAHOUT-1746
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1746
>             Project: Mahout
>          Issue Type: Blog - New Blog Request
>            Reporter: Dmitriy Lyubimov
>            Assignee: Dmitriy Lyubimov
>             Fix For: 0.10.2
>
>
> 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(x)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)