Average Error: 3.6 → 1.9
Time: 14.0s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\ \;\;\;\;\left(1 - y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(x \cdot z\right) \cdot y\right) + x \cdot 1\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\
\;\;\;\;\left(1 - y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r14466463 = x;
        double r14466464 = 1.0;
        double r14466465 = y;
        double r14466466 = z;
        double r14466467 = r14466465 * r14466466;
        double r14466468 = r14466464 - r14466467;
        double r14466469 = r14466463 * r14466468;
        return r14466469;
}

double f(double x, double y, double z) {
        double r14466470 = y;
        double r14466471 = z;
        double r14466472 = r14466470 * r14466471;
        double r14466473 = 9.523507907051805e+193;
        bool r14466474 = r14466472 <= r14466473;
        double r14466475 = 1.0;
        double r14466476 = r14466475 - r14466472;
        double r14466477 = x;
        double r14466478 = r14466476 * r14466477;
        double r14466479 = r14466477 * r14466471;
        double r14466480 = r14466479 * r14466470;
        double r14466481 = -r14466480;
        double r14466482 = r14466477 * r14466475;
        double r14466483 = r14466481 + r14466482;
        double r14466484 = r14466474 ? r14466478 : r14466483;
        return r14466484;
}

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 2 regimes
  2. if (* y z) < 9.523507907051805e+193

    1. Initial program 2.0

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

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Using strategy rm
    6. Applied distribute-rgt-out2.0

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

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

    if 9.523507907051805e+193 < (* y z)

    1. Initial program 26.6

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\ \;\;\;\;\left(1 - y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(x \cdot z\right) \cdot y\right) + x \cdot 1\\ \end{array}\]

Reproduce

herbie shell --seed 2019172 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  (* x (- 1.0 (* y z))))