import System.IO
import Text.Printf
import Control.Monad

writeDat filename x y xprec yprec =
  withFile filename WriteMode $ \h ->
     
     let writeLine = hPrintf h $ "%." ++ show xprec ++ "g\t%." ++ show yprec ++ "g\n" in
       zipWithM_ writeLine x y