(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
(FPCore (r a b) :precision binary64 (* (sin b) (/ (- r) (- (* (sin b) (sin a)) (* (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 / ((sin(b) * sin(a)) - (cos(a) * cos(b))));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (r * sin(b)) / cos((a + b))
end function
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = sin(b) * (-r / ((sin(b) * sin(a)) - (cos(a) * cos(b))))
end function
public static double code(double r, double a, double b) {
return (r * Math.sin(b)) / Math.cos((a + b));
}
public static double code(double r, double a, double b) {
return Math.sin(b) * (-r / ((Math.sin(b) * Math.sin(a)) - (Math.cos(a) * Math.cos(b))));
}
def code(r, a, b): return (r * math.sin(b)) / math.cos((a + b))
def code(r, a, b): return math.sin(b) * (-r / ((math.sin(b) * math.sin(a)) - (math.cos(a) * math.cos(b))))
function code(r, a, b) return Float64(Float64(r * sin(b)) / cos(Float64(a + b))) end
function code(r, a, b) return Float64(sin(b) * Float64(Float64(-r) / Float64(Float64(sin(b) * sin(a)) - Float64(cos(a) * cos(b))))) end
function tmp = code(r, a, b) tmp = (r * sin(b)) / cos((a + b)); end
function tmp = code(r, a, b) tmp = sin(b) * (-r / ((sin(b) * sin(a)) - (cos(a) * cos(b)))); end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * N[((-r) / N[(N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{r \cdot \sin b}{\cos \left(a + b\right)}
\sin b \cdot \frac{-r}{\sin b \cdot \sin a - \cos a \cdot \cos b}



Bits error versus r



Bits error versus a



Bits error versus b
Results
Initial program 14.7
Applied cos-sum_binary640.3
Applied frac-2neg_binary640.3
Simplified0.3
Simplified0.3
Applied *-un-lft-identity_binary640.3
Applied distribute-rgt-neg-in_binary640.3
Applied times-frac_binary640.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022137
(FPCore (r a b)
:name "rsin A"
:precision binary64
(/ (* r (sin b)) (cos (+ a b))))