Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-math-functions for openSUSE:Factory checked in at 2021-04-06 17:31:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-math-functions (Old) and /work/SRC/openSUSE:Factory/.ghc-math-functions.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-math-functions" Tue Apr 6 17:31:17 2021 rev:9 rq:883271 version:0.3.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-math-functions/ghc-math-functions.changes 2020-12-22 11:42:29.353670594 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-math-functions.new.2401/ghc-math-functions.changes 2021-04-06 17:32:53.567334895 +0200 @@ -1,0 +2,9 @@ +Mon Mar 29 11:01:15 UTC 2021 - [email protected] + +- Update math-functions to version 0.3.4.2. + ## Changes in 0.3.4.2 + + * Fixed crash in `invIncompleteBeta` (#68) for some inputs initial approximation + was computed incorrectly. + +------------------------------------------------------------------- Old: ---- math-functions-0.3.4.1.tar.gz New: ---- math-functions-0.3.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-math-functions.spec ++++++ --- /var/tmp/diff_new_pack.J8OsBI/_old 2021-04-06 17:32:54.135335538 +0200 +++ /var/tmp/diff_new_pack.J8OsBI/_new 2021-04-06 17:32:54.139335543 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-math-functions # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name math-functions %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.3.4.1 +Version: 0.3.4.2 Release: 0 Summary: Collection of tools for numeric computations License: BSD-2-Clause ++++++ math-functions-0.3.4.1.tar.gz -> math-functions-0.3.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/math-functions-0.3.4.1/Numeric/SpecFunctions/Internal.hs new/math-functions-0.3.4.2/Numeric/SpecFunctions/Internal.hs --- old/math-functions-0.3.4.1/Numeric/SpecFunctions/Internal.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/math-functions-0.3.4.2/Numeric/SpecFunctions/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -777,7 +777,7 @@ in x -- For small a and not too big b we use approximation from boost. | b < 5 && a <= 1 = - let x | p**(1/a) < 0.5 = (p * a * exp beta) ** (1/a) + let x | p**(1/a) < 0.5 = (p ** (a * exp beta)) ** (1/a) | otherwise = 1 - (1 - p ** (b * exp beta))**(1/b) in x -- When a>>b and both are large approximation from [Temme1992], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/math-functions-0.3.4.1/changelog.md new/math-functions-0.3.4.2/changelog.md --- old/math-functions-0.3.4.1/changelog.md 2001-09-09 03:46:40.000000000 +0200 +++ new/math-functions-0.3.4.2/changelog.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,9 @@ +## Changes in 0.3.4.2 + + * Fixed crash in `invIncompleteBeta` (#68) for some inputs initial approximation + was computed incorrectly. + + ## Changes in 0.3.4.1 * Precision of `incompleteGamma` improved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/math-functions-0.3.4.1/math-functions.cabal new/math-functions-0.3.4.2/math-functions.cabal --- old/math-functions-0.3.4.1/math-functions.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/math-functions-0.3.4.2/math-functions.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: math-functions -version: 0.3.4.1 +version: 0.3.4.2 cabal-version: >= 1.10 license: BSD2 license-file: LICENSE @@ -28,8 +28,9 @@ || ==8.2.2 || ==8.4.4 || ==8.6.5 - || ==8.8.3 - || ==8.10.1 + || ==8.8.4 + || ==8.10.2 + || ==9.0.1 , GHCJS ==8.4 extra-source-files: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/math-functions-0.3.4.1/tests/Tests/SpecFunctions.hs new/math-functions-0.3.4.2/tests/Tests/SpecFunctions.hs --- old/math-functions-0.3.4.1/tests/Tests/SpecFunctions.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/math-functions-0.3.4.2/tests/Tests/SpecFunctions.hs 2001-09-09 03:46:40.000000000 +0200 @@ -26,14 +26,20 @@ import Numeric.MathFunctions.Constants (m_epsilon,m_tiny) erfTol,erfcTol,erfcLargeTol :: Int -#if USE_SYSTEM_ERF && !defined(__GHCJS__) -erfTol = 1 -erfcTol = 2 -erfcLargeTol = 2 -#else +-- Pure haskell implementation is not very good +#if !defined(USE_SYSTEM_ERF) || defined(__GHCJS__) erfTol = 4 erfcTol = 4 erfcLargeTol = 64 +-- Macos's erf is slightly worse that GNU one +#elif defined(darwin_HOST_OS) +erfTol = 2 +erfcTol = 2 +erfcLargeTol = 2 +#else +erfTol = 1 +erfcTol = 2 +erfcLargeTol = 2 #endif isGHCJS :: Bool @@ -43,6 +49,14 @@ isGHCJS = False #endif +isWindows :: Bool +#if defined(mingw32_HOST_OS) +isWindows = True +#else +isWindows = False +#endif + + tests :: TestTree tests = testGroup "Special functions" [ testGroup "erf" @@ -88,7 +102,10 @@ [ testCase "incompleteGamma table" $ forTable "tests/tables/igamma.dat" $ \[a,x,exact] -> do let err | a < 10 = 16 - | a <= 101 = if isGHCJS then 64 else 32 + | a <= 101 = case () of + _| isGHCJS -> 64 + | isWindows -> 64 + | otherwise -> 32 | a == 201 = 200 | otherwise = 32 checkTabularPure err (show (a,x)) exact (incompleteGamma a x) @@ -137,6 +154,12 @@ -- , testProperty "0 <= I[B] <= 1" incompleteBetaInRange , testProperty "ibeta symmetry" incompleteBetaSymmetry + , testCase "Regression #68" $ do + let a = 1 + b = 0.3 + p = 0.3 + x = invIncompleteBeta a b p + assertBool "Inversion OK" $ incompleteBeta a b x `ulpDistance` p < 4 -- XXX FIXME DISABLED due to failures -- , testProperty "invIncompleteBeta = B^-1" $ invIBetaIsInverse ] @@ -177,7 +200,7 @@ [ testCase "choose table" $ forM_ [0 .. 1000] $ \n -> forM_ [0 .. n] $ \k -> do - checkTabular 2048 + checkTabular (if isWindows then 3072 else 2048) (show (n,k)) (fromIntegral $ choose' n k) (choose (fromInteger n) (fromInteger k)) @@ -205,14 +228,18 @@ roundtrip_invErfc_erfc, roundtrip_erf_invErf :: (Double,Double) -#if USE_SYSTEM_ERF && !defined(__GHCJS__) -roundtrip_erfc_invErfc = (2,2) -roundtrip_invErfc_erfc = (2,2) -roundtrip_erf_invErf = (1,1) -#else +#if !defined(USE_SYSTEM_ERF) || defined(__GHCJS__) roundtrip_erfc_invErfc = (2,8) roundtrip_invErfc_erfc = (8,4) roundtrip_erf_invErf = (128,128) +#elif defined(darwin_HOST_OS) +roundtrip_erfc_invErfc = (4,4) +roundtrip_invErfc_erfc = (4,4) +roundtrip_erf_invErf = (2,2) +#else +roundtrip_erfc_invErfc = (2,2) +roundtrip_invErfc_erfc = (2,2) +roundtrip_erf_invErf = (1,1) #endif -- id ??? erfc . invErfc
