Source:
public void printMetrics(StringBuilder result) { double N2 = operands + operandst; double n2 = uniqueoperands + operandst; double N1 = operators + operatorst; double n1 = uniqueoperator + uniqueoperatorst; result.append("Distinct operators "); result.append(n1); result.append("\n"); result.append("Distinct operands "); result.append(n2); result.append("\n"); result.append("Total number of operators "); result.append(N1); result.append("\n"); result.append("Total number of operands "); result.append(N2); result.append("\n"); result.append("Distinct operators ST "); result.append(uniqueoperatorst); result.append("\n"); result.append("Distinct operands ST "); result.append(operandst); result.append("\n"); result.append("Total number of operators ST "); result.append(operatorst); result.append("\n"); result.append("Total number of operands ST "); result.append(operandst); result.append("\n"); double N = N1 + N2; double n = n1 + n2; double Ndach = (n1 * Math.log(n1) / Math.log(2) + n2 * Math.log(n2) / Math.log(2)); double PR = Ndach / N; double V = N * Math.log(n) / Math.log(2); double D = n1 / 2 * N2 / n2; double E = D * V; result.append("Program Length "); result.append(N); result.append("\n"); result.append("Program vocabulary "); result.append(n); result.append("\n"); result.append("Estimated length "); result.append(Ndach); result.append("\n"); result.append("Purity ratio "); result.append(PR); result.append("\n"); result.append("Program volume "); result.append(V); result.append("\n"); result.append("Difficulty "); result.append(D); result.append("\n"); result.append("Program Effort "); result.append(E); result.append("\n"); }

Target:
public void printMetrics(StringBuilder result) { double n2Major = operands + operandST; double n2 = uniqueOperands + operandST; double n1Major = operators + operatorST; double n1 = uniqueOperator + uniqueOperatorST; result.append("Distinct operators "); result.append(n1); result.append("\n"); result.append("Distinct operands "); result.append(n2); result.append("\n"); result.append("Total number of operators "); result.append(n1Major); result.append("\n"); result.append("Total number of operands "); result.append(n2Major); result.append("\n"); result.append("Distinct operators ST "); result.append(uniqueOperatorST); result.append("\n"); result.append("Distinct operands ST "); result.append(operandST); result.append("\n"); result.append("Total number of operators ST "); result.append(operatorST); result.append("\n"); result.append("Total number of operands ST "); result.append(operandST); result.append("\n"); double nMAjor = n1Major + n2Major; double n = n1 + n2; double nHat = (n1 * Math.log(n1) / Math.log(2) + n2 * Math.log(n2) / Math.log(2)); double pr = nHat / nMAjor; double v = nMAjor * Math.log(n) / Math.log(2); double d = n1 / 2 * n2Major / n2; double e = d * v; result.append("Program Length "); result.append(nMAjor); result.append("\n"); result.append("Program vocabulary "); result.append(n); result.append("\n"); result.append("Estimated length "); result.append(nHat); result.append("\n"); result.append("Purity ratio "); result.append(pr); result.append("\n"); result.append("Program volume "); result.append(v); result.append("\n"); result.append("Difficulty "); result.append(d); result.append("\n"); result.append("Program Effort "); result.append(e); result.append("\n"); }