C C++ Other
Permalink
Failed to load latest commit information.
acb acb_inv: tighter error bounds (in particular, ensure nonzero input ->… Feb 18, 2017
acb_calc update copyright headers to switch from GPL to LGPL Apr 26, 2016
acb_dirichlet l_jet: hack to call proper Riemann zeta code Dec 2, 2016
acb_elliptic elliptic_roots, modular_eisenstein: detect real output Feb 17, 2017
acb_hypgeom fix some missing clears() Dec 5, 2016
acb_mat update copyright headers to switch from GPL to LGPL Apr 26, 2016
acb_modular modular_j, modular_delta: detect real output Feb 17, 2017
acb_poly fix a memory leak Feb 16, 2017
arb development version Feb 8, 2017
arb_calc update copyright headers to switch from GPL to LGPL Apr 26, 2016
arb_hypgeom arb_hypgeom: more wrappers, and add some test code Nov 23, 2016
arb_mat MAINT: improve entrywise relative accuracy of exponentials of matrice… Jun 3, 2016
arb_poly fix some missing clears() Dec 5, 2016
arf add arf_sosq (sum of squares) Feb 18, 2017
bernoulli update copyright headers to switch from GPL to LGPL Apr 26, 2016
bool_mat update copyright headers to switch from GPL to LGPL Apr 26, 2016
dirichlet use acb_dirichlet_roots_t in l_hurwitz and l_jet; rename dirichlet_nu… Dec 1, 2016
dlog use dlog_precomp in chi_vec Oct 8, 2016
doc add arf_sosq (sum of squares) Feb 18, 2017
examples lvalue example program Dec 2, 2016
fmpr Fix errors Oct 11, 2016
fmpz_extras update copyright headers to switch from GPL to LGPL Apr 26, 2016
hypgeom update copyright headers to switch from GPL to LGPL Apr 26, 2016
mag de-inline clear() methods -> 8% faster compile, 25% smaller libarb.so Jul 4, 2016
partitions Fix errors Oct 11, 2016
.build_dependencies check if rolling back to mpfr-3.1.4 solves the travis build problems … Oct 8, 2016
.gitignore Add libarb.a to .gitignore Aug 12, 2016
.travis.yml Fix osx link issue in travis-ci Dec 1, 2016
CMakeLists.txt target_compile_definitions require CMake >=2.8.12 Nov 7, 2016
LICENSE replace gpl-2.0.txt with LICENSE = lgpl-2.1.txt Apr 26, 2016
Makefile.in start of code for incomplete elliptic integrals Feb 8, 2017
Makefile.subdirs replace makefiles with version based on the improved flint makefiles Aug 18, 2014
README.md update docs; call this 2.9.0 Dec 2, 2016
acb.h add arb_is_int_2exp_si and acb_is_int_2exp_si Feb 14, 2017
acb_calc.h update copyright headers to switch from GPL to LGPL Apr 26, 2016
acb_dirichlet.h add acb_poly series versions of l, hardy_theta and hardy_z Nov 28, 2016
acb_elliptic.h implement inverse Weierstrass elliptic function and lattice invariants Feb 14, 2017
acb_hypgeom.h more arb_hypgeom wrappers Jul 6, 2016
acb_mat.h add methods to count allocated bytes; restrict memory usage in zeta s… Oct 19, 2016
acb_modular.h add theta_jet functions with tau transformation, and use in elliptic … Feb 16, 2017
acb_poly.h add acb_poly_exp_pi_i_series Feb 16, 2017
arb.h add arb_is_int_2exp_si and acb_is_int_2exp_si Feb 14, 2017
arb_calc.h update copyright headers to switch from GPL to LGPL Apr 26, 2016
arb_hypgeom.h arb_hypgeom: more wrappers, and add some test code Nov 23, 2016
arb_mat.h add methods to count allocated bytes; restrict memory usage in zeta s… Oct 19, 2016
arb_poly.h Change const arb_srcptr -> arb_srcptr Nov 6, 2016
arf.h add arf_sosq (sum of squares) Feb 18, 2017
bernoulli.h update copyright headers to switch from GPL to LGPL Apr 26, 2016
bool_mat.h update copyright headers to switch from GPL to LGPL Apr 26, 2016
configure update docs; call this 2.9.0 Dec 2, 2016
dirichlet.h use acb_dirichlet_roots_t in l_hurwitz and l_jet; rename dirichlet_nu… Dec 1, 2016
dlog.h use dlog_precomp in chi_vec Oct 8, 2016
fmpr.h Add support for dll Nov 6, 2016
fmpz_extras.h add methods to count allocated bytes; restrict memory usage in zeta s… Oct 19, 2016
hypgeom.h update copyright headers to switch from GPL to LGPL Apr 26, 2016
mag.h add methods to count allocated bytes; restrict memory usage in zeta s… Oct 19, 2016
partitions.h update copyright headers to switch from GPL to LGPL Apr 26, 2016

README.md

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

General 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 and matrix exponential.

Support for polynomial 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.

Arb has partial support for automatic differentiation (AD), and includes rudimentary functionality for rigorous calculus based on AD (including real root isolation and complex integration).

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 function, Jacobi theta functions, modular functions, Weierstrass elliptic function, complete elliptic integrals, arithmetic-geometric mean, Bernoulli numbers, partition function, Barnes G-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.

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.

An experimental 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).