File: backlund_s_bound.c

package info (click to toggle)
flint-arb 1%3A2.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,028 kB
  • sloc: ansic: 177,109; sh: 553; makefile: 288; python: 268
file content (64 lines) | stat: -rw-r--r-- 1,645 bytes parent folder | download | duplicates (2)
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
/*
    Copyright (C) 2019 D.H.J Polymath

    This file is part of Arb.

    Arb is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License (LGPL) as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.  See <http://www.gnu.org/licenses/>.
*/

#include "acb_dirichlet.h"

static void
_mag_div_ui_ui(mag_t res, ulong a, ulong b)
{
    mag_set_ui(res, a);
    mag_div_ui(res, res, b);
}

void
acb_dirichlet_backlund_s_bound(mag_t res, const arb_t t)
{
    if (!arb_is_nonnegative(t))
    {
        mag_inf(res);
    }
    else
    {
        mag_t m;
        mag_init(m);
        arb_get_mag(m, t);
        if (mag_cmp_2exp_si(m, 8) < 0) /* 2^8 < 280 */
        {
            mag_one(res);
        }
        else if (mag_cmp_2exp_si(m, 22) < 0) /* 2^22 < 6.8*10^6 */
        {
            mag_set_ui(res, 2);
        }
        else if (mag_cmp_2exp_si(m, 29) < 0) /* 2^29 < 5.45*10^8 */
        {
            _mag_div_ui_ui(res, 231366, 100000);
        }
        else
        {
            /* |S(t)| <= 0.112*log(t) + 0.278*log(log(t)) + 2.51 */
            mag_t c, logm;
            mag_init(c);
            mag_init(logm);
            mag_log(logm, m);
            _mag_div_ui_ui(c, 278, 1000);
            mag_log(res, logm);
            mag_mul(res, res, c);
            _mag_div_ui_ui(c, 112, 1000);
            mag_addmul(res, c, logm);
            _mag_div_ui_ui(c, 251, 100);
            mag_add(res, res, c);
            mag_clear(c);
            mag_clear(logm);
        }
        mag_clear(m);
    }
}