(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
(FPCore (a b angle) :precision binary64 (+ (pow (* a 1.0) 2.0) (pow (* b (sin (fma (* PI angle) 0.005555555555555556 0.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
double code(double a, double b, double angle) {
return pow((a * 1.0), 2.0) + pow((b * sin(fma((((double) M_PI) * angle), 0.005555555555555556, 0.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function code(a, b, angle) return Float64((Float64(a * 1.0) ^ 2.0) + (Float64(b * sin(fma(Float64(pi * angle), 0.005555555555555556, 0.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := N[(N[Power[N[(a * 1.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556 + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
{\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle, 0.005555555555555556, 0\right)\right)\right)}^{2}



Bits error versus a



Bits error versus b



Bits error versus angle
Initial program 20.5
Taylor expanded in angle around 0 20.6
Applied egg-rr20.7
Applied egg-rr20.6
Final simplification20.6
herbie shell --seed 2022131
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))