def METHOD_NAME(self, variables):
    compiled = sv_compile(self.formula)
    def cartesian(x, y, z, V):
        variables.update(dict(x=x, y=y, z=z, V=V))
        r = safe_eval_compiled(compiled, variables, allowed_names = safe_names_np)
        if not isinstance(r, np.ndarray):
            r = np.full_like(x, r)
        return r
    def cylindrical(x, y, z, V):
        rho, phi, z = to_cylindrical_np((x, y, z), mode='radians')
        variables.update(dict(rho=rho, phi=phi, z=z, V=V))
        r = safe_eval_compiled(compiled, variables, allowed_names = safe_names_np)
        if not isinstance(r, np.ndarray):
            r = np.full_like(x, r)
        return r
    def spherical(x, y, z, V):
        rho, phi, theta = to_spherical_np((x, y, z), mode='radians')
        variables.update(dict(rho=rho, phi=phi, theta=theta, V=V))
        r = safe_eval_compiled(compiled, variables, allowed_names = safe_names_np)
        if not isinstance(r, np.ndarray):
            r = np.full_like(x, r)
        return r
    if self.input_mode == 'XYZ':
        function = cartesian
    elif self.input_mode == 'CYL':
        function = cylindrical
    else: # SPH
        function = spherical
    return function