Average Error: 0.0 → 0.0
Time: 644.0ms
Precision: 64
\[\left(x + 1\right) \cdot y - x\]
\[1 \cdot \mathsf{fma}\left(1, y, x \cdot y\right) - x\]
\left(x + 1\right) \cdot y - x
1 \cdot \mathsf{fma}\left(1, y, x \cdot y\right) - x
double f(double x, double y) {
        double r194097 = x;
        double r194098 = 1.0;
        double r194099 = r194097 + r194098;
        double r194100 = y;
        double r194101 = r194099 * r194100;
        double r194102 = r194101 - r194097;
        return r194102;
}

double f(double x, double y) {
        double r194103 = 1.0;
        double r194104 = 1.0;
        double r194105 = y;
        double r194106 = x;
        double r194107 = r194106 * r194105;
        double r194108 = fma(r194104, r194105, r194107);
        double r194109 = r194103 * r194108;
        double r194110 = r194109 - r194106;
        return r194110;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\left(x + 1\right) \cdot y - x\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \color{blue}{\left(1 \cdot \left(x + 1\right)\right)} \cdot y - x\]
  4. Applied associate-*l*0.0

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

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

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

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
  :precision binary64
  (- (* (+ x 1) y) x))