Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[\left(x + 1\right) \cdot y - x\]
\[\mathsf{fma}\left(y, x + 1, -x\right)\]
\left(x + 1\right) \cdot y - x
\mathsf{fma}\left(y, x + 1, -x\right)
double f(double x, double y) {
        double r208295 = x;
        double r208296 = 1.0;
        double r208297 = r208295 + r208296;
        double r208298 = y;
        double r208299 = r208297 * r208298;
        double r208300 = r208299 - r208295;
        return r208300;
}

double f(double x, double y) {
        double r208301 = y;
        double r208302 = x;
        double r208303 = 1.0;
        double r208304 = r208302 + r208303;
        double r208305 = -r208302;
        double r208306 = fma(r208301, r208304, r208305);
        return r208306;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\left(x + 1\right) \cdot y - x\]
  2. Taylor expanded around 0 0.0

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

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

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

Reproduce

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