Average Error: 3.2 → 0.5
Time: 13.5s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\ \;\;\;\;1.0 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \mathbf{elif}\;y \cdot z \le 2.6037039701027763 \cdot 10^{+110}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\
\;\;\;\;1.0 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\

\mathbf{elif}\;y \cdot z \le 2.6037039701027763 \cdot 10^{+110}:\\
\;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + 1.0 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r11064699 = x;
        double r11064700 = 1.0;
        double r11064701 = y;
        double r11064702 = z;
        double r11064703 = r11064701 * r11064702;
        double r11064704 = r11064700 - r11064703;
        double r11064705 = r11064699 * r11064704;
        return r11064705;
}

double f(double x, double y, double z) {
        double r11064706 = y;
        double r11064707 = z;
        double r11064708 = r11064706 * r11064707;
        double r11064709 = -2.345039036328034e+161;
        bool r11064710 = r11064708 <= r11064709;
        double r11064711 = 1.0;
        double r11064712 = x;
        double r11064713 = r11064711 * r11064712;
        double r11064714 = r11064712 * r11064707;
        double r11064715 = -r11064706;
        double r11064716 = r11064714 * r11064715;
        double r11064717 = r11064713 + r11064716;
        double r11064718 = 2.6037039701027763e+110;
        bool r11064719 = r11064708 <= r11064718;
        double r11064720 = -r11064707;
        double r11064721 = r11064720 * r11064706;
        double r11064722 = r11064721 * r11064712;
        double r11064723 = r11064722 + r11064713;
        double r11064724 = r11064719 ? r11064723 : r11064717;
        double r11064725 = r11064710 ? r11064717 : r11064724;
        return r11064725;
}

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) < -2.345039036328034e+161 or 2.6037039701027763e+110 < (* y z)

    1. Initial program 16.4

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

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

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

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

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

    if -2.345039036328034e+161 < (* y z) < 2.6037039701027763e+110

    1. Initial program 0.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.345039036328034 \cdot 10^{+161}:\\ \;\;\;\;1.0 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \mathbf{elif}\;y \cdot z \le 2.6037039701027763 \cdot 10^{+110}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(x \cdot z\right) \cdot \left(-y\right)\\ \end{array}\]

Reproduce

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