Average Error: 0.0 → 0.0
Time: 1.5s
Precision: binary64
Cost: 576
\[x \cdot x - \left(y \cdot 4\right) \cdot z\]
\[x \cdot x - z \cdot \left(y \cdot 4\right)\]
x \cdot x - \left(y \cdot 4\right) \cdot z
x \cdot x - z \cdot \left(y \cdot 4\right)
(FPCore (x y z) :precision binary64 (- (* x x) (* (* y 4.0) z)))
(FPCore (x y z) :precision binary64 (- (* x x) (* z (* y 4.0))))
double code(double x, double y, double z) {
	return (x * x) - ((y * 4.0) * z);
}
double code(double x, double y, double z) {
	return (x * x) - (z * (y * 4.0));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error11.6
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -6478617500.991773 \lor \neg \left(x \leq 5.780174976217915 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot -4\right)\\ \end{array}\]
Alternative 2
Error35.5
Cost192
\[x \cdot x\]
Alternative 3
Error59.3
Cost64
\[0\]
Alternative 4
Error61.3
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[x \cdot x - \left(y \cdot 4\right) \cdot z\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z)
  :name "Graphics.Rasterific.QuadraticFormula:discriminant from Rasterific-0.6.1"
  :precision binary64
  (- (* x x) (* (* y 4.0) z)))