No description
Find a file
Fredrik Johansson 8b8654a5d5
Merge pull request #415 from postmath/fix_arb_urandom_docs
arb_urandom: the docs say it has an extra argument that's not actually there.
2022-05-24 15:48:30 +02:00
.github/workflows .github/workflows/ci-sage.yml: Put e_antic build in TARGETS_OPTIONAL 2020-07-05 14:06:11 -07:00
acb small improvement for barnes_g 2021-09-23 20:26:00 +02:00
acb_calc multithreaded numerical integration 2022-05-16 14:20:40 +02:00
acb_dft use the right format specifiers for slong and ulong 2020-11-12 16:41:19 -06:00
acb_dirichlet multithreaded refinement of zeta zeros; tweak example program 2022-05-24 10:26:39 +02:00
acb_elliptic fix #376 by renaming function 2021-09-22 11:15:48 +02:00
acb_hypgeom fix a minor bug in hypgeom_m (nan result only setting real part to nan) 2022-01-24 16:16:55 +01:00
acb_mat reduce unnecessary number of test iterations 2022-05-24 10:33:31 +02:00
acb_modular n_gcd_full -> n_gcd deprecation 2022-05-11 12:33:32 +02:00
acb_poly add missing include 2021-09-29 19:55:34 +02:00
arb multithreaded euler numbers 2022-05-18 16:43:00 +02:00
arb_calc add arb_sgn_nonzero 2019-02-12 09:22:08 +01:00
arb_fmpz_poly n_gcd_full -> n_gcd deprecation 2022-05-11 12:33:32 +02:00
arb_fpwrap fix bug in fpwrap 2021-12-10 13:36:41 +01:00
arb_hypgeom fix issue #404: nan fp computation resulting in unreasonably large N in erf on some systems 2022-04-02 13:35:38 +02:00
arb_mat reduce unnecessary number of test iterations 2022-05-24 10:33:31 +02:00
arb_poly begin make old gamma functions call new code 2021-09-19 15:07:07 +02:00
arf use flint fft mpn_mul 2022-05-18 15:43:00 +02:00
bernoulli remove print statement 2022-05-19 09:25:09 +02:00
bool_mat Replace abort with flint_abort. 2017-02-28 16:52:57 +01:00
dirichlet fix make profile 2020-09-24 16:03:49 -05:00
dlog fix make profile 2020-09-24 16:03:49 -05:00
doc Merge pull request #415 from postmath/fix_arb_urandom_docs 2022-05-24 15:48:30 +02:00
double_interval try more robust di_fast code 2021-12-08 18:31:26 +01:00
examples multithreaded refinement of zeta zeros; tweak example program 2022-05-24 10:26:39 +02:00
fmpr mag_pow_fmpz: allow negative exponents 2021-11-25 13:55:44 +01:00
fmpz_extras mp_bitcnt_t -> flint_bitcnt_t 2020-06-22 23:48:09 +02:00
hypgeom parallel binary splitting evaluation of various constants 2022-05-16 14:25:49 +02:00
mag mag_pow_fmpz: allow negative exponents 2021-11-25 13:55:44 +01:00
partitions change long to slong in static function in hrr_sum_arb 2020-05-04 11:29:18 +02:00
.build_dependencies fix .build_dependencies to test flint 2.5 instead of flint trunk 2017-07-10 17:43:56 +02:00
.gitignore gitignore automake/libtool artifacts 2019-10-05 18:40:31 +02:00
.travis.yml Update .travis.yml 2018-02-10 16:33:46 -06:00
acb.h Add acb_add_error_arb 2021-09-21 17:14:01 +02:00
acb_calc.h minor improvements to integration code; change interface; more examples 2017-11-22 00:24:20 +01:00
acb_dft.h use the right format specifiers for slong and ulong 2020-11-12 16:41:19 -06:00
acb_dirichlet.h merge 2022-05-23 23:38:01 +02:00
acb_elliptic.h add acb_elliptic_p_prime 2021-05-22 18:50:30 +02:00
acb_hypgeom.h arb_hypgeom_lgamma, acb_hypgeom_lgamma 2021-09-01 09:52:11 +02:00
acb_mat.h Fixed bug for aliased mat_mul of window matrices 2021-03-23 18:32:37 +01:00
acb_modular.h theta_series 2019-10-14 15:53:44 -04:00
acb_poly.h Implement Graeffe Transform for real and complex poly 2021-07-27 14:12:07 +02:00
appveyor.yml Merge branch 'master' of github.com:fredrik-johansson/arb 2022-01-14 14:22:56 +01:00
arb.h update docs; call this 2.22.1 2022-01-25 13:07:17 +01:00
arb_calc.h update copyright headers to switch from GPL to LGPL 2016-04-26 17:20:05 +02:00
arb_fmpz_poly.h missing C++ include guards 2018-02-09 21:52:34 +01:00
arb_fpwrap.h add arb_fpwrap_double_erfinv, arb_fpwrap_double_erfcinv 2021-12-05 13:12:11 +01:00
arb_hypgeom.h new arb_hypgeom_ci 2021-12-21 22:53:06 +01:00
arb_mat.h Fixed bug for aliased mat_mul of window matrices 2021-03-23 18:32:37 +01:00
arb_poly.h Implement Graeffe Transform for real and complex poly 2021-07-27 14:12:07 +02:00
arf.h use flint fft mpn_mul 2022-05-18 15:43:00 +02:00
bernoulli.h multithreaded multi-bernoulli generation 2022-05-18 15:36:44 +02:00
bool_mat.h Change flint_abort to abort only if flint > 2.5.2 2017-03-02 17:18:18 +01:00
CMakeLists.txt CMakeLists.txt: support standard GNU installation directories 2021-04-08 20:15:45 -04:00
configure Fixing MINGW64 build 2022-04-13 11:05:36 -07:00
dirichlet.h use acb_dirichlet_roots_t in l_hurwitz and l_jet; rename dirichlet_number_primitive -> dirichlet_group_num_primitive 2016-12-01 22:33:15 +01:00
dlog.h missing C++ include guards 2018-02-09 21:52:34 +01:00
double_interval.h fixes 2021-12-09 16:49:03 +01:00
fmpr.h handle flint incompatibilities 2020-04-29 13:41:36 +02:00
fmpz_extras.h fallback for old flint 2020-06-23 00:15:11 +02:00
hypgeom.h update copyright headers to switch from GPL to LGPL 2016-04-26 17:20:05 +02:00
LICENSE replace gpl-2.0.txt with LICENSE = lgpl-2.1.txt 2016-04-26 17:24:23 +02:00
mag.h Add serialization arb/arf/mag_load/dump_str/file 2019-10-05 17:56:24 +02:00
Makefile.in helpers for double interval arithmetic 2021-12-08 11:12:52 +01:00
Makefile.subdirs fix make profile 2020-09-24 16:03:49 -05:00
partitions.h update copyright headers to switch from GPL to LGPL 2016-04-26 17:20:05 +02:00
README.md remove reference to ArbFloats.jl which is deprecated. 2022-01-21 16:31:25 -05:00

