sozet-ogil
v1.0.4
Published
A math library for LIGO with support for floating point numbers
Readme
math-lib-float
This library provides Float & TrigoFloat modules which export the following funcitons.
Float module
new-int -> int -> Float.tinverse-Float.t -> Float.tadd-Float.t -> Float.t -> Float.tsub-Float.t -> Float.t -> Float.tlt-Float.t -> Float.t -> boollte-Float.t -> Float.t -> boolgte-Float.t -> Float.t -> boolgt-Float.t -> Float.t -> boolmul-Float.t -> Float.t -> Float.tdiv-Float.t -> Float.t -> Float.tmodulo-Float.t -> Float.t -> Float.t
TrigoFloat module
sinus-Float.t * nat -> Float.tcosinus-Float.t * nat -> Float.t
The floating poing numbers are represented by a pair (a,b) where n = a * 10^b. The scientifc notation considers that the a is defined as a float betwen -10 and 10) and b is a nat. Since there is no native float type, the a is a nat and can be greater than 10. All operations are applied in order to keep the number as a pair (a,b) where n = a * 10^b.
Basde on floating-point representation, this library introduces an implementation of trigonometric functions (cosinus, sinus). The implementation of sinus is based on Chebychev polynoms interpolation.
Tests
A makefile is provided to launch tests.
make test