Common Lisp Package: OCT-INTERNAL

README:

FUNCTION

Public

ABS-QD (A)

Returns the absolute value of the %QUAD-DOUBLE A

ACOS-QD (A)

Return the arc cosine of the %QUAD-DOUBLE number A

ACOSH-QD (A)

Return the inverse hyperbolic cosine of the %QUAD-DOUBLE number A

ADD-D-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the sum of the DOUBLE-FLOAT A and the %QUAD-DOUBLE B. If TARGET is given, TARGET is destructively modified to contain the result.

ADD-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the sum of the %QUAD-DOUBLE numbers A and B. If TARGET is given, TARGET is destructively modified to contain the result.

ADD-QD-D (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the sum of the %QUAD-DOUBLE A and the DOUBLE-FLOAT B. If TARGET is given, TARGET is destructively modified to contain the result.

ASIN-QD (A)

Return the arc sine of the %QUAD-DOUBLE number A

ASINH-QD (A)

Return the inverse hyperbolic sine of the %QUAD-DOUBLE number A

ATAN-QD (Y)

Return the arc tangent of the %QUAD-DOUBLE number Y

ATAN2-QD (Y X)

atan2(y, x) = atan(y/x), but carefully handling the quadrant

ATANH-QD (A)

Return the inverse hyperbolic tangent of the %QUAD-DOUBLE number A

COS-QD (A)

Return the cosine of the %QUAD-DOUBLE number A

COSH-QD (A)

Return the hyperbolic cosine of the %QUAD-DOUBLE number A

DECODE-FLOAT-QD (Q)

Like DECODE-FLOAT, but for %QUAD-DOUBLE numbers. Returns three values: 1) a %QUAD-DOUBLE number representing the significand. This is always between 0.5 (inclusive) and 1.0 (exclusive). 2) an integer representing the exponent. 3) -1.0 or 1.0 (i.e. the sign of the argument.)

DIV-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the quotient of the two %QUAD-DOUBLE numbers A and B. If TARGET is given, it destrutively modified with the result.

DIV-QD-D (A B)

Divides the %QUAD-DOUBLE number A by the DOUBLE-FLOAT number B.

EXP-QD (A)

Return the expnential of the %QUAD-DOUBLE number A

FFLOOR-QD (A)

The floor of the %QUAD-DOUBLE A, returned as a %QUAD-DOUBLE number

HYPOT-QD (X Y)

sqrt(x^2+y^2) computed carefully without unnecessary overflow for the %QUAD-DOUBLE numbers X and Y

INTEGER-DECODE-QD (Q)

Like INTEGER-DECODE-FLOAT, but for %QUAD-DOUBLE numbers. Returns three values: 1) an integer representation of the significand. 2) the exponent for the power of 2 that the significand must be multiplied by to get the actual value. 3) -1 or 1 (i.e. the sign of the argument.)

LOG-QD (A)

Return the (natural) log of the non-negative %QUAD-DOUBLE number A

LOG1P-QD (X)

Return log1p(x) = log(1+x), done more accurately than just evaluating log(1+x). X is a non-negative %QUAD-DOUBLE number

MAKE-QD-D (A0 &OPTIONAL (A1 0.0d0 A1-P) (A2 0.0d0) (A3 0.0d0))

Create a %QUAD-DOUBLE from four double-floats, appropriately normalizing the result from the four double-floats. A0 is the most significant part of the %QUAD-DOUBLE, and A3 is the least. The optional parameters default to 0.

MINUSP-QD (A)

Returns T if the %QUAD-DOUBLE number A is strictly negative.

MUL-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Returns the product of the %QUAD-DOUBLE numbers A and B. If TARGET is given, TARGET is destructively modified to contain the result.