Arb

Arb is a C library for arbitrary-precision interval arithmetic. It has full support for both real and complex numbers. The library is thread-safe, portable, and extensively tested. Arb is free software distributed under the GNU Lesser General Public License (LGPL), version 2.1 or later.

arb logo

Documentation: http://arblib.org

Development updates: http://fredrikj.net/blog/

Author: Fredrik Johansson fredrik.johansson@gmail.com

Bug reports, feature requests and other comments are welcome in private communication, on the GitHub issue tracker, or on the FLINT mailing list flint-devel@googlegroups.com.

Build status

Code example

The following program evaluates sin(pi + exp(-10000)). Since the input to the sine function matches a root to within 4343 digits, at least 4343-digit (14427-bit) precision is needed to get an accurate result. The program repeats the evaluation at 64-bit, 128-bit, ... precision, stopping only when the result is accurate to at least 53 bits.

#include "arb.h"

int main()
{
    slong prec;
    arb_t x, y;
    arb_init(x); arb_init(y);

    for (prec = 64; ; prec *= 2)
    {
        arb_const_pi(x, prec);
        arb_set_si(y, -10000);
        arb_exp(y, y, prec);
        arb_add(x, x, y, prec);
        arb_sin(y, x, prec);
        arb_printn(y, 15, 0); printf("\n");
        if (arb_rel_accuracy_bits(y) >= 53)
            break;
    }

    arb_clear(x); arb_clear(y);
    flint_cleanup();
}

