chore: update

This commit is contained in:
Henri Saudubray 2026-03-27 10:53:26 +01:00
parent 4776edc9db
commit 416d97c513
Signed by: hms
GPG key ID: 7065F57ED8856128
25 changed files with 1653 additions and 283 deletions

21
exm/sincos/sincos.zls Normal file
View file

@ -0,0 +1,21 @@
let dt = 0.001 (* Integration step *)
let node f_integr (x0, x') = x where (* Forward Euler integrator *)
rec x = x0 -> pre (x +. x' *. dt)
let node b_integr (x0, x') = x where (* Backward Euler integrator *)
rec x = x0 -> (pre x) +. x' *. dt
let node sincos () = (sin, cos) where
rec sin = f_integr(0.0, cos)
and cos = b_integr(1.0, -. sin)
let node main () =
let rec t = 0.0 -> pre t +. dt in
let (sin, cos) = sincos () in
match t <= 500.0 with
| true ->
(print_float t; print_string "\t";
print_float sin; print_string "\t";
print_float cos; print_newline ())
| false -> ()