Average Error: 0.1 → 0.2
Time: 21.5s
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 r139372 = x;
        double r139373 = y;
        double r139374 = sin(r139373);
        double r139375 = r139372 * r139374;
        double r139376 = z;
        double r139377 = cos(r139373);
        double r139378 = r139376 * r139377;
        double r139379 = r139375 + r139378;
        return r139379;
}

double f(double x, double y, double z) {
        double r139380 = x;
        double r139381 = y;
        double r139382 = sin(r139381);
        double r139383 = z;
        double r139384 = cos(r139381);
        double r139385 = 2.0;
        double r139386 = pow(r139384, r139385);
        double r139387 = 0.3333333333333333;
        double r139388 = pow(r139386, r139387);
        double r139389 = r139383 * r139388;
        double r139390 = cbrt(r139384);
        double r139391 = log1p(r139390);
        double r139392 = expm1(r139391);
        double r139393 = r139389 * r139392;
        double r139394 = fma(r139380, r139382, r139393);
        return r139394;
}

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