The output is:

[+/- 6.01e-19]
[+/- 2.55e-38]
[+/- 8.01e-77]
[+/- 8.64e-154]
[+/- 5.37e-308]
[+/- 3.63e-616]
[+/- 1.07e-1232]
[+/- 9.27e-2466]
[-1.13548386531474e-4343 +/- 3.91e-4358]

Each line shows a rigorous enclosure of the exact value of the expression. The program demonstrates how the user can rely on Arb's automatic error bound tracking to get an output that is guaranteed to be accurate -- no error analysis needs to be done by the user.

For more example programs, see: http://arblib.org/examples.html

Features

Besides basic arithmetic, Arb allows working with univariate polynomials, truncated power series, and matrices over both real and complex numbers.

Basic linear algebra is supported, including matrix multiplication, determinant, inverse, nonsingular solving, matrix exponential, and computation of eigenvalues and eigenvectors.

Support for polynomials and power series is quite extensive, including methods for composition, reversion, product trees, multipoint evaluation and interpolation, complex root isolation, and transcendental functions of power series.

Other features include root isolation for real functions, rigorous numerical integration of complex functions, and discrete Fourier transforms (DFTs).

Special functions

Arb can compute a wide range of transcendental and special functions, including the gamma function, polygamma functions, Riemann zeta and Hurwitz zeta function, Dirichlet L-functions, polylogarithm, error function, Gauss hypergeometric function 2F1, confluent hypergeometric functions, Bessel functions, Airy functions, Legendre functions and other orthogonal polynomials, exponential and trigonometric integrals, incomplete gamma and beta functions, Jacobi theta functions, modular functions, Weierstrass elliptic functions, complete and incomplete elliptic integrals, arithmetic-geometric mean, Bernoulli numbers, partition function, Barnes G-function, Lambert W function.

Speed

Arb uses a midpoint-radius (ball) representation of real numbers. At high precision, this allows doing interval arithmetic without significant overhead compared to plain floating-point arithmetic. Various low-level optimizations have also been implemented to reduce overhead at precisions of just a few machine words. Most operations on polynomials and power series use asymptotically fast FFT multiplication based on FLINT. Similarly, most operations on large matrices take advantage of the fast integer matrix multiplication in FLINT.

For basic arithmetic, Arb should generally be around as fast as MPFR (http://mpfr.org), though it can be a bit slower at low precision, and around twice as fast as MPFI (https://perso.ens-lyon.fr/nathalie.revol/software.html).

Transcendental functions in Arb are quite well optimized and should generally be faster than any other arbitrary-precision software currently available. The following table compares the time in seconds to evaluate the Gauss hypergeometric function 2F1(1/2, 1/4, 1, z) at the complex number z = 5^(1/2) + 7^(1/2)i, to a given number of decimal digits (Arb 2.8-git and mpmath 0.19 on an 1.90 GHz Intel i5-4300U, Mathematica 9.0 on a 3.07 GHz Intel Xeon X5675).

Digits Mathematica mpmath Arb
10 0.00066 0.00065 0.000071
100 0.0039 0.0012 0.00048
1000 0.23 1.2 0.0093
10000 42.6 84 0.56

Dependencies, installation, and interfaces

Arb depends on FLINT (http://flintlib.org/), either GMP (http://gmplib.org) or MPIR (http://mpir.org), and MPFR (http://mpfr.org).

See http://arblib.org/setup.html for instructions on building and installing Arb directly from the source code. Arb might also be available (or coming soon) as a package for your Linux distribution.

SageMath (http://sagemath.org/) includes Arb as a standard package and contains a high-level Python interface. See the SageMath documentation for RealBallField (http://doc.sagemath.org/html/en/reference/rings_numerical/sage/rings/real_arb.html) and ComplexBallField (http://doc.sagemath.org/html/en/reference/rings_numerical/sage/rings/complex_arb.html).

Nemo (http://nemocas.org/) is a computer algebra package for the Julia programming language which includes a high-level Julia interface to Arb. The Nemo installation script will create a local installation of Arb along with other dependencies.

A standalone Python interface to FLINT and Arb is also available (https://github.com/fredrik-johansson/python-flint).

A separate wrapper of transcendental functions for use with the C99 complex double type is available (https://github.com/fredrik-johansson/arbcmath).

Other third-party wrappers include: