Initial program 0.0
\[\left(x + y\right) \cdot \left(1 - z\right)
\]
Applied egg-rr0.0
\[\leadsto \color{blue}{x + \left(y + \left(x + y\right) \cdot \left(-z\right)\right)}
\]
Taylor expanded in x around 0 0.0
\[\leadsto \color{blue}{\left(-1 \cdot z + 1\right) \cdot x + \left(-1 \cdot \left(y \cdot z\right) + y\right)}
\]
Simplified0.0
\[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, y - y \cdot z\right)}
\]
Proof
[Start]0.0 | \[ \left(-1 \cdot z + 1\right) \cdot x + \left(-1 \cdot \left(y \cdot z\right) + y\right)
\] |
|---|
fma-def [=>]0.0 | \[ \color{blue}{\mathsf{fma}\left(-1 \cdot z + 1, x, -1 \cdot \left(y \cdot z\right) + y\right)}
\] |
|---|
fma-def [=>]0.0 | \[ \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(-1, z, 1\right)}, x, -1 \cdot \left(y \cdot z\right) + y\right)
\] |
|---|
+-commutative [<=]0.0 | \[ \mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, \color{blue}{y + -1 \cdot \left(y \cdot z\right)}\right)
\] |
|---|
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, y + -1 \cdot \color{blue}{\left(z \cdot y\right)}\right)
\] |
|---|
mul-1-neg [=>]0.0 | \[ \mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, y + \color{blue}{\left(-z \cdot y\right)}\right)
\] |
|---|
sub-neg [<=]0.0 | \[ \mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, \color{blue}{y - z \cdot y}\right)
\] |
|---|
*-commutative [=>]0.0 | \[ \mathsf{fma}\left(\mathsf{fma}\left(-1, z, 1\right), x, y - \color{blue}{y \cdot z}\right)
\] |
|---|
Applied egg-rr0.0
\[\leadsto \color{blue}{\mathsf{fma}\left(1 - z, x, \left(1 - z\right) \cdot y\right) \cdot 1}
\]
Final simplification0.0
\[\leadsto \mathsf{fma}\left(1 - z, x, \left(1 - z\right) \cdot y\right)
\]