From 2acfe29830b7c7673b92de08c1c46178a70e69c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= Date: Tue, 21 Sep 2021 14:50:37 +0200 Subject: [PATCH] Add acb_add_error_arb Also add acb_add_error_arf to the documentation. --- acb.h | 7 +++++++ doc/source/acb.rst | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/acb.h b/acb.h index 5d438486..4c88a9d7 100644 --- a/acb.h +++ b/acb.h @@ -331,6 +331,13 @@ acb_add_error_mag(acb_t x, const mag_t err) arb_add_error_mag(acb_imagref(x), err); } +ACB_INLINE void +acb_add_error_arb(acb_t x, const arb_t err) +{ + arb_add_error(acb_realref(x), err); + arb_add_error(acb_imagref(x), err); +} + void acb_get_mag(mag_t z, const acb_t x); void acb_get_mag_lower(mag_t z, const acb_t x); diff --git a/doc/source/acb.rst b/doc/source/acb.rst index 25fdf53f..e090bcc8 100644 --- a/doc/source/acb.rst +++ b/doc/source/acb.rst @@ -139,8 +139,12 @@ Basic manipulation Swaps *z* and *x* efficiently. +.. function:: void acb_add_error_arf(acb_t x, const arf_t err) + .. function:: void acb_add_error_mag(acb_t x, const mag_t err) +.. function:: void acb_add_error_arb(acb_t x, const arb_t err) + Adds *err* to the error bounds of both the real and imaginary parts of *x*, modifying *x* in-place.