-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompalg.rkt
34 lines (25 loc) · 917 Bytes
/
compalg.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#lang s-exp rai/stream
(require rai/compalg-lib
rai/stream-lib
rai/synth-lib
;; rai/test/test-lang ;; FIXME: remove after bootstrapping
)
;; This file is an example of a computer algebra worksheet. This is
;; essentially a target language module (see #lang above) with some
;; extra functions imported from the library compalg-lib.rkt
;; This library overrides `ai-function-printer', printing all values
;; (stream functions) in symbolic form. This is useful for printing
;; the result of program transformation operators, such as
;; derivatives.
(define (test x) (^ x 10))
test
(D test)
(D (D test))
;; To see graphical plots, run this file in drracket / geiser.
;; Scalar plots
(plot-lin/lin test 0 1)
;(plot-log/log test 0.01 1)
;; Stream plots: time
;(plot-t 500 saw-d1 .01)
;; FIXME: system functions with time/space folds do not have a symbolic printer
;; saw-d1