'Transform float() into either a C type cast or a faster C
function call.'

def _handle_simple_function_float(self, node, function, pos_args):

    if (len(pos_args) == 0):
        return ExprNodes.FloatNode(node, value='0.0', constant_result=0.0).coerce_to(Builtin.float_type, self.current_env())
    elif (len(pos_args) != 1):
        self._error_wrong_arg_count('float', node, pos_args, '0    or    1')
        return node
    func_arg = pos_args[0]
    if isinstance(func_arg, ExprNodes.CoerceToPyTypeNode):
        func_arg = func_arg.arg
    if (func_arg.type is PyrexTypes.c_double_type):
        return func_arg
    elif (node.type.assignable_from(func_arg.type) or func_arg.type.is_numeric):
        return ExprNodes.TypecastNode(node.pos, operand=func_arg, type=node.type)
    return ExprNodes.PythonCapiCallNode(node.pos, '__Pyx_PyObject_AsDouble', self.PyObject_AsDouble_func_type, args=pos_args, is_temp=node.is_temp, utility_code=load_c_utility('pyobject_as_double'), py_name='float')
