You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does not expand the division. Instead one can define
functionexpand_fraction(x::BasicSymbolic)
@compactified x::BasicSymbolicbegin
Add =>_apply_termwise(expand_fraction, x)
Mul =>_apply_termwise(expand_fraction, x)
Div =>sum([arg/x.den for arg inarguments(x.num)])
_ => x
endendexpand_fraction(x::Num) =Num(expand_fraction(x.val))
"Apply a function f on every member of a sum or a product"function_apply_termwise(f, x::BasicSymbolic)
@compactified x::BasicSymbolicbegin
Add =>sum([f(arg) for arg inarguments(x)])
Mul =>prod([f(arg) for arg inarguments(x)])
Div =>_apply_termwise(f, x.num) /_apply_termwise(f, x.den)
_ =>f(x)
endend
as a workaround.
The text was updated successfully, but these errors were encountered:
does not expand the division. Instead one can define
as a workaround.
The text was updated successfully, but these errors were encountered: