Average Error: 0.1 → 0.1
Time: 4.2s
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 r187490 = x;
        double r187491 = y;
        double r187492 = sin(r187491);
        double r187493 = r187490 * r187492;
        double r187494 = z;
        double r187495 = cos(r187491);
        double r187496 = r187494 * r187495;
        double r187497 = r187493 + r187496;
        return r187497;
}

double f(double x, double y, double z) {
        double r187498 = x;
        double r187499 = y;
        double r187500 = sin(r187499);
        double r187501 = z;
        double r187502 = cos(r187499);
        double r187503 = r187501 * r187502;
        double r187504 = fma(r187498, r187500, r187503);
        return r187504;
}

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. Using strategy rm
  4. Applied *-un-lft-identity0.1

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

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

Reproduce

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