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

Error

Derivation

  1. Initial program 0.0

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

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

Alternatives

Alternative 1
Error0.0
Cost13248
\[\left(x + \sin y\right) + z \cdot \cos y \]
Alternative 2
Error17.4
Cost7120
\[\begin{array}{l} t_0 := \cos y \cdot z\\ \mathbf{if}\;z \leq -6 \cdot 10^{+131}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-227}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-200}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+158}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error9.7
Cost7120
\[\begin{array}{l} t_0 := \cos y \cdot z\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+138}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-17}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-61}:\\ \;\;\;\;\sin y + x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+157}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error3.3
Cost7116
\[\begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;z \ne 0:\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} + x\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-61}:\\ \;\;\;\;\sin y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error9.9
Cost7112
\[\begin{array}{l} t_0 := \left(y + x\right) + z \cdot \cos y\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-16}:\\ \;\;\;\;\sin y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error22.0
Cost6992
\[\begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-82}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-128}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-252}:\\ \;\;\;\;\left(y + z\right) + x\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-103}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 7
Error19.3
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{+70}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-37}:\\ \;\;\;\;\left(y + z\right) + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 8
Error26.5
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-45}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error20.4
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{-88}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-105}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 10
Error35.2
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-79}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-97}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error28.6
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-42}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error36.5
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2023010 
(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))))