Average Error: 0.0 → 0.0
Time: 1.3s
Precision: 64
\[\left(x + 1\right) \cdot y - x\]
\[\mathsf{fma}\left(1, y, x \cdot y\right) - x\]
\left(x + 1\right) \cdot y - x
\mathsf{fma}\left(1, y, x \cdot y\right) - x
double f(double x, double y) {
        double r255066 = x;
        double r255067 = 1.0;
        double r255068 = r255066 + r255067;
        double r255069 = y;
        double r255070 = r255068 * r255069;
        double r255071 = r255070 - r255066;
        return r255071;
}

double f(double x, double y) {
        double r255072 = 1.0;
        double r255073 = y;
        double r255074 = x;
        double r255075 = r255074 * r255073;
        double r255076 = fma(r255072, r255073, r255075);
        double r255077 = r255076 - r255074;
        return r255077;
}

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(1, y, x \cdot y\right)} - x\]
  4. Final simplification0.0

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

Reproduce

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