Average Error: 0.1 → 0.1
Time: 10.3s
Precision: binary64
\[\left(x + \cos y\right) - z \cdot \sin y \]
\[\mathsf{fma}\left(\sin y, -z, x + \cos y\right) \]
\left(x + \cos y\right) - z \cdot \sin y
\mathsf{fma}\left(\sin y, -z, x + \cos y\right)
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (fma (sin y) (- z) (+ x (cos y))))
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, (x + cos(y)));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.1

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

    \[\leadsto \left(x + \cos y\right) - \color{blue}{{\left(\sqrt[3]{z \cdot \sin y}\right)}^{3}} \]
  3. Taylor expanded in z around -inf 48.5

    \[\leadsto \left(x + \cos y\right) - \color{blue}{-1 \cdot {\left(e^{0.3333333333333333 \cdot \left(\log \sin y - \log \left(\frac{-1}{z}\right)\right)}\right)}^{3}} \]
  4. Simplified0.1

    \[\leadsto \left(x + \cos y\right) - \color{blue}{\left(-\frac{\sin y}{\frac{-1}{z}}\right)} \]
  5. Applied egg-rr0.1

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

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

Reproduce

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