mirror of
https://github.com/vale981/arb
synced 2025-03-05 17:31:38 -05:00
move mag_add_ui_2exp_si to its own file and document it
This commit is contained in:
parent
2ba00389d6
commit
25d4fbcf92
7 changed files with 43 additions and 17 deletions
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "acb.h"
|
#include "acb.h"
|
||||||
|
|
||||||
void mag_add_ui_2exp_si(mag_t, const mag_t, ulong, slong);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
acb_rising_get_mag2_right(mag_t bound, const arb_t a, const arb_t b, ulong n)
|
acb_rising_get_mag2_right(mag_t bound, const arb_t a, const arb_t b, ulong n)
|
||||||
{
|
{
|
||||||
|
|
11
arb/atan.c
11
arb/atan.c
|
@ -66,17 +66,6 @@ arb_atan_inf_eps(arb_t z, const arf_t x, slong prec)
|
||||||
fmpz_clear(mag);
|
fmpz_clear(mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: move out */
|
|
||||||
void
|
|
||||||
mag_add_ui_2exp_si(mag_t z, const mag_t x, ulong y, slong e)
|
|
||||||
{
|
|
||||||
mag_t t;
|
|
||||||
mag_init(t);
|
|
||||||
mag_set_ui_2exp_si(t, y, e);
|
|
||||||
mag_add(z, x, t);
|
|
||||||
mag_clear(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
arb_atan_arf(arb_t z, const arf_t x, slong prec)
|
arb_atan_arf(arb_t z, const arf_t x, slong prec)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "arb.h"
|
#include "arb.h"
|
||||||
|
|
||||||
void mag_add_ui_2exp_si(mag_t, const mag_t, ulong, slong);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Determine N such that the error is bounded by 2^-prec.
|
Determine N such that the error is bounded by 2^-prec.
|
||||||
We choose an N with many trailing zeros to improve efficiency
|
We choose an N with many trailing zeros to improve efficiency
|
||||||
|
|
|
@ -72,8 +72,6 @@ arf_log_via_mpfr(arf_t z, const arf_t x, slong prec, arf_rnd_t rnd)
|
||||||
TMP_END;
|
TMP_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mag_add_ui_2exp_si(mag_t z, const mag_t x, ulong y, slong e);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
arb_log_arf_huge(arb_t z, const arf_t x, slong prec)
|
arb_log_arf_huge(arb_t z, const arf_t x, slong prec)
|
||||||
{
|
{
|
||||||
|
|
|
@ -204,6 +204,10 @@ Arithmetic
|
||||||
|
|
||||||
Sets *z* to an upper bound for `x + 2^e`.
|
Sets *z* to an upper bound for `x + 2^e`.
|
||||||
|
|
||||||
|
.. function:: void mag_add_ui_2exp_si(mag_t z, const mag_t x, ulong y, slong e)
|
||||||
|
|
||||||
|
Sets *z* to an upper bound for `x + y 2^e`.
|
||||||
|
|
||||||
.. function:: void mag_div(mag_t z, const mag_t x, const mag_t y)
|
.. function:: void mag_div(mag_t z, const mag_t x, const mag_t y)
|
||||||
|
|
||||||
.. function:: void mag_div_ui(mag_t z, const mag_t x, ulong y)
|
.. function:: void mag_div_ui(mag_t z, const mag_t x, ulong y)
|
||||||
|
|
2
mag.h
2
mag.h
|
@ -305,6 +305,8 @@ void mag_add(mag_t z, const mag_t x, const mag_t y);
|
||||||
|
|
||||||
void mag_add_lower(mag_t z, const mag_t x, const mag_t y);
|
void mag_add_lower(mag_t z, const mag_t x, const mag_t y);
|
||||||
|
|
||||||
|
void mag_add_ui_2exp_si(mag_t z, const mag_t x, ulong y, slong e);
|
||||||
|
|
||||||
void mag_div(mag_t z, const mag_t x, const mag_t y);
|
void mag_div(mag_t z, const mag_t x, const mag_t y);
|
||||||
|
|
||||||
MAG_INLINE void
|
MAG_INLINE void
|
||||||
|
|
37
mag/add_ui_2exp_si.c
Normal file
37
mag/add_ui_2exp_si.c
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/*=============================================================================
|
||||||
|
|
||||||
|
This file is part of ARB.
|
||||||
|
|
||||||
|
ARB is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
ARB is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with ARB; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
=============================================================================*/
|
||||||
|
/******************************************************************************
|
||||||
|
|
||||||
|
Copyright (C) 2014 Fredrik Johansson
|
||||||
|
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#include "mag.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
mag_add_ui_2exp_si(mag_t z, const mag_t x, ulong y, slong e)
|
||||||
|
{
|
||||||
|
mag_t t;
|
||||||
|
mag_init(t);
|
||||||
|
mag_set_ui_2exp_si(t, y, e);
|
||||||
|
mag_add(z, x, t);
|
||||||
|
mag_clear(t);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue