R8LIB
A Double Precision Real Arithmetic Utility Library
R8LIB
is a Python library which
contains a number of utilities for
double precision real (R8) arithmetic.
Licensing:
The computer code and data files made available on this web page
are distributed under
the GNU LGPL license.
Languages:
R8LIB is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Programs:
C4LIB,
a Python library which
contains many utility routines, using "C4" or
"single precision complex" arithmetic.
C8LIB,
a Python library which
contains many utility routines, using "C8" or
"double precision complex" arithmetic.
I4LIB,
a PYTHON library which
contains many utility routines, using "I4" or "single precision integer"
arithmetic.
R4LIB,
a Python library which
contains many utility routines
using single precision real (R4) arithmetic.
UNIFORM,
a Python library which
contains uniform random number generators (RNG's) for
several arithmetic types.
References:
-
Thomas Cormen, Charles Leiserson, Ronald Rivest,
Introduction to Algorithms,
MIT Press, 2001,
ISBN: 0262032937,
LC: QA76.C662.
-
Albert Nijenhuis, Herbert Wilf,
Combinatorial Algorithms for Computers and Calculators,
Second Edition,
Academic Press, 1978,
ISBN: 0-12-519260-6,
LC: QA164.N54.
Source Code:
-
agm_values.py,
returns selected values of the arithmetic geometric mean;
-
gamma_values.py,
returns selected values of the gamma function;
-
gamma_log_values.py,
returns selected values of the log(gamma) function;
-
i4_log_10.py,
returns the integer part of the logarithm base 10 of ABS(X);
-
i4_sign.py,
returns the sign of an I4.
-
i4_uniform_ab.py,
returns a random I4 between A and B.
-
i4vec_indicator0.py,
returns an indicator vector as an I4VEC.
-
i4vec_indicator1.py,
returns an indicator vector as an I4VEC.
-
i4vec_print.py,
prints an I4VEC.
-
i4vec_transpose_print.py,
prints the transpose of an I4VEC.
-
perm0_check.py,
checks a permutation of ( 0,...,N-1).
-
perm0_uniform.py,
randomly selects a checks a permutation of ( 0,...,N-1).
-
perm1_check.py,
checks a checks a permutation of ( 1,...,N).
-
perm1_uniform.py,
randomly selects a permutation of ( 1,...,N).
-
r8_abs.py,
returns the absolute value of an R8.
-
r8_acos.py,
returns the arc-cosine of an R8.
-
r8_acosh.py,
returns the arc-hyperbolic cosine of an R8.
-
r8_add.py,
adds two R8's.
-
r8_agm.py,
computes the arithmetic-geometry mean of two R8's.
-
r8_aint.py,
truncates an R8 to an integer value.
-
r8_asin.py,
returns the arc-sine of an R8.
-
r8_asinh.py,
computes the inverse hyperbolic sine;
-
r8_atan.py,
returns the arc-tangent of an R8.
-
r8_atanh.py,
computes the inverse hyperbolic tangent;
-
r8_big.py,
returns a "big" R8;
-
r8_cas.py,
returns the "casine" of an R8.
-
r8_ceiling.py,
rounds an R8 up to the nearest integer.
-
r8_choose.py,
returns the combinatorial coefficient C(N,K).
-
r8_chop.py,
chops an R8 to a given number of binary places.
-
r8_cosd.py,
returns the cosine of an angle in degrees.
-
r8_cotd.py,
returns the cotangent of an angle in degrees.
-
r8_csc.py,
returns the cosecant of an R8.
-
r8_cscd.py,
returns the cosecant of an angle in degrees.
-
r8_cube_root.py,
returns the cube root of an R8.
-
r8_degrees.py,
converts a measurement from radians to degrees.
-
r8_diff.py,
computes (X-Y) to a specified accuracy.
-
r8_digit.py,
returns a particular decimal digit of an R8.
-
r8_divide_i4.py,
returns an I4 fraction as an R8.
-
r8_e.py,
returns the natural logarithm base as an R8.
-
r8_epsilon.py,
returns the R8 roundoff unit.
-
r8_epsilon_compute.py,
computes the R8 roundoff unit.
-
r8_exp.py,
evaluates the exponential function, while avoiding underflow and overflow.
-
r8_factorial.py,
evaluates the factorial function.
-
r8_factorial_values.py
returns values of the real factorial function.
-
r8_factorial2.py,
evaluates the double factorial function.
-
r8_factorial2_values.py
returns values of the double factorial function.
-
r8_fall.py,
evaluates the falling factorial function of an R8.
-
r8_fall_values.py,
returns selected values of the falling factorial.
-
r8_floor.py,
rounds an R8 "down" (towards -oo) to the next integer.
-
r8_fraction.py,
uses real arithmetic on an integer ratio.
-
r8_fractional.py,
returns the fractional part of an R8.
-
r8_gamma.py,
returns the gamma function of an R8.
-
r8_gamma_log.py,
returns the logarithm of the gamma function of an R8.
-
r8_huge.py,
returns a "huge" R8;
-
r8_hypot.py,
returns sqrt ( x^2 + y^2 );
-
r8_in_01.py,
is true if the value is in [0,1];
-
r8_insignificant.py,
is true if an R8 is insignificant;
-
r8_is_int.py,
is true if an R8 equals an integer value;
-
r8_log_2.py,
returns the logarithm base 2 of the absolute value of an R8;
-
r8_log_10.py,
returns the logarithm base 10 of the absolute value of an R8;
-
r8_log_b.py,
returns the logarithm base B of the absolute value of an R8;
-
r8_mant.py,
returns the mantissa of an R8;
-
r8_max.py,
returns the maximum of two R8's;
-
r8_min.py,
returns the minimum of two R8's;
-
r8_mod.py,
returns the remainder of real division;
-
r8_modp.py,
returns the nonnegative remainder of real division;
-
r8_mop.py,
returns a power of -1 as an R8;
-
r8_normal_01.py,
returns a unit pseudonormal R8;
-
r8_normal_ab.py,
returns a pseudonormal R8 with mean A and variance B.
-
r8_pi.py,
returns the value of Pi.
-
r8_pi_sqrt.py,
returns the value of the square root of Pi.
-
r8_power.py,
returns the value of an integral power of an R8;
-
r8_power_fast.py,
quickly returns the value of an integral power of an R8;
-
r8_print.py,
prints an R8;
-
r8_pythag.py,
computes sqrt ( A^2 + B^2 ) avoiding unnecessary overflow
and underflow;
-
r8_radians.py,
converts a measurement from degrees to radians.
-
r8_rise.py,
computes a rising factorial as an R8;
-
r8_rise_values.py,
returns selected values of the rising factorial.
-
r8_round.py,
rounds an R8 to the nearest integral value.
-
r8_round_i4.py,
rounds an R8 to the nearest integral value, returned as an I4.
-
r8_round2.py,
rounds an R8 to a specified number of binary digits.
-
r8_roundb.py,
rounds an R8 to a specified number of digits in a given base.
-
r8_roundx.py,
rounds an R8 to a specified number of decimal digits.
-
r8_secd.py,
returns the secant of an angle in degrees.
-
r8_sech.py,
evaluates the hyperbolic secant of an R8.
-
r8_sign.py,
returns the sign of an R8.
-
r8_sign3.py,
returns the three-way sign of an R8.
-
r8_sign_char.py,
returns a character indicating the sign of an R8.
-
r8_sign_match.py,
is TRUE if two R8's have the same sign.
-
r8_sign_match_strict.py,
is TRUE if two R8's have the same strict sign.
-
r8_sign_opposite.py,
is TRUE if two R8's have opposite sign.
-
r8_sign_opposite_strict.py,
is TRUE if two R8's have strictly opposite signs.
-
r8_sind.py,
returns the sine of an angle in degrees.
-
r8_sqrt_i4.py,
returns the square root of an I4 as an R8.
-
r8_swap.py,
swaps two R8's.
-
r8_swap3.py,
swaps three R8's.
-
r8_tand.py,
returns the tangent of an angle in degrees.
-
r8_tiny.py,
returns a "tiny" R8.
-
r8_to_dhms.py,
converts decimal days into days, hours, minutes, seconds.
-
r8_to_i4.py,
maps X in [XMIN,XMAX] to I in [IMIN,IMAX];
-
r8_to_r8_discrete.py,
maps R to RD in [RMIN, RMAX] with NR possible values.
-
r8_uniform_01.py,
returns a unit pseudorandom R8.
-
r8_uniform_ab.py,
returns a scaled pseudorandom R8.
-
r8_unswap3.py,
unswaps 3 R8's.
-
r8_walsh_1d.py,
evaluates the Walsh function;
-
r8_wrap.py,
forces an R8 to lie between given limits by wrapping.
-
r82col_print_part.py,
prints part of an (N,2) array of data.
-
r82row_print_part.py,
prints part of a (2,N) array of data.
-
r83col_print_part.py,
prints part of an (N,3) array of data.
-
r83row_print_part.py,
prints part of a (3,N) array of data.
-
r8col_swap.py,
swaps two columns of an R8COL.
-
r8mat_house_form.py,
constructs a Householder matrix from its compact form;
-
r8mat_indicator.py,
returns an indicator R8MAT.
-
r8mat_mm.py,
computes a matrix-matrix product.
-
r8mat_mmt.py,
computes a matrix-transpose(matrix) product.
-
r8mat_mtm.py,
computes a (transposed matrix)-matrix product.
-
r8mat_mtv.py,
computes the product of a transposed R8MAT times an R8VEC.
-
r8mat_mv.py,
computes the product of an R8MAT times an R8VEC.
-
r8mat_nint.py,
rounds the entries of an R8MAT.
-
r8mat_nonzeros.py,
returns the number of nonzeros in an R8MAT.
-
r8mat_norm_fro.py,
returns the Frobenius norm of an R8MAT.
-
r8mat_norm_l1.py,
returns the L1 norm of an R8MAT.
-
r8mat_norm_li.py,
returns the Loo norm of an R8MAT.
-
r8mat_print.py,
prints an R8MAT.
-
r8mat_print_some.py,
prints some of an R8MAT.
-
r8mat_sub.py,
subtracts one R8MAT from another.
-
r8mat_transpose.py,
transposes an R8MAT.
-
r8mat_transpose_print.py,
prints an R8MAT, transposed.
-
r8mat_transpose_print_some.py,
prints some of an R8MAT, transposed.
-
r8mat_uniform_01.py,
returns a unit pseudorandom R8MAT.
-
r8mat_uniform_ab.py,
returns a scaled pseudorandom R8MAT.
-
r8poly_degree.py
returns the degree of an R8POLY.
-
r8poly_print.py,
prints a polynomial;
-
r8poly_value_horner.py,
evaluates a polynomial using Horner's method;
-
r8vec_amax.py,
returns the maximum absolute value entry in an R8VEC.
-
r8vec_amin.py,
returns the minimum absolute value entry in an R8VEC.
-
r8vec_asum.py,
sums the absolute values of the entries in an R8VEC.
-
r8vec_concatenate.py,
concatenates two R8VECs.
-
r8vec_copy.py,
copies an R8VEC.
-
r8vec_direct_product.py,
creates a direct product of R8VEC's.
-
r8vec_house_column.py,
defines a Householder premultiplier that packs a column.
-
r8vec_indicator0.py,
evaluates the 0-based indicator vector (0,1,2,...) as an R8VEC.
-
r8vec_indicator1.py,
evaluates the 1-based indicator vector (1,2,3,...) as an R8VEC.
-
r8vec_linspace.py,
returns an R8VEC of values evenly spaced between given limits.
-
r8vec_max.py,
returns the maximum entry in an R8VEC.
-
r8vec_min.py,
returns the minimum entry in an R8VEC.
-
r8vec_nint.py,
rounds an R8VEC.
-
r8vec_norm_l0.py,
computes the L0 "norm" of an R8VEC.
-
r8vec_norm_l2.py,
computes the L2 norm of an R8VEC.
-
r8vec_norm_li.py,
computes the Loo norm of an R8VEC.
-
r8vec_permute.py,
permutes an R8VEC.
-
r8vec_print.py,
prints an R8VEC.
-
r8vec_product.py,
computes the product of the entries in an R8VEC.
-
r8vec_step.py,
evaluates a unit step function.
-
r8vec_sum.py,
sums the entries in an R8VEC.
-
r8vec_uniform_01.py,
returns a unit pseudorandom R8VEC.
-
r8vec_uniform_ab.py,
returns a scaled pseudorandom R8VEC.
-
roots_to_r8poly.py,
takes a set of N real roots and determines the N+1 coefficients
of the corresponding polynomial.
-
timestamp.py,
prints the current YMDHMS date as a timestamp.
Examples and Tests:
You can go up one level to
the Python source codes.
Last revised on 20 March 2015.