MUL-QD-D (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the product of the %QUAD-DOUBLE number A and the DOUBLE-FLOAT number B. If TARGET is given, TARGET is destructively modified to contain the result.

NEG-QD (A &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the negative of the %QUAD-DOUBLE number A. If TARGET is given, TARGET is destructively modified to contain the result.

NPOW (A N)

Return N'th power of A, where A is a %QUAD-DOUBLE number and N is a fixnum.

PLUSP-QD (A)

Returns T if the %QUAD-DOUBLE number A is strictly positive.

QD-< (A B)

Returns T if A < B, where A and B are %QUAD-DOUBLE numbers.

QD-<= (A B)

Returns T if A <= B, where A and B are %QUAD-DOUBLE numbers.

QD-= (A B)

Returns T if the %QUAD-DOUBLE numbers A and B are numerically equal.

QD-> (A B)

Returns T if A > B, where A and B are %QUAD-DOUBLE numbers.

QD->= (A B)

Returns T if A >= B, where A and B are %QUAD-DOUBLE numbers.

QD-PARTS (QD)

Extract the four doubles comprising a quad-double and return them as multiple values. The most significant double is the first value.

RANDOM-QD (&OPTIONAL (STATE *RANDOM-STATE*))

Generate a %QUAD-DOUBLE random number in the range [0,1)

RATIONAL-TO-QD (RAT)

Convert a rational number RAT to a %QUAD-DOUBLE number

READ-QD (STREAM)

Read a %QUAD-DOUBLE number from the stream STREAM. The format of the number should be like a float, but with extra significant digits allowed. An exponent marker of Q is allowed.

SCALE-FLOAT-QD (QD K)

Scale the %QUAD-DOUBLE number QD by 2^K. Just like SCALE-FLOAT

SIN-QD (A)

Return the sine of the %QUAD-DOUBLE number A

SINH-QD (A)

Return the hyperbolic sine of the %QUAD-DOUBLE number A

SQR-QD (A &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the square of the %QUAD-DOUBLE number A. If TARGET is also given, it is destructively modified with the result.

SQRT-QD (A)

Return the square root of the (non-negative) %QUAD-DOUBLE number A

SUB-D-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the difference between the DOUBLE-FLOAT number A and the %QUAD-DOUBLE number B. If TARGET is given, TARGET is destructively modified to contain the result.

SUB-QD (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the difference between the %QUAD-DOUBLE numbers A and B. If TARGET is given, TARGET is destructively modified to contain the result.

SUB-QD-D (A B &OPTIONAL (TARGET (%MAKE-QD-D 0.0d0 0.0d0 0.0d0 0.0d0)))

Return the difference between the %QUAD-DOUBLE number A and the DOUBLE-FLOAT number B. If TARGET is given, TARGET is destructively modified to contain the result.

TAN-QD (R)

Return the tangent of the %QUAD-DOUBLE number A

TANH-QD (A)

Return the hyperbolic tangent of the %QUAD-DOUBLE number A

ZEROP-QD (A)

Returns T if the %QUAD-DOUBLE number A is numerically equal to 0.

Undocumented

FLOAT-INFINITY-P (X)

FLOAT-NAN-P (X)

SINCOS-QD (A)

Private

ADD-QD-D-T (A B TARGET)

Add a quad-double A and a double-float B

EXPM1-QD (A)

Return exp(a) - 1 for the %QUAD-DOUBLE number A. This is more accurate than just computing exp(a) - 1 directly.

LOGB-FINITE (X)

Same as logb but X is not infinity and non-zero and not a NaN, so that we can always return an integer

MUL-QD-D-T (A B TARGET)

Multiply quad-double A with B

NINT-QD (A)

Round the quad-float to the nearest integer, which is returned as a quad-float

ONEP-QD (A)

Returns T if the %QUAD-DOUBLE number A is numerically equal to 1.

SPLIT (A)

Split the double-float number a into a-hi and a-lo such that a = a-hi + a-lo and a-hi contains the upper 26 significant bits of a and a-lo contains the lower 26 bits.

SQR-QD-T (A TARGET)

Square A

TWO-PROD

Compute fl(a*b) and err(a*b)

TWO-SQR

Compute fl(a*a) and err(a*b). This is a more efficient implementation of two-prod

Undocumented

ADD-QD-T (A B TARGET)

ATAN-QD/NEWTON (Y)

ATAN2-QD/NEWTON (Y X)

DIV-QD-I (A B)

DIV-QD-T (A B TARGET)

DIVREM-QD (A B)

DREM-QD (A B)

EXP-QD/REDUCE (A)

EXPM1-QD/DUPLICATION (A)

FLOAT-TRAPPING-NAN-P (X)

HYPOT-AUX-QD (X Y)

INVERT-QD (V)

LOG-QD/HALLEY (A)

LOG1P-QD/DUPLICATION (X)

MAKE-FLOAT (SIGN INT-PART FRAC-PART SCALE EXP)

MUL-QD-T (A B TARGET)

NEG-QD-T (A TARGET)

NROOT-QD (A N)

QD-FORMAT (STREAM ARG COLON-P AT-SIGN-P &REST PAR)

QD-FROM-STRING (STRING)

QD-OUTPUT-AUX (X &OPTIONAL (STREAM *STANDARD-OUTPUT*))

QD-PRINT-EXPONENT (X EXP STREAM)

QD-READER (STREAM SUBCHAR ARG)

QD-TO-DIGITS (V &OPTIONAL POSITION RELATIVEP)

QD-TO-STRING (X &OPTIONAL WIDTH FDIGITS SCALE FMIN)

REM-PI/2 (A)

REM-PI/2-INT (QD)

REM-PI/2-INT-B (QD)

RENORM-4

RENORM-5 (C0 C1 C2 C3 C4)

SINCOS-TAYLOR (A)

SUB-QD-T (A B TARGET)

TAN-QD/SINCOS (R)

MACRO

Public

Undocumented

QD-0 (Q)

QD-1 (Q)

QD-2 (Q)

QD-3 (Q)

WITH-QD-PARTS ((A0 A1 A2 A3) QD &BODY BODY)

Private

TWO-SUM (S E X Y)

Computes fl(a+b) and err(a+b)

Undocumented

%MAKE-QD-D (A0 A1 A2 A3)

%STORE-QD-D (TARGET Q0 Q1 Q2 Q3)

QUICK-TWO-SUM (S E X Y)

THREE-SUM (S0 S1 S2 A B C)

THREE-SUM2 (S0 S1 A B C)

CONSTANT

Public

+QD-2PI+

%QUAD-DOUBLE representation of 2*pi

+QD-LOG2+

%QUAD-DOUBLE representation of log(2) (natural log)

+QD-ONE+

%QUAD-DOUBLE representation of 1

+QD-PI+

%QUAD-DOUBLE representation of pi

+QD-PI/2+

%QUAD-DOUBLE representation of pi/2

+QD-PI/4+

%QUAD-DOUBLE representation of pi/4

+QD-ZERO+

%QUAD-DOUBLE representation of 0

Private

+QD-3PI/4+

%QUAD-DOUBLE representation of 3*pi/4

+QD-COS-TABLE+

A table of cos(k/1024) for k = 1 to 256

+QD-SIN-TABLE+

Table of sin(k/1024) for k = 1 to 256

Undocumented

+2/PI-BITS+

+DIGITS+

+DOUBLE-FLOAT-MIN-E+

+QD-E+

+QD-EPS+

+QD-LOG10+

+QD-LOG2-EXTRA+

+QD-PI/1024+