Average Error: 0.1 → 0.1
Time: 24.3s
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 r95721 = x;
        double r95722 = y;
        double r95723 = z;
        double r95724 = r95722 + r95723;
        double r95725 = r95724 + r95723;
        double r95726 = r95725 + r95722;
        double r95727 = t;
        double r95728 = r95726 + r95727;
        double r95729 = r95721 * r95728;
        double r95730 = 5.0;
        double r95731 = r95722 * r95730;
        double r95732 = r95729 + r95731;
        return r95732;
}

double f(double x, double y, double z, double t) {
        double r95733 = x;
        double r95734 = y;
        double r95735 = z;
        double r95736 = r95734 + r95735;
        double r95737 = r95736 + r95735;
        double r95738 = r95737 + r95734;
        double r95739 = t;
        double r95740 = r95738 + r95739;
        double r95741 = 5.0;
        double r95742 = r95734 * r95741;
        double r95743 = fma(r95733, r95740, r95742);
        return r95743;
}

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