ReproBLAS
Macros | Typedefs | Functions
binned.h File Reference

binned.h defines the binned types and the lower level functions associated with their use. More...

#include <stddef.h>
#include <stdlib.h>
#include <float.h>

Go to the source code of this file.

Macros

#define DBWIDTH   40
 Binned double precision bin width. More...
 
#define SBWIDTH   13
 Binned single precision bin width. More...
 
#define binned_DBMAXINDEX   (((DBL_MAX_EXP - DBL_MIN_EXP + DBL_MANT_DIG - 1)/DBWIDTH) - 1)
 Binned double precision maximum index. More...
 
#define binned_SBMAXINDEX   (((FLT_MAX_EXP - FLT_MIN_EXP + FLT_MANT_DIG - 1)/SBWIDTH) - 1)
 Binned single precision maximum index. More...
 
#define binned_DBMAXFOLD   (binned_DBMAXINDEX + 1)
 The maximum double precision fold supported by the library. More...
 
#define binned_SBMAXFOLD   (binned_SBMAXINDEX + 1)
 The maximum single precision fold supported by the library. More...
 
#define binned_DBENDURANCE   (1 << (DBL_MANT_DIG - DBWIDTH - 2))
 Binned double precision deposit endurance. More...
 
#define binned_SBENDURANCE   (1 << (FLT_MANT_DIG - SBWIDTH - 2))
 Binned single precision deposit endurance. More...
 
#define binned_DBCAPACITY   (binned_DBENDURANCE*(1.0/DBL_EPSILON - 1.0))
 Binned double precision capacity. More...
 
#define binned_SBCAPACITY   (binned_SBENDURANCE*(1.0/FLT_EPSILON - 1.0))
 Binned single precision capacity. More...
 
#define binned_DMCOMPRESSION   (1.0/(1 << (DBL_MANT_DIG - DBWIDTH + 1)))
 Binned double precision compression factor. More...
 
#define binned_SMCOMPRESSION   (1.0/(1 << (FLT_MANT_DIG - SBWIDTH + 1)))
 Binned single precision compression factor. More...
 
#define binned_DMEXPANSION   (1.0*(1 << (DBL_MANT_DIG - DBWIDTH + 1)))
 Binned double precision expansion factor. More...
 
#define binned_SMEXPANSION   (1.0*(1 << (FLT_MANT_DIG - SBWIDTH + 1)))
 Binned single precision expansion factor. More...
 

Typedefs

typedef double double_binned
 The binned double datatype. More...
 
typedef double double_complex_binned
 The binned complex double datatype. More...
 
typedef float float_binned
 The binned float datatype. More...
 
typedef float float_complex_binned
 The binned complex float datatype. More...
 

Functions

size_t binned_dbsize (const int fold)
 binned double precision size More...
 
size_t binned_zbsize (const int fold)
 binned complex double precision size More...
 
size_t binned_sbsbze (const int fold)
 binned single precision size More...
 
size_t binned_cbsize (const int fold)
 binned complex single precision size More...
 
double_binnedbinned_dballoc (const int fold)
 binned double precision allocation More...
 
double_complex_binnedbinned_zballoc (const int fold)
 binned complex double precision allocation More...
 
float_binnedbinned_sballoc (const int fold)
 binned single precision allocation More...
 
float_complex_binnedbinned_cballoc (const int fold)
 binned complex single precision allocation More...
 
int binned_dbnum (const int fold)
 binned double precision size More...
 
int binned_zbnum (const int fold)
 binned complex double precision size More...
 
int binned_sbnum (const int fold)
 binned single precision size More...
 
int binned_cbnum (const int fold)
 binned complex single precision size More...
 
double binned_dbbound (const int fold, const int N, const double X, const double S)
 Get binned double precision summation error bound. More...
 
float binned_sbbound (const int fold, const int N, const float X, const float S)
 Get binned single precision summation error bound. More...
 
const double * binned_dmbins (const int X)
 Get binned double precision reference bins. More...
 
const float * binned_smbins (const int X)
 Get binned single precision reference bins. More...
 
int binned_dindex (const double X)
 Get index of double precision. More...
 
int binned_dmindex (const double *priX)
 Get index of manually specified binned double precision. More...
 
int binned_dmindex0 (const double *priX)
 Check if index of manually specified binned double precision is 0. More...
 
int binned_sindex (const float X)
 Get index of single precision. More...
 
int binned_smindex (const float *priX)
 Get index of manually specified binned single precision. More...
 
int binned_smindex0 (const float *priX)
 Check if index of manually specified binned single precision is 0. More...
 
int binned_dmdenorm (const int fold, const double *priX)
 Check if binned type has denormal bits. More...
 
int binned_zmdenorm (const int fold, const double *priX)
 Check if binned type has denormal bits. More...
 
int binned_smdenorm (const int fold, const float *priX)
 Check if binned type has denormal bits. More...
 
int binned_cmdenorm (const int fold, const float *priX)
 Check if binned type has denormal bits. More...
 
void binned_dbprint (const int fold, const double_binned *X)
 Print binned double precision. More...
 
