File: platt_lemma_32.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 (50 lines) | stat: -rw-r--r-- 1,253 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
/*
    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"

/* out = 2*pi^(5/4)*exp(1/(8*h^2) - (t0^2)/(2*h^2) - pi*x) */
void
acb_dirichlet_platt_lemma_32(arb_t out, const arb_t h, const arb_t t0,
        const arb_t x, slong prec)
{
    arb_t pi, one_fourth;
    arb_t x1, x2;

    arb_init(pi);
    arb_init(one_fourth);
    arb_init(x1);
    arb_init(x2);

    arb_const_pi(pi, prec);
    arb_set_d(one_fourth, 0.25);

    arb_set_d(x1, 1.25);
    arb_pow(x1, pi, x1, prec);
    arb_mul_2exp_si(x1, x1, 1);

    arb_sqr(x2, t0, prec);
    arb_sub(x2, x2, one_fourth, prec);
    arb_div(x2, x2, h, prec);
    arb_div(x2, x2, h, prec);
    arb_mul_2exp_si(x2, x2, -1);

    arb_mul(out, pi, x, prec);
    arb_add(out, out, x2, prec);
    arb_neg(out, out);
    arb_exp(out, out, prec);
    arb_mul(out, out, x1, prec);

    arb_clear(pi);
    arb_clear(one_fourth);
    arb_clear(x1);
    arb_clear(x2);
}