Replies: 1 comment
-
The best way is indeed to take function myCustomSymplifyRule(node) {
if (
node.isFunctionNode &&
node.fn.isSymbolNode &&
node.fn.name === 'log'
) {
// ...
}
return node
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to specify simplification exceptions. What would be the easiest way to go about this?
Right now I'm getting the derivatives of log functions like this:
I would like to keep the output for a function on a constant in the form of the second line. However, if I use the option
{simplify: false}
on a more complex derivative the output then becomes quite messy. I would like for everything else except for the constant log function to be simplified. I know that I can use custom rules in thesimplify
function. I'm wondering how to implement a rule with the desired behaviour?The solution that I'm thinking so far is to copy the
simplify.rules
array and then replace the instances ofsimplifyConstant
with a function that wraps it and only runssimplifyConstant
if it is not a log function. Is there another, or better, way to accomplish this? Is this a completely misguided approach?(Additionally, what would be the best way filter if a node is a log function?)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions