<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rmse(target, prediction, relative=False, percent=False):
 """Root Mean Square Error This seems like a simple formula that you'd never need to create a function for. But my mistakes on coding challenges have convinced me that I do need it, as a reminder of important tweaks, if nothing else. 3.0 """

    relative = relative or percent
    prediction = pd.np.array(prediction)
    target = np.array(target)
    err = prediction - target
    if relative:
        denom = target
        # Avoid ZeroDivisionError: divide by prediction rather than target where target==0
        denom[denom == 0] = prediction[denom == 0]
        # If the prediction and target are both 0, then the error is 0 and should be included in the RMSE
        # Otherwise, the np.isinf() below would remove all these zero-error predictions from the array.
        denom[(denom == 0) & (target == 0)] = 1
        err = (err / denom)
        err = err[(~ np.isnan(err)) & (~ np.isinf(err))]
    return 100 * rms(err) if percent else rms(err)