Average Error: 0.0 → 0.0
Time: 2.3s
Precision: binary64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[x \cdot \left(1 \cdot z + y\right) + 1 \cdot \left(-z\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[x \cdot y + \left(x - 1\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip3--12.0

    \[\leadsto x \cdot y + \color{blue}{\frac{{x}^{3} - {1}^{3}}{x \cdot x + \left(1 \cdot 1 + x \cdot 1\right)}} \cdot z\]
  4. Applied associate-*l/14.1

    \[\leadsto x \cdot y + \color{blue}{\frac{\left({x}^{3} - {1}^{3}\right) \cdot z}{x \cdot x + \left(1 \cdot 1 + x \cdot 1\right)}}\]
  5. Taylor expanded around 0 0.0

    \[\leadsto x \cdot y + \color{blue}{\left(1 \cdot \left(x \cdot z\right) - 1 \cdot z\right)}\]
  6. Simplified0.0

    \[\leadsto x \cdot y + \color{blue}{1 \cdot \left(x \cdot z - z\right)}\]
  7. Using strategy rm
  8. Applied sub-neg0.0

    \[\leadsto x \cdot y + 1 \cdot \color{blue}{\left(x \cdot z + \left(-z\right)\right)}\]
  9. Applied distribute-lft-in0.0

    \[\leadsto x \cdot y + \color{blue}{\left(1 \cdot \left(x \cdot z\right) + 1 \cdot \left(-z\right)\right)}\]
  10. Applied associate-+r+0.0

    \[\leadsto \color{blue}{\left(x \cdot y + 1 \cdot \left(x \cdot z\right)\right) + 1 \cdot \left(-z\right)}\]
  11. Simplified0.0

    \[\leadsto \color{blue}{x \cdot \left(1 \cdot z + y\right)} + 1 \cdot \left(-z\right)\]
  12. Final simplification0.0

    \[\leadsto x \cdot \left(1 \cdot z + y\right) + 1 \cdot \left(-z\right)\]

Reproduce

herbie shell --seed 2020157 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
  :precision binary64
  (+ (* x y) (* (- x 1.0) z)))