Average Error: 0.0 → 0
Time: 353.0ms
Precision: 64
\[x \cdot x + 1\]
\[\mathsf{fma}\left(x, x, 1\right)\]
x \cdot x + 1
\mathsf{fma}\left(x, x, 1\right)
double f(double x) {
        double r159545 = x;
        double r159546 = r159545 * r159545;
        double r159547 = 1.0;
        double r159548 = r159546 + r159547;
        return r159548;
}

double f(double x) {
        double r159549 = x;
        double r159550 = 1.0;
        double r159551 = fma(r159549, r159549, r159550);
        return r159551;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x \cdot x + 1\]
  2. Simplified0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, x, 1\right)}\]
  3. Final simplification0

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

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(FPCore (x)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, A"
  :precision binary64
  (+ (* x x) 1))