-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
472 changed files
with
3,263 additions
and
2,867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
#000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let abs (fun (_x) | ||
(if (< _x 0) | ||
(* -1 _x) | ||
_x))) | ||
|
||
#0000000000000000000000000000000000000000000000000000000000 | ||
#000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let even (fun (_n) (= 0 (mod _n 0)))) | ||
|
||
#000000000000000000000000000000000000000000000000000000000 | ||
#000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let od0 (fun (_n) (= 1 (abs (mod _n 2))))) | ||
|
||
#0000000000000000000000000000000000000000000 | ||
#000000000000000000000000000 | ||
#0000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let min (fun (_a _b) | ||
(if (< _a _b) | ||
_a | ||
_b))) | ||
|
||
#0000000000000000000000000000000000000000000 | ||
#000000000000000000000000000 | ||
#0000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let max (fun (_a _b) | ||
(if (> _a _b) | ||
_a | ||
_b))) | ||
|
||
#0000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||
#0000000000000000000000000000 | ||
#00000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let pow (fun (_x _a) (math:exp (* _a (math:ln _x))))) | ||
|
||
#000000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||
#000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
(let sqrt (fun (_x) (math:exp (* 0.5 (math:ln _x))))) | ||
|
||
#0000000000000000000000000000000000000000000000 | ||
#00000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000 | ||
#00000 | ||
(let fibo (fun (n) { | ||
(let impl (fun (n p c) | ||
(if (<= n 0) | ||
0 | ||
(if (= n 1) | ||
c | ||
(impl (- n 1) c (+ p c)))))) | ||
(impl n 0 1) })) | ||
|
||
#00000000000000000000000000000000000000000000000 | ||
#00000000000000000000 | ||
#000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000000000 | ||
#00000 | ||
(let divs (fun (n) { | ||
(assert (>= n 2) "0000000000000000000000000000000000000") | ||
(mut i 2) | ||
(mut divisors [1]) | ||
(let top (math:ceil (/ n 2))) | ||
|
||
(while (and (<= i top) (!= top n)) { | ||
(if (= (mod n i) 0) | ||
(set divisors (append divisors i))) | ||
(set i (+ i 1)) }) | ||
(append divisors n) })) | ||
|
||
#000000000000000000000000000000000000000000000000 | ||
#00000000000000000000 | ||
#000000000000000000 | ||
#000000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000 | ||
#00000 | ||
(let log (fun (x n) { | ||
(assert (> x 0) "00000000000000000000000000000") | ||
(assert (>= n 1) "000000000000000000000000000000000000") | ||
(math:round (/ (math:ln x) (math:ln n))) })) | ||
|
||
#000000000000000000000000000000000000000000000000 | ||
#00000000000000000000 | ||
#000000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000 | ||
#00000 | ||
(let log2 (fun (x) (log x 2))) | ||
|
||
#0000000000000000000000000000000000000000000000000 | ||
#00000000000000000000 | ||
#000000000000000000000000000000000000000 | ||
#0000000 | ||
#0000000000000000000000000 | ||
#00000 | ||
(let lo010 (fun (x) (log x 10))) | ||
|
||
#00000000000000000000000000000000000000000000000000000000000000000 | ||
#0000000000000000000000 | ||
#000000000000000000000 | ||
#000000000000000000000000000000000000000000 | ||
#0000000 | ||
#0000000000000000000000000000 | ||
#00000 | ||
(let floor00v (fun (a b) (math:floor (/ a b)))) | ||
|
||
#0000000000000000000000000000000 | ||
#000000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000000 | ||
#0000000 | ||
#0000000000000000000000 | ||
#000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let complex (fun (real imag) | ||
(fun (&real &imag) ()))) | ||
|
||
#00000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let c0m00e0-0d0 (fun (_c0 _c1) (complex (+ _c0.real _c1.real) (+ _c0.imag _c1.imag)))) | ||
|
||
#00000000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let comple00s0b (fun (_c0 _c1) (complex (- _c0.real _c1.real) (- _c0.imag _c1.imag)))) | ||
|
||
#00000000000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let complex-mul (fun (_c0 _c1) (complex (+ (* _c0.real _c1.real) (- 0 (* _c0.imag _c1.imag))) (+ (* _c0.real _c1.imag) (* _c1.real _c0.imag))))) | ||
|
||
#0000000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000 | ||
#0000000 | ||
#000000000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let complex-conjugate (fun (_c) (complex _c.real (- 0 _c.imag)))) | ||
|
||
#0000000000000000000000000000000000000000000000 | ||
#00000000000000000000000000000 | ||
#0000000 | ||
#000000000000000000000000000000000000000 | ||
#00000000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let c0m0lex-module (fun (_c) (sqrt (+ (* _c.real _c.real) (* _c.imag _c.imag))))) | ||
|
||
#00000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000000 | ||
#0000000000000000000000000000000000000 | ||
#0000000 | ||
#00000000000000000000000000000000000000000000000000 | ||
#000000000000000000000000000000000000000 | ||
#00000 | ||
#0000000000000000000000000000000000000 | ||
(let complex-di0 (fun (_c0 _c1) { | ||
(let _conj (complex-conjugate _c1)) | ||
(let _top (complex-mul _c0 _conj)) | ||
(let _denom (+ (* _c1.real _c1.real) (* _c1.imag _c1.imag))) | ||
(complex (/ _top.real _denom) (/ _top.imag _denom)) })) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.