Skip to content

Commit e37b4b4

Browse files
committed
fixed failing docs
1 parent cb725ef commit e37b4b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/manual/rewrite.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ It works. This can be further simplified using Pythagorean identity and check it
180180
```jldoctest rewriteex
181181
pyid = @rule sin(~x)^2 + cos(~x)^2 => 1
182182
183-
pyid(cos(x)^2 + sin(x)^2) === nothing
183+
pyid(sin(x)^2 + 2sin(x)*cos(x) + cos(x)^2)===nothing
184184
185185
# output
186186
true
187187
```
188188

189-
Why does it return `nothing`? If we look at the rule, we see that the order of `sin(x)` and `cos(x)` is different. Therefore, in order to work, the rule needs to be associative-commutative.
189+
Why does it return `nothing`? If we look at the expression, we see that we have an additional addend `+ 2sin(x)*cos(x)`. Therefore, in order to work, the rule needs to be associative-commutative.
190190

191191
```jldoctest rewriteex
192192
acpyid = @acrule sin(~x)^2 + cos(~x)^2 => 1

0 commit comments

Comments
 (0)