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

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
Error0.0
Cost320
\[500 \cdot \left(x - y\right)\]
Alternative 2
Error15.9
Cost1050
\[\begin{array}{l} \mathbf{if}\;y \leq -3.4064774645020087 \cdot 10^{-37} \lor \neg \left(y \leq 6.916875205818669 \cdot 10^{-103} \lor \neg \left(y \leq 1.458888362185229 \cdot 10^{-67}\right) \land \left(y \leq 615540957539.4889 \lor \neg \left(y \leq 2.666617938657969 \cdot 10^{+56}\right) \land y \leq 6.652556681724243 \cdot 10^{+68}\right)\right):\\ \;\;\;\;y \cdot -500\\ \mathbf{else}:\\ \;\;\;\;500 \cdot x\\ \end{array}\]
Alternative 3
Error31.7
Cost192
\[500 \cdot x\]
Alternative 4
Error61.9
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[500 \cdot \left(x - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg_binary64_55270.0

    \[\leadsto 500 \cdot \color{blue}{\left(x + \left(-y\right)\right)}\]
  4. Applied distribute-rgt-in_binary64_54840.0

    \[\leadsto \color{blue}{x \cdot 500 + \left(-y\right) \cdot 500}\]
  5. Simplified0.0

    \[\leadsto \color{blue}{500 \cdot x} + \left(-y\right) \cdot 500\]
  6. Simplified0.0

    \[\leadsto 500 \cdot x + \color{blue}{y \cdot -500}\]
  7. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, B"
  :precision binary64
  (* 500.0 (- x y)))