(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos (+ a b)))))
(FPCore (r a b) :precision binary64 (/ (* (sin b) r) (fma (sin a) (- (sin b)) (* (cos a) (cos b)))))
double code(double r, double a, double b) {
return r * (sin(b) / cos((a + b)));
}
double code(double r, double a, double b) {
return (sin(b) * r) / fma(sin(a), -sin(b), (cos(a) * cos(b)));
}
function code(r, a, b) return Float64(r * Float64(sin(b) / cos(Float64(a + b)))) end
function code(r, a, b) return Float64(Float64(sin(b) * r) / fma(sin(a), Float64(-sin(b)), Float64(cos(a) * cos(b)))) end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
\frac{\sin b \cdot r}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}



Bits error versus r



Bits error versus a



Bits error versus b
Initial program 15.3
Applied egg-rr0.3
Taylor expanded in r around 0 0.3
Taylor expanded in b around inf 0.3
Simplified0.3
Taylor expanded in a around inf 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022150
(FPCore (r a b)
:name "rsin B"
:precision binary64
(* r (/ (sin b) (cos (+ a b)))))