Average Error: 3.2 → 0.2
Time: 2.2s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r290583 = x;
        double r290584 = 1.0;
        double r290585 = y;
        double r290586 = z;
        double r290587 = r290585 * r290586;
        double r290588 = r290584 - r290587;
        double r290589 = r290583 * r290588;
        return r290589;
}

double f(double x, double y, double z) {
        double r290590 = y;
        double r290591 = z;
        double r290592 = r290590 * r290591;
        double r290593 = -6.493405250404478e+306;
        bool r290594 = r290592 <= r290593;
        double r290595 = 3.0707001026583607e+167;
        bool r290596 = r290592 <= r290595;
        double r290597 = !r290596;
        bool r290598 = r290594 || r290597;
        double r290599 = x;
        double r290600 = 1.0;
        double r290601 = r290599 * r290600;
        double r290602 = -r290590;
        double r290603 = r290599 * r290602;
        double r290604 = r290603 * r290591;
        double r290605 = r290601 + r290604;
        double r290606 = -r290592;
        double r290607 = r290599 * r290606;
        double r290608 = r290601 + r290607;
        double r290609 = r290598 ? r290605 : r290608;
        return r290609;
}

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) < -6.493405250404478e+306 or 3.0707001026583607e+167 < (* y z)

    1. Initial program 32.9

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

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

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

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

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

    if -6.493405250404478e+306 < (* y z) < 3.0707001026583607e+167

    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)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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