MolSSI Integral Reference Project
Macros | Functions
math.h File Reference

Some miscellaneous mathematical functions and constants. More...

#include <arb.h>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIN(a, b)   (((a)<(b))?(a):(b))
 Calculates the minimum value of two variables. More...
 
#define MAX(a, b)   (((a)>(b))?(a):(b))
 Calculates the maximum value of two variables. More...
 
#define MIRP_DBL_TRUE_MIN   4.9406564584124654e-324
 Smallest subnormal double-precision value. More...
 
#define NEG1_POW(n)   (((n)%2)?(-1):(1))
 Calculates (-1) to a given power. More...
 
#define MIRP_PI   3.14159265358979324
 The value of the constant pi in double precision. More...
 
#define MIRP_SQRT_PI   1.7724538509055160273
 The value of the sqrt(pi) in double precision. More...
 
#define MIRP_PI_32   5.5683279968317078453
 The value of the pi**(3/2) in double precision. More...
 
#define MIRP_LOG_10_2   0.3010299956639812
 log_10(2) More...
 

Functions

slong mirp_min_accuracy_bits (arb_srcptr v, size_t n)
 Finds the least number of accuracy bits in a vector. More...
 
void mirp_pow_si (arb_t output, const arb_t b, long e, slong prec)
 Calculates b^e with e being a signed integer. More...
 
void mirp_factorial (arb_t output, long n)
 Calculates a factorial using interval arithmetic. More...
 
void mirp_factorial2 (arb_t output, long n)
 Calculates a double factorial using interval arithmetic. More...
 
void mirp_binomial (arb_t output, long n, long k)
 Calculates a binomial coefficient using interval arithmetic. More...
 

Detailed Description

Some miscellaneous mathematical functions and constants.

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)    (((a)>(b))?(a):(b))

Calculates the maximum value of two variables.

◆ MIN

#define MIN (   a,
 
)    (((a)<(b))?(a):(b))

Calculates the minimum value of two variables.

◆ MIRP_DBL_TRUE_MIN

#define MIRP_DBL_TRUE_MIN   4.9406564584124654e-324

Smallest subnormal double-precision value.

◆ MIRP_LOG_10_2

#define MIRP_LOG_10_2   0.3010299956639812

log_10(2)

For conversion between binary precision and decimal precision (number of decimal digits)

ndigits = log10(2) * precision (in bits)

◆ MIRP_PI

#define MIRP_PI   3.14159265358979324

The value of the constant pi in double precision.

◆ MIRP_PI_32

#define MIRP_PI_32   5.5683279968317078453

The value of the pi**(3/2) in double precision.

◆ MIRP_SQRT_PI

#define MIRP_SQRT_PI   1.7724538509055160273

The value of the sqrt(pi) in double precision.

◆ NEG1_POW

#define NEG1_POW (   n)    (((n)%2)?(-1):(1))

Calculates (-1) to a given power.

This replaces pow(-1, n)

Function Documentation

◆ mirp_binomial()

void mirp_binomial ( arb_t  output,
long  n,
long  k 
)

Calculates a binomial coefficient using interval arithmetic.

◆ mirp_factorial()

void mirp_factorial ( arb_t  output,
long  n 
)

Calculates a factorial using interval arithmetic.

◆ mirp_factorial2()

void mirp_factorial2 ( arb_t  output,
long  n 
)

Calculates a double factorial using interval arithmetic.

◆ mirp_min_accuracy_bits()

slong mirp_min_accuracy_bits ( arb_srcptr  v,
size_t  n 
)

Finds the least number of accuracy bits in a vector.

Parameters
[in]vThe vector to search the minimum accuracy of
[in]nThe length of the vector
Returns
The minimum accuracy found of all elements of the vector

◆ mirp_pow_si()

void mirp_pow_si ( arb_t  output,
const arb_t  b,
long  e,
slong  prec 
)

Calculates b^e with e being a signed integer.