Average Error: 0.0 → 0.0
Time: 13.7s
Precision: 64
\[200 \cdot \left(x - y\right)\]
\[\mathsf{fma}\left(x, 200, -y \cdot 200\right)\]
200 \cdot \left(x - y\right)
\mathsf{fma}\left(x, 200, -y \cdot 200\right)
double f(double x, double y) {
        double r166285 = 200.0;
        double r166286 = x;
        double r166287 = y;
        double r166288 = r166286 - r166287;
        double r166289 = r166285 * r166288;
        return r166289;
}

double f(double x, double y) {
        double r166290 = x;
        double r166291 = 200.0;
        double r166292 = y;
        double r166293 = r166292 * r166291;
        double r166294 = -r166293;
        double r166295 = fma(r166290, r166291, r166294);
        return r166295;
}

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 add-sqr-sqrt0.9

    \[\leadsto \color{blue}{\left(\sqrt{200} \cdot \sqrt{200}\right)} \cdot \left(x - y\right)\]
  4. Applied associate-*l*0.5

    \[\leadsto \color{blue}{\sqrt{200} \cdot \left(\sqrt{200} \cdot \left(x - y\right)\right)}\]
  5. Using strategy rm
  6. Applied sub-neg0.5

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

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

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

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

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

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

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

Reproduce

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