Average Error: 3.2 → 0.5
Time: 9.0s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.563568848510718275539306140850352140933 \cdot 10^{223} \lor \neg \left(y \cdot z \le 1.466350506553371984357185753274899454575 \cdot 10^{97}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.563568848510718275539306140850352140933 \cdot 10^{223} \lor \neg \left(y \cdot z \le 1.466350506553371984357185753274899454575 \cdot 10^{97}\right):\\
\;\;\;\;1 \cdot x + y \cdot \left(x \cdot \left(-z\right)\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r1499780 = x;
        double r1499781 = 1.0;
        double r1499782 = y;
        double r1499783 = z;
        double r1499784 = r1499782 * r1499783;
        double r1499785 = r1499781 - r1499784;
        double r1499786 = r1499780 * r1499785;
        return r1499786;
}

double f(double x, double y, double z) {
        double r1499787 = y;
        double r1499788 = z;
        double r1499789 = r1499787 * r1499788;
        double r1499790 = -2.5635688485107183e+223;
        bool r1499791 = r1499789 <= r1499790;
        double r1499792 = 1.466350506553372e+97;
        bool r1499793 = r1499789 <= r1499792;
        double r1499794 = !r1499793;
        bool r1499795 = r1499791 || r1499794;
        double r1499796 = 1.0;
        double r1499797 = x;
        double r1499798 = r1499796 * r1499797;
        double r1499799 = -r1499788;
        double r1499800 = r1499797 * r1499799;
        double r1499801 = r1499787 * r1499800;
        double r1499802 = r1499798 + r1499801;
        double r1499803 = -r1499789;
        double r1499804 = r1499803 * r1499797;
        double r1499805 = r1499798 + r1499804;
        double r1499806 = r1499795 ? r1499802 : r1499805;
        return r1499806;
}

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.5635688485107183e+223 or 1.466350506553372e+97 < (* y z)

    1. Initial program 18.7

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

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

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

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

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

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

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

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

    if -2.5635688485107183e+223 < (* y z) < 1.466350506553372e+97

    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(-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.563568848510718275539306140850352140933 \cdot 10^{223} \lor \neg \left(y \cdot z \le 1.466350506553371984357185753274899454575 \cdot 10^{97}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]

Reproduce

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