# SAFE: Stochastic Arithmetic with Flexible Exponent

SAFE estimates **rounding errors** and detects **numerical
instabilities** in programs using floating-point numbers
with **arbitrary mantissa-length** and
**arbitrary exponent-length**.

SAFE implements **Discrete Stochastic Arithmetic**.

It requires the FlexFloat library
from https://github.com/oprecomp/flexfloat

SAFE enables the use of variables of
type **flexfloat_st<E,M>** where **E**
is the number of bits for
the exponent and **M**
is the number of physical bits for the mantissa,
i.e. M=52 for binary64.

Souce code and example programs can be downloaded.