Average Error: 0.1 → 0.1
Time: 4.2s
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 r168635 = x;
        double r168636 = y;
        double r168637 = z;
        double r168638 = r168636 + r168637;
        double r168639 = r168638 + r168637;
        double r168640 = r168639 + r168636;
        double r168641 = t;
        double r168642 = r168640 + r168641;
        double r168643 = r168635 * r168642;
        double r168644 = 5.0;
        double r168645 = r168636 * r168644;
        double r168646 = r168643 + r168645;
        return r168646;
}

double f(double x, double y, double z, double t) {
        double r168647 = x;
        double r168648 = y;
        double r168649 = z;
        double r168650 = r168648 + r168649;
        double r168651 = r168650 + r168649;
        double r168652 = r168651 + r168648;
        double r168653 = t;
        double r168654 = r168652 + r168653;
        double r168655 = 5.0;
        double r168656 = r168648 * r168655;
        double r168657 = fma(r168647, r168654, r168656);
        return r168657;
}

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 2020060 +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)))