From owner-svn-src-all@freebsd.org Sun Dec 27 21:55:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20EA5A527AF; Sun, 27 Dec 2015 21:55:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDB5415D6; Sun, 27 Dec 2015 21:55:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBRLtR8g011873; Sun, 27 Dec 2015 21:55:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBRLtRP6011872; Sun, 27 Dec 2015 21:55:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512272155.tBRLtRP6011872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 27 Dec 2015 21:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292806 - stable/9/tools/regression/lib/msun X-SVN-Group: stable-9 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.20 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: Sun, 27 Dec 2015 21:55:28 -0000 Author: ngie Date: Sun Dec 27 21:55:26 2015 New Revision: 292806 URL: https://svnweb.freebsd.org/changeset/base/292806 Log: MFstable/10 r251053: r251053 (by tijl): 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: stable/9/tools/regression/lib/msun/test-cexp.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/lib/msun/test-cexp.c ============================================================================== --- stable/9/tools/regression/lib/msun/test-cexp.c Sun Dec 27 21:53:21 2015 (r292805) +++ stable/9/tools/regression/lib/msun/test-cexp.c Sun Dec 27 21:55:26 2015 (r292806) @@ -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),