Cleaned up generation of special function values