We, at KWARC, developed a search engine capable of searching arXiv, see [1]. It can search latex-style formulae and CMML formulae.
In addition, one can also use "query variables", which means that if I search for, e.g., "?a + ?a" (?a is a query variable), I will get all sums of two equal terms.
?a could be an integral, a fancy function, or just a one-letter variable.
It is documented at [1] and according to the documentation, the code seems perfectly legal. However, calling it twice add5(2); add5(2);
leads to an "Illegal instruction. Core dumped"
Even stranger, calling it twice but with a different argument leads to a a segfault instead of illegal instruction: add5(5); add5(5);
[1] https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html