Average Error: 0.0 → 0.0
Time: 53.3s
Precision: binary64
Cost: 448
\[x \cdot x + y \cdot y\]
\[x \cdot x + y \cdot y\]
x \cdot x + y \cdot y
x \cdot x + y \cdot y
(FPCore (x y) :precision binary64 (+ (* x x) (* y y)))
(FPCore (x y) :precision binary64 (+ (* x x) (* y y)))
double code(double x, double y) {
	return (x * x) + (y * y);
}
double code(double x, double y) {
	return (x * x) + (y * 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
Error13.2
Cost2078
\[\begin{array}{l} \mathbf{if}\;x \cdot x \leq 3.5865650814659467 \cdot 10^{-271} \lor \neg \left(x \cdot x \leq 1.2709100034154791 \cdot 10^{-249}\right) \land \left(x \cdot x \leq 1.774386743510888 \cdot 10^{-214} \lor \neg \left(x \cdot x \leq 2.910329577898235 \cdot 10^{-163}\right) \land \left(x \cdot x \leq 3.787932310089533 \cdot 10^{-120} \lor \neg \left(x \cdot x \leq 3.24388670869413 \cdot 10^{-88}\right) \land x \cdot x \leq 6.486829903925052 \cdot 10^{-74}\right)\right):\\ \;\;\;\;y \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot x\\ \end{array}\]
Alternative 2
Error27.7
Cost192
\[x \cdot x\]
Alternative 3
Error55.6
Cost64
\[0\]
Alternative 4
Error60.7
Cost64
\[1\]

Error

Time

Derivation

  1. Initial program 0.0

    \[x \cdot x + y \cdot y\]
  2. Using strategy rm
  3. Applied *-un-lft-identity_binary64_58750.0

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot x + y \cdot y\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity_binary64_58750.0

    \[\leadsto 1 \cdot \color{blue}{\left(1 \cdot \left(x \cdot x + y \cdot y\right)\right)}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity_binary64_58750.0

    \[\leadsto 1 \cdot \left(1 \cdot \color{blue}{\left(1 \cdot \left(x \cdot x + y \cdot y\right)\right)}\right)\]
  8. Using strategy rm
  9. Applied pow1_binary64_59360.0

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

    \[\leadsto \color{blue}{x \cdot x + y \cdot y}\]
  11. Final simplification0.0

    \[\leadsto x \cdot x + y \cdot y\]

Reproduce

herbie shell --seed 2021040 
(FPCore (x y)
  :name "Graphics.Rasterific.Linear:$cquadrance from Rasterific-0.6.1"
  :precision binary64
  (+ (* x x) (* y y)))