Commit c4e40407 authored by Andreas Enge's avatar Andreas Enge

Wrap the basic arithmetic acb functions from ARB.

* src/arb.c (pari_acb_add, pari_acb_sub, pari_acb_mul, pari_acb_div,
  pari_acb_neg, pari_acb_conj): New functions.
  (WRAP_Acb_Acb_noprec): New macro for wrapping functions that do not take
  a precision parameter.
* src/paritwine.h: Declare the new functions.
* gp/paritwine-arb.gp: Add the new functions.
* doc/paritwine.texi: Document the new functions.
parent caec366b
......@@ -650,7 +650,13 @@ The second function computes the first four theta constants.
The third function computes the squares of the ten non-zero theta constants.
@end deftypefun
@deftypefun GEN pari_acb_exp (GEN x, long prec)
@deftypefun GEN pari_acb_add (GEN x, GEN y, long prec)
@deftypefunx GEN pari_acb_sub (GEN x, GEN y, long prec)
@deftypefunx GEN pari_acb_mul (GEN x, GEN y, long prec)
@deftypefunx GEN pari_acb_div (GEN x, GEN y, long prec)
@deftypefunx GEN pari_acb_neg (GEN x, long prec)
@deftypefunx GEN pari_acb_conj (GEN x, long prec)
@deftypefunx GEN pari_acb_exp (GEN x, long prec)
@deftypefunx GEN pari_acb_log (GEN x, long prec)
@deftypefunx GEN pari_acb_atan (GEN x, long prec)
@deftypefunx GEN pari_acb_sin (GEN x, long prec)
......
install ("pari_acb_exp", "Gb", "acb_exp", LIBPARITWINESO);
install ("pari_acb_add", "GGb", "acb_add", LIBPARITWINESO);
install ("pari_acb_sub", "GGb", "acb_sub", LIBPARITWINESO);
install ("pari_acb_mul", "GGb", "acb_mul", LIBPARITWINESO);
install ("pari_acb_div", "GGb", "acb_div", LIBPARITWINESO);
install ("pari_acb_neg", "Gb", "acb_neg", LIBPARITWINESO);
install ("pari_acb_conj", "Gb", "acb_conj", LIBPARITWINESO);
install ("pari_acb_log", "Gb", "acb_log", LIBPARITWINESO);
install ("pari_acb_atan", "Gb", "acb_atan", LIBPARITWINESO);
install ("pari_acb_sin", "Gb", "acb_sin", LIBPARITWINESO);
......
/*
Copyright © 2014, 2016, 2017, 2018 Andreas Enge <andreas.enge@inria.fr>
Copyright © 2014, 2016, 2017, 2018, 2019 Andreas Enge <andreas.enge@inria.fr>
Copyright © 2017, 2018 Fredrik Johansson <fredrik.johansson@gmail.com>
This file is part of paritwine.
......@@ -22,7 +22,7 @@ along with Paritwine. If not, see <http://www.gnu.org/licenses/>.
/****************************************************************************/
/* Macro for wrapping a function with one ACB inputs and one ACB output */
/* Macro for wrapping a function with one ACB input and one ACB output */
#define WRAP_Acb_Acb(name) \
GEN pari_acb_ ## name (GEN x, long prec) \
{ \
......@@ -36,6 +36,21 @@ GEN pari_acb_ ## name (GEN x, long prec) \
return z; \
}
/* Macro for wrapping a function with one ACB input and one ACB output,
but not taking a prec argument*/
#define WRAP_Acb_Acb_noprec(name) \
GEN pari_acb_ ## name (GEN x, long prec) \
{ \
acb_t z1; \
GEN z; \
acb_init(z1); \
acb_set_GEN(z1, x, prec); \
acb_ ## name(z1, z1); \
z = acb_get_GEN(z1, prec); \
acb_clear(z1); \
return z; \
}
/* Macro for wrapping a function with two ACB inputs and one ACB output */
#define WRAP_Acb_AcbAcb(name) \
GEN pari_acb_ ## name (GEN x, GEN y, long prec) \
......@@ -87,6 +102,12 @@ GEN pari_arb_numbpart (GEN x, long prec) \
/****************************************************************************/
WRAP_Acb_AcbAcb(add)
WRAP_Acb_AcbAcb(sub)
WRAP_Acb_AcbAcb(mul)
WRAP_Acb_AcbAcb(div)
WRAP_Acb_Acb_noprec(neg)
WRAP_Acb_Acb_noprec(conj)
WRAP_Acb_Acb(exp)
WRAP_Acb_Acb(log)
WRAP_Acb_Acb(atan)
......
......@@ -186,6 +186,12 @@ GEN pari_cmh_10theta2 (GEN tau, long prec);
#endif
#ifdef HAVE_LIBARB
GEN pari_acb_add (GEN x, GEN y, long prec);
GEN pari_acb_sub (GEN x, GEN y, long prec);
GEN pari_acb_mul (GEN x, GEN y, long prec);
GEN pari_acb_div (GEN x, GEN y, long prec);
GEN pari_acb_neg (GEN x, long prec);
GEN pari_acb_conj (GEN x, long prec);
GEN pari_acb_exp (GEN x, long prec);
GEN pari_acb_log (GEN x, long prec);
GEN pari_acb_atan (GEN x, long prec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment