Return-Path: X-Original-To: apmail-hama-dev-archive@www.apache.org Delivered-To: apmail-hama-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D53711B1E for ; Tue, 20 May 2014 11:32:38 +0000 (UTC) Received: (qmail 12308 invoked by uid 500); 20 May 2014 11:32:38 -0000 Delivered-To: apmail-hama-dev-archive@hama.apache.org Received: (qmail 12280 invoked by uid 500); 20 May 2014 11:32:38 -0000 Mailing-List: contact dev-help@hama.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hama.apache.org Delivered-To: mailing list dev@hama.apache.org Received: (qmail 12271 invoked by uid 99); 20 May 2014 11:32:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2014 11:32:38 +0000 Date: Tue, 20 May 2014 11:32:38 +0000 (UTC) From: "Edward J. Yoon (JIRA)" To: dev@hama.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HAMA-905) Fix Pi Estimator Example MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HAMA-905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14003112#comment-14003112 ] Edward J. Yoon commented on HAMA-905: ------------------------------------- +1 > Fix Pi Estimator Example > ------------------------ > > Key: HAMA-905 > URL: https://issues.apache.org/jira/browse/HAMA-905 > Project: Hama > Issue Type: Bug > Components: examples > Affects Versions: 0.6.4 > Reporter: Martin Illecker > Priority: Minor > Labels: example, pi_example > Fix For: 0.7.0 > > Attachments: HAMA-905.patch, HAMA-905_2.patch > > > *Fix Pi Estimator Example* > I think we should skip the *sqrt* method in \[1] and change the if condition based on formula 6 on page 2 in \[2]. > {code} > IF (x^2 + y^2 <= 1) THEN > SUM = SUM +1 > END IF > {code} > Because the Equation of the Circle is > {code} > x^2 + y^2 = r^2 > x^2 + y^2 = 1 (with r=1 in unit circle) > -> (x^2 + y^2 <= 1) > {code} > Thanks! > \[1] https://github.com/apache/hama/blob/trunk/examples/src/main/java/org/apache/hama/examples/PiEstimator.java#L62-64 > \[2] http://arxiv.org/pdf/1404.1499v2.pdf -- This message was sent by Atlassian JIRA (v6.2#6252)