Average Error: 6.0 → 0.1
Time: 5.3s
Precision: binary64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[x \cdot x - \left(\left(y \cdot z\right) \cdot \left(4 \cdot z\right) + \left(-y\right) \cdot \left(t \cdot 4\right)\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original6.0
Target6.0
Herbie0.1
\[x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\]

Derivation

  1. Initial program 6.0

    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
  2. Using strategy rm
  3. Applied associate-*l*6.0

    \[\leadsto x \cdot x - \color{blue}{y \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt6.8

    \[\leadsto x \cdot x - \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)\]
  6. Applied associate-*l*6.8

    \[\leadsto x \cdot x - \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(4 \cdot \left(z \cdot z - t\right)\right)\right)}\]
  7. Using strategy rm
  8. Applied sub-neg6.8

    \[\leadsto x \cdot x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(4 \cdot \color{blue}{\left(z \cdot z + \left(-t\right)\right)}\right)\right)\]
  9. Applied distribute-lft-in6.8

    \[\leadsto x \cdot x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \color{blue}{\left(4 \cdot \left(z \cdot z\right) + 4 \cdot \left(-t\right)\right)}\right)\]
  10. Applied distribute-lft-in6.8

    \[\leadsto x \cdot x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{\left(\sqrt[3]{y} \cdot \left(4 \cdot \left(z \cdot z\right)\right) + \sqrt[3]{y} \cdot \left(4 \cdot \left(-t\right)\right)\right)}\]
  11. Applied distribute-lft-in6.8

    \[\leadsto x \cdot x - \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(4 \cdot \left(z \cdot z\right)\right)\right) + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(4 \cdot \left(-t\right)\right)\right)\right)}\]
  12. Simplified0.7

    \[\leadsto x \cdot x - \left(\color{blue}{\left(y \cdot z\right) \cdot \left(4 \cdot z\right)} + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(4 \cdot \left(-t\right)\right)\right)\right)\]
  13. Simplified0.1

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

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

Reproduce

herbie shell --seed 2020171 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :herbie-target
  (- (* x x) (* 4.0 (* y (- (* z z) t))))

  (- (* x x) (* (* y 4.0) (- (* z z) t))))