Average Error: 0.0 → 0.0
Time: 17.3s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[x + \mathsf{fma}\left(y, z, x \cdot y\right)\]
x + y \cdot \left(z + x\right)
x + \mathsf{fma}\left(y, z, x \cdot y\right)
double f(double x, double y, double z) {
        double r66439 = x;
        double r66440 = y;
        double r66441 = z;
        double r66442 = r66441 + r66439;
        double r66443 = r66440 * r66442;
        double r66444 = r66439 + r66443;
        return r66444;
}

double f(double x, double y, double z) {
        double r66445 = x;
        double r66446 = y;
        double r66447 = z;
        double r66448 = r66445 * r66446;
        double r66449 = fma(r66446, r66447, r66448);
        double r66450 = r66445 + r66449;
        return r66450;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

    \[x + y \cdot \left(z + x\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.0

    \[\leadsto x + \color{blue}{\left(y \cdot z + y \cdot x\right)}\]
  4. Simplified0.0

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

    \[\leadsto x + \color{blue}{\mathsf{fma}\left(y, z, x \cdot y\right)}\]
  7. Final simplification0.0

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (x y z)
  :name "Main:bigenough2 from A"
  :precision binary64
  (+ x (* y (+ z x))))