The cf Reference Manual

This is the cf Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:43:59 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cf

Computations using continued fractions

Author

Guillaume LE VAILLANT

License

GPL-3

Version

1.0

Source

cf.asd.

Child Component

cf.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cf/cf.asd

Source

cf.asd.

Parent Component

cf (system).

ASDF Systems

cf.


3.1.2 cf/cf.lisp

Source

cf.asd.

Parent Component

cf (system).

Packages

cf.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cf

Source

cf.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *cf-length*

Maximum number of coefficients used in continued fractions.

Package

cf.

Source

cf.lisp.

Special Variable: *cf-max-number-in-fractional-part*

Maximum integer that can appear in the fractional part of a continued fraction. The CF-SIMPLIFY function will truncate the continued fraction if it encounters a number bigger than this maximum.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-atan-1/2+

Continued fraction for the arctangent of 1/2.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-e+

Continued fraction for e = exp(1). OEIS: A003417.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-gamma+

Continued fraction for the Euler-Mascheroni constant gamma. OEIS: A002852.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-ln-2+

Continued fraction for ln(2). OEIS: A016730.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-pi+

Continued fraction for pi. OEIS: A001203.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-pi/2+

Continued fraction for pi / 2. OEIS: A053300.

Package

cf.

Source

cf.lisp.

Special Variable: +cf-tau+

Continued fraction for tau = 2 * pi. OEIS: A058291.

Package

cf.

Source

cf.lisp.


5.1.2 Ordinary functions

Function: cf (x)

Return the continued fraction for the number X (with at most *CF-LENGTH* coefficients).

Package

cf.

Source

cf.lisp.

Function: cf* (&rest fractions)

Return the continued fraction of the product of its arguments.

Package

cf.

Source

cf.lisp.

Function: cf+ (&rest fractions)

Return the continued fraction of the sum of its arguments.

Package

cf.

Source

cf.lisp.

Function: cf- (x &rest more-fractions)

Return the continued fraction of the subtraction of the second and subsequent arguments from X. If MORE-FRACTIONS are not specified, return the continued fraction of -X.

Package

cf.

Source

cf.lisp.

Function: cf-abs (x)

Return the continued fraction of the absolute value of X.

Package

cf.

Source

cf.lisp.

Function: cf-acos (x)

Return the continued fraction of acos(X).

Package

cf.

Source

cf.lisp.

Function: cf-acosh (x)
Package

cf.

Source

cf.lisp.

Function: cf-asin (x)

Return the continued fraction of asin(X).

Package

cf.

Source

cf.lisp.

Function: cf-asinh (x)
Package

cf.

Source

cf.lisp.

Function: cf-atan (y &optional x)

If X is specified, return the continued fraction of atan(Y / X), and atan(Y) otherwise.

Package

cf.

Source

cf.lisp.

Function: cf-atanh (x)

Return the continued fraction of atanh(X).

Package

cf.

Source

cf.lisp.

Function: cf-bihomographic (a b c d e f g h x y)

Return the continued fraction of (AXY + BX + CY + D) / (EXY + FX + GY + H), where A, B, C, D, E, F, G and H are relative integers, and X and Y are continued fractions.

Package

cf.

Source

cf.lisp.

Function: cf-ceiling (x &optional y)

Return the continued fraction of the smallest integer greater than or equal to X / Y, and the continued fraction of the remainder. The default value for Y is 1.

Package

cf.

Source

cf.lisp.

Function: cf-convergent (x)

Return the convergent of the continued fraction X.

Package

cf.

Source

cf.lisp.

Function: cf-cos (x)

Return the continued fraction of cos(X).

Package

cf.

Source

cf.lisp.

Function: cf-cosh (x)

Return the continued fraction of cosh(X).

Package

cf.

Source

cf.lisp.

Function: cf-decimal (x n)

Return a string representing the decimal expansion of the continued fraction X, with at most N digits in the fractional part.

Package

cf.

Source

cf.lisp.

Function: cf-exp (x)

Return the continued fraction of E^X.

Package

cf.

Source

cf.lisp.

Function: cf-expt (x y)

Return the continued fraction of X^Y.

Package

cf.

Source

cf.lisp.

Function: cf-floor (x &optional y)

Return the continued fraction of the greatest integer smaller than or equal to X / Y, and the continued fraction of X modulo Y. The default value for Y is 1.

Package

cf.

Source

cf.lisp.

Function: cf-homographic (a b c d x)

Return the continued fraction of (AX + B) / (CX + D),
where A, B, C and D are relative integers, and X is a continued fraction.

