(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos (+ a b)))))
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (fma (cos a) (cos b) (- (log1p (expm1 (* (sin b) (sin a)))))))))
double code(double r, double a, double b) {
return r * (sin(b) / cos((a + b)));
}
double code(double r, double a, double b) {
return r * (sin(b) / fma(cos(a), cos(b), -log1p(expm1((sin(b) * sin(a))))));
}
function code(r, a, b) return Float64(r * Float64(sin(b) / cos(Float64(a + b)))) end
function code(r, a, b) return Float64(r * Float64(sin(b) / fma(cos(a), cos(b), Float64(-log1p(expm1(Float64(sin(b) * sin(a)))))))) 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[(r * N[(N[Sin[b], $MachinePrecision] / N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision] + (-N[Log[1 + N[(Exp[N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
r \cdot \frac{\sin b}{\mathsf{fma}\left(\cos a, \cos b, -\mathsf{log1p}\left(\mathsf{expm1}\left(\sin b \cdot \sin a\right)\right)\right)}



Bits error versus r



Bits error versus a



Bits error versus b
Initial program 15.4
Applied egg-rr0.3
Applied egg-rr0.3
Final simplification0.3
herbie shell --seed 2022151
(FPCore (r a b)
:name "rsin B"
:precision binary64
(* r (/ (sin b) (cos (+ a b)))))