Average Error: 6.0 → 0.6
Time: 6.5s
Precision: binary64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[\left(x \cdot x + -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\right) + \left(y \cdot 4\right) \cdot \left(\sqrt[3]{t} \cdot \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right)\]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\left(x \cdot x + -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\right) + \left(y \cdot 4\right) \cdot \left(\sqrt[3]{t} \cdot \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right)
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
(FPCore (x y z t)
 :precision binary64
 (+
  (+ (* x x) (* -4.0 (* z (* z y))))
  (* (* y 4.0) (* (cbrt t) (* (cbrt t) (cbrt t))))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
double code(double x, double y, double z, double t) {
	return ((x * x) + (-4.0 * (z * (z * y)))) + ((y * 4.0) * (cbrt(t) * (cbrt(t) * cbrt(t))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.0
Target5.9
Herbie0.6
\[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 add-cube-cbrt_binary64_178456.5

    \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - \color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\right)\]
  4. Applied cancel-sign-sub-inv_binary64_177766.5

    \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z + \left(-\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\]
  5. Applied distribute-rgt-in_binary64_177606.5

    \[\leadsto x \cdot x - \color{blue}{\left(\left(z \cdot z\right) \cdot \left(y \cdot 4\right) + \left(\left(-\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot 4\right)\right)}\]
  6. Applied associate--r+_binary64_177466.5

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

    \[\leadsto \color{blue}{\left(x \cdot x + -4 \cdot \left(y \cdot \left(z \cdot z\right)\right)\right)} - \left(\left(-\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot 4\right)\]
  8. Using strategy rm
  9. Applied associate-*r*_binary64_177500.6

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

    \[\leadsto \left(x \cdot x + -4 \cdot \left(\color{blue}{\left(z \cdot y\right)} \cdot z\right)\right) - \left(\left(-\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot 4\right)\]
  11. Final simplification0.6

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

Reproduce

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