22 #include <lal/LALAtomicDatatypes.h>
23 #include <lal/LALStdio.h>
24 #include <lal/XLALError.h>
75 INT4 gpssec = floor(t);
81 if(fabs(t) > 0x7fffffff) {
82 XLALPrintError(
"%s(): overflow: %.17g out of range of a 32-bit signed integer\n", __func__, t);
176 if ( t0 == NULL || t1 == NULL ) {
177 return ( t1 != NULL ) ? -1 : ( ( t0 != NULL ) ? 1 : 0 );
182 return ( ns0 > ns1 ) - ( ns0 < ns1 );
233 double addendlo[4], addendhi[4];
235 if(isnan(
x) || isinf(
x)) {
269 addendlo[0] = modf(slo * xlo, &addendhi[0]);
270 addendlo[1] = modf(shi * xlo, &addendhi[1]);
271 addendlo[2] = modf(slo * xhi, &addendhi[2]);
272 addendlo[3] = modf(shi * xhi, &addendhi[3]);
280 if(!
XLALGPSSetREAL8(&workspace, addendhi[0] + addendhi[1] + addendhi[2] + addendhi[3]))
295 double threshold = 0.5e-9 * (1. + fabs(1. /
x));
331 }
while(fabs(residual) > threshold);
#define XLAL_BILLION_INT8
#define XLAL_BILLION_REAL8
int XLALPrintError(const char *fmt,...)
#define LAL_REAL4_EPS
Difference between 1 and the next resolvable REAL4 2^-23.
double REAL8
Double precision real floating-point number (8 bytes).
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
int32_t INT4
Four-byte signed integer.
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
@ XLAL_EFPINVAL
IEEE Invalid floating point operation, eg sqrt(-1), 0/0.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_EDOM
Input domain error.
@ XLAL_EFPDIV0
IEEE Division by zero floating point error.
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
Adds a double to a GPS time.
REAL8 XLALGPSModf(REAL8 *iptr, const LIGOTimeGPS *epoch)
Breaks the GPS time into REAL8 integral and fractional parts, each of which has the same sign as the ...
LIGOTimeGPS * XLALGPSDivide(LIGOTimeGPS *gps, REAL8 x)
Divide a GPS time by a number.
static void split_double(double x, double *hi, double *lo)
LIGOTimeGPS * XLALGPSAddGPS(LIGOTimeGPS *epoch, const LIGOTimeGPS *dt)
Adds two GPS times.
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
Sets GPS time given GPS seconds as a REAL8.
int XLALGPSCmp(const LIGOTimeGPS *t0, const LIGOTimeGPS *t1)
Compares two GPS times.
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
Returns the GPS time as a REAL8.
LIGOTimeGPS * XLALGPSMultiply(LIGOTimeGPS *gps, REAL8 x)
Multiply a GPS time by a number.
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
Difference between two GPS times as double.
LIGOTimeGPS * XLALGPSSet(LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan)
Sets GPS time given GPS integer seconds and residual nanoseconds.
LIGOTimeGPS * XLALINT8NSToGPS(LIGOTimeGPS *epoch, INT8 ns)
Converts nano seconds stored as an INT8 to GPS time.
INT8 XLALGPSToINT8NS(const LIGOTimeGPS *epoch)
Converts GPS time to nano seconds stored as an INT8.
LIGOTimeGPS * XLALGPSSubGPS(LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
Difference between two GPS times.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
INT4 gpsNanoSeconds
Residual nanoseconds.