Average Error: 3.2 → 1.0
Time: 9.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -5.3339645795204343917849025144700084631 \cdot 10^{202}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;y \cdot z \le 3.774734520200298367391484675498101872076 \cdot 10^{287}:\\ \;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \sqrt{\left(-z\right) \cdot \left(y \cdot x\right)} \cdot \sqrt{\left(-z\right) \cdot \left(y \cdot x\right)}\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -5.3339645795204343917849025144700084631 \cdot 10^{202}:\\
\;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\

\mathbf{elif}\;y \cdot z \le 3.774734520200298367391484675498101872076 \cdot 10^{287}:\\
\;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r135309 = x;
        double r135310 = 1.0;
        double r135311 = y;
        double r135312 = z;
        double r135313 = r135311 * r135312;
        double r135314 = r135310 - r135313;
        double r135315 = r135309 * r135314;
        return r135315;
}

double f(double x, double y, double z) {
        double r135316 = y;
        double r135317 = z;
        double r135318 = r135316 * r135317;
        double r135319 = -5.333964579520434e+202;
        bool r135320 = r135318 <= r135319;
        double r135321 = 1.0;
        double r135322 = x;
        double r135323 = r135321 * r135322;
        double r135324 = -r135317;
        double r135325 = r135316 * r135322;
        double r135326 = r135324 * r135325;
        double r135327 = r135323 + r135326;
        double r135328 = 3.7747345202002984e+287;
        bool r135329 = r135318 <= r135328;
        double r135330 = r135317 * r135316;
        double r135331 = -r135330;
        double r135332 = r135331 * r135322;
        double r135333 = r135323 + r135332;
        double r135334 = sqrt(r135326);
        double r135335 = r135334 * r135334;
        double r135336 = r135323 + r135335;
        double r135337 = r135329 ? r135333 : r135336;
        double r135338 = r135320 ? r135327 : r135337;
        return r135338;
}

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 3 regimes
  2. if (* y z) < -5.333964579520434e+202

    1. Initial program 25.4

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied sub-neg25.4

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-lft-in25.4

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Simplified25.4

      \[\leadsto \color{blue}{1 \cdot x} + x \cdot \left(-y \cdot z\right)\]
    6. Simplified25.4

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z \cdot y\right) \cdot x}\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-in25.4

      \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z\right) \cdot y\right)} \cdot x\]
    9. Applied associate-*l*1.5

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z\right) \cdot \left(y \cdot x\right)}\]

    if -5.333964579520434e+202 < (* y z) < 3.7747345202002984e+287

    1. Initial program 0.1

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied sub-neg0.1

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-lft-in0.1

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Simplified0.1

      \[\leadsto \color{blue}{1 \cdot x} + x \cdot \left(-y \cdot z\right)\]
    6. Simplified0.1

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z \cdot y\right) \cdot x}\]

    if 3.7747345202002984e+287 < (* y z)

    1. Initial program 52.6

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied sub-neg52.6

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-lft-in52.6

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Simplified52.6

      \[\leadsto \color{blue}{1 \cdot x} + x \cdot \left(-y \cdot z\right)\]
    6. Simplified52.6

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z \cdot y\right) \cdot x}\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-in52.6

      \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-z\right) \cdot y\right)} \cdot x\]
    9. Applied associate-*l*0.3

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z\right) \cdot \left(y \cdot x\right)}\]
    10. Using strategy rm
    11. Applied add-sqr-sqrt25.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -5.3339645795204343917849025144700084631 \cdot 10^{202}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;y \cdot z \le 3.774734520200298367391484675498101872076 \cdot 10^{287}:\\ \;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \sqrt{\left(-z\right) \cdot \left(y \cdot x\right)} \cdot \sqrt{\left(-z\right) \cdot \left(y \cdot x\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))