Average Error: 0.1 → 0.1
Time: 34.9s
Precision: binary64
Cost: 320
\[x - \frac{3}{8} \cdot y\]
\[x - 0.375 \cdot y\]
x - \frac{3}{8} \cdot y
x - 0.375 \cdot y
(FPCore (x y) :precision binary64 (- x (* (/ 3.0 8.0) y)))
(FPCore (x y) :precision binary64 (- x (* 0.375 y)))
double code(double x, double y) {
	return x - ((3.0 / 8.0) * y);
}
double code(double x, double y) {
	return x - (0.375 * 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
Error17.2
Cost785
\[\begin{array}{l} \mathbf{if}\;y \leq -1.732125122718438 \cdot 10^{-75} \lor \neg \left(y \leq 5.433611729866632 \cdot 10^{-93} \lor \neg \left(y \leq 8.847753174316048 \cdot 10^{-66}\right) \land y \leq 1.1624915795083632 \cdot 10^{+87}\right):\\ \;\;\;\;y \cdot -0.375\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 2
Error31.5
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 0.1

    \[x - \frac{3}{8} \cdot y\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x - 0.375 \cdot y}\]
  3. Final simplification0.1

    \[\leadsto x - 0.375 \cdot y\]

Reproduce

herbie shell --seed 2021040 
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, A"
  :precision binary64
  (- x (* (/ 3.0 8.0) y)))