Average Error: 0.1 → 0.2
Time: 23.2s
Precision: 64
\[x \cdot \sin y + z \cdot \cos y\]
\[\mathsf{fma}\left(x, \sin y, \left(z \cdot {\left({\left(\cos y\right)}^{2}\right)}^{\frac{1}{3}}\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\cos y}\right)\right)\right)\]
x \cdot \sin y + z \cdot \cos y
\mathsf{fma}\left(x, \sin y, \left(z \cdot {\left({\left(\cos y\right)}^{2}\right)}^{\frac{1}{3}}\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\cos y}\right)\right)\right)
double f(double x, double y, double z) {
        double r128329 = x;
        double r128330 = y;
        double r128331 = sin(r128330);
        double r128332 = r128329 * r128331;
        double r128333 = z;
        double r128334 = cos(r128330);
        double r128335 = r128333 * r128334;
        double r128336 = r128332 + r128335;
        return r128336;
}

double f(double x, double y, double z) {
        double r128337 = x;
        double r128338 = y;
        double r128339 = sin(r128338);
        double r128340 = z;
        double r128341 = cos(r128338);
        double r128342 = 2.0;
        double r128343 = pow(r128341, r128342);
        double r128344 = 0.3333333333333333;
        double r128345 = pow(r128343, r128344);
        double r128346 = r128340 * r128345;
        double r128347 = cbrt(r128341);
        double r128348 = log1p(r128347);
        double r128349 = expm1(r128348);
        double r128350 = r128346 * r128349;
        double r128351 = fma(r128337, r128339, r128350);
        return r128351;
}

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 pow1/316.3

    \[\leadsto \mathsf{fma}\left(x, \sin y, \left(z \cdot \left(\sqrt[3]{\cos y} \cdot \color{blue}{{\left(\cos y\right)}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\cos y}\right)\]
  8. Applied pow1/316.2

    \[\leadsto \mathsf{fma}\left(x, \sin y, \left(z \cdot \left(\color{blue}{{\left(\cos y\right)}^{\frac{1}{3}}} \cdot {\left(\cos y\right)}^{\frac{1}{3}}\right)\right) \cdot \sqrt[3]{\cos y}\right)\]
  9. Applied pow-prod-down0.2

    \[\leadsto \mathsf{fma}\left(x, \sin y, \left(z \cdot \color{blue}{{\left(\cos y \cdot \cos y\right)}^{\frac{1}{3}}}\right) \cdot \sqrt[3]{\cos y}\right)\]
  10. Simplified0.2

    \[\leadsto \mathsf{fma}\left(x, \sin y, \left(z \cdot {\color{blue}{\left({\left(\cos y\right)}^{2}\right)}}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\cos y}\right)\]
  11. Using strategy rm
  12. Applied expm1-log1p-u0.2

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

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

Reproduce

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