# The floating-point-contractions Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

# The floating-point-contractions Reference Manual

This is the floating-point-contractions Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:54:05 2018 GMT+0.

Next: , Previous: , Up: Top   [Contents][Index]

## 1 Introduction

```This system provides some numerically stable, contracted versions of
common but unstable floating-point operations.

| Export   | (AKA)    | Computes        |
|----------+----------+-----------------|
| log1+    | log1p    | log (1 + x)     |
| log1-    | log1m    | log (1 - x)     |
| log1+/x  |          | (log (1 + x))/x |
| exp-1    | expm1    | exp(x) - 1      |
| exp-1/x  |          | (exp(x)-1)/x    |
| expt-1   | powm1    | (x^y)-1         |
| log1-exp | log1mexp | log(1 - exp(x)) |
| log1+exp | log1pexp | log(1 + exp(x)) |
| log2-exp | log2mexp | log(2 - exp(x)) |
| logexp-1 | logexpm1 | log(exp(a) -1)  |
| hypot    |          | sqrt(x^2 + y^2) |

```

Next: , Previous: , Up: Top   [Contents][Index]

## 2 Systems

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

Previous: , Up: Systems   [Contents][Index]

### 2.1 floating-point-contractions

Author

Paul M. Rodriguez <pmr@ruricolist.com>

MIT

Description

Numerically stable contractions of floating-point operations.

Source
Components

Next: , Previous: , Up: Top   [Contents][Index]

## 3 Files

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

Previous: , Up: Files   [Contents][Index]

### 3.1 Lisp

Next: , Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.1 floating-point-contractions.asd

Location

floating-point-contractions.asd

Systems

floating-point-contractions (system)

#### 3.1.2 floating-point-contractions/package.lisp

Parent

floating-point-contractions (system)

Location

package.lisp

Packages

#### 3.1.3 floating-point-contractions/floating-point-contractions.lisp

Dependency

package.lisp (file)

Parent

floating-point-contractions (system)

Location

floating-point-contractions.lisp

Exported Definitions
Internal Definitions

sq (function)

Next: , Previous: , Up: Top   [Contents][Index]

## 4 Packages

Packages are listed by definition order.

Previous: , Up: Packages   [Contents][Index]

### 4.1 floating-point-contractions

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

sq (function)

Next: , Previous: , Up: Top   [Contents][Index]

## 5 Definitions

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

Next: , Previous: , Up: Definitions   [Contents][Index]

### 5.1 Exported definitions

Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.1 Functions

Function: exp-1 X

Compute (- (exp x) 1) stably even when X is near zero.

Package
Source
Function: exp-1/x X

Compute (/ (- (exp x) 1) x) stably even when X is near zero.

Package
Source
Function: expt-1 A Z

Compute (a^z)-1 stably even when A is close to 1 or Z is close to zero.

Package
Source
Function: hypot X Y

Compute the hypotenuse of X and Y without danger of floating-point overflow or underflow.

Package
Source
Function: lb N

Binary logarithm.

Package
Source
Function: lg N

Decimal logarithm.

Package
Source
Function: ln N

Natural logarithm.

Package
Source
Function: log1+ X

Compute (log (+ 1 x)) stably even when X is near zero.

Package
Source
Function: log1+/x X

Compute (/ (log (+ 1 x)) x) stably even when X is near zero.

Package
Source
Function: log1+exp A

Accurately compute log(1+exp(x)) even when A is near zero.

Package
Source
Function: log1- X

Compute (log (- 1 x)) stably even when X is near zero.

Package
Source
Function: log1-exp A

Compute log(1-exp(x)) stably even when A is near zero.

This is sometimes known as the E_3, the third Einstein function.

See Mächler 2008 for notes on accurate calculation.

https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf

Package
Source
Function: log2-exp X

Compute log(2-exp(x)) stably even when X is near zero.

Package
Source
Function: logexp-1 A

Compute log(exp(a)-1) stably even when A is small.

Package
Source

Previous: , Up: Definitions   [Contents][Index]

### 5.2 Internal definitions

Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.1 Functions

Function: sq X
Package
Source

Previous: , Up: Top   [Contents][Index]

## Appendix A Indexes

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.1 Concepts

Next: , Previous: , Up: Indexes   [Contents][Index]