Average Error: 0.1 → 0.1
Time: 12.5s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[x \cdot \left(\left(\mathsf{fma}\left(2, z, y\right) + y\right) + t\right) + y \cdot 5\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
x \cdot \left(\left(\mathsf{fma}\left(2, z, y\right) + y\right) + t\right) + y \cdot 5
double f(double x, double y, double z, double t) {
        double r195562 = x;
        double r195563 = y;
        double r195564 = z;
        double r195565 = r195563 + r195564;
        double r195566 = r195565 + r195564;
        double r195567 = r195566 + r195563;
        double r195568 = t;
        double r195569 = r195567 + r195568;
        double r195570 = r195562 * r195569;
        double r195571 = 5.0;
        double r195572 = r195563 * r195571;
        double r195573 = r195570 + r195572;
        return r195573;
}

double f(double x, double y, double z, double t) {
        double r195574 = x;
        double r195575 = 2.0;
        double r195576 = z;
        double r195577 = y;
        double r195578 = fma(r195575, r195576, r195577);
        double r195579 = r195578 + r195577;
        double r195580 = t;
        double r195581 = r195579 + r195580;
        double r195582 = r195574 * r195581;
        double r195583 = 5.0;
        double r195584 = r195577 * r195583;
        double r195585 = r195582 + r195584;
        return r195585;
}

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. Taylor expanded around 0 0.1

    \[\leadsto x \cdot \left(\left(\color{blue}{\left(2 \cdot z + y\right)} + y\right) + t\right) + y \cdot 5\]
  3. Simplified0.1

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

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

Reproduce

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