@Override
 public void attributeChanged(final Attribute attribute) throws IllegalActionException {
   try {
     if (attribute == function) {
       final String functionName = function.stringValue();
       if (functionName.equals("exp")) {
         _function = _EXP;
         if (secondOperand != null) {
           secondOperand.setContainer(null);
         }
       } else if (functionName.equals("log")) {
         _function = _LOG;
         if (secondOperand != null) {
           secondOperand.setContainer(null);
         }
       } else if (functionName.equals("modulo")) {
         _function = _MODULO;
         _createSecondPort();
       } else if (functionName.equals("sign")) {
         _function = _SIGN;
         if (secondOperand != null) {
           secondOperand.setContainer(null);
         }
       } else if (functionName.equals("square")) {
         _function = _SQUARE;
         if (secondOperand != null) {
           secondOperand.setContainer(null);
         }
       } else if (functionName.equals("sqrt")) {
         _function = _SQRT;
         if (secondOperand != null) {
           secondOperand.setContainer(null);
         }
       } else {
         throw new IllegalActionException(this, "Unrecognized math function: " + functionName);
       }
     } else {
       super.attributeChanged(attribute);
     }
   } catch (final NameDuplicationException nameDuplication) {
     throw new InternalErrorException(this, nameDuplication, "Unexpected name duplication");
   }
 }