Average Error: 0.1 → 0.1
Time: 7.8s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r131739 = x;
        double r131740 = y;
        double r131741 = z;
        double r131742 = r131740 + r131741;
        double r131743 = r131742 + r131741;
        double r131744 = r131743 + r131740;
        double r131745 = t;
        double r131746 = r131744 + r131745;
        double r131747 = r131739 * r131746;
        double r131748 = 5.0;
        double r131749 = r131740 * r131748;
        double r131750 = r131747 + r131749;
        return r131750;
}

double f(double x, double y, double z, double t) {
        double r131751 = x;
        double r131752 = y;
        double r131753 = z;
        double r131754 = r131752 + r131753;
        double r131755 = r131754 + r131753;
        double r131756 = r131755 + r131752;
        double r131757 = t;
        double r131758 = r131756 + r131757;
        double r131759 = 5.0;
        double r131760 = r131752 * r131759;
        double r131761 = fma(r131751, r131758, r131760);
        return r131761;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.1

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
  2. Using strategy rm
  3. Applied fma-def0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \left(\left(\left(y + z\right) + z\right) + y\right) + t, y \cdot 5\right)}\]
  4. Final simplification0.1

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

Reproduce

herbie shell --seed 2019352 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  :precision binary64
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5)))