Liking cljdoc? Tell your friends :D

sicmutils.simplify.rules


associativeclj/s

(associative & ops)

Takes a sequence ops of operator symbols like '+, '* and returns a rule that collapses nested applications of each operation into a single list. (The associative property lets us strip parentheses.)

(let [rule (associative '+ '*)
      f    (rule-simplifier rule)]
  (f '(+ x (+ y (+ z a) (* b (* c d))
              (+ cake face)))))
;;=> (+ x y z a (* b c d) cake face)
Takes a sequence `ops` of operator symbols like `'+`, `'*` and returns a rule
that collapses nested applications of each operation into a single list. (The
associative property lets us strip parentheses.)

```clojure
(let [rule (associative '+ '*)
      f    (rule-simplifier rule)]
  (f '(+ x (+ y (+ z a) (* b (* c d))
              (+ cake face)))))
;;=> (+ x y z a (* b c d) cake face)
```
sourceraw docstring

canonicalize-partialsclj/s

source

complex-trigclj/s

source

constant-eliminationclj/s

(constant-elimination op constant)

Takes an operation op and an identity element constant and returns a rule that eliminates instances of constant inside binary forms like (<op> l r).

Takes an operation `op` and an identity element `constant` and returns a rule
that eliminates instances of `constant` inside binary forms like `(<op> l
r)`.
sourceraw docstring

divide-numbers-throughclj/s

source

exponent-contractclj/s

Set of rules that collect adjacent products, exponents and nested exponents into exponent terms.

Set of rules that collect adjacent products, exponents and nested
exponents into exponent terms.
sourceraw docstring

simplify-square-rootsclj/s

source

sin-sq->cos-sqclj/s

source

sincos->trigclj/s

source

sincos-flush-onesclj/s

source

sqrt-contractclj/s

(sqrt-contract)
(sqrt-contract simplify)
source

sqrt-expandclj/s

source

trig->sincosclj/s

source

triginvclj/s

source

unary-eliminationclj/s

(unary-elimination & ops)

Takes a sequence ops of operator symbols like '+, '* and returns a rule that strips these operations off of unary applications.

(let [rule (unary-elimination '+ '*)
      f    (rule-simplifier rule)]
  (f '(+ x y (* z) (+ a))))
;;=> (+ x y z a)
Takes a sequence `ops` of operator symbols like `'+`, `'*` and returns a rule
that strips these operations off of unary applications.

```clojure
(let [rule (unary-elimination '+ '*)
      f    (rule-simplifier rule)]
  (f '(+ x y (* z) (+ a))))
;;=> (+ x y z a)
```
sourceraw docstring

universal-reductionsclj/s

(universal-reductions x)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close