Average Error: 3.2 → 0.3
Time: 7.6s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;1.0 - z \cdot y = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(-z \cdot \left(y \cdot x\right)\right)\\ \mathbf{elif}\;1.0 - z \cdot y \le 2.3198672006399403 \cdot 10^{+136}:\\ \;\;\;\;x \cdot 1.0 + \left(-\left(z \cdot y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(-z \cdot \left(y \cdot x\right)\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;1.0 - z \cdot y = -\infty:\\
\;\;\;\;x \cdot 1.0 + \left(-z \cdot \left(y \cdot x\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r3626553 = x;
        double r3626554 = 1.0;
        double r3626555 = y;
        double r3626556 = z;
        double r3626557 = r3626555 * r3626556;
        double r3626558 = r3626554 - r3626557;
        double r3626559 = r3626553 * r3626558;
        return r3626559;
}

double f(double x, double y, double z) {
        double r3626560 = 1.0;
        double r3626561 = z;
        double r3626562 = y;
        double r3626563 = r3626561 * r3626562;
        double r3626564 = r3626560 - r3626563;
        double r3626565 = -inf.0;
        bool r3626566 = r3626564 <= r3626565;
        double r3626567 = x;
        double r3626568 = r3626567 * r3626560;
        double r3626569 = r3626562 * r3626567;
        double r3626570 = r3626561 * r3626569;
        double r3626571 = -r3626570;
        double r3626572 = r3626568 + r3626571;
        double r3626573 = 2.3198672006399403e+136;
        bool r3626574 = r3626564 <= r3626573;
        double r3626575 = r3626563 * r3626567;
        double r3626576 = -r3626575;
        double r3626577 = r3626568 + r3626576;
        double r3626578 = r3626574 ? r3626577 : r3626572;
        double r3626579 = r3626566 ? r3626572 : r3626578;
        return r3626579;
}

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 (- 1.0 (* y z)) < -inf.0 or 2.3198672006399403e+136 < (- 1.0 (* y z))

    1. Initial program 25.6

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

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

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

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

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

    if -inf.0 < (- 1.0 (* y z)) < 2.3198672006399403e+136

    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-lft-in0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;1.0 - z \cdot y = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(-z \cdot \left(y \cdot x\right)\right)\\ \mathbf{elif}\;1.0 - z \cdot y \le 2.3198672006399403 \cdot 10^{+136}:\\ \;\;\;\;x \cdot 1.0 + \left(-\left(z \cdot y\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(-z \cdot \left(y \cdot x\right)\right)\\ \end{array}\]

Reproduce

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