raise cost of oPowerDeriv to always create a temporary variable if it has been encountered at least twice

time-shift
Houtan Bastani 2015-09-03 14:25:06 +02:00
parent ee7e5d6814
commit 6c34da5c12
1 changed files with 3 additions and 2 deletions

View File

@ -2750,7 +2750,7 @@ BinaryOpNode::cost(const temporary_terms_t &temporary_terms, bool is_matlab) con
return cost + 990;
case oPower:
case oPowerDeriv:
return cost + 1160;
return cost + (MIN_COST_MATLAB/2+1);
case oEqual:
return cost;
}
@ -2775,8 +2775,9 @@ BinaryOpNode::cost(const temporary_terms_t &temporary_terms, bool is_matlab) con
case oDivide:
return cost + 15;
case oPower:
case oPowerDeriv:
return cost + 520;
case oPowerDeriv:
return cost + (MIN_COST_C/2+1);;
case oEqual:
return cost;
}