Average Error: 0.1 → 0.4
Time: 17.0s
Precision: 64
\[x \cdot \sin y + z \cdot \cos y\]
\[\mathsf{fma}\left(x, \sin y, \left(z \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\cos y}\right)\right) \cdot \sqrt[3]{\cos y}\right)\right) \cdot \sqrt[3]{\cos y}\right)\]
x \cdot \sin y + z \cdot \cos y
\mathsf{fma}\left(x, \sin y, \left(z \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\cos y}\right)\right) \cdot \sqrt[3]{\cos y}\right)\right) \cdot \sqrt[3]{\cos y}\right)
double f(double x, double y, double z) {
        double r122206 = x;
        double r122207 = y;
        double r122208 = sin(r122207);
        double r122209 = r122206 * r122208;
        double r122210 = z;
        double r122211 = cos(r122207);
        double r122212 = r122210 * r122211;
        double r122213 = r122209 + r122212;
        return r122213;
}

double f(double x, double y, double z) {
        double r122214 = x;
        double r122215 = y;
        double r122216 = sin(r122215);
        double r122217 = z;
        double r122218 = cos(r122215);
        double r122219 = cbrt(r122218);
        double r122220 = log1p(r122219);
        double r122221 = expm1(r122220);
        double r122222 = r122221 * r122219;
        double r122223 = r122217 * r122222;
        double r122224 = r122223 * r122219;
        double r122225 = fma(r122214, r122216, r122224);
        return r122225;
}

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 add-cube-cbrt0.4

    \[\leadsto \mathsf{fma}\left(x, \sin y, z \cdot \color{blue}{\left(\left(\sqrt[3]{\cos y} \cdot \sqrt[3]{\cos y}\right) \cdot \sqrt[3]{\cos y}\right)}\right)\]
  5. Applied associate-*r*0.4

    \[\leadsto \mathsf{fma}\left(x, \sin y, \color{blue}{\left(z \cdot \left(\sqrt[3]{\cos y} \cdot \sqrt[3]{\cos y}\right)\right) \cdot \sqrt[3]{\cos y}}\right)\]
  6. Using strategy rm
  7. Applied expm1-log1p-u0.4

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

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

Reproduce

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