Average Error: 0.0 → 0.0
Time: 1.9s
Precision: binary64
Cost: 448
\[0.5 \cdot \left(x \cdot x - y\right)\]
\[0.5 \cdot \left(x \cdot x - y\right)\]
0.5 \cdot \left(x \cdot x - y\right)
0.5 \cdot \left(x \cdot x - y\right)
(FPCore (x y) :precision binary64 (* 0.5 (- (* x x) y)))
(FPCore (x y) :precision binary64 (* 0.5 (- (* x x) y)))
double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}
double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error11.1
Cost913
\[\begin{array}{l} \mathbf{if}\;x \leq -1.2703154764558993 \cdot 10^{+32} \lor \neg \left(x \leq 1.0109962581521985 \cdot 10^{-05} \lor \neg \left(x \leq 4.844413000259981 \cdot 10^{+53}\right) \land x \leq 2.1834298452759395 \cdot 10^{+79}\right):\\ \;\;\;\;0.5 \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot -0.5\\ \end{array}\]
Alternative 2
Error21.4
Cost192
\[y \cdot -0.5\]
Alternative 3
Error61.4
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

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

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "System.Random.MWC.Distributions:standard from mwc-random-0.13.3.2"
  :precision binary64
  (* 0.5 (- (* x x) y)))