computeLinear function
Computes Y from a given X and function formula and returns it as a double for linear functions.
Implementation
double computeLinear(String formula, double value) {
double result = 0;
if (astParser(formula) == 'LINEAR_FUNCTION') {
double constant = irParser(formula)[0];
double factor = irParser(formula)[1];
result = constant + (factor * value);
} else {}
return result;
}