Average Error: 0.1 → 13.0
Time: 4.8s
Precision: 64
\[x \cdot \sin y + z \cdot \cos y\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.419249552228977 \cdot 10^{58}:\\ \;\;\;\;x \cdot \sin y + {\left({z}^{2} \cdot {\left(\cos y\right)}^{2}\right)}^{\frac{1}{2}}\\ \mathbf{elif}\;x \le -4.92636567797937616 \cdot 10^{-161}:\\ \;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\ \mathbf{elif}\;x \le -8.8117981882047215 \cdot 10^{-213}:\\ \;\;\;\;\left(x \cdot \sqrt{\sin y}\right) \cdot \sqrt{\sin y} + z \cdot \cos y\\ \mathbf{elif}\;x \le -4.0086353280866672 \cdot 10^{-293}:\\ \;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(\sqrt{x} \cdot \sin y\right) + z \cdot \cos y\\ \end{array}\]
x \cdot \sin y + z \cdot \cos y
\begin{array}{l}
\mathbf{if}\;x \le -2.419249552228977 \cdot 10^{58}:\\
\;\;\;\;x \cdot \sin y + {\left({z}^{2} \cdot {\left(\cos y\right)}^{2}\right)}^{\frac{1}{2}}\\

\mathbf{elif}\;x \le -4.92636567797937616 \cdot 10^{-161}:\\
\;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\

\mathbf{elif}\;x \le -8.8117981882047215 \cdot 10^{-213}:\\
\;\;\;\;\left(x \cdot \sqrt{\sin y}\right) \cdot \sqrt{\sin y} + z \cdot \cos y\\

\mathbf{elif}\;x \le -4.0086353280866672 \cdot 10^{-293}:\\
\;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\

\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(\sqrt{x} \cdot \sin y\right) + z \cdot \cos y\\

\end{array}
double f(double x, double y, double z) {
        double r258280 = x;
        double r258281 = y;
        double r258282 = sin(r258281);
        double r258283 = r258280 * r258282;
        double r258284 = z;
        double r258285 = cos(r258281);
        double r258286 = r258284 * r258285;
        double r258287 = r258283 + r258286;
        return r258287;
}

