From owner-svn-src-all@FreeBSD.ORG Tue May 28 08:50:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EF0080E; Tue, 28 May 2013 08:50:51 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF523F7; Tue, 28 May 2013 08:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S8opMe092586; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S8opvu092585; Tue, 28 May 2013 08:50:51 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201305280850.r4S8opvu092585@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 May 2013 08:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251053 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 08:50:51 -0000 Author: tijl Date: Tue May 28 08:50:50 2013 New Revision: 251053 URL: http://svnweb.freebsd.org/changeset/base/251053 Log: Fix cexp regression tests that have an infinite real part. The signs of the result depend on the cosine and sine of the imaginary part. Small values are used in the new tests such that cosine and sine are well defined. Reviewed by: das Modified: head/tools/regression/lib/msun/test-cexp.c Modified: head/tools/regression/lib/msun/test-cexp.c ============================================================================== --- head/tools/regression/lib/msun/test-cexp.c Tue May 28 05:52:03 2013 (r251052) +++ head/tools/regression/lib/msun/test-cexp.c Tue May 28 08:50:50 2013 (r251053) @@ -110,7 +110,7 @@ cpackl(long double x, long double y) /* Various finite non-zero numbers to test. */ static const float finites[] = -{ -42.0e20, -1.0 -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; +{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; /* * Determine whether x and y are equal, with two special rules: @@ -228,21 +228,35 @@ test_inf(void) int i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ - /* cexp(inf + yi) = 0 + 0yi */ - /* cexp(-inf + yi) = inf + inf yi (except y=0) */ for (i = 0; i < N(finites); i++) { testall(cpackl(finites[i], INFINITY), cpackl(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); - /* XXX shouldn't raise an inexact exception */ - testall(cpackl(-INFINITY, finites[i]), - cpackl(0.0, 0.0 * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - if (finites[i] == 0) - continue; - testall(cpackl(INFINITY, finites[i]), - cpackl(INFINITY, INFINITY * finites[i]), - ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } + /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(-INFINITY, M_PI_4), cpackl(0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 3 * M_PI_4), cpackl(-0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 5 * M_PI_4), cpackl(-0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 7 * M_PI_4), cpackl(0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(-INFINITY, 0.0), cpackl(0.0, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(cpackl(-INFINITY, -0.0), cpackl(0.0, -0.0), + ALL_STD_EXCEPT, 0, 1); + /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */ + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(INFINITY, M_PI_4), cpackl(INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 3 * M_PI_4), cpackl(-INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 5 * M_PI_4), cpackl(-INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(cpackl(INFINITY, 7 * M_PI_4), cpackl(INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + /* cexp(inf + 0i) = inf + 0i */ testall(cpackl(INFINITY, 0.0), cpackl(INFINITY, 0.0), ALL_STD_EXCEPT, 0, 1); testall(cpackl(INFINITY, -0.0), cpackl(INFINITY, -0.0),