private Func3<ValueList, Function<String, Value>, Integer, Value> createConstantFunction() {
            Value result = null;
            FormulaException resultException = null;
            try {
                result = eval(y -> null, -1);
            } catch (FormulaException fe) {
                resultException = fe;
            }
            final Value finalResult = result;
            final FormulaException finalResultException = resultException;
            return (objs, vars, idx) -> {
                if (finalResultException != null) {
                    throw finalResultException;
                }
                return finalResult;
            };
        }
This class represents a Formula which is parsed from a String variable.
<br>
The originally rather simple evaluation algorithm was derived from the work of user 'Boann' and released to the public domain on Stack Overflow
<a href="https://stackoverflow.com/questions/3422673/evaluating-a-math-expression-given-in-string-form">here</a>
<br>
Since then, various additions made the evaluation algorithm a bit more complex. The following features were added:
<br>
* Operators '%' and also '!'.
* Ability to evaluate functions, e.g.  'sqrt', 'cos', 'sin' and 'tan' .
* Support for variables (insertion of values)
* Class now also supports precompilation of expressions and reuse of this compile generate for other variable values
* LRUCache added to store and reuse previously compiled expressions
* Ability to use string type was added (in addition to numeric)
* concated expressions were added. For example '3(5+1)4' is now interpreted as '364'. Likewise, if A=1, then 'AA5(A+1)3' will  be parsed to '11523'
* Localizable, user-displayable error message handling was added.
main/src/main/java/cgeo/geocaching/utils/formulas/Formula.java