correct: correct
correct = ((numericValue(abs(${compinppi}-${companspi}))<0.1) and (numericValue(abs(${compinpe}-${companse}))<0.1)) #or parseEquation(this.latex).rhs=5\left(5x-x^{2}\right)-\left(5x-x^{2}\right)^{2}
initialLatex: f\left(f\left(x\right)\right)=
I want this to compare a student’s input with the correct expression and determine it is equivalent based on the absolute value of the difference being close enough to 0 for inputs of pi and e. I don’t know why it is not working.
You have the right idea, but I think all of your backticks and quotes got stripped out of this? It’s hard to tell exactly where the error is because of that. (EDIT: I see - when I copy/pasted it the formatting made the quotes disappear… in the future, it’s easiest to just post a link to the activity where you have the code).
No I think the only problem is in your absolute value check, because abs(X) isn’t proper latex. If you replace abs(X) in your expression with \left|X\right| it should work. The best plan is to type your expression into a math box in Desmos, copy it, and then paste it into CL and it will have perfectly formatted latex. That would give you something like \operatorname{abs}\left(X\right) which would work as well.
patterns is a whole other subject. There is basically a patterns library, which you access by typing pattens.patternname so p = patterns lets you use p.patternname as a shortcut.
“literal” is one of the pattern names, which lets you match/parse specific variable names.