Average Error: 0.1 → 0.1
Time: 26.1s
Precision: 64
\[x \cdot \sin y + z \cdot \cos y\]
\[\mathsf{fma}\left(x, \sin y, z \cdot \cos y\right)\]
x \cdot \sin y + z \cdot \cos y
\mathsf{fma}\left(x, \sin y, z \cdot \cos y\right)
double f(double x, double y, double z) {
        double r130886 = x;
        double r130887 = y;
        double r130888 = sin(r130887);
        double r130889 = r130886 * r130888;
        double r130890 = z;
        double r130891 = cos(r130887);
        double r130892 = r130890 * r130891;
        double r130893 = r130889 + r130892;
        return r130893;
}

double f(double x, double y, double z) {
        double r130894 = x;
        double r130895 = y;
        double r130896 = sin(r130895);
        double r130897 = z;
        double r130898 = cos(r130895);
        double r130899 = r130897 * r130898;
        double r130900 = fma(r130894, r130896, r130899);
        return r130900;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.1

    \[x \cdot \sin y + z \cdot \cos y\]
  2. Simplified0.1

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

    \[\leadsto \mathsf{fma}\left(x, \sin y, z \cdot \cos y\right)\]

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x y z)
  :name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, B"
  :precision binary64
  (+ (* x (sin y)) (* z (cos y))))