private float Function2D(float x) { if (variables[0] != null) { variables[0].value = x; } float d = parser.Calculate(); return(parser.Calculate()); }