Average Error: 0.1 → 0.1
Time: 6.0s
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 r130847 = x;
        double r130848 = y;
        double r130849 = z;
        double r130850 = r130848 + r130849;
        double r130851 = r130850 + r130849;
        double r130852 = r130851 + r130848;
        double r130853 = t;
        double r130854 = r130852 + r130853;
        double r130855 = r130847 * r130854;
        double r130856 = 5.0;
        double r130857 = r130848 * r130856;
        double r130858 = r130855 + r130857;
        return r130858;
}

double f(double x, double y, double z, double t) {
        double r130859 = y;
        double r130860 = z;
        double r130861 = r130859 + r130860;
        double r130862 = x;
        double r130863 = r130862 + r130862;
        double r130864 = 5.0;
        double r130865 = t;
        double r130866 = r130865 * r130862;
        double r130867 = fma(r130864, r130859, r130866);
        double r130868 = fma(r130861, r130863, r130867);
        return r130868;
}

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