Package

cf.

Source

cf.lisp.

Function: cf-log (x &optional y)

If Y is specified, return the continued fraction of the base Y logarithm of X, and ln(X) otherwise.

Package

cf.

Source

cf.lisp.

Function: cf-max (x &rest more-fractions)

Return the greatest of its arguments.

Package

cf.

Source

cf.lisp.

Function: cf-min (x &rest more-fractions)

Return the least of its arguments.

Package

cf.

Source

cf.lisp.

Function: cf-minusp (x)

Return T if X is strictly negative, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf-mod (x y)

Return the continued fraction of X modulo Y (the second value of CF-FLOOR).

Package

cf.

Source

cf.lisp.

Function: cf-nsimplify (x)

Like CF-SIMPLIFY, but modifying X instead of creating a new continued fraction.

Package

cf.

Source

cf.lisp.

Function: cf-plusp (x)

Return T if X is strictly positive, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf-rem (x y)

Return the continued fraction of the remainder of X / Y (the second value of CF-TRUNCATE).

Package

cf.

Source

cf.lisp.

Function: cf-round (x &optional y)

Return the continued fraction of X / Y rounded to the nearest integer, and the continued fraction of the remainder. The default value for Y is 1.

Package

cf.

Source

cf.lisp.

Function: cf-signum (x)

Return the continued fraction of -1, 0 or 1 if X is respectively negative, zero or positive.

Package

cf.

Source

cf.lisp.

Function: cf-simplify (x)

Keep at most *CF-LENGTH* coefficients of the continued fraction X and remove huge numbers (greater than *cf-max-number-in-fractional-part*) from the fractional part.

Package

cf.

Source

cf.lisp.

Function: cf-sin (x)

Return the continued fraction of cos(X).

Package

cf.

Source

cf.lisp.

Function: cf-sinh (x)

Return the continued fraction of sinh(X).

Package

cf.

Source

cf.lisp.

Function: cf-sqrt (x)

Return the continued fraction of the square root of X.

Package

cf.

Source

cf.lisp.

Function: cf-tan (x)

Return the continued fraction of tan(X).

Package

cf.

Source

cf.lisp.

Function: cf-tanh (x)

Return the continued fraction of tanh(X).

Package

cf.

Source

cf.lisp.

Function: cf-truncate (x &optional y)

Return the continued fraction of the integer part of X / Y rounded toward 0, and the continued fraction of the remainder. The default value for Y is 1.

Package

cf.

Source

cf.lisp.

Function: cf-zerop (x)

Return T if X is zero, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf/ (x &rest more-fractions)

Return the continued fraction of the division of X by the second and subsequent arguments. If MORE-FRACTIONS are not specified, return the continued fraction of 1 / X.

Package

cf.

Source

cf.lisp.

Function: cf/= (x &rest more-fractions)

Return NIL if at least two of its arguments are equal, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf1+ (x)

Return the continued fraction of X + 1.

Package

cf.

Source

cf.lisp.

Function: cf1- (x)

Return the continued fraction of X - 1.

Package

cf.

Source

cf.lisp.

Function: cf< (x &rest more-fractions)

Return if T its arguments are in strictly increasing order, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf<= (x &rest more-fractions)

Return T if its arguments are in increasing order, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf= (x &rest more-fractions)

Return T if all its arguments are equal, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf> (x &rest more-fractions)

Return T if its arguments are in strictly decreasing order, and NIL otherwise.

Package

cf.

Source

cf.lisp.

Function: cf>= (x &rest more-fractions)

Return T if its arguments are in decreasing order, and NIL otherwise.

Package

cf.

Source

cf.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *cf-max-iterations*

Maximum number of iterations used to compute some functions like EXP, LN, COS, SIN...

Package

cf.

Source

cf.lisp.


5.2.2 Macros

Macro: check-cf (x)

Throw an error if X is not a valid continued fraction.

Package

cf.

Source

cf.lisp.


5.2.3 Ordinary functions

Function: cf-atan1 (x)

Return the continued fraction of atan(X).

Package

cf.

Source

cf.lisp.

Function: cf-expt-n (x n)

Return the continued fraction of X^N, where N is a positive integer.

Package

cf.

Source

cf.lisp.

Function: cf-ln (x)

Return the continued fraction of ln(X).

Package

cf.

Source

cf.lisp.

Function: cf-sqrt-n (n)

Return the continued fraction of the square root of N, where N is a positive integer.

Package

cf.

