function recurPol(node, noPai, o) {
      var tp = node.type;

      if (tp === 'FunctionNode') {
        // ***** FunctionName *****
        // No function call in polynomial expression
        throw new Error('There is an unsolved function call');
      } else if (tp === 'OperatorNode') {
        // ***** OperatorName *****
        if ('+-*^'.indexOf(node.op) === -1) throw new Error('Operator ' + node.op + ' invalid');

        if (noPai !== null) {
          // -(unary),^  : children of *,+,-
          if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {
            throw new Error('Invalid ' + node.op + ' placing');
          } // -,+,* : children of +,-


          if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {
            throw new Error('Invalid ' + node.op + ' placing');
          } // -,+ : first child


          if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {
            throw new Error('Invalid ' + node.op + ' placing');
          }
        } // Has parent
        // Firers: ^,*       Old:   ^,&,-(unary): firers


        if (node.op === '^' || node.op === '*') {
          o.fire = node.op;
        }

        for (var _i = 0; _i < node.args.length; _i++) {
          // +,-: reset fire
          if (node.fn === 'unaryMinus') o.oper = '-';

          if (node.op === '+' || node.fn === 'subtract') {
            o.fire = '';
            o.cte = 1; // default if there is no constant

            o.oper = _i === 0 ? '+' : node.op;
          }

          o.noFil = _i; // number of son

          recurPol(node.args[_i], node, o);
        } // for in children

      } else if (tp === 'SymbolNode') {
        // ***** SymbolName *****
        if (node.name !== varname && varname !== '') {
          throw new Error('There is more than one variable');
        }

        varname = node.name;

        if (noPai === null) {
          coefficients[1] = 1;
          return;
        } // ^: Symbol is First child


        if (noPai.op === '^' && o.noFil !== 0) {
          throw new Error('In power the variable should be the first parameter');
        } // *: Symbol is Second child


        if (noPai.op === '*' && o.noFil !== 1) {
          throw new Error('In multiply the variable should be the second parameter');
        } // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)


        if (o.fire === '' || o.fire === '*') {
          if (maxExpo < 1) coefficients[1] = 0;
          coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);
          maxExpo = Math.max(1, maxExpo);
        }
      } else if (tp === 'ConstantNode') {
        var valor = parseFloat(node.value);

        if (noPai === null) {
          coefficients[0] = valor;
          return;
        }

        if (noPai.op === '^') {
          // cte: second  child of power
          if (o.noFil !== 1) throw new Error('Constant cannot be powered');

          if (!number.isInteger(valor) || valor <= 0) {
            throw new Error('Non-integer exponent is not allowed');
          }

          for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) {
            coefficients[_i2] = 0;
          }

          if (valor > maxExpo) coefficients[valor] = 0;
          coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);
          maxExpo = Math.max(valor, maxExpo);
          return;
        }

        o.cte = valor; // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.

        if (o.fire === '') {
          coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);
        }
      } else {
        throw new Error('Type ' + tp + ' is not allowed');
      }
    }
Recursive auxilary function inside polyToCanonical for
converting expression in canonical form

Syntax:

    recurPol(node, noPai, obj)

@param  {Node} node        The current subpolynomial expression
@param  {Node | Null}  noPai   The current parent node
@param  {object}    obj        Object with many internal flags

@return {}                    No return. If error, throws an exception