Average Error: 0.1 → 0
Time: 691.0ms
Precision: binary64
\[x - \frac{3}{8} \cdot y \]
\[\mathsf{fma}\left(y, -0.375, x\right) \]
x - \frac{3}{8} \cdot y
\mathsf{fma}\left(y, -0.375, x\right)
(FPCore (x y) :precision binary64 (- x (* (/ 3.0 8.0) y)))
(FPCore (x y) :precision binary64 (fma y -0.375 x))
double code(double x, double y) {
	return x - ((3.0 / 8.0) * y);
}
double code(double x, double y) {
	return fma(y, -0.375, x);
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.1

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, -0.375, x\right)} \]
  3. Final simplification0

    \[\leadsto \mathsf{fma}\left(y, -0.375, x\right) \]

Reproduce

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