1This is mpc.info, produced by makeinfo version 7.0 from mpc.texi. 2 3This manual is for GNU MPC, a library for multiple precision complex 4arithmetic, version 1.3.1 of December 2022. 5 6 Copyright �� 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 72011, 2012, 2013, 2016, 2018, 2020, 2022 INRIA 8 9 Permission is granted to copy, distribute and/or modify this 10 document under the terms of the GNU Free Documentation License, 11 Version 1.3 or any later version published by the Free Software 12 Foundation; with no Invariant Sections. A copy of the license is 13 included in the section entitled ���GNU Free Documentation License.��� 14INFO-DIR-SECTION GNU Packages 15START-INFO-DIR-ENTRY 16* mpc: (mpc)Multiple Precision Complex Library. 17END-INFO-DIR-ENTRY 18 19 20File: mpc.info, Node: Top, Next: Copying, Up: (dir) 21 22GNU MPC 23******* 24 25This manual documents how to install and use the GNU Multiple Precision 26Complex Library, version 1.3.1 27 28* Menu: 29 30* Copying:: GNU MPC Copying Conditions (LGPL). 31* Introduction to GNU MPC:: Brief introduction to GNU MPC. 32* Installing GNU MPC:: How to configure and compile the GNU MPC library. 33* Reporting Bugs:: How to usefully report bugs. 34* GNU MPC Basics:: What every GNU MPC user should know. 35* Complex Functions:: Functions for arithmetic on complex numbers. 36* Ball Arithmetic:: Types and functions for complex balls. 37* References:: 38* Concept Index:: 39* Function Index:: 40* Type Index:: 41* GNU Free Documentation License:: 42 43 44File: mpc.info, Node: Copying, Next: Introduction to GNU MPC, Prev: Top, Up: Top 45 46GNU MPC Copying Conditions 47************************** 48 49GNU MPC is free software; you can redistribute it and/or modify it under 50the terms of the GNU Lesser General Public License as published by the 51Free Software Foundation; either version 3 of the License, or (at your 52option) any later version. 53 54 GNU MPC is distributed in the hope that it will be useful, but 55WITHOUT ANY WARRANTY; without even the implied warranty of 56MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 57General Public License for more details. 58 59 You should have received a copy of the GNU Lesser General Public 60License along with this program. If not, see 61<http://www.gnu.org/licenses/>. 62 63 64File: mpc.info, Node: Introduction to GNU MPC, Next: Installing GNU MPC, Prev: Copying, Up: Top 65 661 Introduction to GNU MPC 67************************* 68 69GNU MPC is a portable library written in C for arbitrary precision 70arithmetic on complex numbers providing correct rounding. It implements 71a multiprecision equivalent of the C99 standard. It builds upon the GNU 72MP and the GNU MPFR libraries. 73 741.1 How to use this Manual 75========================== 76 77Everyone should read *note GNU MPC Basics::. If you need to install the 78library yourself, you need to read *note Installing GNU MPC::, too. 79 80 The remainder of the manual can be used for later reference, although 81it is probably a good idea to skim through it. 82 83 84File: mpc.info, Node: Installing GNU MPC, Next: Reporting Bugs, Prev: Introduction to GNU MPC, Up: Top 85 862 Installing GNU MPC 87******************** 88 89To build GNU MPC, you first have to install GNU MP (version 5.0.0 or 90higher) and GNU MPFR (version 4.1.0 or higher) on your computer. You 91need a C compiler; GCC version 4.4 or higher is recommended, since GNU 92MPC may trigger a bug in previous versions, see the thread at 93<https://sympa.inria.fr/sympa/arc/mpc-discuss/2011-02/msg00024.html>. 94And you need a standard Unix ���make��� program, plus some other standard 95Unix utility programs. 96 97 Here are the steps needed to install the library on Unix systems: 98 99 1. ���tar xzf mpc-1.3.1.tar.gz��� 100 101 2. ���cd mpc-1.3.1��� 102 103 3. ���./configure��� 104 105 if GMP and GNU MPFR are installed into standard directories, that 106 is, directories that are searched by default by the compiler and 107 the linking tools. 108 109 ���./configure --with-gmp=<gmp_install_dir>��� 110 111 is used to indicate a different location where GMP is installed. 112 Alternatively, you can specify directly GMP include and GMP lib 113 directories with ���./configure --with-gmp-lib=<gmp_lib_dir> 114 --with-gmp-include=<gmp_include_dir>���. 115 116 ���./configure --with-mpfr=<mpfr_install_dir>��� 117 118 is used to indicate a different location where GNU MPFR is 119 installed. Alternatively, you can specify directly GNU MPFR 120 include and GNU MPFR lib directories with ���./configure 121 --with-mpf-lib=<mpfr_lib_dir> 122 --with-mpfr-include=<mpfr_include_dir>���. 123 124 Another useful parameter is ���--prefix���, which can be used to 125 specify an alternative installation location instead of 126 ���/usr/local���; see ���make install��� below. 127 128 To enable checking for memory leaks using ���valgrind��� during ���make 129 check���, add the parameter ���--enable-valgrind-tests���. 130 131 If for debugging purposes you wish to log calls to GNU MPC 132 functions from within your code, add the parameter 133 ���--enable-logging���. In your code, replace the inclusion of ���mpc.h��� 134 by ���mpc-log.h��� and link the executable dynamically. Then all calls 135 to functions with only complex arguments are printed to ���stderr��� in 136 the following form: First, the function name is given, followed by 137 its type such as ���c_cc���, meaning that the function has one complex 138 result (one ���c��� in front of the ���_���), computed from two complex 139 arguments (two ���c��� after the ���_���). Then, the precisions of the 140 real and the imaginary part of the first result is given, followed 141 by the second one and so on. Finally, for each argument, the 142 precisions of its real and imaginary part are specified and the 143 argument itself is printed in hexadecimal via the function 144 ���mpc_out_str��� (*note String and Stream Input and Output::). The 145 option requires a dynamic library, so it may not be combined with 146 ���--disable-shared���. 147 148 Use ���./configure --help��� for an exhaustive list of parameters. 149 150 4. ���make��� 151 152 This compiles GNU MPC in the working directory. 153 154 5. ���make check��� 155 156 This will make sure GNU MPC was built correctly. 157 158 If you get error messages, please report them to 159 ���mpc-discuss@inria.fr��� (*Note Reporting Bugs::, for information on 160 what to include in useful bug reports). 161 162 6. ���make install��� 163 164 This will copy the file ���mpc.h��� to the directory 165 ���/usr/local/include���, the file ���libmpc.a��� to the directory 166 ���/usr/local/lib���, and the file ���mpc.info��� to the directory 167 ���/usr/local/share/info��� (or if you passed the ���--prefix��� option to 168 ���configure���, using the prefix directory given as argument to 169 ���--prefix��� instead of ���/usr/local���). Note: you need write 170 permissions on these directories. 171 1722.1 Other ���make��� Targets 173======================== 174 175There are some other useful make targets: 176 177 ��� ���info��� 178 179 Create an info version of the manual, in ���mpc.info���. 180 181 ��� ���pdf��� 182 183 Create a PDF version of the manual, in ���doc/mpc.pdf���. 184 185 ��� ���dvi��� 186 187 Create a DVI version of the manual, in ���doc/mpc.dvi���. 188 189 ��� ���ps��� 190 191 Create a Postscript version of the manual, in ���doc/mpc.ps���. 192 193 ��� ���html��� 194 195 Create an HTML version of the manual, in several pages in the 196 directory ���doc/mpc.html���; if you want only one output HTML file, 197 then type ���makeinfo --html --no-split mpc.texi��� instead. 198 199 ��� ���clean��� 200 201 Delete all object files and archive files, but not the 202 configuration files. 203 204 ��� ���distclean��� 205 206 Delete all files not included in the distribution. 207 208 ��� ���uninstall��� 209 210 Delete all files copied by ���make install���. 211 2122.2 Known Build Problems 213======================== 214 215On AIX, if GMP was built with the 64-bit ABI, before building and 216testing GNU MPC, it might be necessary to set the ���OBJECT_MODE��� 217environment variable to 64 by, e.g., 218 219 ���export OBJECT_MODE=64��� 220 221 This has been tested with the C compiler IBM XL C/C++ Enterprise 222Edition V8.0 for AIX, version: 08.00.0000.0021, GMP 4.2.4 and GNU MPFR 2232.4.1. 224 225 Please report any other problems you encounter to 226���mpc-discuss@inria.fr���. *Note Reporting Bugs::. 227 228 229File: mpc.info, Node: Reporting Bugs, Next: GNU MPC Basics, Prev: Installing GNU MPC, Up: Top 230 2313 Reporting Bugs 232**************** 233 234If you think you have found a bug in the GNU MPC library, please 235investigate and report it. We have made this library available to you, 236and it is not to ask too much from you, to ask you to report the bugs 237that you find. 238 239 There are a few things you should think about when you put your bug 240report together. 241 242 You have to send us a test case that makes it possible for us to 243reproduce the bug. Include instructions on how to run the test case. 244 245 You also have to explain what is wrong; if you get a crash, or if the 246results printed are incorrect and in that case, in what way. 247 248 Please include compiler version information in your bug report. This 249can be extracted using ���gcc -v���, or ���cc -V��� on some machines. Also, 250include the output from ���uname -a���. 251 252 If your bug report is good, we will do our best to help you to get a 253corrected version of the library; if the bug report is poor, we will not 254do anything about it (aside of chiding you to send better bug reports). 255 256 Send your bug report to: ���mpc-discuss@inria.fr���. 257 258 If you think something in this manual is unclear, or downright 259incorrect, or if the language needs to be improved, please send a note 260to the same address. 261 262 263File: mpc.info, Node: GNU MPC Basics, Next: Complex Functions, Prev: Reporting Bugs, Up: Top 264 2654 GNU MPC Basics 266**************** 267 268All declarations needed to use GNU MPC are collected in the include file 269���mpc.h���. It is designed to work with both C and C++ compilers. You 270should include that file in any program using the GNU MPC library by 271adding the line 272 #include "mpc.h" 273 2744.1 Nomenclature and Types 275========================== 276 277���Complex number��� or ���Complex��� for short, is a pair of two arbitrary 278precision floating-point numbers (for the real and imaginary parts). 279The C data type for such objects is ���mpc_t���. 280 281The ���Precision��� is the number of bits used to represent the mantissa of 282the real and imaginary parts; the corresponding C data type is 283���mpfr_prec_t���. For more details on the allowed precision range, *note 284(mpfr.info)Nomenclature and Types::. 285 286The ���rounding mode��� specifies the way to round the result of a complex 287operation, in case the exact result can not be represented exactly in 288the destination mantissa; the corresponding C data type is ���mpc_rnd_t���. 289A complex rounding mode is a pair of two rounding modes: one for the 290real part, one for the imaginary part. 291 2924.2 Function Classes 293==================== 294 295There is only one class of functions in the GNU MPC library, namely 296functions for complex arithmetic. The function names begin with ���mpc_���. 297The associated type is ���mpc_t���. 298 2994.3 GNU MPC Variable Conventions 300================================ 301 302As a general rule, all GNU MPC functions expect output arguments before 303input arguments. This notation is based on an analogy with the 304assignment operator. 305 306 GNU MPC allows you to use the same variable for both input and output 307in the same expression. For example, the main function for 308floating-point multiplication, ���mpc_mul���, can be used like this: 309���mpc_mul (x, x, x, rnd_mode)���. This computes the square of X with 310rounding mode ���rnd_mode��� and puts the result back in X. 311 312 Before you can assign to an GNU MPC variable, you need to initialise 313it by calling one of the special initialization functions. When you are 314done with a variable, you need to clear it out, using one of the 315functions for that purpose. 316 317 A variable should only be initialised once, or at least cleared out 318between each initialization. After a variable has been initialised, it 319may be assigned to any number of times. 320 321 For efficiency reasons, avoid to initialise and clear out a variable 322in loops. Instead, initialise it before entering the loop, and clear it 323out after the loop has exited. 324 325 You do not need to be concerned about allocating additional space for 326GNU MPC variables, since each of its real and imaginary part has a 327mantissa of fixed size. Hence unless you change its precision, or clear 328and reinitialise it, a complex variable will have the same allocated 329space during all its life. 330 3314.4 Rounding Modes 332================== 333 334A complex rounding mode is of the form ���MPC_RNDxy��� where ���x��� and ���y��� are 335one of ���N��� (to nearest), ���Z��� (towards zero), ���U��� (towards plus 336infinity), ���D��� (towards minus infinity), ���A��� (away from zero, that is, 337towards plus or minus infinity depending on the sign of the number to be 338rounded). The first letter refers to the rounding mode for the real 339part, and the second one for the imaginary part. For example 340���MPC_RNDZU��� indicates to round the real part towards zero, and the 341imaginary part towards plus infinity. 342 343 The ���round to nearest��� mode works as in the IEEE P754 standard: in 344case the number to be rounded lies exactly in the middle of two 345representable numbers, it is rounded to the one with the least 346significant bit set to zero. For example, the number 5, which is 347represented by (101) in binary, is rounded to (100)=4 with a precision 348of two bits, and not to (110)=6. 349 3504.5 Return Value 351================ 352 353Most GNU MPC functions have a return value of type ���int���, which is used 354to indicate the position of the rounded real and imaginary parts with 355respect to the exact (infinite precision) values. If this integer is 356���i���, the macros ���MPC_INEX_RE(i)��� and ���MPC_INEX_IM(i)��� give 0 if the 357corresponding rounded value is exact, a negative value if the rounded 358value is less than the exact one, and a positive value if it is greater 359than the exact one. Similarly, functions computing a result of type 360���mpfr_t��� return an integer that is 0, positive or negative depending on 361whether the rounded value is the same, larger or smaller then the exact 362result. 363 364 Some functions, such as ���mpc_sin_cos���, compute two complex results; 365the macros ���MPC_INEX1(i)��� and ���MPC_INEX2(i)���, applied to the return 366value ���i��� of such a function, yield the exactness value corresponding to 367the first or the second computed value, respectively. 368 3694.6 Branch Cuts And Special Values 370================================== 371 372Some complex functions have branch cuts, across which the function is 373discontinous. In GNU MPC, the branch cuts chosen are the same as those 374specified for the corresponding functions in the ISO C99 standard. 375 376 Likewise, when evaluated at a point whose real or imaginary part is 377either infinite or a NaN or a signed zero, a function returns the same 378value as those specified for the corresponding function in the ISO C99 379standard. 380 381 382File: mpc.info, Node: Complex Functions, Next: Ball Arithmetic, Prev: GNU MPC Basics, Up: Top 383 3845 Complex Functions 385******************* 386 387The complex functions expect arguments of type ���mpc_t���. 388 389 The GNU MPC floating-point functions have an interface that is 390similar to the GNU MP integer functions. The function prefix for 391operations on complex numbers is ���mpc_���. 392 393 The precision of a computation is defined as follows: Compute the 394requested operation exactly (with ���infinite precision���), and round the 395result to the destination variable precision with the given rounding 396mode. 397 398 The GNU MPC complex functions are intended to be a smooth extension 399of the IEEE P754 arithmetic. The results obtained on one computer 400should not differ from the results obtained on a computer with a 401different word size. 402 403* Menu: 404 405* Initializing Complex Numbers:: 406* Assigning Complex Numbers:: 407* Converting Complex Numbers:: 408* String and Stream Input and Output:: 409* Complex Comparison:: 410* Projection & Decomposing:: 411* Basic Arithmetic:: 412* Power Functions and Logarithm:: 413* Trigonometric Functions:: 414* Modular Functions:: 415* Miscellaneous Complex Functions:: 416* Advanced Functions:: 417* Internals:: 418 419 420File: mpc.info, Node: Initializing Complex Numbers, Next: Assigning Complex Numbers, Up: Complex Functions 421 4225.1 Initialization Functions 423============================ 424 425An ���mpc_t��� object must be initialised before storing the first value in 426it. The functions ���mpc_init2��� and ���mpc_init3��� are used for that 427purpose. 428 429 -- Function: void mpc_init2 (mpc_t Z, mpfr_prec_t PREC) 430 Initialise Z to precision PREC bits and set its real and imaginary 431 parts to NaN. Normally, a variable should be initialised once only 432 or at least be cleared, using ���mpc_clear���, between initializations. 433 434 -- Function: void mpc_init3 (mpc_t Z, mpfr_prec_t PREC_R, mpfr_prec_t 435 PREC_I) 436 Initialise Z with the precision of its real part being PREC_R bits 437 and the precision of its imaginary part being PREC_I bits, and set 438 the real and imaginary parts to NaN. 439 440 -- Function: void mpc_clear (mpc_t Z) 441 Free the space occupied by Z. Make sure to call this function for 442 all ���mpc_t��� variables when you are done with them. 443 444 Here is an example on how to initialise complex variables: 445 { 446 mpc_t x, y; 447 mpc_init2 (x, 256); /* precision _exactly_ 256 bits */ 448 mpc_init3 (y, 100, 50); /* 100/50 bits for the real/imaginary part */ 449 ... 450 mpc_clear (x); 451 mpc_clear (y); 452 } 453 454 The following function is useful for changing the precision during a 455calculation. A typical use would be for adjusting the precision 456gradually in iterative algorithms like Newton-Raphson, making the 457computation precision closely match the actual accurate part of the 458numbers. 459 460 -- Function: void mpc_set_prec (mpc_t X, mpfr_prec_t PREC) 461 Reset the precision of X to be *exactly* PREC bits, and set its 462 real/imaginary parts to NaN. The previous value stored in X is 463 lost. It is equivalent to a call to ���mpc_clear(x)��� followed by a 464 call to ���mpc_init2(x, prec)���, but more efficient as no allocation 465 is done in case the current allocated space for the mantissa of X 466 is sufficient. 467 468 -- Function: mpfr_prec_t mpc_get_prec (const mpc_t X) 469 If the real and imaginary part of X have the same precision, it is 470 returned, otherwise, 0 is returned. 471 472 -- Function: void mpc_get_prec2 (mpfr_prec_t* PR, mpfr_prec_t* PI, 473 const mpc_t X) 474 Returns the precision of the real part of X via PR and of its 475 imaginary part via PI. 476 477 478File: mpc.info, Node: Assigning Complex Numbers, Next: Converting Complex Numbers, Prev: Initializing Complex Numbers, Up: Complex Functions 479 4805.2 Assignment Functions 481======================== 482 483These functions assign new values to already initialised complex numbers 484(*note Initializing Complex Numbers::). When using any functions with 485���intmax_t��� or ���uintmax_t��� parameters, you must include ���<stdint.h>��� or 486���<inttypes.h>��� _before_ ���mpc.h���, to allow ���mpc.h��� to define prototypes 487for these functions. Similarly, functions with parameters of type 488���complex��� or ���long complex��� are defined only if ���<complex.h>��� is 489included _before_ ���mpc.h���. If you need assignment functions that are 490not in the current API, you can define them using the ���MPC_SET_X_Y��� 491macro (*note Advanced Functions::). 492 493 -- Function: int mpc_set (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 494 Set the value of ROP from OP, rounded to the precision of ROP with 495 the given rounding mode RND. 496 497 -- Function: int mpc_set_ui (mpc_t ROP, unsigned long int OP, mpc_rnd_t 498 RND) 499 -- Function: int mpc_set_si (mpc_t ROP, long int OP, mpc_rnd_t RND) 500 -- Function: int mpc_set_uj (mpc_t ROP, uintmax_t OP, mpc_rnd_t RND) 501 -- Function: int mpc_set_sj (mpc_t ROP, intmax_t OP, mpc_rnd_t RND) 502 -- Function: int mpc_set_d (mpc_t ROP, double OP, mpc_rnd_t RND) 503 -- Function: int mpc_set_ld (mpc_t ROP, long double OP, mpc_rnd_t RND) 504 -- Function: int mpc_set_dc (mpc_t ROP, double _Complex OP, mpc_rnd_t 505 RND) 506 -- Function: int mpc_set_ldc (mpc_t ROP, long double _Complex OP, 507 mpc_rnd_t RND) 508 -- Function: int mpc_set_z (mpc_t ROP, const mpz_t OP mpc_rnd_t RND) 509 -- Function: int mpc_set_q (mpc_t ROP, const mpq_t OP mpc_rnd_t RND) 510 -- Function: int mpc_set_f (mpc_t ROP, const mpf_t OP mpc_rnd_t RND) 511 -- Function: int mpc_set_fr (mpc_t ROP, const mpfr_t OP, mpc_rnd_t RND) 512 Set the value of ROP from OP, rounded to the precision of ROP with 513 the given rounding mode RND. The argument OP is interpreted as 514 real, so the imaginary part of ROP is set to zero with a positive 515 sign. Please note that even a ���long int��� may have to be rounded, 516 if the destination precision is less than the machine word width. 517 For ���mpc_set_d���, be careful that the input number OP may not be 518 exactly representable as a double-precision number (this happens 519 for 0.1 for instance), in which case it is first rounded by the C 520 compiler to a double-precision number, and then only to a complex 521 number. 522 523 -- Function: int mpc_set_ui_ui (mpc_t ROP, unsigned long int OP1, 524 unsigned long int OP2, mpc_rnd_t RND) 525 -- Function: int mpc_set_si_si (mpc_t ROP, long int OP1, long int OP2, 526 mpc_rnd_t RND) 527 -- Function: int mpc_set_uj_uj (mpc_t ROP, uintmax_t OP1, uintmax_t 528 OP2, mpc_rnd_t RND) 529 -- Function: int mpc_set_sj_sj (mpc_t ROP, intmax_t OP1, intmax_t OP2, 530 mpc_rnd_t RND) 531 -- Function: int mpc_set_d_d (mpc_t ROP, double OP1, double OP2, 532 mpc_rnd_t RND) 533 -- Function: int mpc_set_ld_ld (mpc_t ROP, long double OP1, long double 534 OP2, mpc_rnd_t RND) 535 -- Function: int mpc_set_z_z (mpc_t ROP, const mpz_t OP1, const mpz_t 536 OP2, mpc_rnd_t RND) 537 -- Function: int mpc_set_q_q (mpc_t ROP, const mpq_t OP1, const mpq_t 538 OP2, mpc_rnd_t RND) 539 -- Function: int mpc_set_f_f (mpc_t ROP, const mpf_t OP1, const mpf_t 540 OP2, mpc_rnd_t RND) 541 -- Function: int mpc_set_fr_fr (mpc_t ROP, const mpfr_t OP1, const 542 mpfr_t OP2, mpc_rnd_t RND) 543 Set the real part of ROP from OP1, and its imaginary part from OP2, 544 according to the rounding mode RND. 545 546 Beware that the behaviour of ���mpc_set_fr_fr��� is undefined if OP1 or 547 OP2 is a pointer to the real or imaginary part of ROP. To exchange 548 the real and the imaginary part of a complex number, either use 549 ���mpfr_swap (mpc_realref (rop), mpc_imagref (rop))���, which also 550 exchanges the precisions of the two parts; or use a temporary 551 variable. 552 553 For functions assigning complex variables from strings or input 554streams, *note String and Stream Input and Output::. 555 556 -- Function: void mpc_set_nan (mpc_t ROP) 557 Set ROP to Nan+i*NaN. 558 559 -- Function: void mpc_swap (mpc_t OP1, mpc_t OP2) 560 Swap the values of OP1 and OP2 efficiently. Warning: The 561 precisions are exchanged, too; in case these are different, 562 ���mpc_swap��� is thus not equivalent to three ���mpc_set��� calls using a 563 third auxiliary variable. 564 565 566File: mpc.info, Node: Converting Complex Numbers, Next: String and Stream Input and Output, Prev: Assigning Complex Numbers, Up: Complex Functions 567 5685.3 Conversion Functions 569======================== 570 571The following functions are available only if ���<complex.h>��� is included 572_before_ ���mpc.h���. 573 574 -- Function: double _Complex mpc_get_dc (const mpc_t OP, mpc_rnd_t RND) 575 -- Function: long double _Complex mpc_get_ldc (mpc_t OP, mpc_rnd_t RND) 576 Convert OP to a C complex number, using the rounding mode RND. 577 578 For functions converting complex variables to strings or stream 579output, *note String and Stream Input and Output::. 580 581 582File: mpc.info, Node: String and Stream Input and Output, Next: Complex Comparison, Prev: Converting Complex Numbers, Up: Complex Functions 583 5845.4 String and Stream Input and Output 585====================================== 586 587 -- Function: int mpc_strtoc (mpc_t ROP, const char *NPTR, char 588 **ENDPTR, int BASE, mpc_rnd_t RND) 589 Read a complex number from a string NPTR in base BASE, rounded to 590 the precision of ROP with the given rounding mode RND. The BASE 591 must be either 0 or a number from 2 to 36 (otherwise the behaviour 592 is undefined). If NPTR starts with valid data, the result is 593 stored in ROP, the usual inexact value is returned (*note Return 594 Value: return-value.) and, if ENDPTR is not the null pointer, 595 *ENDPTR points to the character just after the valid data. 596 Otherwise, ROP is set to ���NaN + i * NaN���, -1 is returned and, if 597 ENDPTR is not the null pointer, the value of NPTR is stored in the 598 location referenced by ENDPTR. 599 600 The expected form of a complex number string is either a real 601 number (an optional leading whitespace, an optional sign followed 602 by a floating-point number), or a pair of real numbers in 603 parentheses separated by whitespace. If a real number is read, the 604 missing imaginary part is set to +0. The form of a floating-point 605 number depends on the base and is described in the documentation of 606 ���mpfr_strtofr��� (*note (mpfr.info)Assignment Functions::). For 607 instance, ���"3.1415926"���, ���"(1.25e+7 +.17)"���, ���"(@nan@ 2)"��� and 608 ���"(-0 -7)"��� are valid strings for BASE = 10. If BASE = 0, then a 609 prefix may be used to indicate the base in which the floating-point 610 number is written. Use prefix ���0b��� for binary numbers, prefix ���0x��� 611 for hexadecimal numbers, and no prefix for decimal numbers. The 612 real and imaginary part may then be written in different bases. 613 For instance, ���"(1.024e+3 +2.05e+3)"��� and ���"(0b1p+10 +0x802)"��� are 614 valid strings for ���base���=0 and represent the same value. 615 616 -- Function: int mpc_set_str (mpc_t ROP, const char *S, int BASE, 617 mpc_rnd_t rnd) 618 Set ROP to the value of the string S in base BASE, rounded to the 619 precision of ROP with the given rounding mode RND. See the 620 documentation of ���mpc_strtoc��� for a detailed description of the 621 valid string formats. Contrarily to ���mpc_strtoc���, ���mpc_set_str��� 622 requires the _whole_ string to represent a valid complex number 623 (potentially followed by additional white space). This function 624 returns the usual inexact value (*note Return Value: return-value.) 625 if the entire string up to the final null character is a valid 626 number in base BASE; otherwise it returns ���1, and ROP is set to 627 NaN+i*NaN. 628 629 -- Function: char * mpc_get_str (int B, size_t N, const mpc_t OP, 630 mpc_rnd_t RND) 631 Convert OP to a string containing its real and imaginary parts, 632 separated by a space and enclosed in a pair of parentheses. The 633 numbers are written in base B (which may vary from 2 to 36) and 634 rounded according to RND. The number of significant digits, at 635 least 2, is given by N. It is also possible to let N be zero, in 636 which case the number of digits is chosen large enough so that 637 re-reading the printed value with the same precision, assuming both 638 output and input use rounding to nearest, will recover the original 639 value of OP. Note that ���mpc_get_str��� uses the decimal point of the 640 current locale if available, and ���.��� otherwise. 641 642 The string is generated using the current memory allocation 643 function (���malloc��� by default, unless it has been modified using 644 the custom memory allocation interface of ���gmp���); once it is not 645 needed any more, it should be freed by calling ���mpc_free_str���. 646 647 -- Function: void mpc_free_str (char *STR) 648 Free the string STR, which needs to have been allocated by a call 649 to ���mpc_get_str���. 650 651 The following two functions read numbers from input streams and write 652them to output streams. When using any of these functions, you need to 653include ���stdio.h��� _before_ ���mpc.h���. 654 655 -- Function: int mpc_inp_str (mpc_t ROP, FILE *STREAM, size_t *READ, 656 int BASE, mpc_rnd_t RND) 657 Input a string in base BASE in the same format as for ���mpc_strtoc��� 658 from stdio stream STREAM, rounded according to RND, and put the 659 read complex number into ROP. If STREAM is the null pointer, ROP 660 is read from ���stdin���. Return the usual inexact value; if an error 661 occurs, set ROP to ���NaN + i * NaN��� and return -1. If READ is not 662 the null pointer, it is set to the number of read characters. 663 664 Unlike ���mpc_strtoc���, the function ���mpc_inp_str��� does not possess 665 perfect knowledge of the string to transform and has to read it 666 character by character, so it behaves slightly differently: It 667 tries to read a string describing a complex number and processes 668 this string through a call to ���mpc_set_str���. Precisely, after 669 skipping optional whitespace, a minimal string is read according to 670 the regular expression ���mpfr | '(' \s* mpfr \s+ mpfr \s* ')'���, 671 where ���\s��� denotes a whitespace, and ���mpfr��� is either a string 672 containing neither whitespaces nor parentheses, or 673 ���nan(n-char-sequence)��� or ���@nan@(n-char-sequence)��� (regardless of 674 capitalisation) with ���n-char-sequence��� a string of ascii letters, 675 digits or ���'_'���. 676 677 For instance, upon input of ���"nan(13 1)"���, the function 678 ���mpc_inp_str��� starts to recognise a value of NaN followed by an 679 n-char-sequence indicated by the opening parenthesis; as soon as 680 the space is reached, it becomes clear that the expression in 681 parentheses is not an n-char-sequence, and the error flag -1 is 682 returned after 6 characters have been consumed from the stream (the 683 whitespace itself remaining in the stream). The function 684 ���mpc_strtoc���, on the other hand, may track back when reaching the 685 whitespace; it treats the string as the two successive complex 686 numbers ���NaN + i * 0��� and ���13 + i���. It is thus recommended to have 687 a whitespace follow each floating point number to avoid this 688 problem. 689 690 -- Function: size_t mpc_out_str (FILE *STREAM, int BASE, size_t 691 N_DIGITS, const mpc_t OP, mpc_rnd_t RND) 692 Output OP on stdio stream STREAM in base BASE, rounded according to 693 RND, in the same format as for ���mpc_strtoc��� If STREAM is the null 694 pointer, ROP is written to ���stdout���. 695 696 Return the number of characters written. 697 698 699File: mpc.info, Node: Complex Comparison, Next: Projection & Decomposing, Prev: String and Stream Input and Output, Up: Complex Functions 700 7015.5 Comparison Functions 702======================== 703 704 -- Function: int mpc_cmp (const mpc_t OP1, const mpc_t OP2) 705 -- Function: int mpc_cmp_si_si (const mpc_t OP1, long int OP2R, long 706 int OP2I) 707 -- Macro: int mpc_cmp_si (mpc_t OP1, long int OP2) 708 709 Compare OP1 and OP2, where in the case of ���mpc_cmp_si_si���, OP2 is 710 taken to be OP2R + i OP2I. The return value C can be decomposed 711 into ���x = MPC_INEX_RE(c)��� and ���y = MPC_INEX_IM(c)���, such that X is 712 positive if the real part of OP1 is greater than that of OP2, zero 713 if both real parts are equal, and negative if the real part of OP1 714 is less than that of OP2, and likewise for Y. Both OP1 and OP2 are 715 considered to their full own precision, which may differ. It is 716 not allowed that one of the operands has a NaN (Not-a-Number) part. 717 718 The storage of the return value is such that equality can be simply 719 checked with ���mpc_cmp (op1, op2) == 0���. 720 721 -- Function: int mpc_cmp_abs (const mpc_t OP1, const mpc_t OP2) 722 723 Compare the absolute values of OP1 and OP2. The return value is 0 724 if both are the same (including infinity), positive if the absolute 725 value of OP1 is greater than that of OP2, and negative if it is 726 smaller. If OP1 or OP2 has a real or imaginary part which is NaN, 727 the function behaves like ���mpfr_cmp��� on two real numbers of which 728 at least one is NaN. 729 730 731File: mpc.info, Node: Projection & Decomposing, Next: Basic Arithmetic, Prev: Complex Comparison, Up: Complex Functions 732 7335.6 Projection and Decomposing Functions 734======================================== 735 736 -- Function: int mpc_real (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND) 737 Set ROP to the value of the real part of OP rounded in the 738 direction RND. 739 740 -- Function: int mpc_imag (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND) 741 Set ROP to the value of the imaginary part of OP rounded in the 742 direction RND. 743 744 -- Macro: mpfr_t mpc_realref (mpc_t OP) 745 -- Macro: mpfr_t mpc_imagref (mpc_t OP) 746 Return a reference to the real part and imaginary part of OP, 747 respectively. The ���mpfr��� functions can be used on the result of 748 these macros (note that the ���mpfr_t��� type is itself a pointer). 749 750 -- Function: int mpc_arg (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND) 751 Set ROP to the argument of OP, with a branch cut along the negative 752 real axis. 753 754 -- Function: int mpc_proj (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 755 Compute a projection of OP onto the Riemann sphere. Set ROP to OP 756 rounded in the direction RND, except when at least one part of OP 757 is infinite (even if the other part is a NaN) in which case the 758 real part of ROP is set to plus infinity and its imaginary part to 759 a signed zero with the same sign as the imaginary part of OP. 760 761 762File: mpc.info, Node: Basic Arithmetic, Next: Power Functions and Logarithm, Prev: Projection & Decomposing, Up: Complex Functions 763 7645.7 Basic Arithmetic Functions 765============================== 766 767All the following functions are designed in such a way that, when 768working with real numbers instead of complex numbers, their complexity 769should essentially be the same as with the GNU MPFR library, with only a 770marginal overhead due to the GNU MPC layer. 771 772 For functions taking as input an integer argument (for example 773���mpc_add_ui���), when this argument is zero, it is considered as an 774unsigned (that is, exact in this context) zero, and we follow the MPFR 775conventions: (0) + (+0) = +0, (0) - (+0) = -0, (0) - (+0) = -0, (0) - 776(-0) = +0. The same applies for functions taking an argument of type 777���mpfr_t���, such as ���mpc_add_fr���, of which the imaginary part is 778considered to be an exact, unsigned zero. 779 780 -- Function: int mpc_add (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 781 mpc_rnd_t RND) 782 -- Function: int mpc_add_ui (mpc_t ROP, const mpc_t OP1, unsigned long 783 int OP2, mpc_rnd_t RND) 784 -- Function: int mpc_add_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t 785 OP2, mpc_rnd_t RND) 786 Set ROP to OP1 + OP2 rounded according to RND. 787 788 -- Function: int mpc_sub (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 789 mpc_rnd_t RND) 790 -- Function: int mpc_sub_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t 791 OP2, mpc_rnd_t RND) 792 -- Function: int mpc_fr_sub (mpc_t ROP, const mpfr_t OP1, const mpc_t 793 OP2, mpc_rnd_t RND) 794 -- Function: int mpc_sub_ui (mpc_t ROP, const mpc_t OP1, unsigned long 795 int OP2, mpc_rnd_t RND) 796 -- Macro: int mpc_ui_sub (mpc_t ROP, unsigned long int OP1, const mpc_t 797 OP2, mpc_rnd_t RND) 798 -- Function: int mpc_ui_ui_sub (mpc_t ROP, unsigned long int RE1, 799 unsigned long int IM1, mpc_t OP2, mpc_rnd_t RND) 800 Set ROP to OP1 ��� OP2 rounded according to RND. For 801 ���mpc_ui_ui_sub���, OP1 is RE1 + IM1. 802 803 -- Function: int mpc_neg (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 804 Set ROP to ���OP rounded according to RND. Just changes the sign if 805 ROP and OP are the same variable. 806 807 -- Function: int mpc_sum (mpc_t ROP, const mpc_ptr* OP, unsigned long 808 N, mpc_rnd_t RND) 809 Set ROP to the sum of the elements in the array OP of length N, 810 rounded according to RND. 811 812 -- Function: int mpc_mul (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 813 mpc_rnd_t RND) 814 -- Function: int mpc_mul_ui (mpc_t ROP, const mpc_t OP1, unsigned long 815 int OP2, mpc_rnd_t RND) 816 -- Function: int mpc_mul_si (mpc_t ROP, const mpc_t OP1, long int OP2, 817 mpc_rnd_t RND) 818 -- Function: int mpc_mul_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t 819 OP2, mpc_rnd_t RND) 820 Set ROP to OP1 times OP2 rounded according to RND. Note: for 821 ���mpc_mul���, in case OP1 and OP2 have the same value, use ���mpc_sqr��� 822 for better efficiency. 823 824 -- Function: int mpc_mul_i (mpc_t ROP, const mpc_t OP, int SGN, 825 mpc_rnd_t RND) 826 Set ROP to OP times the imaginary unit i if SGN is non-negative, 827 set ROP to OP times -i otherwise, in both cases rounded according 828 to RND. 829 830 -- Function: int mpc_sqr (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 831 Set ROP to the square of OP rounded according to RND. 832 833 -- Function: int mpc_fma (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 834 const mpc_t OP3, mpc_rnd_t RND) 835 Set ROP to OP1*OP2+OP3, rounded according to RND, with only one 836 final rounding. 837 838 -- Function: int mpc_dot (mpc_t ROP, const mpc_ptr* OP1, mpc_ptr* OP2, 839 unsigned long N, mpc_rnd_t RND) 840 Set ROP to the dot product of the elements in the arrays OP1 and 841 OP2, both of length N, rounded according to RND. 842 843 -- Function: int mpc_div (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 844 mpc_rnd_t RND) 845 -- Function: int mpc_div_ui (mpc_t ROP, const mpc_t OP1, unsigned long 846 int OP2, mpc_rnd_t RND) 847 -- Function: int mpc_div_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t 848 OP2, mpc_rnd_t RND) 849 -- Function: int mpc_ui_div (mpc_t ROP, unsigned long int OP1, const 850 mpc_t OP2, mpc_rnd_t RND) 851 -- Function: int mpc_fr_div (mpc_t ROP, const mpfr_t OP1, const mpc_t 852 OP2, mpc_rnd_t RND) 853 Set ROP to OP1/OP2 rounded according to RND. 854 855 -- Function: int mpc_conj (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 856 Set ROP to the conjugate of OP rounded according to RND. Just 857 changes the sign of the imaginary part if ROP and OP are the same 858 variable. 859 860 -- Function: int mpc_abs (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND) 861 Set the floating-point number ROP to the absolute value of OP, 862 rounded in the direction RND. 863 864 -- Function: int mpc_norm (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND) 865 Set the floating-point number ROP to the norm of OP (i.e., the 866 square of its absolute value), rounded in the direction RND. 867 868 -- Function: int mpc_mul_2ui (mpc_t ROP, const mpc_t OP1, unsigned long 869 int OP2, mpc_rnd_t RND) 870 -- Function: int mpc_mul_2si (mpc_t ROP, const mpc_t OP1, long int OP2, 871 mpc_rnd_t RND) 872 Set ROP to OP1 times 2 raised to OP2 rounded according to RND. 873 Just modifies the exponents of the real and imaginary parts by OP2 874 when ROP and OP1 are identical. 875 876 -- Function: int mpc_div_2ui (mpc_t ROP, const mpc_t OP1, unsigned long 877 int OP2, mpc_rnd_t RND) 878 -- Function: int mpc_div_2si (mpc_t ROP, const mpc_t OP1, long int OP2, 879 mpc_rnd_t RND) 880 Set ROP to OP1 divided by 2 raised to OP2 rounded according to RND. 881 Just modifies the exponents of the real and imaginary parts by OP2 882 when ROP and OP1 are identical. 883 884 885File: mpc.info, Node: Power Functions and Logarithm, Next: Trigonometric Functions, Prev: Basic Arithmetic, Up: Complex Functions 886 8875.8 Power Functions and Logarithm 888================================= 889 890 -- Function: int mpc_sqrt (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 891 Set ROP to the square root of OP rounded according to RND. The 892 returned value ROP has a non-negative real part, and if its real 893 part is zero, a non-negative imaginary part. 894 895 -- Function: int mpc_pow (mpc_t ROP, const mpc_t OP1, const mpc_t OP2, 896 mpc_rnd_t RND) 897 -- Function: int mpc_pow_d (mpc_t ROP, const mpc_t OP1, double OP2, 898 mpc_rnd_t RND) 899 -- Function: int mpc_pow_ld (mpc_t ROP, const mpc_t OP1, long double 900 OP2, mpc_rnd_t RND) 901 -- Function: int mpc_pow_si (mpc_t ROP, const mpc_t OP1, long OP2, 902 mpc_rnd_t RND) 903 -- Function: int mpc_pow_ui (mpc_t ROP, const mpc_t OP1, unsigned long 904 OP2, mpc_rnd_t RND) 905 -- Function: int mpc_pow_z (mpc_t ROP, const mpc_t OP1, const mpz_t 906 OP2, mpc_rnd_t RND) 907 -- Function: int mpc_pow_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t 908 OP2, mpc_rnd_t RND) 909 Set ROP to OP1 raised to the power OP2, rounded according to RND. 910 For ���mpc_pow_d���, ���mpc_pow_ld���, ���mpc_pow_si���, ���mpc_pow_ui���, 911 ���mpc_pow_z��� and ���mpc_pow_fr���, the imaginary part of OP2 is 912 considered as +0. When both OP1 and OP2 are zero, the result has 913 real part 1, and imaginary part 0, with sign being the opposite of 914 that of OP2. 915 916 -- Function: int mpc_exp (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 917 Set ROP to the exponential of OP, rounded according to RND with the 918 precision of ROP. 919 920 -- Function: int mpc_log (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 921 -- Function: int mpc_log10 (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 922 Set ROP to the natural and base-10 logarithm of OP respectively, 923 rounded according to RND with the precision of ROP. The principal 924 branch is chosen, with the branch cut on the negative real axis, so 925 that the imaginary part of the result lies in ]-Pi , Pi] and 926 ]-Pi/log(10) , Pi/log(10)] respectively. 927 928 -- Function: int mpc_rootofunity (mpc_t ROP, unsigned long int N, 929 unsigned long int K, mpc_rnd_t RND) 930 Set ROP to the standard primitive N-th root of unity raised to the 931 power K, that is, exp (2 Pi i k / n), rounded according to RND with 932 the precision of ROP. 933 934 -- Function: int mpc_agm (mpc_t ROP, const mpc_t A, const mpc_t B, 935 mpc_rnd_t RND) 936 Set ROP to the arithmetic-geometric mean (AGM) of A and B, rounded 937 according to RND with the precision of ROP. Concerning the branch 938 cut, the function is computed by homogeneity either as A AGM(1,b0) 939 with b0=B/A if |A|>=|B|, or as B AGM(1,b0) with b0=A/B otherwise; 940 then when b0 is real and negative, AGM(1,b0) is chosen to have 941 positive imaginary part. 942 943 944File: mpc.info, Node: Trigonometric Functions, Next: Modular Functions, Prev: Power Functions and Logarithm, Up: Complex Functions 945 9465.9 Trigonometric Functions 947=========================== 948 949 -- Function: int mpc_sin (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 950 -- Function: int mpc_cos (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 951 -- Function: int mpc_tan (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 952 Set ROP to the sine, cosine, tangent of OP, rounded according to 953 RND with the precision of ROP. 954 955 -- Function: int mpc_sin_cos (mpc_t ROP_SIN, mpc_t ROP_COS, const mpc_t 956 OP, mpc_rnd_t RND_SIN, mpc_rnd_t RND_COS) 957 Set ROP_SIN to the sine of OP, rounded according to RND_SIN with 958 the precision of ROP_SIN, and ROP_COS to the cosine of OP, rounded 959 according to RND_COS with the precision of ROP_COS. 960 961 -- Function: int mpc_sinh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 962 -- Function: int mpc_cosh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 963 -- Function: int mpc_tanh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 964 Set ROP to the hyperbolic sine, hyperbolic cosine, hyperbolic 965 tangent of OP, rounded according to RND with the precision of ROP. 966 967 -- Function: int mpc_asin (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 968 -- Function: int mpc_acos (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 969 -- Function: int mpc_atan (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 970 Set ROP to the inverse sine, inverse cosine, inverse tangent of OP, 971 rounded according to RND with the precision of ROP. 972 973 -- Function: int mpc_asinh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 974 -- Function: int mpc_acosh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 975 -- Function: int mpc_atanh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND) 976 Set ROP to the inverse hyperbolic sine, inverse hyperbolic cosine, 977 inverse hyperbolic tangent of OP, rounded according to RND with the 978 precision of ROP. The branch cut of ���mpc_acosh��� is (-Inf, 1) 979 980 981File: mpc.info, Node: Modular Functions, Next: Miscellaneous Complex Functions, Prev: Trigonometric Functions, Up: Complex Functions 982 9835.10 Modular Functions 984====================== 985 986The following function is experimental, not least because it depends on 987the equally experimental ball arithmetic, see *note Ball Arithmetic::. 988So its prototype may change in future releases, and it may be removed 989altogether. 990 991 -- Function: int mpc_eta_fund (mpc_t ROP, const mpc_t OP, mpc_rnd_t 992 RND) 993 Assuming that the argument OP lies in the fundamental domain for 994 Sl_2(Z), that is, it has real part not below -1/2 and not above 995 +1/2 and absolute value at least 1, return the value of the 996 Dedekind eta-function in ROP. For arguments outside the 997 fundamental domain the function is expected to loop indefinitely. 998 999 1000File: mpc.info, Node: Miscellaneous Complex Functions, Next: Advanced Functions, Prev: Modular Functions, Up: Complex Functions 1001 10025.11 Miscellaneous Functions 1003============================ 1004 1005 -- Function: int mpc_urandom (mpc_t ROP, gmp_randstate_t STATE) 1006 Generate a uniformly distributed random complex in the unit square 1007 [0, 1] x [0, 1]. Return 0, unless an exponent in the real or 1008 imaginary part is not in the current exponent range, in which case 1009 that part is set to NaN and a zero value is returned. The second 1010 argument is a ���gmp_randstate_t��� structure which should be created 1011 using the GMP ���rand_init��� function, see the GMP manual. 1012 1013 -- Function: const char * mpc_get_version (void) 1014 Return the GNU MPC version, as a null-terminated string. 1015 1016 -- Macro: MPC_VERSION 1017 -- Macro: MPC_VERSION_MAJOR 1018 -- Macro: MPC_VERSION_MINOR 1019 -- Macro: MPC_VERSION_PATCHLEVEL 1020 -- Macro: MPC_VERSION_STRING 1021 ���MPC_VERSION��� is the version of GNU MPC as a preprocessing 1022 constant. ���MPC_VERSION_MAJOR���, ���MPC_VERSION_MINOR��� and 1023 ���MPC_VERSION_PATCHLEVEL��� are respectively the major, minor and 1024 patch level of GNU MPC version, as preprocessing constants. 1025 ���MPC_VERSION_STRING��� is the version as a string constant, which can 1026 be compared to the result of ���mpc_get_version��� to check at run time 1027 the header file and library used match: 1028 if (strcmp (mpc_get_version (), MPC_VERSION_STRING)) 1029 fprintf (stderr, "Warning: header and library do not match\n"); 1030 Note: Obtaining different strings is not necessarily an error, as 1031 in general, a program compiled with some old GNU MPC version can be 1032 dynamically linked with a newer GNU MPC library version (if allowed 1033 by the library versioning system). 1034 1035 -- Macro: long MPC_VERSION_NUM (MAJOR, MINOR, PATCHLEVEL) 1036 Create an integer in the same format as used by ���MPC_VERSION��� from 1037 the given MAJOR, MINOR and PATCHLEVEL. Here is an example of how 1038 to check the GNU MPC version at compile time: 1039 #if (!defined(MPC_VERSION) || (MPC_VERSION<MPC_VERSION_NUM(2,1,0))) 1040 # error "Wrong GNU MPC version." 1041 #endif 1042 1043 1044File: mpc.info, Node: Advanced Functions, Next: Internals, Prev: Miscellaneous Complex Functions, Up: Complex Functions 1045 10465.12 Advanced Functions 1047======================= 1048 1049 -- Macro: MPC_SET_X_Y (REAL_SUFFIX, IMAG_SUFFIX, ROP, REAL, IMAG, RND) 1050 The macro MPC_SET_X_Y is designed to serve as the body of an 1051 assignment function and cannot be used by itself. The REAL_SUFFIX 1052 and IMAG_SUFFIX parameters are the types of the real and imaginary 1053 part, that is, the ���x��� in the ���mpfr_set_x��� function one would use 1054 to set the part; for the mpfr type, use ���fr���. REAL (respectively 1055 IMAG) is the value you want to assign to the real (resp. 1056 imaginary) part, its type must conform to REAL_SUFFIX (resp. 1057 IMAG_SUFFIX). RND is the ���mpc_rnd_t��� rounding mode. The return 1058 value is the usual inexact value (*note Return Value: 1059 return-value.). 1060 1061 For instance, you can define mpc_set_ui_fr as follows: 1062 int mpc_set_ui_fr (mpc_t rop, unsigned long int re, mpfr_t im, mpc_rnd_t rnd) 1063 MPC_SET_X_Y (ui, fr, rop, re, im, rnd); 1064 1065 1066File: mpc.info, Node: Internals, Prev: Advanced Functions, Up: Complex Functions 1067 10685.13 Internals 1069============== 1070 1071These macros and functions are mainly designed for the implementation of 1072GNU MPC, but may be useful for users too. However, no upward 1073compatibility is guaranteed. You need to include ���mpc-impl.h��� to use 1074them. 1075 1076 The macro ���MPC_MAX_PREC(z)��� gives the maximum of the precisions of 1077the real and imaginary parts of a complex number. 1078 1079 1080File: mpc.info, Node: Ball Arithmetic, Next: References, Prev: Complex Functions, Up: Top 1081 10826 Ball Arithmetic 1083***************** 1084 1085Since release 1.3.0, GNU MPC contains a simple and very limited 1086implementation of complex balls (or rather, circles). This part is 1087experimental, its interface may vary and it may be removed completely in 1088future releases. 1089 1090 A complex ball of the new type ���mpcb_t��� is defined by a non-zero 1091centre c of the type ���mpc_t��� and a relative radius r of the new type 1092���mpcr_t���, and it represents all complex numbers z = c (1 + ��) with |��| ��� 1093r, or equivalently the closed circle with centre c and radius r |c|. 1094The approach of using a relative error (or radius) instead of an 1095absolute one simplifies error analyses for multiplicative operations 1096(multiplication, division, square roots, and the AGM), at the expense of 1097making them more complicated for additive operations. It has the major 1098drawback of not being able to represent balls centred at 0; in floating 1099point arithmetic, however, 0 is never reached by rounding, but only 1100through operations with exact result, which could be handled at a 1101higher, application level. For more discussion on these issues, see the 1102file ���algorithms.tex���. 1103 11046.1 Radius type and functions 1105============================= 1106 1107The radius type is defined by 1108struct { 1109 int64_t mant; 1110 int64_t exp; 1111} 1112 with the usual trick in the GNU multiprecision libraries of defining 1113the main type ���mpcr_t��� as a 1-dimensional array of this struct, and 1114variable and constant pointers ���mpcr_ptr��� and ���mpcr_srcptr���. It can 1115contain the special values infinity or zero, or floating point numbers 1116encoded as m���2^{e} for a positive mantissa m and an arbitrary (usually 1117negative) exponent e. Normalised finite radii use 31 bits for the 1118mantissa, that is, 2^{30}���m���2^{31} - 1. The special values infinity and 11190 are encoded through the sign of m, but should be tested for and set 1120using dedicated functions. 1121 1122 Unless indicated otherwise, the following functions assume radius 1123arguments to be normalised, they return normalised results, and they 1124round their results up, not necessarily to the smallest representable 1125number, although reasonable effort is made to get a tight upper bound: 1126They only guarantee that their outputs are an upper bound on the true 1127results. (There may be a trade-off between tightness of the result and 1128speed of computation. For instance, when a 32-bit mantissa is 1129normalised, an even mantissa should be divided by 2, an odd mantissa 1130should be divided by 2 and 1 should be added, and then in both cases the 1131exponent must be increased by 1. It might be more efficient to add 1 1132all the time instead of testing the last bit of the mantissa.) 1133 1134 -- Function: int mpcr_inf_p (mpcr_srcptr R) 1135 -- Function: int mpcr_zero_p (mpcr_srcptr R) 1136 Test whether R is infinity or zero, respectively, and return a 1137 boolean. 1138 1139 -- Function: int mpcr_lt_half_p (mpcr_srcptr R) 1140 Return ���true��� if R<1/2, and ���false��� otherwise. (Everywhere in this 1141 document, ���true��� means any non-zero value, and ���false��� means zero.) 1142 1143 -- Function: int mpcr_cmp (mpcr_srcptr R, mpcr_srcptr S) 1144 Return +1, 0 or -1 depending on whether R is larger than, equal to 1145 or less than S, with the natural total order on the compactified 1146 non-negative real axis letting 0 be smaller and letting infinity be 1147 larger than any finite real number. 1148 1149 -- Function: void mpcr_set_inf (mpcr_ptr R) 1150 -- Function: void mpcr_set_zero (mpcr_ptr R) 1151 -- Function: void mpcr_set_one (mpcr_ptr R) 1152 -- Function: void mpcr_set (mpcr_ptr R, mpcr_srcptr S) 1153 -- Function: void mpcr_set_ui64_2si64 (mpcr_ptr R, uint64_t MANT, 1154 int64_t EXP) 1155 Set R to infinity, zero, 1, S or MANT���2^{EXP}, respectively. 1156 1157 -- Function: void mpcr_max (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr T) 1158 Set R to the maximum of S and T. 1159 1160 -- Function: int64_t mpcr_get_exp (mpcr_srcptr R) 1161 Assuming that R is neither infinity nor 0, return its exponent e 1162 when writing r = m���2^{e} with 1/2 ��� m < 1. (Notice that this is 1163 _not_ the same as the field ���exp��� in the struct representing a 1164 radius, but that instead it is independent of the implementation.) 1165 Otherwise the behaviour is undefined. 1166 1167 -- Function: void mpcr_out_str (FILE *F, mpcr_srcptr R) 1168 Output R on F, which may be ���stdout���. Caveat: This function so far 1169 serves mainly for debugging purposes, its behaviour will probably 1170 change in the future. 1171 1172 -- Function: void mpcr_add (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr T) 1173 -- Function: void mpcr_sub (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr T) 1174 -- Function: void mpcr_mul (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr T) 1175 -- Function: void mpcr_div (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr T) 1176 -- Function: void mpcr_mul_2ui (mpcr_ptr R, mpcr_srcptr S, unsigned 1177 long int T) 1178 -- Function: void mpcr_div_2ui (mpcr_ptr R, mpcr_srcptr S, unsigned 1179 long int T) 1180 -- Function: void mpcr_sqr (mpcr_ptr R, mpcr_srcptr S) 1181 -- Function: void mpcr_sqrt (mpcr_ptr R, mpcr_srcptr S) 1182 Set R to the sum, difference, product or quotient of S and T, or to 1183 the product of S by 2^{T} or to the quotient of S by 2^{T}, or to 1184 the square or the square root of S. If any of the arguments is 1185 infinity, or if a difference is negative, the result is infinity. 1186 1187 -- Function: void mpcr_sub_rnd (mpcr_ptr R, mpcr_srcptr S, mpcr_srcptr 1188 T, mpfr_rnd_t RND) 1189 Set R to the difference of S and T, rounded into direction RND, 1190 which can be one of ���MPFR_RNDU��� or ���MPFR_RNDD���. If one of the 1191 arguments is infinity or the difference is negative, the result is 1192 infinity. Calling the function with ���MPFR_RNDU��� is equivalent to 1193 calling ���mpcr_sub���. 1194 1195 This is one out of several functions taking a rounding parameter. 1196 Rounding down may be useful to obtain an upper bound when dividing 1197 by the result. 1198 1199 -- Function: void mpcr_c_abs_rnd (mpcr_ptr R, mpc_srcptr Z, mpfr_rnd_t 1200 RND) 1201 Set R to the absolute value of the complex number Z, rounded in 1202 direction RND, which may be one of ���MPFR_RNDU��� or ���MPFR_RNDD���. 1203 1204 -- Function: void mpcr_add_rounding_error (mpcr_ptr R, mpfr_prec_t P, 1205 mpfr_rnd_t RND) 1206 Set R to r + (1 + r) 2^{-p} if RND equals ���MPFR_RNDN���, and to r + 1207 (1 + r) 2^{1-p} otherwise. The idea is that if a (potentially not 1208 representable) centre of an ideal complex ball of radius R is 1209 rounded to a representable complex number at precision P, this 1210 shifts the centre by up to 1/2 ulp (for rounding to nearest) or 1 1211 ulp (for directed rounding of at least one of the real or imaginary 1212 parts), which increases the radius accordingly. So this function 1213 is typically called internally at the end of each operation with 1214 complex balls to account for the error made by rounding the centre. 1215 12166.2 Ball type and functions 1217=========================== 1218 1219The ball type is defined by 1220typedef struct { 1221 mpc_t c; 1222 mpcr_t r; 1223} 1224 or, more precisely, ���mpcb_t��� is again a 1-dimensional array of such a 1225struct, and variable and constant pointer types are defined as 1226���mpcb_ptr��� and ���mpcb_srcptr���, respectively. As usual, the components 1227should only be accessed through corresponding functions. 1228 1229 To understand functions on balls, one needs to consider the balls 1230passed as arguments as sets of complex values, to which a mathematical 1231function is applied; the C function ���rounds up��� in the sense that it 1232returns a ball containing all possible values of the function in all the 1233possible input values. Reasonable effort is made to return small balls, 1234but again there is no guarantee that the result is the smallest possible 1235one. In the current implementation, the centre of a ball returned as a 1236value is obtained by applying the function to the centres of the balls 1237passed as arguments, and rounding. While this is a natural approach, it 1238is not the only possible one; however, it also simplifies the error 1239analysis as already carried out for functions with regular complex 1240arguments. Whenever the centre of a complex ball has a non-finite real 1241or imaginary part (positive or negative infinity or NaN) the radius is 1242set to infinity; this can be interpreted as the ���useless ball���, 1243representing the whole complex plane, whatever the value of the centre 1244is. 1245 1246 Unlike for variables of ���mpc_t��� type, where the precision needs to be 1247set explicitly at initialisation, variables of type ���mpcb_t��� handle 1248their precision dynamically. Ball centres always have the same 1249precision for their real and their imaginary parts (again this is a 1250choice of the implementation; if they are of very different sizes, one 1251could theoretically reduce the precision of the part that is smaller in 1252absolute value, which is more strongly affected by the common error 1253coded in the radius). When setting a complex ball from a value of a 1254different type, an additional precision parameter is passed, which 1255determines the precision of the centre. Functions on complex balls set 1256the precision of their result depending on the input. In the current 1257implementation, this is the minimum of the argument precisions, so if 1258all balls are initially set to the same precision, this is preserved 1259throughout the computations. (Notice that the exponent of the radius 1260encodes roughly the number of correct binary digits of the ball centre; 1261so it would also make sense to reduce the precision if the radius 1262becomes larger.) 1263 1264 The following functions on complex balls are currently available; the 1265eclectic collection is motivated by the desire to provide an 1266implementation of the arithmetic-geometric mean of complex numbers 1267through the use of ball arithmetic. As for functions taking complex 1268arguments, there may be arbitrary overlaps between variables 1269representing arguments and results; for instance ���mpcb_mul (z, z, z)��� is 1270an allowed way of replacing the ball Z by its square. 1271 1272 -- Function: void mpcb_init (mpcb_ptr Z) 1273 -- Function: void mpcb_clear (mpcb_ptr Z) 1274 Initialise or free memory for Z; ���mpcb_init��� must be called once 1275 before using a variable, and ���mpcb_clear��� must be called once 1276 before stopping to use a variable. Unlike its ���mpc_t��� counterpart, 1277 ���mpcb_init��� does not fix the precision of Z, but it sets its radius 1278 to infinity, so that Z represents the whole complex plane. 1279 1280 -- Function: mpfr_prec_t mpcb_get_prec (mpcb_srcptr Z) 1281 Return the (common) precision of the real and the complex parts of 1282 the centre of Z. 1283 1284 -- Function: void mpcb_set (mpcb_ptr Z, mpcb_srcptr Z1) 1285 Set Z to Z1, preserving the precision of the centre. 1286 1287 -- Function: void mpcb_set_inf (mpcb_ptr Z) 1288 Set Z to the whole complex plane. This is intended to be used much 1289 in the spirit of an assertion: When a precondition is not satisfied 1290 inside a function, it can set its result to this value, which will 1291 propagate through further computations. 1292 1293 -- Function: void mpcb_set_c (mpcb_ptr Z, mpc_srcptr C, mpfr_prec_t 1294 PREC, unsigned long int ERR_RE, unsigned long int ERR_IM) 1295 Set Z to a ball with centre C at precision PREC. If PREC is at 1296 least the maximum of the precisions of the real and the imaginary 1297 parts of C and ERR_RE and ERR_IM are 0, then the resulting ball is 1298 exact with radius zero. Using a larger value for PREC makes sense 1299 if C is considered exact and a larger target precision for the 1300 result is desired, or some leeway for the working precision is to 1301 be taken into account. If PREC is less than the precision of C, 1302 then usually some rounding error occurs when setting the centre, 1303 which is taken into account in the radius. 1304 1305 If ERR_RE and ERR_IM are non-zero, the argument C is considered as 1306 an inexact complex number, with a bound on the absolute error of 1307 its real part given in ERR_RE as a multiple of 1/2 ulp of the real 1308 part of C, and a bound on the absolute error of its imaginary part 1309 given in ERR_IM as a multiple of 1/2 ulp of the imaginary part of 1310 C. (Notice that if the parts of C have different precisions or 1311 exponents, the absolute values of their ulp differ.) Then Z is 1312 created as a ball with centre C and a radius taking these errors on 1313 C as well as the potential additional rounding error for the centre 1314 into account. If the real part of C is 0, then ERR_RE must be 0, 1315 since ulp of 0 makes no sense; otherwise the radius is set to 1316 infinity. The same remark holds for the imaginary part. 1317 1318 Using ERR_RE and ERR_IM different from 0 is particularly useful in 1319 two settings: If C is itself the result of a call to an ���mpc_��� 1320 function with exact input and rounding mode ���MPC_RNDNN��� of both 1321 parts to nearest, then its parts are known with errors of at most 1322 1/2 ulp, and setting ERR_RE and ERR_IM to 1 yields a ball which is 1323 known to contain the exact result (this motivates the strange unit 1324 of 1/2 ulp); if directed rounding was used, ERR_RE and ERR_IM can 1325 be set to 2 instead. 1326 1327 And if C is the result of a sequence of calls to ���mpc_��� functions 1328 for which some error analysis has been carried out (as is 1329 frequently the case internally when implementing complex 1330 functions), again the resulting ball Z is known to contain the 1331 exact result when using appropriate values for ERR_RE and ERR_IM. 1332 1333 -- Function: void mpcb_set_ui_ui (mpcb_ptr Z, unsigned long int RE, 1334 unsigned long int IM, mpfr_prec_t PREC) 1335 Set Z to a ball with centre RE+I*IM at precision PREC or the size 1336 of an ���unsigned long int���, whatever is larger. 1337 1338 -- Function: void mpcb_neg (mpcb_ptr Z, mpcb_srcptr Z1) 1339 -- Function: void mpcb_add (mpcb_ptr Z, mpcb_srcptr Z1, mpcb_srcptr Z2) 1340 -- Function: void mpcb_mul (mpcb_ptr Z, mpcb_srcptr Z1, mpcb_srcptr Z2) 1341 -- Function: void mpcb_sqr (mpcb_ptr Z, mpcb_srcptr Z1) 1342 -- Function: void mpcb_pow_ui (mpcb_ptr Z, mpcb_srcptr Z1, unsigned 1343 long int E) 1344 -- Function: void mpcb_sqrt (mpcb_ptr Z, mpcb_srcptr Z1) 1345 -- Function: void mpcb_div (mpcb_ptr Z, mpcb_srcptr Z1, mpcb_srcptr Z2) 1346 -- Function: void mpcb_div_2ui (mpcb_ptr Z, mpcb_srcptr Z1, unsigned 1347 long int E) 1348 These are the exact counterparts of the corresponding functions 1349 ���mpc_neg���, ���mpc_add��� and so on, but on complex balls instead of 1350 complex numbers. 1351 1352 -- Function: int mpcb_can_round (mpcb_srcptr Z, mpfr_prec_t PREC_RE, 1353 mpfr_prec_t PREC_IM, mpc_rnd_t RND) 1354 If the function returns ���true��� (a non-zero number), then rounding 1355 any of the complex numbers in the ball to a complex number with 1356 precision PREC_RE of its real and precision PREC_IM of its 1357 imaginary part and rounding mode RND yields the same result and 1358 rounding direction value, cf. *note return-value::. If the 1359 function returns ���false��� (that is, 0), then it could not conclude, 1360 or there are two numbers in the ball which would be rounded to a 1361 different complex number or in a different direction. Notice that 1362 the function works in a best effort mode and errs on the side of 1363 caution by potentially returning ���false��� on a roundable ball; this 1364 is consistent with computational functions not necessarily 1365 returning the smallest enclosing ball. 1366 1367 If Z contains the result of evaluating some mathematical function 1368 through a sequence of calls to ���mpcb��� functions, starting with 1369 exact complex numbers, that is, balls of radius 0, then a return 1370 value of ���true��� indicates that rounding any value in the ball (its 1371 centre is readily available) in direction RND yields the correct 1372 result of the function and the correct rounding direction value 1373 with the usual MPC semantics. 1374 1375 Notice that when the precision of Z is larger than PREC_RE or 1376 PREC_IM, the centre need not be representable at the desired 1377 precision, and in fact the ball need not contain a representable 1378 number at all to be ���roundable���. Even worse, when RND is a 1379 directed rounding mode for the real or the imaginary part and the 1380 ball of non-zero radius contains a representable number, the return 1381 value is necessarily ���false���. Even worse, when the rounding mode 1382 for one part is to nearest, the corresponding part of the centre of 1383 the ball is representable and the ball has a non-zero radius, then 1384 the return value is also necessarily ���false���, since even if 1385 rounding may be possible, the rounding direction value cannot be 1386 determined. 1387 1388 -- Function: int mpcb_round (mpc_ptr C, mpcb_srcptr Z, mpc_rnd_t RND) 1389 Set C to the centre of Z, rounded in direction RND, and return the 1390 corresponding rounding direction value. If ���mpcb_can_round���, 1391 called with Z, the precisions of C and the rounding mode RND 1392 returns ���true���, then this function does what is expected, it 1393 ���correctly rounds the ball��� and returns a rounding direction value 1394 that is valid for all of the ball. As explained above, the result 1395 is then not necessarily (in the presence of directed rounding with 1396 radius different from 0, it is rather necessarily not) an element 1397 of the ball. 1398 1399 1400File: mpc.info, Node: References, Next: Concept Index, Prev: Ball Arithmetic, Up: Top 1401 1402References 1403********** 1404 1405 ��� Torbj��rn Granlund et al. ���GMP��� ��� GNU multiprecision library. 1406 Version 6.2.0, <http://gmplib.org>. 1407 1408 ��� Guillaume Hanrot, Vincent Lef��vre, Patrick P��lissier, Paul 1409 Zimmermann et al. ���MPFR��� ��� A library for multiple-precision 1410 floating-point computations with exact rounding. Version 4.1.0, 1411 <http://www.mpfr.org>. 1412 1413 ��� IEEE Standard for Floating-Point Arithmetic, IEEE Computer Society, 1414 IEEE Std 754-2019, Approved 13 June 2019, 84 pages. 1415 1416 ��� Donald E. Knuth, "The Art of Computer Programming", vol 2, 1417 "Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981. 1418 1419 ��� ISO/IEC 9899:1999, Programming languages ��� C. 1420 1421 1422File: mpc.info, Node: Concept Index, Next: Function Index, Prev: References, Up: Top 1423 1424Concept Index 1425************* 1426 1427[index] 1428* Menu: 1429 1430* Arithmetic functions: Basic Arithmetic. (line 6) 1431* Ball arithmetic: Ball Arithmetic. (line 6) 1432* Comparison functions: Complex Comparison. (line 6) 1433* Complex arithmetic functions: Basic Arithmetic. (line 6) 1434* Complex assignment functions: Assigning Complex Numbers. 1435 (line 6) 1436* Complex comparisons functions: Complex Comparison. (line 6) 1437* Complex functions: Complex Functions. (line 6) 1438* Complex number: GNU MPC Basics. (line 15) 1439* Conditions for copying GNU MPC: Copying. (line 6) 1440* Conversion functions: Converting Complex Numbers. 1441 (line 6) 1442* Copying conditions: Copying. (line 6) 1443* Installation: Installing GNU MPC. (line 6) 1444* Logarithm: Power Functions and Logarithm. 1445 (line 6) 1446* Miscellaneous complex functions: Miscellaneous Complex Functions. 1447 (line 6) 1448* Modular functions: Modular Functions. (line 6) 1449* mpc.h: GNU MPC Basics. (line 6) 1450* Power functions: Power Functions and Logarithm. 1451 (line 6) 1452* Precision: GNU MPC Basics. (line 19) 1453* Projection and Decomposing Functions: Projection & Decomposing. 1454 (line 6) 1455* Reporting bugs: Reporting Bugs. (line 6) 1456* Rounding Mode: GNU MPC Basics. (line 24) 1457* String and stream input and output: String and Stream Input and Output. 1458 (line 6) 1459* Trigonometric functions: Trigonometric Functions. 1460 (line 6) 1461* User-defined precision: Complex Functions. (line 12) 1462 1463 1464File: mpc.info, Node: Function Index, Next: Type Index, Prev: Concept Index, Up: Top 1465 1466Function Index 1467************** 1468 1469[index] 1470* Menu: 1471 1472* _Complex: Converting Complex Numbers. 1473 (line 9) 1474* mpcb_add: Ball Arithmetic. (line 260) 1475* mpcb_can_round: Ball Arithmetic. (line 273) 1476* mpcb_clear: Ball Arithmetic. (line 194) 1477* mpcb_div: Ball Arithmetic. (line 266) 1478* mpcb_div_2ui: Ball Arithmetic. (line 267) 1479* mpcb_get_prec: Ball Arithmetic. (line 201) 1480* mpcb_init: Ball Arithmetic. (line 193) 1481* mpcb_mul: Ball Arithmetic. (line 261) 1482* mpcb_neg: Ball Arithmetic. (line 259) 1483* mpcb_pow_ui: Ball Arithmetic. (line 263) 1484* mpcb_round: Ball Arithmetic. (line 309) 1485* mpcb_set: Ball Arithmetic. (line 205) 1486* mpcb_set_c: Ball Arithmetic. (line 214) 1487* mpcb_set_inf: Ball Arithmetic. (line 208) 1488* mpcb_set_ui_ui: Ball Arithmetic. (line 254) 1489* mpcb_sqr: Ball Arithmetic. (line 262) 1490* mpcb_sqrt: Ball Arithmetic. (line 265) 1491* mpcr_add: Ball Arithmetic. (line 93) 1492* mpcr_add_rounding_error: Ball Arithmetic. (line 125) 1493* mpcr_cmp: Ball Arithmetic. (line 64) 1494* mpcr_c_abs_rnd: Ball Arithmetic. (line 120) 1495* mpcr_div: Ball Arithmetic. (line 96) 1496* mpcr_div_2ui: Ball Arithmetic. (line 99) 1497* mpcr_get_exp: Ball Arithmetic. (line 81) 1498* mpcr_inf_p: Ball Arithmetic. (line 55) 1499* mpcr_lt_half_p: Ball Arithmetic. (line 60) 1500* mpcr_max: Ball Arithmetic. (line 78) 1501* mpcr_mul: Ball Arithmetic. (line 95) 1502* mpcr_mul_2ui: Ball Arithmetic. (line 97) 1503* mpcr_out_str: Ball Arithmetic. (line 88) 1504* mpcr_set: Ball Arithmetic. (line 73) 1505* mpcr_set_inf: Ball Arithmetic. (line 70) 1506* mpcr_set_one: Ball Arithmetic. (line 72) 1507* mpcr_set_ui64_2si64: Ball Arithmetic. (line 74) 1508* mpcr_set_zero: Ball Arithmetic. (line 71) 1509* mpcr_sqr: Ball Arithmetic. (line 101) 1510* mpcr_sqrt: Ball Arithmetic. (line 102) 1511* mpcr_sub: Ball Arithmetic. (line 94) 1512* mpcr_sub_rnd: Ball Arithmetic. (line 108) 1513* mpcr_zero_p: Ball Arithmetic. (line 56) 1514* mpc_abs: Basic Arithmetic. (line 99) 1515* mpc_acos: Trigonometric Functions. 1516 (line 25) 1517* mpc_acosh: Trigonometric Functions. 1518 (line 31) 1519* mpc_add: Basic Arithmetic. (line 19) 1520* mpc_add_fr: Basic Arithmetic. (line 23) 1521* mpc_add_ui: Basic Arithmetic. (line 21) 1522* mpc_agm: Power Functions and Logarithm. 1523 (line 50) 1524* mpc_arg: Projection & Decomposing. 1525 (line 20) 1526* mpc_asin: Trigonometric Functions. 1527 (line 24) 1528* mpc_asinh: Trigonometric Functions. 1529 (line 30) 1530* mpc_atan: Trigonometric Functions. 1531 (line 26) 1532* mpc_atanh: Trigonometric Functions. 1533 (line 32) 1534* mpc_clear: Initializing Complex Numbers. 1535 (line 21) 1536* mpc_cmp: Complex Comparison. (line 6) 1537* mpc_cmp_abs: Complex Comparison. (line 23) 1538* mpc_cmp_si: Complex Comparison. (line 9) 1539* mpc_cmp_si_si: Complex Comparison. (line 7) 1540* mpc_conj: Basic Arithmetic. (line 94) 1541* mpc_cos: Trigonometric Functions. 1542 (line 7) 1543* mpc_cosh: Trigonometric Functions. 1544 (line 19) 1545* mpc_div: Basic Arithmetic. (line 82) 1546* mpc_div_2si: Basic Arithmetic. (line 117) 1547* mpc_div_2ui: Basic Arithmetic. (line 115) 1548* mpc_div_fr: Basic Arithmetic. (line 86) 1549* mpc_div_ui: Basic Arithmetic. (line 84) 1550* mpc_dot: Basic Arithmetic. (line 77) 1551* mpc_eta_fund: Modular Functions. (line 11) 1552* mpc_exp: Power Functions and Logarithm. 1553 (line 32) 1554* mpc_fma: Basic Arithmetic. (line 72) 1555* mpc_free_str: String and Stream Input and Output. 1556 (line 66) 1557* mpc_fr_div: Basic Arithmetic. (line 90) 1558* mpc_fr_sub: Basic Arithmetic. (line 31) 1559* mpc_get_ldc: Converting Complex Numbers. 1560 (line 10) 1561* mpc_get_prec: Initializing Complex Numbers. 1562 (line 49) 1563* mpc_get_prec2: Initializing Complex Numbers. 1564 (line 53) 1565* mpc_get_str: String and Stream Input and Output. 1566 (line 48) 1567* mpc_get_version: Miscellaneous Complex Functions. 1568 (line 14) 1569* mpc_imag: Projection & Decomposing. 1570 (line 10) 1571* mpc_imagref: Projection & Decomposing. 1572 (line 15) 1573* mpc_init2: Initializing Complex Numbers. 1574 (line 10) 1575* mpc_init3: Initializing Complex Numbers. 1576 (line 15) 1577* mpc_inp_str: String and Stream Input and Output. 1578 (line 74) 1579* mpc_log: Power Functions and Logarithm. 1580 (line 36) 1581* mpc_log10: Power Functions and Logarithm. 1582 (line 37) 1583* mpc_mul: Basic Arithmetic. (line 51) 1584* mpc_mul_2si: Basic Arithmetic. (line 109) 1585* mpc_mul_2ui: Basic Arithmetic. (line 107) 1586* mpc_mul_fr: Basic Arithmetic. (line 57) 1587* mpc_mul_i: Basic Arithmetic. (line 63) 1588* mpc_mul_si: Basic Arithmetic. (line 55) 1589* mpc_mul_ui: Basic Arithmetic. (line 53) 1590* mpc_neg: Basic Arithmetic. (line 42) 1591* mpc_norm: Basic Arithmetic. (line 103) 1592* mpc_out_str: String and Stream Input and Output. 1593 (line 109) 1594* mpc_pow: Power Functions and Logarithm. 1595 (line 11) 1596* mpc_pow_d: Power Functions and Logarithm. 1597 (line 13) 1598* mpc_pow_fr: Power Functions and Logarithm. 1599 (line 23) 1600* mpc_pow_ld: Power Functions and Logarithm. 1601 (line 15) 1602* mpc_pow_si: Power Functions and Logarithm. 1603 (line 17) 1604* mpc_pow_ui: Power Functions and Logarithm. 1605 (line 19) 1606* mpc_pow_z: Power Functions and Logarithm. 1607 (line 21) 1608* mpc_proj: Projection & Decomposing. 1609 (line 24) 1610* mpc_real: Projection & Decomposing. 1611 (line 6) 1612* mpc_realref: Projection & Decomposing. 1613 (line 14) 1614* mpc_rootofunity: Power Functions and Logarithm. 1615 (line 44) 1616* mpc_set: Assigning Complex Numbers. 1617 (line 16) 1618* mpc_set_d: Assigning Complex Numbers. 1619 (line 25) 1620* mpc_set_dc: Assigning Complex Numbers. 1621 (line 27) 1622* mpc_set_d_d: Assigning Complex Numbers. 1623 (line 54) 1624* mpc_set_f: Assigning Complex Numbers. 1625 (line 33) 1626* mpc_set_fr: Assigning Complex Numbers. 1627 (line 34) 1628* mpc_set_fr_fr: Assigning Complex Numbers. 1629 (line 64) 1630* mpc_set_f_f: Assigning Complex Numbers. 1631 (line 62) 1632* mpc_set_ld: Assigning Complex Numbers. 1633 (line 26) 1634* mpc_set_ldc: Assigning Complex Numbers. 1635 (line 29) 1636* mpc_set_ld_ld: Assigning Complex Numbers. 1637 (line 56) 1638* mpc_set_nan: Assigning Complex Numbers. 1639 (line 79) 1640* mpc_set_prec: Initializing Complex Numbers. 1641 (line 41) 1642* mpc_set_q: Assigning Complex Numbers. 1643 (line 32) 1644* mpc_set_q_q: Assigning Complex Numbers. 1645 (line 60) 1646* mpc_set_si: Assigning Complex Numbers. 1647 (line 22) 1648* mpc_set_si_si: Assigning Complex Numbers. 1649 (line 48) 1650* mpc_set_sj: Assigning Complex Numbers. 1651 (line 24) 1652* mpc_set_sj_sj: Assigning Complex Numbers. 1653 (line 52) 1654* mpc_set_str: String and Stream Input and Output. 1655 (line 35) 1656* mpc_set_ui: Assigning Complex Numbers. 1657 (line 20) 1658* mpc_set_ui_ui: Assigning Complex Numbers. 1659 (line 46) 1660* mpc_set_uj: Assigning Complex Numbers. 1661 (line 23) 1662* mpc_set_uj_uj: Assigning Complex Numbers. 1663 (line 50) 1664* MPC_SET_X_Y: Advanced Functions. (line 6) 1665* mpc_set_z: Assigning Complex Numbers. 1666 (line 31) 1667* mpc_set_z_z: Assigning Complex Numbers. 1668 (line 58) 1669* mpc_sin: Trigonometric Functions. 1670 (line 6) 1671* mpc_sinh: Trigonometric Functions. 1672 (line 18) 1673* mpc_sin_cos: Trigonometric Functions. 1674 (line 12) 1675* mpc_sqr: Basic Arithmetic. (line 69) 1676* mpc_sqrt: Power Functions and Logarithm. 1677 (line 6) 1678* mpc_strtoc: String and Stream Input and Output. 1679 (line 6) 1680* mpc_sub: Basic Arithmetic. (line 27) 1681* mpc_sub_fr: Basic Arithmetic. (line 29) 1682* mpc_sub_ui: Basic Arithmetic. (line 33) 1683* mpc_sum: Basic Arithmetic. (line 46) 1684* mpc_swap: Assigning Complex Numbers. 1685 (line 82) 1686* mpc_tan: Trigonometric Functions. 1687 (line 8) 1688* mpc_tanh: Trigonometric Functions. 1689 (line 20) 1690* mpc_ui_div: Basic Arithmetic. (line 88) 1691* mpc_ui_sub: Basic Arithmetic. (line 35) 1692* mpc_ui_ui_sub: Basic Arithmetic. (line 37) 1693* mpc_urandom: Miscellaneous Complex Functions. 1694 (line 6) 1695* MPC_VERSION: Miscellaneous Complex Functions. 1696 (line 17) 1697* MPC_VERSION_MAJOR: Miscellaneous Complex Functions. 1698 (line 18) 1699* MPC_VERSION_MINOR: Miscellaneous Complex Functions. 1700 (line 19) 1701* MPC_VERSION_NUM: Miscellaneous Complex Functions. 1702 (line 36) 1703* MPC_VERSION_PATCHLEVEL: Miscellaneous Complex Functions. 1704 (line 20) 1705* MPC_VERSION_STRING: Miscellaneous Complex Functions. 1706 (line 21) 1707 1708 1709File: mpc.info, Node: Type Index, Next: GNU Free Documentation License, Prev: Function Index, Up: Top 1710 1711Type Index 1712********** 1713 1714[index] 1715* Menu: 1716 1717* mpcb_ptr: Ball Arithmetic. (line 140) 1718* mpcb_srcptr: Ball Arithmetic. (line 140) 1719* mpcb_t: Ball Arithmetic. (line 11) 1720* mpcb_t <1>: Ball Arithmetic. (line 140) 1721* mpcr_ptr: Ball Arithmetic. (line 28) 1722* mpcr_srcptr: Ball Arithmetic. (line 28) 1723* mpcr_t: Ball Arithmetic. (line 28) 1724* mpc_ptr: GNU MPC Basics. (line 15) 1725* mpc_rnd_t: GNU MPC Basics. (line 24) 1726* mpc_srcptr: GNU MPC Basics. (line 15) 1727* mpc_t: GNU MPC Basics. (line 15) 1728* mpfr_prec_t: GNU MPC Basics. (line 19) 1729 1730 1731File: mpc.info, Node: GNU Free Documentation License, Prev: Type Index, Up: Top 1732 1733Appendix A GNU Free Documentation License 1734***************************************** 1735 1736 Version 1.3, 3 November 2008 1737 1738 Copyright �� 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 1739 <http://fsf.org/> 1740 1741 Everyone is permitted to copy and distribute verbatim copies 1742 of this license document, but changing it is not allowed. 1743 1744 0. PREAMBLE 1745 1746 The purpose of this License is to make a manual, textbook, or other 1747 functional and useful document ���free��� in the sense of freedom: to 1748 assure everyone the effective freedom to copy and redistribute it, 1749 with or without modifying it, either commercially or 1750 noncommercially. Secondarily, this License preserves for the 1751 author and publisher a way to get credit for their work, while not 1752 being considered responsible for modifications made by others. 1753 1754 This License is a kind of ���copyleft���, which means that derivative 1755 works of the document must themselves be free in the same sense. 1756 It complements the GNU General Public License, which is a copyleft 1757 license designed for free software. 1758 1759 We have designed this License in order to use it for manuals for 1760 free software, because free software needs free documentation: a 1761 free program should come with manuals providing the same freedoms 1762 that the software does. But this License is not limited to 1763 software manuals; it can be used for any textual work, regardless 1764 of subject matter or whether it is published as a printed book. We 1765 recommend this License principally for works whose purpose is 1766 instruction or reference. 1767 1768 1. APPLICABILITY AND DEFINITIONS 1769 1770 This License applies to any manual or other work, in any medium, 1771 that contains a notice placed by the copyright holder saying it can 1772 be distributed under the terms of this License. Such a notice 1773 grants a world-wide, royalty-free license, unlimited in duration, 1774 to use that work under the conditions stated herein. The 1775 ���Document���, below, refers to any such manual or work. Any member 1776 of the public is a licensee, and is addressed as ���you���. You accept 1777 the license if you copy, modify or distribute the work in a way 1778 requiring permission under copyright law. 1779 1780 A ���Modified Version��� of the Document means any work containing the 1781 Document or a portion of it, either copied verbatim, or with 1782 modifications and/or translated into another language. 1783 1784 A ���Secondary Section��� is a named appendix or a front-matter section 1785 of the Document that deals exclusively with the relationship of the 1786 publishers or authors of the Document to the Document���s overall 1787 subject (or to related matters) and contains nothing that could 1788 fall directly within that overall subject. (Thus, if the Document 1789 is in part a textbook of mathematics, a Secondary Section may not 1790 explain any mathematics.) The relationship could be a matter of 1791 historical connection with the subject or with related matters, or 1792 of legal, commercial, philosophical, ethical or political position 1793 regarding them. 1794 1795 The ���Invariant Sections��� are certain Secondary Sections whose 1796 titles are designated, as being those of Invariant Sections, in the 1797 notice that says that the Document is released under this License. 1798 If a section does not fit the above definition of Secondary then it 1799 is not allowed to be designated as Invariant. The Document may 1800 contain zero Invariant Sections. If the Document does not identify 1801 any Invariant Sections then there are none. 1802 1803 The ���Cover Texts��� are certain short passages of text that are 1804 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 1805 that says that the Document is released under this License. A 1806 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 1807 be at most 25 words. 1808 1809 A ���Transparent��� copy of the Document means a machine-readable copy, 1810 represented in a format whose specification is available to the 1811 general public, that is suitable for revising the document 1812 straightforwardly with generic text editors or (for images composed 1813 of pixels) generic paint programs or (for drawings) some widely 1814 available drawing editor, and that is suitable for input to text 1815 formatters or for automatic translation to a variety of formats 1816 suitable for input to text formatters. A copy made in an otherwise 1817 Transparent file format whose markup, or absence of markup, has 1818 been arranged to thwart or discourage subsequent modification by 1819 readers is not Transparent. An image format is not Transparent if 1820 used for any substantial amount of text. A copy that is not 1821 ���Transparent��� is called ���Opaque���. 1822 1823 Examples of suitable formats for Transparent copies include plain 1824 ASCII without markup, Texinfo input format, LaTeX input format, 1825 SGML or XML using a publicly available DTD, and standard-conforming 1826 simple HTML, PostScript or PDF designed for human modification. 1827 Examples of transparent image formats include PNG, XCF and JPG. 1828 Opaque formats include proprietary formats that can be read and 1829 edited only by proprietary word processors, SGML or XML for which 1830 the DTD and/or processing tools are not generally available, and 1831 the machine-generated HTML, PostScript or PDF produced by some word 1832 processors for output purposes only. 1833 1834 The ���Title Page��� means, for a printed book, the title page itself, 1835 plus such following pages as are needed to hold, legibly, the 1836 material this License requires to appear in the title page. For 1837 works in formats which do not have any title page as such, ���Title 1838 Page��� means the text near the most prominent appearance of the 1839 work���s title, preceding the beginning of the body of the text. 1840 1841 The ���publisher��� means any person or entity that distributes copies 1842 of the Document to the public. 1843 1844 A section ���Entitled XYZ��� means a named subunit of the Document 1845 whose title either is precisely XYZ or contains XYZ in parentheses 1846 following text that translates XYZ in another language. (Here XYZ 1847 stands for a specific section name mentioned below, such as 1848 ���Acknowledgements���, ���Dedications���, ���Endorsements���, or ���History���.) 1849 To ���Preserve the Title��� of such a section when you modify the 1850 Document means that it remains a section ���Entitled XYZ��� according 1851 to this definition. 1852 1853 The Document may include Warranty Disclaimers next to the notice 1854 which states that this License applies to the Document. These 1855 Warranty Disclaimers are considered to be included by reference in 1856 this License, but only as regards disclaiming warranties: any other 1857 implication that these Warranty Disclaimers may have is void and 1858 has no effect on the meaning of this License. 1859 1860 2. VERBATIM COPYING 1861 1862 You may copy and distribute the Document in any medium, either 1863 commercially or noncommercially, provided that this License, the 1864 copyright notices, and the license notice saying this License 1865 applies to the Document are reproduced in all copies, and that you 1866 add no other conditions whatsoever to those of this License. You 1867 may not use technical measures to obstruct or control the reading 1868 or further copying of the copies you make or distribute. However, 1869 you may accept compensation in exchange for copies. If you 1870 distribute a large enough number of copies you must also follow the 1871 conditions in section 3. 1872 1873 You may also lend copies, under the same conditions stated above, 1874 and you may publicly display copies. 1875 1876 3. COPYING IN QUANTITY 1877 1878 If you publish printed copies (or copies in media that commonly 1879 have printed covers) of the Document, numbering more than 100, and 1880 the Document���s license notice requires Cover Texts, you must 1881 enclose the copies in covers that carry, clearly and legibly, all 1882 these Cover Texts: Front-Cover Texts on the front cover, and 1883 Back-Cover Texts on the back cover. Both covers must also clearly 1884 and legibly identify you as the publisher of these copies. The 1885 front cover must present the full title with all words of the title 1886 equally prominent and visible. You may add other material on the 1887 covers in addition. Copying with changes limited to the covers, as 1888 long as they preserve the title of the Document and satisfy these 1889 conditions, can be treated as verbatim copying in other respects. 1890 1891 If the required texts for either cover are too voluminous to fit 1892 legibly, you should put the first ones listed (as many as fit 1893 reasonably) on the actual cover, and continue the rest onto 1894 adjacent pages. 1895 1896 If you publish or distribute Opaque copies of the Document 1897 numbering more than 100, you must either include a machine-readable 1898 Transparent copy along with each Opaque copy, or state in or with 1899 each Opaque copy a computer-network location from which the general 1900 network-using public has access to download using public-standard 1901 network protocols a complete Transparent copy of the Document, free 1902 of added material. If you use the latter option, you must take 1903 reasonably prudent steps, when you begin distribution of Opaque 1904 copies in quantity, to ensure that this Transparent copy will 1905 remain thus accessible at the stated location until at least one 1906 year after the last time you distribute an Opaque copy (directly or 1907 through your agents or retailers) of that edition to the public. 1908 1909 It is requested, but not required, that you contact the authors of 1910 the Document well before redistributing any large number of copies, 1911 to give them a chance to provide you with an updated version of the 1912 Document. 1913 1914 4. MODIFICATIONS 1915 1916 You may copy and distribute a Modified Version of the Document 1917 under the conditions of sections 2 and 3 above, provided that you 1918 release the Modified Version under precisely this License, with the 1919 Modified Version filling the role of the Document, thus licensing 1920 distribution and modification of the Modified Version to whoever 1921 possesses a copy of it. In addition, you must do these things in 1922 the Modified Version: 1923 1924 A. Use in the Title Page (and on the covers, if any) a title 1925 distinct from that of the Document, and from those of previous 1926 versions (which should, if there were any, be listed in the 1927 History section of the Document). You may use the same title 1928 as a previous version if the original publisher of that 1929 version gives permission. 1930 1931 B. List on the Title Page, as authors, one or more persons or 1932 entities responsible for authorship of the modifications in 1933 the Modified Version, together with at least five of the 1934 principal authors of the Document (all of its principal 1935 authors, if it has fewer than five), unless they release you 1936 from this requirement. 1937 1938 C. State on the Title page the name of the publisher of the 1939 Modified Version, as the publisher. 1940 1941 D. Preserve all the copyright notices of the Document. 1942 1943 E. Add an appropriate copyright notice for your modifications 1944 adjacent to the other copyright notices. 1945 1946 F. Include, immediately after the copyright notices, a license 1947 notice giving the public permission to use the Modified 1948 Version under the terms of this License, in the form shown in 1949 the Addendum below. 1950 1951 G. Preserve in that license notice the full lists of Invariant 1952 Sections and required Cover Texts given in the Document���s 1953 license notice. 1954 1955 H. Include an unaltered copy of this License. 1956 1957 I. Preserve the section Entitled ���History���, Preserve its Title, 1958 and add to it an item stating at least the title, year, new 1959 authors, and publisher of the Modified Version as given on the 1960 Title Page. If there is no section Entitled ���History��� in the 1961 Document, create one stating the title, year, authors, and 1962 publisher of the Document as given on its Title Page, then add 1963 an item describing the Modified Version as stated in the 1964 previous sentence. 1965 1966 J. Preserve the network location, if any, given in the Document 1967 for public access to a Transparent copy of the Document, and 1968 likewise the network locations given in the Document for 1969 previous versions it was based on. These may be placed in the 1970 ���History��� section. You may omit a network location for a work 1971 that was published at least four years before the Document 1972 itself, or if the original publisher of the version it refers 1973 to gives permission. 1974 1975 K. For any section Entitled ���Acknowledgements��� or ���Dedications���, 1976 Preserve the Title of the section, and preserve in the section 1977 all the substance and tone of each of the contributor 1978 acknowledgements and/or dedications given therein. 1979 1980 L. Preserve all the Invariant Sections of the Document, unaltered 1981 in their text and in their titles. Section numbers or the 1982 equivalent are not considered part of the section titles. 1983 1984 M. Delete any section Entitled ���Endorsements���. Such a section 1985 may not be included in the Modified Version. 1986 1987 N. Do not retitle any existing section to be Entitled 1988 ���Endorsements��� or to conflict in title with any Invariant 1989 Section. 1990 1991 O. Preserve any Warranty Disclaimers. 1992 1993 If the Modified Version includes new front-matter sections or 1994 appendices that qualify as Secondary Sections and contain no 1995 material copied from the Document, you may at your option designate 1996 some or all of these sections as invariant. To do this, add their 1997 titles to the list of Invariant Sections in the Modified Version���s 1998 license notice. These titles must be distinct from any other 1999 section titles. 2000 2001 You may add a section Entitled ���Endorsements���, provided it contains 2002 nothing but endorsements of your Modified Version by various 2003 parties���for example, statements of peer review or that the text has 2004 been approved by an organization as the authoritative definition of 2005 a standard. 2006 2007 You may add a passage of up to five words as a Front-Cover Text, 2008 and a passage of up to 25 words as a Back-Cover Text, to the end of 2009 the list of Cover Texts in the Modified Version. Only one passage 2010 of Front-Cover Text and one of Back-Cover Text may be added by (or 2011 through arrangements made by) any one entity. If the Document 2012 already includes a cover text for the same cover, previously added 2013 by you or by arrangement made by the same entity you are acting on 2014 behalf of, you may not add another; but you may replace the old 2015 one, on explicit permission from the previous publisher that added 2016 the old one. 2017 2018 The author(s) and publisher(s) of the Document do not by this 2019 License give permission to use their names for publicity for or to 2020 assert or imply endorsement of any Modified Version. 2021 2022 5. COMBINING DOCUMENTS 2023 2024 You may combine the Document with other documents released under 2025 this License, under the terms defined in section 4 above for 2026 modified versions, provided that you include in the combination all 2027 of the Invariant Sections of all of the original documents, 2028 unmodified, and list them all as Invariant Sections of your 2029 combined work in its license notice, and that you preserve all 2030 their Warranty Disclaimers. 2031 2032 The combined work need only contain one copy of this License, and 2033 multiple identical Invariant Sections may be replaced with a single 2034 copy. If there are multiple Invariant Sections with the same name 2035 but different contents, make the title of each such section unique 2036 by adding at the end of it, in parentheses, the name of the 2037 original author or publisher of that section if known, or else a 2038 unique number. Make the same adjustment to the section titles in 2039 the list of Invariant Sections in the license notice of the 2040 combined work. 2041 2042 In the combination, you must combine any sections Entitled 2043 ���History��� in the various original documents, forming one section 2044 Entitled ���History���; likewise combine any sections Entitled 2045 ���Acknowledgements���, and any sections Entitled ���Dedications���. You 2046 must delete all sections Entitled ���Endorsements.��� 2047 2048 6. COLLECTIONS OF DOCUMENTS 2049 2050 You may make a collection consisting of the Document and other 2051 documents released under this License, and replace the individual 2052 copies of this License in the various documents with a single copy 2053 that is included in the collection, provided that you follow the 2054 rules of this License for verbatim copying of each of the documents 2055 in all other respects. 2056 2057 You may extract a single document from such a collection, and 2058 distribute it individually under this License, provided you insert 2059 a copy of this License into the extracted document, and follow this 2060 License in all other respects regarding verbatim copying of that 2061 document. 2062 2063 7. AGGREGATION WITH INDEPENDENT WORKS 2064 2065 A compilation of the Document or its derivatives with other 2066 separate and independent documents or works, in or on a volume of a 2067 storage or distribution medium, is called an ���aggregate��� if the 2068 copyright resulting from the compilation is not used to limit the 2069 legal rights of the compilation���s users beyond what the individual 2070 works permit. When the Document is included in an aggregate, this 2071 License does not apply to the other works in the aggregate which 2072 are not themselves derivative works of the Document. 2073 2074 If the Cover Text requirement of section 3 is applicable to these 2075 copies of the Document, then if the Document is less than one half 2076 of the entire aggregate, the Document���s Cover Texts may be placed 2077 on covers that bracket the Document within the aggregate, or the 2078 electronic equivalent of covers if the Document is in electronic 2079 form. Otherwise they must appear on printed covers that bracket 2080 the whole aggregate. 2081 2082 8. TRANSLATION 2083 2084 Translation is considered a kind of modification, so you may 2085 distribute translations of the Document under the terms of section 2086 4. Replacing Invariant Sections with translations requires special 2087 permission from their copyright holders, but you may include 2088 translations of some or all Invariant Sections in addition to the 2089 original versions of these Invariant Sections. You may include a 2090 translation of this License, and all the license notices in the 2091 Document, and any Warranty Disclaimers, provided that you also 2092 include the original English version of this License and the 2093 original versions of those notices and disclaimers. In case of a 2094 disagreement between the translation and the original version of 2095 this License or a notice or disclaimer, the original version will 2096 prevail. 2097 2098 If a section in the Document is Entitled ���Acknowledgements���, 2099 ���Dedications���, or ���History���, the requirement (section 4) to 2100 Preserve its Title (section 1) will typically require changing the 2101 actual title. 2102 2103 9. TERMINATION 2104 2105 You may not copy, modify, sublicense, or distribute the Document 2106 except as expressly provided under this License. Any attempt 2107 otherwise to copy, modify, sublicense, or distribute it is void, 2108 and will automatically terminate your rights under this License. 2109 2110 However, if you cease all violation of this License, then your 2111 license from a particular copyright holder is reinstated (a) 2112 provisionally, unless and until the copyright holder explicitly and 2113 finally terminates your license, and (b) permanently, if the 2114 copyright holder fails to notify you of the violation by some 2115 reasonable means prior to 60 days after the cessation. 2116 2117 Moreover, your license from a particular copyright holder is 2118 reinstated permanently if the copyright holder notifies you of the 2119 violation by some reasonable means, this is the first time you have 2120 received notice of violation of this License (for any work) from 2121 that copyright holder, and you cure the violation prior to 30 days 2122 after your receipt of the notice. 2123 2124 Termination of your rights under this section does not terminate 2125 the licenses of parties who have received copies or rights from you 2126 under this License. If your rights have been terminated and not 2127 permanently reinstated, receipt of a copy of some or all of the 2128 same material does not give you any rights to use it. 2129 2130 10. FUTURE REVISIONS OF THIS LICENSE 2131 2132 The Free Software Foundation may publish new, revised versions of 2133 the GNU Free Documentation License from time to time. Such new 2134 versions will be similar in spirit to the present version, but may 2135 differ in detail to address new problems or concerns. See 2136 <http://www.gnu.org/copyleft/>. 2137 2138 Each version of the License is given a distinguishing version 2139 number. If the Document specifies that a particular numbered 2140 version of this License ���or any later version��� applies to it, you 2141 have the option of following the terms and conditions either of 2142 that specified version or of any later version that has been 2143 published (not as a draft) by the Free Software Foundation. If the 2144 Document does not specify a version number of this License, you may 2145 choose any version ever published (not as a draft) by the Free 2146 Software Foundation. If the Document specifies that a proxy can 2147 decide which future versions of this License can be used, that 2148 proxy���s public statement of acceptance of a version permanently 2149 authorizes you to choose that version for the Document. 2150 2151 11. RELICENSING 2152 2153 ���Massive Multiauthor Collaboration Site��� (or ���MMC Site���) means any 2154 World Wide Web server that publishes copyrightable works and also 2155 provides prominent facilities for anybody to edit those works. A 2156 public wiki that anybody can edit is an example of such a server. 2157 A ���Massive Multiauthor Collaboration��� (or ���MMC���) contained in the 2158 site means any set of copyrightable works thus published on the MMC 2159 site. 2160 2161 ���CC-BY-SA��� means the Creative Commons Attribution-Share Alike 3.0 2162 license published by Creative Commons Corporation, a not-for-profit 2163 corporation with a principal place of business in San Francisco, 2164 California, as well as future copyleft versions of that license 2165 published by that same organization. 2166 2167 ���Incorporate��� means to publish or republish a Document, in whole or 2168 in part, as part of another Document. 2169 2170 An MMC is ���eligible for relicensing��� if it is licensed under this 2171 License, and if all works that were first published under this 2172 License somewhere other than this MMC, and subsequently 2173 incorporated in whole or in part into the MMC, (1) had no cover 2174 texts or invariant sections, and (2) were thus incorporated prior 2175 to November 1, 2008. 2176 2177 The operator of an MMC Site may republish an MMC contained in the 2178 site under CC-BY-SA on the same site at any time before August 1, 2179 2009, provided the MMC is eligible for relicensing. 2180 2181ADDENDUM: How to use this License for your documents 2182==================================================== 2183 2184To use this License in a document you have written, include a copy of 2185the License in the document and put the following copyright and license 2186notices just after the title page: 2187 2188 Copyright (C) YEAR YOUR NAME. 2189 Permission is granted to copy, distribute and/or modify this document 2190 under the terms of the GNU Free Documentation License, Version 1.3 2191 or any later version published by the Free Software Foundation; 2192 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 2193 Texts. A copy of the license is included in the section entitled ``GNU 2194 Free Documentation License''. 2195 2196 If you have Invariant Sections, Front-Cover Texts and Back-Cover 2197Texts, replace the ���with...Texts.��� line with this: 2198 2199 with the Invariant Sections being LIST THEIR TITLES, with 2200 the Front-Cover Texts being LIST, and with the Back-Cover Texts 2201 being LIST. 2202 2203 If you have Invariant Sections without Cover Texts, or some other 2204combination of the three, merge those two alternatives to suit the 2205situation. 2206 2207 If your document contains nontrivial examples of program code, we 2208recommend releasing these examples in parallel under your choice of free 2209software license, such as the GNU General Public License, to permit 2210their use in free software. 2211 2212 2213 2214Tag Table: 2215Node: Top769 2216Node: Copying1550 2217Node: Introduction to GNU MPC2322 2218Node: Installing GNU MPC3041 2219Node: Reporting Bugs8342 2220Node: GNU MPC Basics9689 2221Ref: return-value13571 2222Node: Complex Functions15058 2223Node: Initializing Complex Numbers16257 2224Node: Assigning Complex Numbers18684 2225Node: Converting Complex Numbers23230 2226Node: String and Stream Input and Output23869 2227Node: Complex Comparison30607 2228Node: Projection & Decomposing32170 2229Node: Basic Arithmetic33579 2230Node: Power Functions and Logarithm39308 2231Node: Trigonometric Functions42244 2232Node: Modular Functions44199 2233Node: Miscellaneous Complex Functions45034 2234Node: Advanced Functions47240 2235Node: Internals48338 2236Node: Ball Arithmetic48797 2237Node: References66134 2238Node: Concept Index66931 2239Node: Function Index69391 2240Node: Type Index86438 2241Node: GNU Free Documentation License87468 2242 2243End Tag Table 2244 2245 2246Local Variables: 2247coding: utf-8 2248End: 2249