See this closed issue: https://github.com/herbie-fp/herbie/pull/1266#issuecomment-2964703718 If you improve an expression like sin(cos(pow(x, 2.7))), you may get back a duplicate of the original expression. This should be filtered. 