(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (fma x (cos y) (* (sin y) (- z))))
double code(double x, double y, double z) {
return (x * cos(y)) - (z * sin(y));
}
double code(double x, double y, double z) {
return fma(x, cos(y), (sin(y) * -z));
}
function code(x, y, z) return Float64(Float64(x * cos(y)) - Float64(z * sin(y))) end
function code(x, y, z) return fma(x, cos(y), Float64(sin(y) * Float64(-z))) end
code[x_, y_, z_] := N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(x * N[Cos[y], $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]), $MachinePrecision]
x \cdot \cos y - z \cdot \sin y
\mathsf{fma}\left(x, \cos y, \sin y \cdot \left(-z\right)\right)



Bits error versus x



Bits error versus y



Bits error versus z
Initial program 0.1
Applied egg-rr0.2
Taylor expanded in z around 0 0.1
Final simplification0.1
herbie shell --seed 2022153
(FPCore (x y z)
:name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, A"
:precision binary64
(- (* x (cos y)) (* z (sin y))))