Average Error: 0.1 → 0.1
Time: 6.8s
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 r214443 = x;
        double r214444 = y;
        double r214445 = sin(r214444);
        double r214446 = r214443 * r214445;
        double r214447 = z;
        double r214448 = cos(r214444);
        double r214449 = r214447 * r214448;
        double r214450 = r214446 + r214449;
        return r214450;
}

double f(double x, double y, double z) {
        double r214451 = x;
        double r214452 = y;
        double r214453 = sin(r214452);
        double r214454 = z;
        double r214455 = cos(r214452);
        double r214456 = r214454 * r214455;
        double r214457 = fma(r214451, r214453, r214456);
        return r214457;
}

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