double f(double x, double y, double z) {
        double r258288 = x;
        double r258289 = -2.419249552228977e+58;
        bool r258290 = r258288 <= r258289;
        double r258291 = y;
        double r258292 = sin(r258291);
        double r258293 = r258288 * r258292;
        double r258294 = z;
        double r258295 = 2.0;
        double r258296 = pow(r258294, r258295);
        double r258297 = cos(r258291);
        double r258298 = pow(r258297, r258295);
        double r258299 = r258296 * r258298;
        double r258300 = 0.5;
        double r258301 = pow(r258299, r258300);
        double r258302 = r258293 + r258301;
        double r258303 = -4.926365677979376e-161;
        bool r258304 = r258288 <= r258303;
        double r258305 = sqrt(r258293);
        double r258306 = r258305 * r258305;
        double r258307 = r258294 * r258297;
        double r258308 = r258306 + r258307;
        double r258309 = -8.811798188204722e-213;
        bool r258310 = r258288 <= r258309;
        double r258311 = sqrt(r258292);
        double r258312 = r258288 * r258311;
        double r258313 = r258312 * r258311;
        double r258314 = r258313 + r258307;
        double r258315 = -4.008635328086667e-293;
        bool r258316 = r258288 <= r258315;
        double r258317 = sqrt(r258288);
        double r258318 = r258317 * r258292;
        double r258319 = r258317 * r258318;
        double r258320 = r258319 + r258307;
        double r258321 = r258316 ? r258308 : r258320;
        double r258322 = r258310 ? r258314 : r258321;
        double r258323 = r258304 ? r258308 : r258322;
        double r258324 = r258290 ? r258302 : r258323;
        return r258324;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if x < -2.419249552228977e+58

    1. Initial program 0.1

      \[x \cdot \sin y + z \cdot \cos y\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt30.8

      \[\leadsto x \cdot \sin y + \color{blue}{\sqrt{z \cdot \cos y} \cdot \sqrt{z \cdot \cos y}}\]
    4. Using strategy rm
    5. Applied pow130.8

      \[\leadsto x \cdot \sin y + \sqrt{z \cdot \cos y} \cdot \sqrt{z \cdot \color{blue}{{\left(\cos y\right)}^{1}}}\]
    6. Applied pow130.8

      \[\leadsto x \cdot \sin y + \sqrt{z \cdot \cos y} \cdot \sqrt{\color{blue}{{z}^{1}} \cdot {\left(\cos y\right)}^{1}}\]
    7. Applied pow-prod-down30.8

      \[\leadsto x \cdot \sin y + \sqrt{z \cdot \cos y} \cdot \sqrt{\color{blue}{{\left(z \cdot \cos y\right)}^{1}}}\]
    8. Applied sqrt-pow130.8

      \[\leadsto x \cdot \sin y + \sqrt{z \cdot \cos y} \cdot \color{blue}{{\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}}\]
    9. Applied pow130.8

      \[\leadsto x \cdot \sin y + \sqrt{z \cdot \color{blue}{{\left(\cos y\right)}^{1}}} \cdot {\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}\]
    10. Applied pow130.8

      \[\leadsto x \cdot \sin y + \sqrt{\color{blue}{{z}^{1}} \cdot {\left(\cos y\right)}^{1}} \cdot {\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}\]
    11. Applied pow-prod-down30.8

      \[\leadsto x \cdot \sin y + \sqrt{\color{blue}{{\left(z \cdot \cos y\right)}^{1}}} \cdot {\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}\]
    12. Applied sqrt-pow130.8

      \[\leadsto x \cdot \sin y + \color{blue}{{\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(z \cdot \cos y\right)}^{\left(\frac{1}{2}\right)}\]
    13. Applied pow-prod-down20.4

      \[\leadsto x \cdot \sin y + \color{blue}{{\left(\left(z \cdot \cos y\right) \cdot \left(z \cdot \cos y\right)\right)}^{\left(\frac{1}{2}\right)}}\]
    14. Simplified20.4

      \[\leadsto x \cdot \sin y + {\color{blue}{\left({z}^{2} \cdot {\left(\cos y\right)}^{2}\right)}}^{\left(\frac{1}{2}\right)}\]

    if -2.419249552228977e+58 < x < -4.926365677979376e-161 or -8.811798188204722e-213 < x < -4.008635328086667e-293

    1. Initial program 0.1

      \[x \cdot \sin y + z \cdot \cos y\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt26.6

      \[\leadsto \color{blue}{\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y}} + z \cdot \cos y\]

    if -4.926365677979376e-161 < x < -8.811798188204722e-213

    1. Initial program 0.1

      \[x \cdot \sin y + z \cdot \cos y\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt32.7

      \[\leadsto x \cdot \color{blue}{\left(\sqrt{\sin y} \cdot \sqrt{\sin y}\right)} + z \cdot \cos y\]
    4. Applied associate-*r*32.7

      \[\leadsto \color{blue}{\left(x \cdot \sqrt{\sin y}\right) \cdot \sqrt{\sin y}} + z \cdot \cos y\]

    if -4.008635328086667e-293 < x

    1. Initial program 0.1

      \[x \cdot \sin y + z \cdot \cos y\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt1.8

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \sin y + z \cdot \cos y\]
    4. Applied associate-*l*1.8

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(\sqrt{x} \cdot \sin y\right)} + z \cdot \cos y\]
  3. Recombined 4 regimes into one program.
  4. Final simplification13.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.419249552228977 \cdot 10^{58}:\\ \;\;\;\;x \cdot \sin y + {\left({z}^{2} \cdot {\left(\cos y\right)}^{2}\right)}^{\frac{1}{2}}\\ \mathbf{elif}\;x \le -4.92636567797937616 \cdot 10^{-161}:\\ \;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\ \mathbf{elif}\;x \le -8.8117981882047215 \cdot 10^{-213}:\\ \;\;\;\;\left(x \cdot \sqrt{\sin y}\right) \cdot \sqrt{\sin y} + z \cdot \cos y\\ \mathbf{elif}\;x \le -4.0086353280866672 \cdot 10^{-293}:\\ \;\;\;\;\sqrt{x \cdot \sin y} \cdot \sqrt{x \cdot \sin y} + z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(\sqrt{x} \cdot \sin y\right) + z \cdot \cos y\\ \end{array}\]

Reproduce

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