From e301f1fbc7e949f0474d3310c45aedf9e7f01873 Mon Sep 17 00:00:00 2001 From: Teme <lememta@gmail.com> Date: Thu, 5 Jan 2017 23:53:36 -0800 Subject: [PATCH] missing files --- include/conv.h | 30 +++++++++++++ include/math.h | 75 +++++++++++++++++++++++++++++++ include/mpfr_lustre.c | 96 ++++++++++++++++++++++++++++++++++++++++ include/mpfr_lustre.h | 75 +++++++++++++++++++++++++++++++ include/mpfr_lustre.lusi | 23 ++++++++++ 5 files changed, 299 insertions(+) create mode 100644 include/conv.h create mode 100644 include/math.h create mode 100644 include/mpfr_lustre.c create mode 100644 include/mpfr_lustre.h create mode 100644 include/mpfr_lustre.lusi diff --git a/include/conv.h b/include/conv.h new file mode 100644 index 00000000..6b6b86b6 --- /dev/null +++ b/include/conv.h @@ -0,0 +1,30 @@ +/* C code generated by lustrec + Version number 1.1-Unversioned directory + Code is C99 compliant + Using (double) floating-point numbers */ + +#ifndef _CONV +#define _CONV + +/* Imports standard library */ +#include "/Users/Teme/Documents/GitHub/lustrec/include/lustrec/arrow.h" + + +/* Import dependencies */ + +/* Types definitions */ + +/* Global constant (declarations, definitions are in C file) */ + +/* Structs declarations */ + +/* Nodes declarations */ +extern double int_to_real (int in1 + ); + +extern int real_to_int (double in1 + ); + + +#endif + diff --git a/include/math.h b/include/math.h new file mode 100644 index 00000000..2a3c6a9b --- /dev/null +++ b/include/math.h @@ -0,0 +1,75 @@ +/* C code generated by lustrec + Version number 1.1-Unversioned directory + Code is C99 compliant + Using (double) floating-point numbers */ + +#ifndef _MATH +#define _MATH + +/* Imports standard library */ +#include "/Users/Teme/Documents/GitHub/lustrec/include/lustrec/arrow.h" + + +/* Import dependencies */ + +/* Types definitions */ + +/* Global constant (declarations, definitions are in C file) */ + +/* Structs declarations */ + +/* Nodes declarations */ +extern double sqrt (double x + ); + +extern double sinh (double x + ); + +extern double sin (double x + ); + +extern double pow (double x, double n + ); + +extern double fabs (double x + ); + +extern double erf (double x + ); + +extern double ceil (double x + ); + +extern double cosh (double x + ); + +extern double cos (double x + ); + +extern double cbrt (double x + ); + +extern double atanh (double x + ); + +extern double atan2 (double x, double n + ); + +extern double atan (double x + ); + +extern double asinh (double x + ); + +extern double asin (double x + ); + +extern double acosh (double x + ); + +extern double acos (double x + ); + + +#endif + diff --git a/include/mpfr_lustre.c b/include/mpfr_lustre.c new file mode 100644 index 00000000..d58ca6a4 --- /dev/null +++ b/include/mpfr_lustre.c @@ -0,0 +1,96 @@ +#include <mpfr.h> +#include "mpfr_lustre.h" + +void MPFR_LUSTRE_INIT () { + return; +} + +void MPFR_LUSTRE_CLEAR () { + return; +} + +void MPFRNeq_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_lessgreater_p(i1, i2); +} + +void MPFREq_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_equal_p(i1, i2); +} + +void MPFRGt_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_greater_p(i1, i2); +} + +void MPFRGe_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_greaterequal_p(i1, i2); +} + +extern void MPFRLt_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_less_p(i1, i2); +} +void MPFRLe_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ) +{ + *out = mpfr_lessequal_p(i1, i2); +} + +void MPFRDiv_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ) +{ + mpfr_div(out, i1, i2, MPFR_RNDN); +} + +void MPFRTimes_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ) +{ + mpfr_mul(out, i1, i2, MPFR_RNDN); +} + +void MPFRMinus_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ) +{ + mpfr_sub(out, i1, i2, MPFR_RNDN); +} + +void MPFRPlus_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ) +{ + mpfr_add(out, i1, i2, MPFR_RNDN); +} + +void MPFRUminus_step (mpfr_t i, + mpfr_t out + ) +{ + mpfr_neg(out, i, MPFR_RNDN); +} + +void MPFRInit(mpfr_t i, mpfr_prec_t prec) +{ + mpfr_init2(i, prec); +} + +void MPFRClear(mpfr_t i) +{ + mpfr_clear(i); +} diff --git a/include/mpfr_lustre.h b/include/mpfr_lustre.h new file mode 100644 index 00000000..85363ef3 --- /dev/null +++ b/include/mpfr_lustre.h @@ -0,0 +1,75 @@ +/* C code generated by lustrec + Version number 1.1-Unversioned directory + Code is C99 compliant + Using MPFR multi-precision numbers */ + +#ifndef _MPFR_LUSTRE +#define _MPFR_LUSTRE + +/* Imports standard library */ +#include <mpfr.h> +#include "/Users/Teme/Documents/GitHub/lustrec/include/lustrec/arrow.h" + + +/* Import dependencies */ + +/* Types definitions */ + +/* Global constant (declarations, definitions are in C file) */ + +/* Global initialization declaration */ +extern void MPFR_LUSTRE_INIT (); + +/* Global clear declaration */ +extern void MPFR_LUSTRE_CLEAR (); + +/* Structs declarations */ + +/* Nodes declarations */ +extern void MPFRNeq_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFREq_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFRGt_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFRGe_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFRLt_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFRLe_step (mpfr_t i1, mpfr_t i2, + _Bool (*out) + ); + +extern void MPFRDiv_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ); + +extern void MPFRTimes_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ); + +extern void MPFRMinus_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ); + +extern void MPFRPlus_step (mpfr_t i1, mpfr_t i2, + mpfr_t out + ); + +extern void MPFRUminus_step (mpfr_t i, + mpfr_t out + ); + + +#endif + diff --git a/include/mpfr_lustre.lusi b/include/mpfr_lustre.lusi new file mode 100644 index 00000000..e23ae136 --- /dev/null +++ b/include/mpfr_lustre.lusi @@ -0,0 +1,23 @@ + + +function MPFRUminus(i: real) returns (out: real) lib gmp lib mpfr; + +function MPFRPlus(i1, i2: real) returns (out: real); + +function MPFRMinus(i1, i2: real) returns (out: real); + +function MPFRTimes(i1, i2: real) returns (out: real); + +function MPFRDiv(i1, i2: real) returns (out: real); + +function MPFRLe(i1, i2: real) returns (out: bool); + +function MPFRLt(i1, i2: real) returns (out: bool); + +function MPFRGe(i1, i2: real) returns (out: bool); + +function MPFRGt(i1, i2: real) returns (out: bool); + +function MPFREq(i1, i2: real) returns (out: bool); + +function MPFRNeq(i1, i2: real) returns (out: bool); -- GitLab