math: add eval_as_float and eval_as_double