Implement a strongly Darboux function According to Wikipedia, a strongly Darboux function is


  one for which the image of every (non-empty) open interval is the whole real line


In other words, a function \$f\$ is strongly Darboux if given 3 arbitrary real numbers \$a\$, \$b\$, and \$y\$, it is always possible to find an \$x\$ between (distinct) \$a\$ and \$b\$ such that \$f(x) = y\$.

For the purposes of this challenge, we will consider strongly Darboux functions over the rationals instead.

Your challenge is to write a program or function that:


gives a rational number as output for every rational number input,
always gives the same output for a given input, and
has the strongly Darboux property.


Input and output may be either of the following:


an arbitrary-precision number type, if your language has one (or has a library for one, e.g. GMP).
a string representation of the number, which you may assume will always contain a decimal point and at least one digit on either side. It may be in any base \$b \geq 2\$, but input and output must be in the same base. You may use any set of characters for the digits and decimal point (but again, they must be consistent between input and output).


The input will always have a terminating base \$b\$ expansion. As for the output, which may have a theoretically non-terminating base \$b\$ expansion depending on your choice of function, you may choose any of the following:


output digits forever.
take an additional integer as input and output at least that many digits.
output at least as many digits as are in the input (which may contain trailing zeroes).


Note that by the nature of this challenge, the convention that numbers may be assumed to be representable by standard number types does not apply, except for the second input described in option 2 above.

To avoid loopholes with functions that are only defined on non-terminating rationals, your submission must be able to produce output arbitrarily close to a desired value in practice. Formally, given rational numbers \$a\$, \$b\$, \$y\$, and \$\varepsilon\$, there must be a rational number \$x\$ that terminates in your chosen base such that \$a&lt;x&lt;b\$ and \$|f(x)-y|&lt;\varepsilon\$.



To give you some ideas, here is a description of the Conway base 13 function:


Convert \$x\$ to base 13 and remove the decimal point.
If the result is of the form \$[x]A[y]C[z]_{13}\$, where \$[y]\$ and \$[z]\$ consist of only digits from 0 to 9, then \$f(x) = [y].[z]\$.
If the result is of the form \$[x]B[y]C[z]_{13}\$, where \$[y]\$ and \$[z]\$ consist of only digits from 0 to 9, then \$f(x) = -[y].[z]\$.
Otherwise, \$f(x) = 0\$.


This function is strongly Darboux. Say, for example, that we want to find some \$x\$ between \$123.456_{13}\$ and \$123.457_{13}\$ such that \$f(x) = 7.89\$. The base-13 value \$123.456A7C89_{13}\$ would satisfy this requirement.

Your submission may be an implementation of this function, although I suspect that there are other strongly Darboux functions that are a lot shorter to implement. :)
Retina 0.8.2, 43 50 bytes

^.*\.(..)*1(.)((..)+)1.((..)*)$
$2$*-$3.$5
0(.)
$1


Try it online! I/O is as a binary string. Encode a binary number y close to another binary number a as follows:


If a does not contain a ., suffix one.
If a contains an odd number of digits after the ., suffix a 0.
If y is negative then suffix 11 otherwise suffix 10.
For each digit in y, suffix 0 followed by that digit.
If y contains a ., suffix 11 at that point, otherwise suffix it after all the digits in y.


Explanation:

^.*\.(..)*1(.)((..)+)1.((..)*)$
$2$*-$3.$5


Pair the digits starting at the binary point. If the number is a valid encoding, then decode the last 1x digit pair to a . and the second last to an optional - sign. Digits before that are ignored.

0(.)
$1


This should just leave pairs that begin with 0, so delete the 0s.