- unsigned i = function::find_function(ex_to_symbol($1).getname(), $3.nops());
- $$ = function(i, static_cast<const exprseq &>(*($3.bp))).eval(1);
+ string n = ex_to<symbol>($1).get_name();
+ if (n == "sqrt") {
+ if ($3.nops() != 1)
+ throw (std::runtime_error("too many arguments to sqrt()"));
+ $$ = sqrt($3.op(0));
+ } else {
+ unsigned i = function::find_function(n, $3.nops());
+ $$ = function(i, ex_to<exprseq>($3)).eval(1);
+ }