Average Error: 0.1 → 13.0
Time: 4.5s
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 + \sqrt{{z}^{2} \cdot {\left(\cos y\right)}^{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 + \sqrt{{z}^{2} \cdot {\left(\cos y\right)}^{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 r212187 = x;
        double r212188 = y;
        double r212189 = sin(r212188);
        double r212190 = r212187 * r212189;
        double r212191 = z;
        double r212192 = cos(r212188);
        double r212193 = r212191 * r212192;
        double r212194 = r212190 + r212193;
        return r212194;
}

double f(double x, double y, double z) {
        double r212195 = x;
        double r212196 = -2.419249552228977e+58;
        bool r212197 = r212195 <= r212196;
        double r212198 = y;
        double r212199 = sin(r212198);
        double r212200 = r212195 * r212199;
        double r212201 = z;
        double r212202 = 2.0;
        double r212203 = pow(r212201, r212202);
        double r212204 = cos(r212198);
        double r212205 = pow(r212204, r212202);
        double r212206 = r212203 * r212205;
        double r212207 = sqrt(r212206);
        double r212208 = r212200 + r212207;
        double r212209 = -4.926365677979376e-161;
        bool r212210 = r212195 <= r212209;
        double r212211 = sqrt(r212200);
        double r212212 = r212211 * r212211;
        double r212213 = r212201 * r212204;
        double r212214 = r212212 + r212213;
        double r212215 = -8.811798188204722e-213;
        bool r212216 = r212195 <= r212215;
        double r212217 = sqrt(r212199);
        double r212218 = r212195 * r212217;
        double r212219 = r212218 * r212217;
        double r212220 = r212219 + r212213;
        double r212221 = -4.008635328086667e-293;
        bool r212222 = r212195 <= r212221;
        double r212223 = sqrt(r212195);
        double r212224 = r212223 * r212199;
        double r212225 = r212223 * r212224;
        double r212226 = r212225 + r212213;
        double r212227 = r212222 ? r212214 : r212226;
        double r212228 = r212216 ? r212220 : r212227;
        double r212229 = r212210 ? r212214 : r212228;
        double r212230 = r212197 ? r212208 : r212229;
        return r212230;
}

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 sqrt-unprod20.4

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

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

    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 + \sqrt{{z}^{2} \cdot {\left(\cos y\right)}^{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 
(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))))