?

Average Error: 0.1 → 0.1
Time: 9.9s
Precision: binary64
Cost: 19520

?

\[x \cdot \cos y + z \cdot \sin y \]
\[\mathsf{fma}\left(\sin y, z, x \cdot \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)));
}
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(x * cos(y)))
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[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \cos y + z \cdot \sin y
\mathsf{fma}\left(\sin y, z, x \cdot \cos y\right)

Error?

Derivation?

  1. Initial program 0.1

    \[x \cdot \cos y + z \cdot \sin y \]
  2. Applied egg-rr0.1

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

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

Alternatives

Alternative 1
Error9.4
Cost13257
\[\begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+28} \lor \neg \left(x \leq 8.2 \cdot 10^{-51}\right):\\ \;\;\;\;x \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin y, z, x\right)\\ \end{array} \]
Alternative 2
Error0.1
Cost13248
\[\sin y \cdot z + x \cdot \cos y \]
Alternative 3
Error9.4
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -6.1 \cdot 10^{+28} \lor \neg \left(x \leq 7.6 \cdot 10^{-51}\right):\\ \;\;\;\;x \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;x + \sin y \cdot z\\ \end{array} \]
Alternative 4
Error16.8
Cost6857
\[\begin{array}{l} \mathbf{if}\;y \leq -470000000000 \lor \neg \left(y \leq 0.11\right):\\ \;\;\;\;\sin y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
Alternative 5
Error17.1
Cost6857
\[\begin{array}{l} \mathbf{if}\;x \leq -5.1 \cdot 10^{-172} \lor \neg \left(x \leq 7.8 \cdot 10^{-56}\right):\\ \;\;\;\;x \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\sin y \cdot z\\ \end{array} \]
Alternative 6
Error38.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-177}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-108}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error31.4
Cost320
\[x + y \cdot z \]
Alternative 8
Error39.5
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023039 
(FPCore (x y z)
  :name "Diagrams.ThreeD.Transform:aboutY from diagrams-lib-1.3.0.3"
  :precision binary64
  (+ (* x (cos y)) (* z (sin y))))