You can use a vertical alignment to get the measuring done and then re-flow them in a horizontal layout:
% START CODE
% Do everything an a box, as you can not remove
% things from the main vertical list.
% Allow \\ for ends of row.
% Use an \halign (I experimented with using one
% of the AMS alignments but they tend to want to
% be full width, or already in math mode, so just
% use a primitive \halign here with two display math
% entries in its preamble.
% END CODE
% Finish the \halign.
% Now, at this point the vertical list being assembled in
% box0 contains all the rows of the alignment these will be
% a sequence of \hboxes (which will all be forced to be the
% same width) and baselineskip glue. (While testing with the
% AMS alignments there was additional glue and penalties
% as well.
% We will discard all the glue and penalties but assemble
% a horizontal list of the boxes in box1.
% start by making box1 and empty hbox.
% Then loop backwards up the vertical list discarding any glue
% and penalties and grabbing hold of each box.
% This combination removes two adjacent glue items
% or glue followed by penalty, it may be more than needed
% but better be safe than sorry.
% Glue and penalties we discard, but the boxes have the
% formula so remove this one from the current list and
% save it in box 4.
% If there was no box box4 is void and we reached the top
% of the original vertical alignent so stop.
% Otherwise Put this box4 at the front of the horizontal
% list being built in box1, followed by an em of space.
% Go round the loop again.
% End the group for the working box 0.
% The horizontal list is globally assigned
% to box 1 so will be visible after this group end.
% Now put out all the boxes flush left, the usual paragraph breaker
% will fit as many on a line as it can. As each box is the same width
% vertical alignment is automatic.
% Ignore white space after the end of the environment
x^2 + y^2 &= 1\\
a + b &= c\\
r-x &= y+z \\
f - y &= z\\
a - b &= 2d\\
r+x &= 2y-3z