Average Error: 0.1 → 0.1
Time: 47.7s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(x, \mathsf{fma}\left(2, z + y, t\right), 5 \cdot y\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(x, \mathsf{fma}\left(2, z + y, t\right), 5 \cdot y\right)
double f(double x, double y, double z, double t) {
        double r8837707 = x;
        double r8837708 = y;
        double r8837709 = z;
        double r8837710 = r8837708 + r8837709;
        double r8837711 = r8837710 + r8837709;
        double r8837712 = r8837711 + r8837708;
        double r8837713 = t;
        double r8837714 = r8837712 + r8837713;
        double r8837715 = r8837707 * r8837714;
        double r8837716 = 5.0;
        double r8837717 = r8837708 * r8837716;
        double r8837718 = r8837715 + r8837717;
        return r8837718;
}

double f(double x, double y, double z, double t) {
        double r8837719 = x;
        double r8837720 = 2.0;
        double r8837721 = z;
        double r8837722 = y;
        double r8837723 = r8837721 + r8837722;
        double r8837724 = t;
        double r8837725 = fma(r8837720, r8837723, r8837724);
        double r8837726 = 5.0;
        double r8837727 = r8837726 * r8837722;
        double r8837728 = fma(r8837719, r8837725, r8837727);
        return r8837728;
}

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. Simplified0.1

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

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

Reproduce

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