Average Error: 0.1 → 0.1
Time: 5.9s
Precision: 64
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5\]
\[\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(5, y, t \cdot x\right)\right)\]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y + z, x + x, \mathsf{fma}\left(5, y, t \cdot x\right)\right)
double f(double x, double y, double z, double t) {
        double r155798 = x;
        double r155799 = y;
        double r155800 = z;
        double r155801 = r155799 + r155800;
        double r155802 = r155801 + r155800;
        double r155803 = r155802 + r155799;
        double r155804 = t;
        double r155805 = r155803 + r155804;
        double r155806 = r155798 * r155805;
        double r155807 = 5.0;
        double r155808 = r155799 * r155807;
        double r155809 = r155806 + r155808;
        return r155809;
}

double f(double x, double y, double z, double t) {
        double r155810 = y;
        double r155811 = z;
        double r155812 = r155810 + r155811;
        double r155813 = x;
        double r155814 = r155813 + r155813;
        double r155815 = 5.0;
        double r155816 = t;
        double r155817 = r155816 * r155813;
        double r155818 = fma(r155815, r155810, r155817);
        double r155819 = fma(r155812, r155814, r155818);
        return r155819;
}

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(y + z, x + x, \mathsf{fma}\left(t, x, y \cdot 5\right)\right)}\]
  3. Taylor expanded around 0 0.1

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

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

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

Reproduce

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