gnu: pari-gp: Update to 2.5.4.
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages multiprecision)
20 #:use-module (guix licenses)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages m4)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu))
26
27 (define-public gmp
28 (package
29 (name "gmp")
30 (version "5.1.2")
31 (source (origin
32 (method url-fetch)
33 (uri
34 (string-append "mirror://gnu/gmp/gmp-"
35 version ".tar.xz"))
36 (sha256
37 (base32
38 "1hnbxz7a6jrli8ph27i8zb6k2f456zn6l5xi78yhskzbxjk47nf7"))))
39 (build-system gnu-build-system)
40 (native-inputs `(("m4" ,m4)))
41 (outputs '("out" "debug"))
42 (arguments `(#:configure-flags
43 '(;; Build a "fat binary", with routines for several
44 ;; sub-architectures.
45 "--enable-fat"
46 "--enable-cxx")))
47 (synopsis "Multiple-precision arithmetic library")
48 (description
49 "GMP is a free library for arbitrary precision arithmetic, operating on
50 signed integers, rational numbers, and floating point numbers. There is no
51 practical limit to the precision except the ones implied by the available
52 memory in the machine GMP runs on. GMP has a rich set of functions, and the
53 functions have a regular interface.
54
55 The main target applications for GMP are cryptography applications and
56 research, Internet security applications, algebra systems, computational
57 algebra research, etc.
58
59 GMP is carefully designed to be as fast as possible, both for small operands
60 and for huge operands. The speed is achieved by using fullwords as the basic
61 arithmetic type, by using fast algorithms, with highly optimised assembly
62 code for the most common inner loops for a lot of CPUs, and by a general
63 emphasis on speed.
64
65 GMP is faster than any other bignum library. The advantage for GMP increases
66 with the operand sizes for many operations, since GMP uses asymptotically
67 faster algorithms.")
68 (license lgpl3+)
69 (home-page "http://gmplib.org/")))
70
71 (define-public mpfr
72 (package
73 (name "mpfr")
74 (version "3.1.2")
75 (source (origin
76 (method url-fetch)
77 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
78 ".tar.xz"))
79 (sha256 (base32
80 "0fs501qi8l523gs3cpy4jjcnvwxggyfbklcys80wq236xx3hz79r"))))
81 (build-system gnu-build-system)
82 (outputs '("out" "debug"))
83 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
84 (synopsis "C library for arbitrary precision floating-point arithmetic")
85 (description
86 "The GNU MPFR library is a C library for multiple-precision
87 floating-point computations with correct rounding. MPFR is based on the GMP
88 multiple-precision library.
89
90 The main goal of MPFR is to provide a library for multiple-precision
91 floating-point computation which is both efficient and has a well-defined
92 semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
93 double-precision floating-point arithmetic (53-bit mantissa).")
94 (license lgpl3+)
95 (home-page "http://www.mpfr.org/")))
96
97 (define-public mpc
98 (package
99 (name "mpc")
100 (version "1.0.1")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append
104 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
105 (sha256 (base32
106 "1zq0fidp1jii2j5k5n9hmx55a6wwid33gjzhimvxq9d5zrf82npd"))))
107 (build-system gnu-build-system)
108 (outputs '("out" "debug"))
109 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
110 ("mpfr" ,mpfr)))
111 (synopsis "C library for arbitrary precision complex arithmetic")
112 (description
113 "GNU MPC is a C library for the arithmetic of complex numbers with
114 arbitrarily high precision and correct rounding of the result. It extends
115 the principles of the IEEE-754 standard for fixed precision real floating
116 point numbers to complex numbers, providing well-defined semantics for
117 every operation. At the same time, speed of operation at high precision
118 is a major design goal. The library is built upon and follows the same
119 principles as GNU MPFR.")
120 (license lgpl3+)
121 (home-page "http://mpc.multiprecision.org/")))