I'd not bother trying to develop approximations of your own. Simpler is to pick up a copy of "Computer Approximations", Hart, et al. A good university library should have it. 23 bits is about 7 decimal digits, so just pick an approximation that gives you the accuracy you need. You can choose either a simple polynomial approximation, or use a rational polynomial, usually a bit better as long as you can tolerate the divide.
Range reduction does make sense, in fact, I chose the same range (+/-pi/4) in my own tools because this choice of range is particularly easy to work with.
Edit: (An example of the use of the approximations one can find in Hart.)
Here I'll find an approximation for sin(x), where x lies in the interval [0,pi/4]. My goal will be to choose an approximation with absolute accuracy of at least 1.e-7 over that interval. Of course, if you have a negative value for x, we know that sin(x) is an odd function, so this is trivial.
I note that the approximations in Hart tend to be of the form sin(alphapix), where x lies in the interval [0,1]. If I then choose an approximation for alpha = 1/2, I'd get an approximation that is valid over the chosen interval. So for an approximation over the interval [0,pi/4] we look for alpha = 1/4.
Next, I look for an approximation that is indicated to have absolute accuracy of at least 7 digits or so, and I'll prefer to use rational polynomial approximations, since they tend to be a bit more efficient. Scanning down the tables on page 118 (my copy of Hart is from 1978) I find an approximation with alpha = 1/4 that fits the bill: index 3060.
This approximation will be of the form
sin(alpha*pi*x) = x*P(x^2)/Q(x^2)
So now I tab over to the page that gives the coefficients for SIN 3060. In my copy, it falls on pages 199-200. There are 5 coefficients, P00, P01, P02, Q00, Q01. (Watch out for the somewhat non-standard scientific notation used here.) Thus P (the numerator polynomial) has 3 terms in it, while Q, the denominator has 2 terms. Writing it out, I get this:
sin(alpha*pi*x) = (52.81860134812 -4.644800481954*x^3 + 0.0867545069521*x^5)/ ...
(67.250731777791 + x^2)
Lets try it now in MATLAB.
x = linspace(0,pi/4,10001);
xt = x*4/pi; % transform to [0,1]
sine = @(x) (52.81860134812*x -4.644800481954*x.^3 + ...
0.0867545069521*x.^5)./(67.250731777791 + x.^2);
max(abs(sin(x) -sine(xt)))
ans =
1.6424e-09
plot(x,sin(x)- sine(xt),'-')
![Error for the sin approximation over [0,pi/4]](../../images/3811839094.webp)
Note the 1e-9 attached to the y-axis.
It looks like this is the most reasonable choice of approximation for sin(x) over that specific interval, although this gives about 29 bits of accuracy instead of the 23 bits you asked for. If you are willing to choose a different range reduction interval, there are a few choices that might save a term, possibly at a cost of a few bits that you don't need.
log2(max(abs(sin(x) -sine(xt))))
ans =
-29.182