exp-pairs 0.1.6.0 → 0.2.0.0
raw patch · 10 files changed
+26/−24 lines, 10 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Math.ExpPairs.LinearForm: instance GHC.Num.Num t => Data.Semigroup.Semigroup (Math.ExpPairs.LinearForm.LinearForm t)
- Math.ExpPairs.Pair: Hux05 :: Triangle
- Math.ExpPairs.Process: instance Data.Semigroup.Semigroup Math.ExpPairs.Process.Path
- Math.ExpPairs.ProcessMatrix: instance Data.Semigroup.Semigroup Math.ExpPairs.ProcessMatrix.ProcessMatrix
+ Math.ExpPairs.LinearForm: instance GHC.Num.Num t => GHC.Base.Semigroup (Math.ExpPairs.LinearForm.LinearForm t)
+ Math.ExpPairs.Pair: Bourgain17 :: Triangle
+ Math.ExpPairs.Process: instance GHC.Base.Semigroup Math.ExpPairs.Process.Path
+ Math.ExpPairs.ProcessMatrix: instance GHC.Base.Semigroup Math.ExpPairs.ProcessMatrix.ProcessMatrix
- Math.ExpPairs.Matrix3: toList :: Foldable t => forall a. () => t a -> [a]
+ Math.ExpPairs.Matrix3: toList :: Foldable t => t a -> [a]
Files
- CHANGELOG.md +5/−0
- Math/ExpPairs/Ivic.hs +4/−4
- Math/ExpPairs/Pair.hs +10/−10
- exp-pairs.cabal +1/−1
- tests/Etalon.hs +1/−1
- tests/Instances.hs +1/−1
- tests/Ivic.hs +2/−2
- tests/Kratzel.hs +1/−1
- tests/MenzerNowak.hs +1/−1
- tests/etalon-mOnS.txt +0/−3
CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes ======= +Version 0.2.0.0+----------------++Switch from Huxley's exponent pair (2005) to Bourgain's one (2017).+ Version 0.1.5.0 ----------------
Math/ExpPairs/Ivic.hs view
@@ -147,16 +147,16 @@ mBigOnHalf a | a < 4 = simulateOptimize 1 | a < 12 = simulateOptimize $ 1+(a-4)/8- | a > 41614060315296730740083860226662 % 2636743270445733804969041895717 = simulateOptimize $ 1 + (a - 6) * zetaOnHalf+ | a > 16645467 / 972266 = simulateOptimize $ 1 + (a - 6) * zetaOnHalf | otherwise = if Finite x >= optimalValue optRes then simulateOptimize x else optRes where optRes = optimize [K 1 + L 1 :/: K 1] [K (4 - a) + L 4 + 2 >=. 0]- x = 1 + 32*(a-6)/205--- Constant 41614060315296730740083860226662 % 2636743270445733804969041895717+ x = 1 + 13*(a-6)/84+-- Constant 16645467 / 972266 -- is produced by--- optimize [K 4 + L 4 + 2 :/: K 1] [64 >. K 64 + L 77]+-- optimize [K 4 + L 4 + 2 :/: K 1] [26 >. K 26 + L 32] -- | Try to reverse 'mBigOnHalf': for a given M(A) find maximal possible A. -- Sometimes, when 'mBigOnHalf' gets especially lucky exponent pair, 'reverseMBigOnHalf' can miss
Math/ExpPairs/Pair.hs view
@@ -42,10 +42,10 @@ -- \/\/ Proceedings of the International Number -- Theory Conference held at Universite Laval in 1987, Walter de Gruyter, 1989, P. 417-423. | HuxW87b1- -- | An exponent pair (32\/205, 269\/410) from /Huxley M. N./- -- `Exponential sums and the Riemann zeta function V' \/\/- -- Proc. Lond. Math. Soc., 2005, Vol. 90, no. 1., P. 1--41.- | Hux05+ -- |An exponent pair (13\/84, 55\/84) from /Bourgain J./+ -- `Decoupling, exponential sums and the Riemann zeta function`+ -- \/\/ J. Amer. Math. Soc., 2017, 30, P. 205-224.+ | Bourgain17 deriving (Show, Bounded, Enum, Eq, Ord, Generic) instance Pretty Triangle where@@ -61,7 +61,7 @@ | Corput12 -- |Point from the interior of 'Triangle'. -- Exactly- -- 'Mix' a b = a * 'Corput16' + b * 'HuxW87b1' + (1-a-b) * 'Hux05'+ -- 'Mix' a b = a * 'Corput16' + b * 'HuxW87b1' + (1-a-b) * 'Bourgain17' | Mix !t !t deriving (Eq, Ord, Show, Generic) @@ -75,7 +75,7 @@ instance (Pretty t, Num t, Eq t) => Pretty (InitPair' t) where pretty Corput01 = parens (pretty (0%1) <> comma <+> pretty (1%1)) pretty Corput12 = parens (pretty (1%2) <> comma <+> pretty (1%2))- pretty (Mix r1 r2) = cat $ punctuate plus $ mapMaybe f [(r1, Corput16), (r2, HuxW87b1), (1 - r1 - r2, Hux05)] where+ pretty (Mix r1 r2) = cat $ punctuate plus $ mapMaybe f [(r1, Corput16), (r2, HuxW87b1), (1 - r1 - r2, Bourgain17)] where plus = space <> pretty "+" <> space f (0, _) = Nothing f (1, t) = Just (pretty t)@@ -97,7 +97,7 @@ r3 = 1 - r1 - r2 (x1, y1) = (1%6, 2%3) (x2, y2) = ( 2 % 13, 35 % 52)- (x3, y3) = (32 % 205, 269 % 410)+ (x3, y3) = (13 % 84, 55 % 84) x = x1*r1 + x2*r2 + x3*r3 y = y1*r1 + y2*r2 + y3*r3 --initPairToValue (Mix r1 r2) = (13 % 1230 * r1 - 6 % 2665 * r2 + 32 % 205, 13 % 1230 * r1 + 181 % 10660 * r2 + 269 % 410)@@ -110,9 +110,9 @@ where dr1 = denominator r1 dr2 = denominator r2- m = 31980 * dr1 * dr2- k = 338 * numerator r1 * dr2 - 72 * numerator r2 * dr1 + 4992 * dr1 * dr2- l = 338 * numerator r1 * dr2 + 543 * numerator r2 * dr1 + 20982 * dr1 * dr2+ m = 1092 * dr1 * dr2+ k = 13 * numerator r1 * dr2 - 1 * numerator r2 * dr1 + 169 * dr1 * dr2+ l = 13 * numerator r1 * dr2 + 20 * numerator r2 * dr1 + 715 * dr1 * dr2 d = k `gcd` l `gcd` m
exp-pairs.cabal view
@@ -1,5 +1,5 @@ name: exp-pairs-version: 0.1.6.0+version: 0.2.0.0 synopsis: Linear programming over exponent pairs description: Package implements an algorithm to minimize rational objective function over the set of exponent pairs homepage: https://github.com/Bodigrim/exp-pairs
tests/Etalon.hs view
@@ -13,7 +13,7 @@ fetchRandomLines n filename = do etalon <- readFile filename gen <- newStdGen- let items = (take n . unsort gen . lines) etalon+ let items = lines etalon -- (take n . unsort gen . lines) etalon let tests = map (map read . words) items return tests
tests/Instances.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveGeneric, CPP #-} module Instances (Ratio01 (..), Positive (..), Sorted(..)) where -import Test.QuickCheck hiding (Positive)+import Test.QuickCheck (Arbitrary(..), Gen, genericShrink, suchThat, vectorOf) import Test.SmallCheck.Series import Control.Applicative import Control.Monad
tests/Ivic.hs view
@@ -6,7 +6,7 @@ import Test.Tasty import Test.Tasty.SmallCheck as SC-import Test.Tasty.QuickCheck as QC hiding (Positive)+import Test.Tasty.QuickCheck as QC (testProperty, QuickCheckTests(..)) import Test.Tasty.HUnit import Debug.Trace@@ -59,7 +59,7 @@ a = fromMinus3To3 a' testZetaReverse1 :: Ratio01 Rational -> Bool-testZetaReverse1 (Ratio01 s') = if t <= s + 2e-2 && s <= t + 2e-3 then True else trace (show $ fromRational $ s-t) False where+testZetaReverse1 (Ratio01 s') = if t <= s + 2.1e-2 && s <= t + 2e-3 then True else trace (show $ fromRational $ s-t) False where s = fromHalfToOne s' zs = zetaOnS s t = toRational $ optimalValue $ reverseZetaOnS $ toRational $ optimalValue zs
tests/Kratzel.hs view
@@ -6,7 +6,7 @@ import Test.Tasty import Test.Tasty.SmallCheck as SC-import Test.Tasty.QuickCheck as QC hiding (Positive)+import Test.Tasty.QuickCheck as QC (testProperty) import Test.Tasty.HUnit import Instances
tests/MenzerNowak.hs view
@@ -7,7 +7,7 @@ import Test.Tasty import Test.Tasty.SmallCheck as SC-import Test.Tasty.QuickCheck as QC hiding (Positive)+import Test.Tasty.QuickCheck as QC (testProperty) import Instances
tests/etalon-mOnS.txt view
@@ -290,7 +290,6 @@ 25 36 71882325 6523522 25 38 135260848 14414887 255 256 2560 1-257 284 73356632 1208837 257 308 741691104 26727829 257 332 35560459576 2051440701 257 356 392137204 31041385@@ -503,7 +502,6 @@ 469 496 120148064 952893 469 664 423737576 36106647 469 712 7928052004 842029635-473 488 485039792 1869697 473 608 25465205762887566277872914 1432933868656272952719597 473 656 5448736 433671 47 48 17562322278 42480791@@ -683,7 +681,6 @@ 67 94 274973124 22546777 685 688 6880 3 68 95 1129604340 90893383-697 784 3404362107124972 70417119108897 69 88 1847403 99592 701 704 7040 3 70 73 139301082 780289