(FPCore (x y z) :precision binary64 (+ (* x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (fma (sin y) z (* (cos y) x)))
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(sin(y), z, (cos(y) * x));
}
function code(x, y, z) return Float64(Float64(x * cos(y)) + Float64(z * sin(y))) end
function code(x, y, z) return fma(sin(y), z, Float64(cos(y) * x)) 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[(N[Sin[y], $MachinePrecision] * z + N[(N[Cos[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
x \cdot \cos y + z \cdot \sin y
\mathsf{fma}\left(\sin y, z, \cos y \cdot x\right)



Bits error versus x



Bits error versus y



Bits error versus z
Initial program 0.1
Simplified0.1
Taylor expanded in x around 0 0.1
Simplified0.1
Applied add-cube-cbrt_binary640.4
Applied associate-*l*_binary640.4
Applied add-cbrt-cube_binary640.4
Simplified0.3
Applied *-un-lft-identity_binary640.3
Applied associate-*l*_binary640.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2022131
(FPCore (x y z)
:name "Diagrams.ThreeD.Transform:aboutY from diagrams-lib-1.3.0.3"
:precision binary64
(+ (* x (cos y)) (* z (sin y))))