Skip to content

Commit e46e806

Browse files
authored
simplify_rules.jl: Add rules for sinh, cosh
Add rules for sinh, cosh, similar to those for sin and cos.
1 parent e3eba85 commit e46e806

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/simplify_rules.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ let
4343

4444
MUL_DISTRIBUTE = @ordered_acrule((~x)^(~n) * (~x)^(~m) => (~x)^(~n + ~m))
4545

46-
4746
CANONICALIZE_POW = [
4847
@rule(^(*(~~x), ~y::_isinteger) => *(map(a->pow(a, ~y), ~~x)...))
4948
@rule((((~x)^(~p::_isinteger))^(~q::_isinteger)) => (~x)^((~p)*(~q)))
@@ -91,6 +90,13 @@ let
9190
@acrule(cot(~x)^2 + 1 => csc(~x)^2)
9291
@acrule(csc(~x)^2 + -1 => cot(~x)^2)
9392

93+
@acrule(cosh(~x)^2 + -1*sinh(~x)^2 => one(~x))
94+
@acrule(cosh(~x)^2 + -1 => sinh(~x)^2)
95+
@acrule(sinh(~x)^2 + 1 => cosh(~x)^2)
96+
97+
@acrule(cosh(~x)^2 + sinh(~x)^2 => cosh(2 * ~x))
98+
@acrule(cosh(~x) * sinh(~x) => sinh(2 * ~x)/2)
99+
94100
@acrule(exp(~x) * exp(~y) => _iszero(~x + ~y) ? 1 : exp(~x + ~y))
95101
@rule(exp(~x)^(~y) => exp(~x * ~y))
96102
]

0 commit comments

Comments
 (0)