summaryrefslogtreecommitdiff
path: root/sci-mathematics/arb/files/arb-2.21.0-gamma_fmpq-testfix.patch
blob: 179ba8887f3271fe55813141270ae618dec744ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 450435a84a40acc1871cd84f1caf2ea47c11a18c Mon Sep 17 00:00:00 2001
From: fredrik <fredrik.johansson@gmail.com>
Date: Tue, 28 Sep 2021 12:07:45 +0200
Subject: [PATCH] fix (hopefully) spurious test failures for gamma_fmpq

---
 arb_hypgeom/gamma_fmpq.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arb_hypgeom/gamma_fmpq.c b/arb_hypgeom/gamma_fmpq.c
index 996a87e5..ee750d0d 100644
--- a/arb_hypgeom/gamma_fmpq.c
+++ b/arb_hypgeom/gamma_fmpq.c
@@ -529,22 +529,22 @@ arb_hypgeom_gamma_fmpq_outward(arb_t y, const fmpq_t x, slong prec)
 
     if (q == 1 || q == 2 || q == 3 || q == 4 || q == 6)
     {
-        arb_hypgeom_gamma_small_frac(t, p, q, prec);
+        arb_hypgeom_gamma_small_frac(t, p, q, prec + 4 * (m != 0));
     }
     else
     {
-        arb_hypgeom_gamma_fmpq_hyp(t, a, prec);
+        arb_hypgeom_gamma_fmpq_hyp(t, a, prec + 4 * (m != 0));
     }
 
     /* argument reduction */
     if (m >= 0)
     {
-        arb_rising_fmpq_ui(u, a, m, prec);
+        arb_rising_fmpq_ui(u, a, m, prec + 4);
         arb_mul(y, t, u, prec);
     }
     else
     {
-        arb_rising_fmpq_ui(u, x, -m, prec);
+        arb_rising_fmpq_ui(u, x, -m, prec + 4);
         arb_div(y, t, u, prec);
     }
 
@@ -602,7 +602,7 @@ arb_hypgeom_gamma_fmpq_taylor(arb_t y, const fmpq_t x, slong prec)
     }
 
     arb_set_fmpq(t, a, prec + 4);
-    success = arb_hypgeom_gamma_taylor(t, t, 0, prec);
+    success = arb_hypgeom_gamma_taylor(t, t, 0, prec + 4);
 
     if (success)
     {
@@ -611,12 +611,12 @@ arb_hypgeom_gamma_fmpq_taylor(arb_t y, const fmpq_t x, slong prec)
 
         if (m >= 0)
         {
-            arb_rising_fmpq_ui(u, a, m, prec);
+            arb_rising_fmpq_ui(u, a, m, prec + 4);
             arb_mul(y, t, u, prec);
         }
         else
         {
-            arb_rising_fmpq_ui(u, x, -m, prec);
+            arb_rising_fmpq_ui(u, x, -m, prec + 4);
             arb_div(y, t, u, prec);
         }
 
@@ -684,7 +684,7 @@ arb_hypgeom_gamma_fmpq(arb_t y, const fmpq_t x, slong prec)
         wp = (slong) fmpz_bits(fmpq_numref(x)) - (slong) fmpz_bits(fmpq_denref(x));
         wp = FLINT_MAX(wp, 0);
         wp = FLINT_MIN(wp, 4 * prec);
-        wp += prec;
+        wp += prec + 4;
 
         arb_set_fmpq(y, x, wp);