# How to produce a longer \sim with a small letter on top

I am able to produce a standard length \sim with a tiny S above it, but I would like the \sim tilde to be longer (maybe one and half times as wide as a capital letter). Any tips on how to change the width/length of \sim?

-
See also the question tex.stackexchange.com/q/15830/86 and its answers. – Loop Space May 29 '11 at 20:23

\mathrel{\overset{#2}{\scalebox{#1}[1]{$\sim$}}}
$A \widesim{S} B$
$A \widesim[2]{SS} B$