let rec v_sqrt v = match v with
|N i ->
if i >= 0 then return_R (sqrt (float_of_int i))
else raise (Value_operation "sqrt parameter < 0.")
|R f ->
if f >= 0. then return_R (sqrt f)
else raise (Value_operation "sqrt parameter < 0.")
|Vec (size, vec) -> make_vector size (fun i -> v_sqrt (vec i))
|Zero -> return_R (sqrt 0.)
|W -> W