I've been using Wolfram Engine 14.3 for a personal project, and a common problem I've encountered is that its outputs — even after using Simplify[], FullSimplify[], user-defined simplification functions like SuperFullSimplify[], or the suggestions from "Advice for Mathematica as Mathematician's Aid" — are extremely long, but can be manually simplified down to equivalent expressions that are a tiny fraction of their initial size.
As an example, one of the outputs I got recently was the 592-character, 328-leaf expression
-1/2*((1 + 1/Sqrt[2])*(99 - 70*Sqrt[2])*r*(6 + 4*Sqrt[2] + U^2)^2*
(7 + 4*Sqrt[2] + U^2)^2*(8*(3 - 2*Sqrt[2])*U^4 + 32*(3 + 2*Sqrt[2] + U^2) +
4*c*(-4*(10 + 7*Sqrt[2]) - 8*(2 + Sqrt[2])*U^2 + 5*(-2 + Sqrt[2])*U^4 +
(-10 + 7*Sqrt[2])*U^6) + c^2*(68 + 48*Sqrt[2] + 12*(3 + 2*Sqrt[2])*U^2 +
13*U^4 + 6*(3 - 2*Sqrt[2])*U^6 + (17 - 12*Sqrt[2])*U^8)))/
((-2*(7 + 4*Sqrt[2]) + (-7 + 2*Sqrt[2])*U^2 + (-3 + 2*Sqrt[2])*U^4)^2*
(8*(2 + Sqrt[2]) - 4*(3 + 2*Sqrt[2])*c - 8*(-2 + Sqrt[2] + c)*U^2 +
(20 - 14*Sqrt[2] + 5*(-3 + 2*Sqrt[2])*c)*U^4 + (-17 + 12*Sqrt[2])*c*U^6)*
Sqrt[1 + (3/2 - Sqrt[2])*(1 + U^2)])
which (with a lot of effort) can be manually simplified down to the 78-character, 45-leaf expression
r*(c*((2 - Sqrt[2])*(U^2 - 1) + 4) - 4)/Sqrt[8*(3 - 2*Sqrt[2])*(1 + U^2) + 16]
for an over 86.8% reduction in length and an almost 86.3% reduction in leaf count. Wolfram Engine will almost-instantly confirm that those two expressions are equal, but I haven't been able to find a way to make the program produce the second expression (or anything even close to it in size) from the first �� in fact, several of the results from my customized ComplexityFunction setups were significantly longer than the first expression, while most simply returned the input unchanged.
Are there any tricks that will make Wolfram Engine reliably find such drastically-shorter equivalent forms when dealing with expressions like this?