void binned_dmprint (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Print manually specified binned double precision. More...
 
void binned_zbprint (const int fold, const double_complex_binned *X)
 Print binned complex double precision. More...
 
void binned_zmprint (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Print manually specified binned complex double precision. More...
 
void binned_sbprint (const int fold, const float_binned *X)
 Print binned single precision. More...
 
void binned_smprint (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Print manually specified binned single precision. More...
 
void binned_cbprint (const int fold, const float_complex_binned *X)
 Print binned complex single precision. More...
 
void binned_cmprint (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Print manually specified binned complex single precision. More...
 
void binned_dbdbset (const int fold, const double_binned *X, double_binned *Y)
 Set binned double precision (Y = X) More...
 
void binned_dmdmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified binned double precision (Y = X) More...
 
void binned_zbzbset (const int fold, const double_complex_binned *X, double_complex_binned *Y)
 Set binned complex double precision (Y = X) More...
 
void binned_zmzmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified binned complex double precision (Y = X) More...
 
void binned_zbdbset (const int fold, const double_binned *X, double_complex_binned *Y)
 Set binned complex double precision to binned double precision (Y = X) More...
 
void binned_zmdmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified binned complex double precision to manually specified binned double precision (Y = X) More...
 
void binned_sbsbset (const int fold, const float_binned *X, float_binned *Y)
 Set binned single precision (Y = X) More...
 
void binned_smsmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified binned single precision (Y = X) More...
 
void binned_cbcbset (const int fold, const float_complex_binned *X, float_complex_binned *Y)
 Set binned complex single precision (Y = X) More...
 
void binned_cmcmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified binned complex single precision (Y = X) More...
 
void binned_cbsbset (const int fold, const float_binned *X, float_complex_binned *Y)
 Set binned complex single precision to binned single precision (Y = X) More...
 
void binned_cmsmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified binned complex single precision to manually specified binned single precision (Y = X) More...
 
void binned_dbsetzero (const int fold, double_binned *X)
 Set binned double precision to 0 (X = 0) More...
 
void binned_dmsetzero (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Set manually specified binned double precision to 0 (X = 0) More...
 
void binned_zbsetzero (const int fold, double_complex_binned *X)
 Set binned double precision to 0 (X = 0) More...
 
void binned_zmsetzero (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Set manually specified binned complex double precision to 0 (X = 0) More...
 
void binned_sbsetzero (const int fold, float_binned *X)
 Set binned single precision to 0 (X = 0) More...
 
void binned_smsetzero (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Set manually specified binned single precision to 0 (X = 0) More...
 
void binned_cbsetzero (const int fold, float_complex_binned *X)
 Set binned single precision to 0 (X = 0) More...
 
void binned_cmsetzero (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Set manually specified binned complex single precision to 0 (X = 0) More...
 
void binned_dbdbadd (const int fold, const double_binned *X, double_binned *Y)
 Add binned double precision (Y += X) More...
 
void binned_dmdmadd (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified binned double precision (Y += X) More...
 
void binned_zbzbadd (const int fold, const double_complex_binned *X, double_complex_binned *Y)
 Add binned complex double precision (Y += X) More...
 
void binned_zmzmadd (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified binned complex double precision (Y += X) More...
 
void binned_sbsbadd (const int fold, const float_binned *X, float_binned *Y)
 Add binned single precision (Y += X) More...
 
void binned_smsmadd (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified binned single precision (Y += X) More...
 
void binned_cbcbadd (const int fold, const float_complex_binned *X, float_complex_binned *Y)
 Add binned complex single precision (Y += X) More...
 
void binned_cmcmadd (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified binned complex single precision (Y += X) More...
 
void binned_dbdbaddv (const int fold, const int N, const double_binned *X, const int incX, double_binned *Y, const int incY)
 Add binned double precision vectors (Y += X) More...
 
void binned_zbzbaddv (const int fold, const int N, const double_complex_binned *X, const int incX, double_complex_binned *Y, const int incY)
 Add binned complex double precision vectors (Y += X) More...
 
void binned_sbsbaddv (const int fold, const int N, const float_binned *X, const int incX, float_binned *Y, const int incY)
 Add binned single precision vectors (Y += X) More...
 
void binned_cbcbaddv (const int fold, const int N, const float_complex_binned *X, const int incX, float_complex_binned *Y, const int incY)
 Add binned complex single precision vectors (Y += X) More...
 
void binned_dbdadd (const int fold, const double X, double_binned *Y)
 Add double precision to binned double precision (Y += X) More...
 
void binned_dmdadd (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Add double precision to manually specified binned double precision (Y += X) More...
 
void binned_zbzadd (const int fold, const void *X, double_complex_binned *Y)
 Add complex double precision to binned complex double precision (Y += X) More...
 
void binned_zmzadd (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Add complex double precision to manually specified binned complex double precision (Y += X) More...
 
void binned_sbsadd (const int fold, const float X, float_binned *Y)
 Add single precision to binned single precision (Y += X) More...
 
void binned_smsadd (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Add single precision to manually specified binned single precision (Y += X) More...
 
void binned_cbcadd (const int fold, const void *X, float_complex_binned *Y)
 Add complex single precision to binned complex single precision (Y += X) More...
 
void binned_cmcadd (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Add complex single precision to manually specified binned complex single precision (Y += X) More...
 
void binned_dbdupdate (const int fold, const double X, double_binned *Y)
 Update binned double precision with double precision (X -> Y) More...
 
void binned_dmdupdate (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified binned double precision with double precision (X -> Y) More...
 
void binned_zbzupdate (const int fold, const void *X, double_complex_binned *Y)
 Update binned complex double precision with complex double precision (X -> Y) More...
 
void binned_zmzupdate (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified binned complex double precision with complex double precision (X -> Y) More...
 
void binned_zbdupdate (const int fold, const double X, double_complex_binned *Y)
 Update binned complex double precision with double precision (X -> Y) More...
 
void binned_zmdupdate (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified binned complex double precision with double precision (X -> Y) More...
 
void binned_sbsupdate (const int fold, const float X, float_binned *Y)
 Update binned single precision with single precision (X -> Y) More...
 
void binned_smsupdate (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified binned single precision with single precision (X -> Y) More...
 
void binned_cbcupdate (const int fold, const void *X, float_complex_binned *Y)
 Update binned complex single precision with complex single precision (X -> Y) More...
 
void binned_cmcupdate (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified binned complex single precision with complex single precision (X -> Y) More...
 
void binned_cbsupdate (const int fold, const float X, float_complex_binned *Y)
 Update binned complex single precision with single precision (X -> Y) More...
 
void binned_cmsupdate (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified binned complex single precision with single precision (X -> Y) More...
 
void binned_dbddeposit (const int fold, const double X, double_binned *Y)
 Add double precision to suitably binned binned double precision (Y += X) More...
 
void binned_dmddeposit (const int fold, const double X, double *priY, const int incpriY)
 Add double precision to suitably binned manually specified binned double precision (Y += X) More...
 
void binned_zbzdeposit (const int fold, const void *X, double_complex_binned *Y)
 Add complex double precision to suitably binned binned complex double precision (Y += X) More...
 
void binned_zmzdeposit (const int fold, const void *X, double *priY, const int incpriY)
 Add complex double precision to suitably binned manually specified binned complex double precision (Y += X) More...
 
void binned_sbsdeposit (const int fold, const float X, float_binned *Y)
 Add single precision to suitably binned binned single precision (Y += X) More...
 
void binned_smsdeposit (const int fold, const float X, float *priY, const int incpriY)
 Add single precision to suitably binned manually specified binned single precision (Y += X) More...
 
void binned_cbcdeposit (const int fold, const void *X, float_complex_binned *Y)
 Add complex single precision to suitably binned binned complex single precision (Y += X) More...
 
void binned_cmcdeposit (const int fold, const void *X, float *priY, const int incpriY)
 Add complex single precision to suitably binned manually specified binned complex single precision (Y += X) More...
 
void binned_dbrenorm (const int fold, double_binned *X)
 Renormalize binned double precision. More...
 
void binned_dmrenorm (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Renormalize manually specified binned double precision. More...
 
void binned_zbrenorm (const int fold, double_complex_binned *X)
 Renormalize binned complex double precision. More...
 
void binned_zmrenorm (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Renormalize manually specified binned complex double precision. More...
 
void binned_sbrenorm (const int fold, float_binned *X)
 Renormalize binned single precision. More...
 
void binned_smrenorm (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Renormalize manually specified binned single precision. More...
 
void binned_cbrenorm (const int fold, float_complex_binned *X)
 Renormalize binned complex single precision. More...
 
void binned_cmrenorm (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Renormalize manually specified binned complex single precision. More...
 
void binned_dbdconv (const int fold, const double X, double_binned *Y)
 Convert double precision to binned double precision (X -> Y) More...
 
void binned_dmdconv (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Convert double precision to manually specified binned double precision (X -> Y) More...
 
void binned_zbzconv (const int fold, const void *X, double_complex_binned *Y)
 Convert complex double precision to binned complex double precision (X -> Y) More...
 
void binned_zmzconv (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Convert complex double precision to manually specified binned complex double precision (X -> Y) More...
 
void binned_sbsconv (const int fold, const float X, float_binned *Y)
 Convert single precision to binned single precision (X -> Y) More...
 
void binned_smsconv (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Convert single precision to manually specified binned single precision (X -> Y) More...
 
void binned_cbcconv (const int fold, const void *X, float_complex_binned *Y)
 Convert complex single precision to binned complex single precision (X -> Y) More...
 
void binned_cmcconv (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Convert complex single precision to manually specified binned complex single precision (X -> Y) More...
 
double binned_ddbconv (const int fold, const double_binned *X)
 Convert binned double precision to double precision (X -> Y) More...
 
double binned_ddmconv (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Convert manually specified binned double precision to double precision (X -> Y) More...
 
void binned_zzbconv_sub (const int fold, const double_complex_binned *X, void *conv)
 Convert binned complex double precision to complex double precision (X -> Y) More...
 
void binned_zzmconv_sub (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, void *conv)
 Convert manually specified binned complex double precision to complex double precision (X -> Y) More...
 
float binned_ssbconv (const int fold, const float_binned *X)
 Convert binned single precision to single precision (X -> Y) More...
 
float binned_ssmconv (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Convert manually specified binned single precision to single precision (X -> Y) More...
 
void binned_ccbconv_sub (const int fold, const float_complex_binned *X, void *conv)
 Convert binned complex single precision to complex single precision (X -> Y) More...
 
void binned_ccmconv_sub (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, void *conv)
 Convert manually specified binned complex single precision to complex single precision (X -> Y) More...
 
void binned_dbnegate (const int fold, double_binned *X)
 Negate binned double precision (X = -X) More...
 
void binned_dmnegate (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Negate manually specified binned double precision (X = -X) More...
 
void binned_zbnegate (const int fold, double_complex_binned *X)
 Negate binned complex double precision (X = -X) More...
 
void binned_zmnegate (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Negate manually specified binned complex double precision (X = -X) More...
 
void binned_sbnegate (const int fold, float_binned *X)
 Negate binned single precision (X = -X) More...
 
void binned_smnegate (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Negate manually specified binned single precision (X = -X) More...
 
void binned_cbnegate (const int fold, float_complex_binned *X)
 Negate binned complex single precision (X = -X) More...
 
void binned_cmnegate (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Negate manually specified binned complex single precision (X = -X) More...
 
double binned_dscale (const double X)
 Get a reproducible double precision scale. More...
 
float binned_sscale (const float X)
 Get a reproducible single precision scale. More...
 
void binned_dmdrescale (const int fold, const double X, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 rescale manually specified binned double precision sum of squares More...
 
void binned_zmdrescale (const int fold, const double X, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 rescale manually specified binned complex double precision sum of squares More...
 
void binned_smsrescale (const int fold, const float X, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 rescale manually specified binned single precision sum of squares More...
 
void binned_cmsrescale (const int fold, const float X, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 rescale manually specified binned complex single precision sum of squares More...
 
double binned_dmdmaddsq (const int fold, const double scaleX, const double *priX, const int incpriX, const double *carX, const int inccarX, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified binned double precision scaled sums of squares (Y += X) More...
 
double binned_dbdbaddsq (const int fold, const double scaleX, const double_binned *X, const double scaleY, double_binned *Y)
 Add binned double precision scaled sums of squares (Y += X) More...
 
float binned_smsmaddsq (const int fold, const float scaleX, const float *priX, const int incpriX, const float *carX, const int inccarX, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified binned single precision scaled sums of squares (Y += X) More...
 
float binned_sbsbaddsq (const int fold, const float scaleX, const float_binned *X, const float scaleY, float_binned *Y)
 Add binned single precision scaled sums of squares (Y += X) More...
 
double binned_ufp (const double X)
 unit in the first place More...
 
float binned_ufpf (const float X)
 unit in the first place More...
 

Detailed Description

binned.h defines the binned types and the lower level functions associated with their use.

This header is modeled after cblas.h, and as such functions are prefixed with character sets describing the data types they operate upon. For example, the function dfoo would perform the function foo on double possibly returning a double.

If two character sets are prefixed, the first set of characters describes the output and the second the input type. For example, the function dzbar would perform the function bar on double complex and return a double.

Such character sets are listed as follows:

Throughout the library, complex types are specified via *void pointers. These routines will sometimes be suffixed by sub, to represent that a function has been made into a subroutine. This allows programmers to use whatever complex types they are already using, as long as the memory pointed to is of the form of two adjacent floating point types, the first and second representing real and imaginary components of the complex number.

The goal of using binned types is to obtain either more accurate or reproducible summation of floating point numbers. In reproducible summation, floating point numbers are split into several slices along predefined boundaries in the exponent range. The space between two boundaries is called a bin. Binned types are composed of several accumulators, each accumulating the slices in a particular bin. The accumulators correspond to the largest consecutive nonzero bins seen so far.

The parameter fold describes how many accumulators are used in the binned types supplied to a subroutine (an binned type with k accumulators is k-fold). The default value for this parameter can be set in config.h. If you are unsure of what value to use for fold, we recommend 3. Note that the fold of binned types must be the same for all binned types that interact with each other. Operations on more than one binned type assume all binned types being operated upon have the same fold. Note that the fold of an binned type may not be changed once the type has been allocated. A common use case would be to set the value of fold as a global macro in your code and supply it to all binned functions that you use.

Power users of the library may find themselves wanting to manually specify the underlying primary and carry vectors of an binned type themselves. If you do not know what these are, don't worry about the manually specified binned types.

Macro Definition Documentation

#define binned_DBCAPACITY   (binned_DBENDURANCE*(1.0/DBL_EPSILON - 1.0))

Binned double precision capacity.

The maximum number of double precision numbers that can be summed using binned double precision. Applies also to binned complex double precision.

Author
Peter Ahrens
Date
27 Apr 2015
#define binned_DBENDURANCE   (1 << (DBL_MANT_DIG - DBWIDTH - 2))

Binned double precision deposit endurance.

The number of deposits that can be performed before a renorm is necessary. Applies also to binned complex double precision.

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define binned_DBMAXFOLD   (binned_DBMAXINDEX + 1)

The maximum double precision fold supported by the library.

Author
Peter Ahrens
Date
14 Jan 2016
#define binned_DBMAXINDEX   (((DBL_MAX_EXP - DBL_MIN_EXP + DBL_MANT_DIG - 1)/DBWIDTH) - 1)

Binned double precision maximum index.

maximum index (inclusive)

Author
Peter Ahrens
Date
24 Jun 2015
#define binned_DMCOMPRESSION   (1.0/(1 << (DBL_MANT_DIG - DBWIDTH + 1)))

Binned double precision compression factor.

This factor is used to scale down inputs before deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define binned_DMEXPANSION   (1.0*(1 << (DBL_MANT_DIG - DBWIDTH + 1)))

Binned double precision expansion factor.

This factor is used to scale up inputs after deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define binned_SBCAPACITY   (binned_SBENDURANCE*(1.0/FLT_EPSILON - 1.0))

Binned single precision capacity.

The maximum number of single precision numbers that can be summed using binned single precision. Applies also to binned complex double precision.

Author
Peter Ahrens
Date
27 Apr 2015
#define binned_SBENDURANCE   (1 << (FLT_MANT_DIG - SBWIDTH - 2))

Binned single precision deposit endurance.

The number of deposits that can be performed before a renorm is necessary. Applies also to binned complex single precision.

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define binned_SBMAXFOLD   (binned_SBMAXINDEX + 1)

The maximum single precision fold supported by the library.

Author
Peter Ahrens
Date
14 Jan 2016
#define binned_SBMAXINDEX   (((FLT_MAX_EXP - FLT_MIN_EXP + FLT_MANT_DIG - 1)/SBWIDTH) - 1)

Binned single precision maximum index.

maximum index (inclusive)

Author
Peter Ahrens
Date
24 Jun 2015
#define binned_SMCOMPRESSION   (1.0/(1 << (FLT_MANT_DIG - SBWIDTH + 1)))

Binned single precision compression factor.

This factor is used to scale down inputs before deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define binned_SMEXPANSION   (1.0*(1 << (FLT_MANT_DIG - SBWIDTH + 1)))

Binned single precision expansion factor.

This factor is used to scale up inputs after deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define DBWIDTH   40

Binned double precision bin width.

bin width (in bits)

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define SBWIDTH   13

Binned single precision bin width.

bin width (in bits)

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015

Typedef Documentation

typedef double double_binned

The binned double datatype.

To allocate a double_binned, call binned_dballoc()

Warning
A double_binned is, under the hood, an array of double. Therefore, if you have defined an array of double_binned, you must index it by multiplying the index into the array by the number of underlying double that make up the double_binned. This number can be obtained by a call to binned_dbnum()
typedef double double_complex_binned

The binned complex double datatype.

To allocate a double_complex_binned, call binned_zballoc()

Warning
A double_complex_binned is, under the hood, an array of double. Therefore, if you have defined an array of double_complex_binned, you must index it by multiplying the index into the array by the number of underlying double that make up the double_complex_binned. This number can be obtained by a call to binned_zbnum()
typedef float float_binned

The binned float datatype.

To allocate a float_binned, call binned_sballoc()

Warning
A float_binned is, under the hood, an array of float. Therefore, if you have defined an array of float_binned, you must index it by multiplying the index into the array by the number of underlying float that make up the float_binned. This number can be obtained by a call to binned_sbnum()
typedef float float_complex_binned

The binned complex float datatype.

To allocate a float_complex_binned, call binned_cballoc()

Warning
A float_complex_binned is, under the hood, an array of float. Therefore, if you have defined an array of float_complex_binned, you must index it by multiplying the index into the array by the number of underlying float that make up the float_complex_binned. This number can be obtained by a call to binned_cbnum()

Function Documentation

float_complex_binned* binned_cballoc ( const int  fold)

binned complex single precision allocation

Parameters
foldthe fold of the binned type
Returns
a freshly allocated binned type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
void binned_cbcadd ( const int  fold,
const void *  X,
float_complex_binned Y 
)

Add complex single precision to binned complex single precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbcbadd ( const int  fold,
const float_complex_binned X,
float_complex_binned Y 
)

Add binned complex single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbcbaddv ( const int  fold,
const int  N,
const float_complex_binned X,
const int  incX,
float_complex_binned Y,
const int  incY 
)

Add binned complex single precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Nvector length
Xbinned vector X
incXX vector stride (use every incX'th element)
Ybinned vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void binned_cbcbset ( const int  fold,
const float_complex_binned X,
float_complex_binned Y 
)

Set binned complex single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbcconv ( const int  fold,
const void *  X,
float_complex_binned Y 
)

Convert complex single precision to binned complex single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbcdeposit ( const int  fold,
const void *  X,
float_complex_binned Y 
)

Add complex single precision to suitably binned binned complex single precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_cbcupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_cbcdeposit() to deposit a maximum of binned_SBENDURANCE elements into Y before renormalizing Y with binned_cbrenorm(). After any number of successive calls of binned_cbcdeposit() on Y, you must renormalize Y with binned_cbrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_cbcupdate ( const int  fold,
const void *  X,
float_complex_binned Y 
)

Update binned complex single precision with complex single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbnegate ( const int  fold,
float_complex_binned X 
)

Negate binned complex single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_cbnum ( const int  fold)

binned complex single precision size

Parameters
foldthe fold of the binned type
Returns
the size (in float) of the binned type
Author
Peter Ahrens
Date
27 Apr 2015
void binned_cbprint ( const int  fold,
const float_complex_binned X 
)

Print binned complex single precision.

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbrenorm ( const int  fold,
float_complex_binned X 
)

Renormalize binned complex single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbsbset ( const int  fold,
const float_binned X,
float_complex_binned Y 
)

Set binned complex single precision to binned single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbsetzero ( const int  fold,
float_complex_binned X 
)

Set binned single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t binned_cbsize ( const int  fold)

binned complex single precision size

Parameters
foldthe fold of the binned type
Returns
the size (in bytes) of the binned type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cbsupdate ( const int  fold,
const float  X,
float_complex_binned Y 
)

Update binned complex single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_ccbconv_sub ( const int  fold,
const float_complex_binned X,
void *  conv 
)

Convert binned complex single precision to complex single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xbinned scalar X
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_ccmconv_sub ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
void *  conv 
)

Convert manually specified binned complex single precision to complex single precision (X -> Y)

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmcadd ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add complex single precision to manually specified binned complex single precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmcconv ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Convert complex single precision to manually specified binned complex single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmcdeposit ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY 
)

Add complex single precision to suitably binned manually specified binned complex single precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_cmcupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_cmcdeposit() to deposit a maximum of binned_SBENDURANCE elements into Y before renormalizing Y with binned_cmrenorm(). After any number of successive calls of binned_cmcdeposit() on Y, you must renormalize Y with binned_cmrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_cmcmadd ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified binned complex single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmcmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified binned complex single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmcupdate ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified binned complex single precision with complex single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_cmdenorm ( const int  fold,
const float *  priX 
)

Check if binned type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the binned type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void binned_cmnegate ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Negate manually specified binned complex single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmprint ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Print manually specified binned complex single precision.

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmrenorm ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Renormalize manually specified binned complex single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmsetzero ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Set manually specified binned complex single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmsmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified binned complex single precision to manually specified binned single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_cmsrescale ( const int  fold,
const float  X,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

rescale manually specified binned complex single precision sum of squares

Rescale an binned complex single precision sum of squares Y

Parameters
foldthe fold of the binned types
XY's new scaleY (X == binned_sscale (f) for some float f) (X >= scaleY)
scaleYY's current scaleY (scaleY == binned_sscale (f) for some float f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
19 Jun 2015
void binned_cmsupdate ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified binned complex single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double_binned* binned_dballoc ( const int  fold)

binned double precision allocation

Parameters
foldthe fold of the binned type
Returns
a freshly allocated binned type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
double binned_dbbound ( const int  fold,
const int  N,
const double  X,
const double  S 
)

Get binned double precision summation error bound.

This is a bound on the absolute error of a summation using binned types

Parameters
foldthe fold of the binned types
Nthe number of double precision floating point summands
Xthe summand of maximum absolute value
Sthe value of the sum computed using binned types
Returns
error bound
Author
Peter Ahrens
Date
31 Jul 2015
void binned_dbdadd ( const int  fold,
const double  X,
double_binned Y 
)

Add double precision to binned double precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbdbadd ( const int  fold,
const double_binned X,
double_binned Y 
)

Add binned double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_dbdbaddsq ( const int  fold,
const double  scaleX,
const double_binned X,
const double  scaleY,
double_binned Y 
)

Add binned double precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the binned types
scaleXscale of X (scaleX == binned_dscale (Z) for some double Z)
Xbinned scalar X
scaleYscale of Y (scaleY == binned_dscale (Z) for some double Z)
Ybinned scalar Y
Returns
updated scale of Y
Author
Peter Ahrens
Date
2 Dec 2015
void binned_dbdbaddv ( const int  fold,
const int  N,
const double_binned X,
const int  incX,
double_binned Y,
const int  incY 
)

Add binned double precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Nvector length
Xbinned vector X
incXX vector stride (use every incX'th element)
Ybinned vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void binned_dbdbset ( const int  fold,
const double_binned X,
double_binned Y 
)

Set binned double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbdconv ( const int  fold,
const double  X,
double_binned Y 
)

Convert double precision to binned double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbddeposit ( const int  fold,
const double  X,
double_binned Y 
)

Add double precision to suitably binned binned double precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_dbdupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_dbddeposit() to deposit a maximum of binned_DBENDURANCE elements into Y before renormalizing Y with binned_dbrenorm(). After any number of successive calls of binned_dbddeposit() on Y, you must renormalize Y with binned_dbrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_dbdupdate ( const int  fold,
const double  X,
double_binned Y 
)

Update binned double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbnegate ( const int  fold,
double_binned X 
)

Negate binned double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_dbnum ( const int  fold)

binned double precision size

Parameters
foldthe fold of the binned type
Returns
the size (in double) of the binned type
Author
Peter Ahrens
Date
27 Apr 2015
void binned_dbprint ( const int  fold,
const double_binned X 
)

Print binned double precision.

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbrenorm ( const int  fold,
double_binned X 
)

Renormalize binned double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dbsetzero ( const int  fold,
double_binned X 
)

Set binned double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t binned_dbsize ( const int  fold)

binned double precision size

Parameters
foldthe fold of the binned type
Returns
the size (in bytes) of the binned type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_ddbconv ( const int  fold,
const double_binned X 
)

Convert binned double precision to double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xbinned scalar X
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_ddmconv ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Convert manually specified binned double precision to double precision (X -> Y)

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Returns
scalar Y
Author
Peter Ahrens
Date
31 Jul 2015
int binned_dindex ( const double  X)

Get index of double precision.

The index of a non-binned type is the smallest index an binned type would need to have to sum it reproducibly. Higher indicies correspond to smaller bins.

Parameters
Xscalar X
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
const double* binned_dmbins ( const int  X)

Get binned double precision reference bins.

returns a pointer to the bins corresponding to the given index

Parameters
Xindex
Returns
pointer to constant double precision bins of index X
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
void binned_dmdadd ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add double precision to manually specified binned double precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dmdconv ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Convert double precision to manually specified binned double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
30 Apr 2015
void binned_dmddeposit ( const int  fold,
const double  X,
double *  priY,
const int  incpriY 
)

Add double precision to suitably binned manually specified binned double precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_dmdupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_dmddeposit() to deposit a maximum of binned_DBENDURANCE elements into Y before renormalizing Y with binned_dmrenorm(). After any number of successive calls of binned_dmddeposit() on Y, you must renormalize Y with binned_dmrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
int binned_dmdenorm ( const int  fold,
const double *  priX 
)

Check if binned type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the binned type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void binned_dmdmadd ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified binned double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_dmdmaddsq ( const int  fold,
const double  scaleX,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified binned double precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the binned types
scaleXscale of X (scaleX == binned_dscale (Z) for some double Z)
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
scaleYscale of Y (scaleY == binned_dscale (Z) for some double Z)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Returns
updated scale of Y
Author
Peter Ahrens
Date
1 Jun 2015
void binned_dmdmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified binned double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dmdrescale ( const int  fold,
const double  X,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

rescale manually specified binned double precision sum of squares

Rescale an binned double precision sum of squares Y

Parameters
foldthe fold of the binned types
XY's new scaleY (X == binned_dscale (f) for some double f) (X >= scaleY)
scaleYY's current scaleY (scaleY == binned_dscale (f) for some double f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
19 Jun 2015
void binned_dmdupdate ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified binned double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
5 May 2015
int binned_dmindex ( const double *  priX)

Get index of manually specified binned double precision.

The index of an binned type is the bin that it corresponds to. Higher indicies correspond to smaller bins.

Parameters
priXX's primary vector
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
23 Sep 2015
int binned_dmindex0 ( const double *  priX)

Check if index of manually specified binned double precision is 0.

A quick check to determine if the index is 0

Parameters
priXX's primary vector
Returns
>0 if x has index 0, 0 otherwise.
Author
Peter Ahrens
Date
19 May 2015
void binned_dmnegate ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Negate manually specified binned double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dmprint ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Print manually specified binned double precision.

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_dmrenorm ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Renormalize manually specified binned double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
23 Sep 2015
void binned_dmsetzero ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Set manually specified binned double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_dscale ( const double  X)

Get a reproducible double precision scale.

For any given X, return a reproducible scaling factor Y of the form

2^(DBWIDTH * z) where z is an integer

such that

Y * 2^(-DBL_MANT_DIG - DBWIDTH - 1) < X < Y * 2\^(DBWIDTH + 2)

Parameters
Xdouble precision number to be scaled
Returns
reproducible scaling factor
Author
Peter Ahrens
Date
19 Jun 2015
float_binned* binned_sballoc ( const int  fold)

binned single precision allocation

Parameters
foldthe fold of the binned type
Returns
a freshly allocated binned type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
float binned_sbbound ( const int  fold,
const int  N,
const float  X,
const float  S 
)

Get binned single precision summation error bound.

This is a bound on the absolute error of a summation using binned types

Parameters
foldthe fold of the binned types
Nthe number of single precision floating point summands
Xthe summand of maximum absolute value
Sthe value of the sum computed using binned types
Returns
error bound
Author
Peter Ahrens
Date
31 Jul 2015
Author
Peter Ahrens
Hong Diep Nguyen
Date
21 May 2015
void binned_sbnegate ( const int  fold,
float_binned X 
)

Negate binned single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_sbnum ( const int  fold)

binned single precision size

Parameters
foldthe fold of the binned type
Returns
the size (in float) of the binned type
Author
Peter Ahrens
Date
27 Apr 2015
void binned_sbprint ( const int  fold,
const float_binned X 
)

Print binned single precision.

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbrenorm ( const int  fold,
float_binned X 
)

Renormalize binned single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbsadd ( const int  fold,
const float  X,
float_binned Y 
)

Add single precision to binned single precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbsbadd ( const int  fold,
const float_binned X,
float_binned Y 
)

Add binned single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float binned_sbsbaddsq ( const int  fold,
const float  scaleX,
const float_binned X,
const float  scaleY,
float_binned Y 
)

Add binned single precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the binned types
scaleXscale of X (scaleX == binned_sscale (Z) for some float Z)
Xbinned scalar X
scaleYscale of Y (scaleY == binned_sscale (Z) for some float Z)
Ybinned scalar Y
Returns
updated scale of Y
Author
Peter Ahrens
Date
2 Dec 2015
void binned_sbsbaddv ( const int  fold,
const int  N,
const float_binned X,
const int  incX,
float_binned Y,
const int  incY 
)

Add binned single precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Nvector length
Xbinned vector X
incXX vector stride (use every incX'th element)
Ybinned vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void binned_sbsbset ( const int  fold,
const float_binned X,
float_binned Y 
)

Set binned single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t binned_sbsbze ( const int  fold)

binned single precision size

Parameters
foldthe fold of the binned type
Returns
the size (in bytes) of the binned type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbsconv ( const int  fold,
const float  X,
float_binned Y 
)

Convert single precision to binned single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbsdeposit ( const int  fold,
const float  X,
float_binned Y 
)

Add single precision to suitably binned binned single precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_sbsupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_sbsdeposit() to deposit a maximum of binned_SBENDURANCE elements into Y before renormalizing Y with binned_sbrenorm(). After any number of successive calls of binned_sbsdeposit() on Y, you must renormalize Y with binned_sbrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_sbsetzero ( const int  fold,
float_binned X 
)

Set binned single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_sbsupdate ( const int  fold,
const float  X,
float_binned Y 
)

Update binned single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_sindex ( const float  X)

Get index of single precision.

The index of a non-binned type is the smallest index an binned type would need to have to sum it reproducibly. Higher indicies correspond to smaller bins.

Parameters
Xscalar X
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
const float* binned_smbins ( const int  X)

Get binned single precision reference bins.

returns a pointer to the bins corresponding to the given index

Parameters
Xindex
Returns
pointer to constant single precision bins of index X
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
int binned_smdenorm ( const int  fold,
const float *  priX 
)

Check if binned type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the binned type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
int binned_smindex ( const float *  priX)

Get index of manually specified binned single precision.

The index of an binned type is the bin that it corresponds to. Higher indicies correspond to smaller bins.

Parameters
priXX's primary vector
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
23 Sep 2015
int binned_smindex0 ( const float *  priX)

Check if index of manually specified binned single precision is 0.

A quick check to determine if the index is 0

Parameters
priXX's primary vector
Returns
>0 if x has index 0, 0 otherwise.
Author
Peter Ahrens
Date
19 May 2015
void binned_smnegate ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Negate manually specified binned single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_smprint ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Print manually specified binned single precision.

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_smrenorm ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Renormalize manually specified binned single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
23 Sep 2015
void binned_smsadd ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add single precision to manually specified binned single precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_smsconv ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Convert single precision to manually specified binned single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
30 Apr 2015
void binned_smsdeposit ( const int  fold,
const float  X,
float *  priY,
const int  incpriY 
)

Add single precision to suitably binned manually specified binned single precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_smsupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_smsdeposit() to deposit a maximum of binned_SBENDURANCE elements into Y before renormalizing Y with binned_smrenorm(). After any number of successive calls of binned_smsdeposit() on Y, you must renormalize Y with binned_smrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_smsetzero ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Set manually specified binned single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_smsmadd ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified binned single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float binned_smsmaddsq ( const int  fold,
const float  scaleX,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified binned single precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the binned types
scaleXscale of X (scaleX == binned_sscale (Z) for some float Z)
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
scaleYscale of Y (scaleY == binned_sscale (Z) for some double Z)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Returns
updated scale of Y
Author
Peter Ahrens
Date
1 Jun 2015
void binned_smsmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified binned single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_smsrescale ( const int  fold,
const float  X,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

rescale manually specified binned single precision sum of squares

Rescale an binned single precision sum of squares Y

Parameters
foldthe fold of the binned types
XY's new scaleY (X == binned_sscale (f) for some float f) (X >= scaleY)
scaleYY's current scaleY (scaleY == binned_sscale (f) for some float f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
1 Jun 2015
void binned_smsupdate ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified binned single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
5 May 2015
float binned_ssbconv ( const int  fold,
const float_binned X 
)

Convert binned single precision to single precision (X -> Y)

Parameters
foldthe fold of the binned types
Xbinned scalar X
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float binned_sscale ( const float  X)

Get a reproducible single precision scale.

For any given X, return a reproducible scaling factor Y of the form

2^(SBWIDTH * z) where z is an integer

such that

Y * 2^(-FLT_MANT_DIG - SBWIDTH - 1) < X < Y * 2\^(SBWIDTH + 2)

Parameters
Xsingle precision number to be scaled
Returns
reproducible scaling factor
Author
Peter Ahrens
Date
19 Jun 2015
float binned_ssmconv ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Convert manually specified binned single precision to single precision (X -> Y)

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double binned_ufp ( double  X)

unit in the first place

This method returns just the implicit 1 in the mantissa of a double

Parameters
Xscalar X
Returns
unit in the first place
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float binned_ufpf ( float  X)

unit in the first place

This method returns just the implicit 1 in the mantissa of a float

Parameters
Xscalar X
Returns
unit in the first place
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double_complex_binned* binned_zballoc ( const int  fold)

binned complex double precision allocation

Parameters
foldthe fold of the binned type
Returns
a freshly allocated binned type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
void binned_zbdbset ( const int  fold,
const double_binned X,
double_complex_binned Y 
)

Set binned complex double precision to binned double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbdupdate ( const int  fold,
const double  X,
double_complex_binned Y 
)

Update binned complex double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbnegate ( const int  fold,
double_complex_binned X 
)

Negate binned complex double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_zbnum ( const int  fold)

binned complex double precision size

Parameters
foldthe fold of the binned type
Returns
the size (in double) of the binned type
Author
Peter Ahrens
Date
27 Apr 2015
void binned_zbprint ( const int  fold,
const double_complex_binned X 
)

Print binned complex double precision.

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbrenorm ( const int  fold,
double_complex_binned X 
)

Renormalize binned complex double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbsetzero ( const int  fold,
double_complex_binned X 
)

Set binned double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
Xbinned scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t binned_zbsize ( const int  fold)

binned complex double precision size

Parameters
foldthe fold of the binned type
Returns
the size (in bytes) of the binned type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbzadd ( const int  fold,
const void *  X,
double_complex_binned Y 
)

Add complex double precision to binned complex double precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbzbadd ( const int  fold,
const double_complex_binned X,
double_complex_binned Y 
)

Add binned complex double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbzbaddv ( const int  fold,
const int  N,
const double_complex_binned X,
const int  incX,
double_complex_binned Y,
const int  incY 
)

Add binned complex double precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
Nvector length
Xbinned vector X
incXX vector stride (use every incX'th element)
Ybinned vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void binned_zbzbset ( const int  fold,
const double_complex_binned X,
double_complex_binned Y 
)

Set binned complex double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
Xbinned scalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbzconv ( const int  fold,
const void *  X,
double_complex_binned Y 
)

Convert complex double precision to binned complex double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zbzdeposit ( const int  fold,
const void *  X,
double_complex_binned Y 
)

Add complex double precision to suitably binned binned complex double precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_zbzupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_zbzdeposit() to deposit a maximum of binned_DBENDURANCE elements into Y before renormalizing Y with binned_zbrenorm(). After any number of successive calls of binned_zbzdeposit() on Y, you must renormalize Y with binned_zbrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_zbzupdate ( const int  fold,
const void *  X,
double_complex_binned Y 
)

Update binned complex double precision with complex double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the binned types
Xscalar X
Ybinned scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int binned_zmdenorm ( const int  fold,
const double *  priX 
)

Check if binned type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the binned type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void binned_zmdmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified binned complex double precision to manually specified binned double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmdrescale ( const int  fold,
const double  X,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

rescale manually specified binned complex double precision sum of squares

Rescale an binned complex double precision sum of squares Y

Parameters
foldthe fold of the binned types
XY's new scaleY (X == binned_dscale (f) for some double f) (X >= scaleY)
scaleYY's current scaleY (scaleY == binned_dscale (f) for some double f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
1 Jun 2015
void binned_zmdupdate ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified binned complex double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmnegate ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Negate manually specified binned complex double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmprint ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Print manually specified binned complex double precision.

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmrenorm ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Renormalize manually specified binned complex double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmsetzero ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Set manually specified binned complex double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmzadd ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add complex double precision to manually specified binned complex double precision (Y += X)

Performs the operation Y += X on an binned type Y

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmzconv ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Convert complex double precision to manually specified binned complex double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmzdeposit ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY 
)

Add complex double precision to suitably binned manually specified binned complex double precision (Y += X)

Performs the operation Y += X on an binned type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called binned_zmzupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call binned_zmzdeposit() to deposit a maximum of binned_DBENDURANCE elements into Y before renormalizing Y with binned_zmrenorm(). After any number of successive calls of binned_zmzdeposit() on Y, you must renormalize Y with binned_zmrenorm() before using any other function on Y.
Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void binned_zmzmadd ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified binned complex double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmzmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified binned complex double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zmzupdate ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified binned complex double precision with complex double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the binned types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zzbconv_sub ( const int  fold,
const double_complex_binned X,
void *  conv 
)

Convert binned complex double precision to complex double precision (X -> Y)

Parameters
foldthe fold of the binned types
Xbinned scalar X
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void binned_zzmconv_sub ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
void *  conv 
)

Convert manually specified binned complex double precision to complex double precision (X -> Y)

Parameters
foldthe fold of the binned types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015