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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[\left(x + \sin y\right) + z \cdot \cos y \]
  2. Applied egg-rr0.6

    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y \cdot {\left(\sqrt[3]{z}\right)}^{2}, \sqrt[3]{z}, x + \sin y\right)} \]
  3. Applied egg-rr0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, z, \sin y\right) + x} \]
  4. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) + x \]

Reproduce

herbie shell --seed 2022153 
(FPCore (x y z)
  :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
  :precision binary64
  (+ (+ x (sin y)) (* z (cos y))))