Skip to content

Commit

Permalink
feat: add printing for DivMonomial
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Dec 8, 2024
1 parent 72e21fe commit f5f7637
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ComposableExpression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function _symbolic_derivative(

if !any_dependence
return constructorof(N)(; val=zero(T))
elseif tree.degree == 0
elseif tree.degree == 0 # && any_dependence
return constructorof(N)(; val=one(T))
elseif tree.degree == 1
# f(g(x)) => f'(g(x)) * g'(x)
Expand Down Expand Up @@ -480,6 +480,10 @@ DE.get_op_name(::typeof(last ∘ tuple)) = "last"
DE.get_op_name(::typeof((-) sin)) = "-sin"
DE.get_op_name(::typeof((-) cos)) = "-cos"

function DE.get_op_name(::DivMonomial{C,XP,YNP}) where {C,XP,YNP}
return join(("((x, y) -> ", string(C), "x^", string(XP), "/y^", string(YNP), ")"))
end

function _expand_operators(operators::OperatorEnum)
unaops = operators.unaops
binops = operators.binops
Expand Down

0 comments on commit f5f7637

Please sign in to comment.