Average Error: 0.0 → 0.0
Time: 7.0s
Precision: 64
\[200 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(x, 200, \left(-y\right) \cdot 200\right)\]
200 \cdot \left(x - y\right)
\mathsf{fma}\left(x, 200, \left(-y\right) \cdot 200\right)
double f(double x, double y) {
        double r283628 = 200.0;
        double r283629 = x;
        double r283630 = y;
        double r283631 = r283629 - r283630;
        double r283632 = r283628 * r283631;
        return r283632;
}

double f(double x, double y) {
        double r283633 = x;
        double r283634 = 200.0;
        double r283635 = y;
        double r283636 = -r283635;
        double r283637 = r283636 * r283634;
        double r283638 = fma(r283633, r283634, r283637);
        return r283638;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

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

    \[\leadsto 200 \cdot \color{blue}{\left(x + \left(-y\right)\right)}\]
  4. Applied distribute-lft-in0.0

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

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

    \[\leadsto x \cdot 200 + \color{blue}{\left(-y\right) \cdot 200}\]
  7. Using strategy rm
  8. Applied fma-def0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 200, \left(-y\right) \cdot 200\right)}\]
  9. Final simplification0.0

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

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, C"
  :precision binary64
  (* 200 (- x y)))