From f97a886970bef9e1d6e8a1e217732d6ef8be087e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 1 Jul 2014 15:42:57 +0200 Subject: Adapt for real type with Apron ; not very efficient ATM. --- tests/source/cosinus.scade | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/source/cosinus.scade (limited to 'tests/source/cosinus.scade') diff --git a/tests/source/cosinus.scade b/tests/source/cosinus.scade new file mode 100644 index 0000000..a1596c2 --- /dev/null +++ b/tests/source/cosinus.scade @@ -0,0 +1,19 @@ +const dt: real = 0.1; + +node integrator(first: real; v: real; dt: real) returns (probe i: real) +let + i = (first -> pre i) + (dt * v); +tel + +node test(i: int) returns (a, b, c: int; exit: bool) +var + probe cos, probe cosprime: real; +let + cosprime = integrator(1.0, 0. -> pre (-cos), dt); + cos = integrator(0., cosprime, dt); + a = int(cos * 1000.); + b = int(cosprime * 1000.); + c = int(-cos * 1000.); + exit = (i > 8000); +tel + -- cgit v1.2.3