Skip to content

Commit

Permalink
Fix ARB_DEF_CACHED_CONSTANT
Browse files Browse the repository at this point in the history
  • Loading branch information
albinahlback committed Nov 5, 2024
1 parent 67b7511 commit 16d98f1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/acb/barnes_g.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ _arb_const_zeta_minus_one_eval(arb_t y, slong prec)
acb_clear(a);
}

_ARB_DEF_CACHED_CONSTANT(static, static, _arb_const_zeta_minus_one, _arb_const_zeta_minus_one_eval)
_ARB_DEF_CACHED_CONSTANT(_arb_const_zeta_minus_one, _arb_const_zeta_minus_one_eval)

/* LogG(z) = (z-1) LogGamma(z) - zeta'(-1,z) + zeta'(-1)
LogG'(z) = (1/2)(-2z + 1 + log(2pi)) + (z-1) digamma(z) */
Expand Down
8 changes: 4 additions & 4 deletions src/acb_hypgeom/airy_direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ arb_const_airy_bi1_eval(arb_t y, slong prec)
arb_clear(t); fmpq_clear(v);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_airy_ai0, arb_const_airy_ai0_eval)
_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_airy_ai1, arb_const_airy_ai1_eval)
_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_airy_bi0, arb_const_airy_bi0_eval)
_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_airy_bi1, arb_const_airy_bi1_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_airy_ai0, arb_const_airy_ai0_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_airy_ai1, arb_const_airy_ai1_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_airy_bi0, arb_const_airy_bi0_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_airy_bi1, arb_const_airy_bi1_eval)

static void
acb_hypgeom_airy_0f1_sum_inner(acb_t s, acb_srcptr t, slong m, slong n, slong alpha, int real, slong prec)
Expand Down
2 changes: 1 addition & 1 deletion src/acb_hypgeom/lgamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ _arb_const_log_pi(arb_t t, slong prec)
arb_log(t, t, prec);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_log_pi, _arb_const_log_pi)
_ARB_DEF_CACHED_CONSTANT(arb_const_log_pi, _arb_const_log_pi)

static int
acb_hypgeom_lgamma_taylor(acb_t res, const acb_t z, slong prec)
Expand Down
2 changes: 1 addition & 1 deletion src/acb_hypgeom/li.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _acb_hypgeom_const_li2_eval(arb_t s, slong prec)
acb_clear(t);
}

_ARB_DEF_CACHED_CONSTANT(static, static, _acb_hypgeom_const_li2, _acb_hypgeom_const_li2_eval)
_ARB_DEF_CACHED_CONSTANT(_acb_hypgeom_const_li2, _acb_hypgeom_const_li2_eval)

static void
_acb_hypgeom_li_offset(acb_t res, const acb_t z, slong prec)
Expand Down
5 changes: 3 additions & 2 deletions src/arb.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ arb_sqr(arb_t res, const arb_t val, slong prec)
arb_mul(res, val, val, prec);
}

#define _ARB_DEF_CACHED_CONSTANT(DECL1, DECL2, name, comp_func) \
#define __ARB_DEF_CACHED_CONSTANT(DECL1, DECL2, name, comp_func) \
FLINT_TLS_PREFIX slong name ## _cached_prec = 0; \
FLINT_TLS_PREFIX arb_t name ## _cached_value; \
DECL1 void name ## _cleanup(void) \
Expand All @@ -636,7 +636,8 @@ arb_sqr(arb_t res, const arb_t val, slong prec)
arb_set_round(x, name ## _cached_value, prec); \
}

#define ARB_DEF_CACHED_CONSTANT(name, comp_func) _ARB_DEF_CACHED_CONSTANT(static,, name, comp_func)
#define _ARB_DEF_CACHED_CONSTANT(name, comp_func) __ARB_DEF_CACHED_CONSTANT(static, static, name, comp_func)
#define ARB_DEF_CACHED_CONSTANT(name, comp_func) __ARB_DEF_CACHED_CONSTANT(static,, name, comp_func)

/* vector functions */

Expand Down
2 changes: 1 addition & 1 deletion src/arb/const_euler.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ arb_const_euler_eval(arb_t res, slong prec)
euler_bsplit_1_clear(sum, NULL);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_euler_brent_mcmillan, arb_const_euler_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_euler_brent_mcmillan, arb_const_euler_eval)

FLINT_DLL extern const ulong arb_hypgeom_gamma_tab_limbs[];

Expand Down
2 changes: 1 addition & 1 deletion src/arb/const_log2.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Note: for log(3) the corresponding formula is
but currently we do not have a use for this as a standalone constant.
*/

_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_log2_hypgeom, arb_const_log2_hypgeom_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_log2_hypgeom, arb_const_log2_hypgeom_eval)

void
arb_const_log2(arb_t res, slong prec)
Expand Down
2 changes: 1 addition & 1 deletion src/arb/const_pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ arb_const_pi_chudnovsky_eval(arb_t s, slong prec)
arb_clear(u);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_const_pi_chudnovsky, arb_const_pi_chudnovsky_eval)
_ARB_DEF_CACHED_CONSTANT(arb_const_pi_chudnovsky, arb_const_pi_chudnovsky_eval)

void
arb_const_pi(arb_t res, slong prec)
Expand Down
4 changes: 2 additions & 2 deletions src/arb_hypgeom/gamma_fmpq.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ arb_gamma_const_1_3_eval(arb_t s, slong prec)
arb_clear(u);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_gamma_const_1_3, arb_gamma_const_1_3_eval)
_ARB_DEF_CACHED_CONSTANT(arb_gamma_const_1_3, arb_gamma_const_1_3_eval)

static void
arb_gamma_const_1_4_eval(arb_t x, slong prec)
Expand All @@ -79,7 +79,7 @@ arb_gamma_const_1_4_eval(arb_t x, slong prec)
arb_clear(u);
}

_ARB_DEF_CACHED_CONSTANT(static, static, arb_gamma_const_1_4, arb_gamma_const_1_4_eval)
_ARB_DEF_CACHED_CONSTANT(arb_gamma_const_1_4, arb_gamma_const_1_4_eval)


static void
Expand Down

0 comments on commit 16d98f1

Please sign in to comment.