From issues-return-28384-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Tue Jul 24 21:00:36 2012 Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59ADED069 for ; Tue, 24 Jul 2012 21:00:36 +0000 (UTC) Received: (qmail 53564 invoked by uid 500); 24 Jul 2012 21:00:35 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 53475 invoked by uid 500); 24 Jul 2012 21:00:35 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 53326 invoked by uid 99); 24 Jul 2012 21:00:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 21:00:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 11A74142860 for ; Tue, 24 Jul 2012 21:00:35 +0000 (UTC) Date: Tue, 24 Jul 2012 21:00:35 +0000 (UTC) From: "Alex (JIRA)" To: issues@commons.apache.org Message-ID: <2072213042.98199.1343163635074.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1089469828.98175.1343163515331.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (MATH-832) Brent solver calculates incorrect root (namley Double.MAX_VALUE) 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/MATH-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex updated MATH-832: ---------------------- Description: Wolfram-Alpha-Solution: http://www.wolframalpha.com/input/?i=min+100*sqrt%28x%29%2B1000000%2Fx%2B10000%2Fsqrt%28x%29+with+x%3E0 Java-Input:{code:borderStyle=solid} int startValue1 = 100 + 1000000 + 10000; int startValue2 = 100; System.out.println( (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { @Override public double value(double x) { return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); } }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue1) ); System.out.println( (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { @Override public double value(double x) { return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); } }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue2) );{code} Java-Output:{code:borderStyle=solid} 804.9355821866686 1.7976931348623157E308 (= Double.MAX_VALUE){code} was: Wolfram-Alpha-Solution: http://www.wolframalpha.com/input/?i=min+100*sqrt%28x%29%2B1000000%2Fx%2B10000%2Fsqrt%28x%29+with+x%3E0 Java-Input:{code:title=Test.java|borderStyle=solid} int startValue1 = 100 + 1000000 + 10000; int startValue2 = 100; System.out.println( (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { @Override public double value(double x) { return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); } }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue1) ); System.out.println( (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { @Override public double value(double x) { return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); } }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue2) );{code} Java-Output:{code:borderStyle=solid} 804.9355821866686 1.7976931348623157E308 (= Double.MAX_VALUE){code} Environment: Netbeans 7.1.2 was:Netbeans 7.1.2 > Brent solver calculates incorrect root (namley Double.MAX_VALUE) > ---------------------------------------------------------------- > > Key: MATH-832 > URL: https://issues.apache.org/jira/browse/MATH-832 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.0 > Environment: Netbeans 7.1.2 > Reporter: Alex > Original Estimate: 0.75h > Remaining Estimate: 0.75h > > Wolfram-Alpha-Solution: > http://www.wolframalpha.com/input/?i=min+100*sqrt%28x%29%2B1000000%2Fx%2B10000%2Fsqrt%28x%29+with+x%3E0 > Java-Input:{code:borderStyle=solid} > int startValue1 = 100 + 1000000 + 10000; > int startValue2 = 100; > System.out.println( > (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { > @Override > public double value(double x) { > return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); > } > }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue1) > ); > System.out.println( > (new BrentSolver()).solve(Integer.MAX_VALUE, new UnivariateFunction() { > @Override > public double value(double x) { > return 100/(2*Math.sqrt(x)) - 1000000/Math.pow(x,2) - 10000/(2*Math.pow(x,(double) 3/2)); > } > }, 1/Double.MAX_VALUE, Double.MAX_VALUE, startValue2) > );{code} > Java-Output:{code:borderStyle=solid} > 804.9355821866686 > 1.7976931348623157E308 (= Double.MAX_VALUE){code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira