egison 4.0.2 → 4.0.3
raw patch · 3 files changed
+7/−7 lines, 3 files
Files
- egison.cabal +1/−1
- lib/math/common/functions.egi +1/−1
- lib/math/normalize.egi +5/−5
egison.cabal view
@@ -1,5 +1,5 @@ Name: egison-Version: 4.0.2+Version: 4.0.3 Synopsis: Programming language with non-linear pattern-matching against non-free data Description: An interpreter for Egison, a **pattern-matching-oriented**, purely functional programming language.
lib/math/common/functions.egi view
@@ -13,7 +13,7 @@ then match x as termExpr with | #0 -> 1 | #1 -> e- | mult $a #(i * pi) -> (-1) ^ a+ | mult $a #(i * π) -> (-1) ^ a | _ -> `exp x else `exp x
lib/math/normalize.egi view
@@ -119,7 +119,7 @@ match term as mathExpr with | $a * #`exp #0 * $r -> a *' r | $a * #`exp #1 * $r -> a *' e *' r- | $a * #`exp (mult $x #(i * pi)) * $r -> a *' (-1) ^ x *' r+ | $a * #`exp (mult $x #(i * π)) * $r -> a *' (-1) ^ x *' r | $a * #`exp $x ^ (?(>= 2) & $n) * $r -> rewriteRuleForExp (a *' exp (x * n) *' r) | $a * #`exp $x * #`exp $y * $r -> rewriteRuleForExp (a *' exp (x + y) *' r)@@ -202,8 +202,8 @@ f term := match term as mathExpr with | _ * #`sin #0 * _ -> 0- | _ * #`sin (mult _ #pi) * _ -> 0- | $a * #`sin (mult $n #pi / #2) * $mr ->+ | _ * #`sin (mult _ #π) * _ -> 0+ | $a * #`sin (mult $n #π / #2) * $mr -> a *' (-1) ^ ((abs n - 1) / 2) *' mr | _ -> term @@ -212,8 +212,8 @@ f term := match term as mathExpr with | $a * #`cos #0 * $mr -> a *' mr- | $a * #`cos (term $n [#pi]) * $mr -> a *' (-1) ^ abs n *' mr- | _ * #`cos (mult _ #pi / #2) * _ -> 0+ | $a * #`cos (term $n [#π]) * $mr -> a *' (-1) ^ abs n *' mr+ | _ * #`cos (mult _ #π / #2) * _ -> 0 | _ -> term --