Source

cf.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   F   M  
Index Entry  Section

C
cf: Public ordinary functions
cf*: Public ordinary functions
cf+: Public ordinary functions
cf-: Public ordinary functions
cf-abs: Public ordinary functions
cf-acos: Public ordinary functions
cf-acosh: Public ordinary functions
cf-asin: Public ordinary functions
cf-asinh: Public ordinary functions
cf-atan: Public ordinary functions
cf-atan1: Private ordinary functions
cf-atanh: Public ordinary functions
cf-bihomographic: Public ordinary functions
cf-ceiling: Public ordinary functions
cf-convergent: Public ordinary functions
cf-cos: Public ordinary functions
cf-cosh: Public ordinary functions
cf-decimal: Public ordinary functions
cf-exp: Public ordinary functions
cf-expt: Public ordinary functions
cf-expt-n: Private ordinary functions
cf-floor: Public ordinary functions
cf-homographic: Public ordinary functions
cf-ln: Private ordinary functions
cf-log: Public ordinary functions
cf-max: Public ordinary functions
cf-min: Public ordinary functions
cf-minusp: Public ordinary functions
cf-mod: Public ordinary functions
cf-nsimplify: Public ordinary functions
cf-plusp: Public ordinary functions
cf-rem: Public ordinary functions
cf-round: Public ordinary functions
cf-signum: Public ordinary functions
cf-simplify: Public ordinary functions
cf-sin: Public ordinary functions
cf-sinh: Public ordinary functions
cf-sqrt: Public ordinary functions
cf-sqrt-n: Private ordinary functions
cf-tan: Public ordinary functions
cf-tanh: Public ordinary functions
cf-truncate: Public ordinary functions
cf-zerop: Public ordinary functions
cf/: Public ordinary functions
cf/=: Public ordinary functions
cf1+: Public ordinary functions
cf1-: Public ordinary functions
cf<: Public ordinary functions
cf<=: Public ordinary functions
cf=: Public ordinary functions
cf>: Public ordinary functions
cf>=: Public ordinary functions
check-cf: Private macros

F
Function, cf: Public ordinary functions
Function, cf*: Public ordinary functions
Function, cf+: Public ordinary functions
Function, cf-: Public ordinary functions
Function, cf-abs: Public ordinary functions
Function, cf-acos: Public ordinary functions
Function, cf-acosh: Public ordinary functions
Function, cf-asin: Public ordinary functions
Function, cf-asinh: Public ordinary functions
Function, cf-atan: Public ordinary functions
Function, cf-atan1: Private ordinary functions
Function, cf-atanh: Public ordinary functions
Function, cf-bihomographic: Public ordinary functions
Function, cf-ceiling: Public ordinary functions
Function, cf-convergent: Public ordinary functions
Function, cf-cos: Public ordinary functions
Function, cf-cosh: Public ordinary functions
Function, cf-decimal: Public ordinary functions
Function, cf-exp: Public ordinary functions
Function, cf-expt: Public ordinary functions
Function, cf-expt-n: Private ordinary functions
Function, cf-floor: Public ordinary functions
Function, cf-homographic: Public ordinary functions
Function, cf-ln: Private ordinary functions
Function, cf-log: Public ordinary functions
Function, cf-max: Public ordinary functions
Function, cf-min: Public ordinary functions
Function, cf-minusp: Public ordinary functions
Function, cf-mod: Public ordinary functions
Function, cf-nsimplify: Public ordinary functions
Function, cf-plusp: Public ordinary functions
Function, cf-rem: Public ordinary functions
Function, cf-round: Public ordinary functions
Function, cf-signum: Public ordinary functions
Function, cf-simplify: Public ordinary functions
Function, cf-sin: Public ordinary functions
Function, cf-sinh: Public ordinary functions
Function, cf-sqrt: Public ordinary functions
Function, cf-sqrt-n: Private ordinary functions
Function, cf-tan: Public ordinary functions
Function, cf-tanh: Public ordinary functions
Function, cf-truncate: Public ordinary functions
Function, cf-zerop: Public ordinary functions
Function, cf/: Public ordinary functions
Function, cf/=: Public ordinary functions
Function, cf1+: Public ordinary functions
Function, cf1-: Public ordinary functions
Function, cf<: Public ordinary functions
Function, cf<=: Public ordinary functions
Function, cf=: Public ordinary functions
Function, cf>: Public ordinary functions
Function, cf>=: Public ordinary functions

M
Macro, check-cf: Private macros


A.4 Data types