<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gfrefn(t1, t2, s1, s2):
 """ For those times when we can't do better, we use a bisection method to find the next time at which to test for state change. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrefn_c.html :param t1: One of two values bracketing a state change. :type t1: float :param t2: The other value that brackets a state change. :type t2: float :param s1: State at t1. :type s1: bool :param s2: State at t2. :type s2: bool :return: New value at which to check for transition. :rtype: float """

    t1 = ctypes.c_double(t1)
    t2 = ctypes.c_double(t2)
    s1 = ctypes.c_int(s1)
    s2 = ctypes.c_int(s2)
    t = ctypes.c_double()
    libspice.gfrefn_c(t1, t2, s1, s2, ctypes.byref(t))
    return t.value