Average Error: 0.1 → 0.1
Time: 28.6s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(\mathsf{fma}\left(2, y + z, t\right), x, 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(\mathsf{fma}\left(2, y + z, t\right), x, y \cdot 5\right)
double f(double x, double y, double z, double t) {
        double r12996027 = x;
        double r12996028 = y;
        double r12996029 = z;
        double r12996030 = r12996028 + r12996029;
        double r12996031 = r12996030 + r12996029;
        double r12996032 = r12996031 + r12996028;
        double r12996033 = t;
        double r12996034 = r12996032 + r12996033;
        double r12996035 = r12996027 * r12996034;
        double r12996036 = 5.0;
        double r12996037 = r12996028 * r12996036;
        double r12996038 = r12996035 + r12996037;
        return r12996038;
}

double f(double x, double y, double z, double t) {
        double r12996039 = 2.0;
        double r12996040 = y;
        double r12996041 = z;
        double r12996042 = r12996040 + r12996041;
        double r12996043 = t;
        double r12996044 = fma(r12996039, r12996042, r12996043);
        double r12996045 = x;
        double r12996046 = 5.0;
        double r12996047 = r12996040 * r12996046;
        double r12996048 = fma(r12996044, r12996045, r12996047);
        return r12996048;
}

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(\mathsf{fma}\left(2, y + z, t\right), x, y \cdot 5\right)}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2019174 +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)))