TITLE: What is the effect of adding 1/2 to a continued fraction?
QUESTION [30 upvotes]: Is there a simple answer to the question "what happens to the continued fraction expansion of an irrational number when you add 1/2?"  A closely related question is "what happens to such an expansion when you multiply by 2?"
Remarks:  I'm not sure what qualifies for an answer.  The motivation comes from wanting to better understand the equivalence relation on integer sequences generated by tail equivalence (which is generated by adding integers and taking reciprocals) and closure under doubling/halving.  It is known that this Borel equivalence relation is not hyperfinite, so the answer cannot be too simple.
Edit:  The answers are not really what I am asking for.  It is clear there is some recursive procedure for doing this, just like there is a recursive procedure for taking a square root of a decimal expansion.  I'm looking for something which one might call a "closed form".  For instance, if you start with a periodic expansion, adding 1/2 produces a new periodic expansion.  Is there a simple transformation on the initial and periodic parts which corresponds to adding 1/2?  For instance, can this be done with a finite state automaton?  An authoritative "there is no such nice answer" would actually be an acceptable answer.

REPLY [11 votes]: Kind of a late response, but since no one else mentioned it I think it is worth pointing out that the procedure for computing homographies/linear fractional transformations on continued fractions (mentioned in Douglas Zare's answer) was also described explicitly in terms of finite state automata by George N. Raney, in "On continued fractions and finite automata", Mathematische Annalen 206:4, 1973. (This was a little after Gosper's memo, but neither one cites the other, so I suppose Gosper and Raney came up with these ideas independently?)
Formally, Raney showed how to interpret homographies $\phi(x) = \frac{ax + b}{cx + d}$ (e.g., the map $x \mapsto x + 1/2$, taking $a=2,b=1,c=0,d=2$) as states of finite state transducers. The transitions executed by these transducers are of the form
$$\phi_1 \underset{I:O}{\longrightarrow} \phi_2$$
where $\phi_1$ and $\phi_2$ are states corresponding to a pair of homographies, and $I,O \in \{L,R\}^*$ are binary words describing a piece of the continued fractions of the input and output, respectively. Note that this is based on an encoding of continued fractions $x = [a_0;a_1,a_2,\dots]$ as binary sequences $R^{a_0}L^{a_1}R^{a_2}\cdots$ (which, incidentally, is closely related to the Stern-Brocot/Calkin-Wilf representations of the rationals).
I'm mostly ignorant as to how far Raney's approach has been taken (and curious myself). However, one significant follow-up work was by Pierre Liardet and Pierre Stambul in "Algebraic Computations with Continued Fractions" (1998), where they showed how to unify Gosper's and Raney's approaches by building transducers to interpret general "bihomographies"/"biquadratic fractional transformations" $\phi(x,y) = \frac{axy + bx + cy + d}{exy + fx + gy + h}$.

UPDATE:
I went ahead and derived the Raney transducer for computing $x \mapsto x + 1/2$.

There are four states $q_1,\dots,q_4$, corresponding to the homographies
\begin{aligned}
q_1(x) &= (2x + 1)/2 = x + 1/2 \\
q_2(x) &= 4x \\
q_3(x) &= x/4 \\
q_4(x) &= 2x/(x+2)
\end{aligned}
A total of 16 transitions, which can be grouped into eight transitions
\begin{aligned}
q_1 &\overset{R:R}{\longrightarrow} q_1 \\
q_1 &\overset{LL:LR}{\longrightarrow} q_2 \\
q_1 &\overset{LR:RLL}{\longrightarrow} q_3 \\
q_2 &\overset{R:RRRR}{\longrightarrow} q_2 \\
q_2 &\overset{LR:RR}{\longrightarrow} q_4 \\
q_2 &\overset{LLR:RL}{\longrightarrow} q_1 \\
q_2 &\overset{LLLR:RLLL}{\longrightarrow} q_3 \\
q_2 &\overset{LLLL:L}{\longrightarrow} q_2
\end{aligned}
together with a dual set of eight transitions:
\begin{aligned}
q_3 &\overset{L:LLLL}{\longrightarrow} q_3 \\
q_3 &\overset{RL:LL}{\longrightarrow} q_1 \\
q_3 &\overset{RRL:LR}{\longrightarrow} q_4 \\
q_3 &\overset{RRRL:LRRR}{\longrightarrow} q_2 \\
q_3 &\overset{RRRR:R}{\longrightarrow} q_3 \\
q_4 &\overset{L:L}{\longrightarrow} q_4 \\
q_4 &\overset{RR:RL}{\longrightarrow} q_3 \\
q_4 &\overset{RL:LRR}{\longrightarrow} q_2 \\
\end{aligned}

In case you are interested, here is a little Haskell implementation, which shows how to use this machine to add 1/2 to the continued fractions representing the golden ratio and $e$.