Average Error: 3.2 → 0.4
Time: 12.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -4.867016490751216293607091243975016956706 \cdot 10^{264}:\\ \;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;y \cdot z \le 2.649559227460045009329263142923922493941 \cdot 10^{140}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -4.867016490751216293607091243975016956706 \cdot 10^{264}:\\
\;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\

\mathbf{elif}\;y \cdot z \le 2.649559227460045009329263142923922493941 \cdot 10^{140}:\\
\;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r16871521 = x;
        double r16871522 = 1.0;
        double r16871523 = y;
        double r16871524 = z;
        double r16871525 = r16871523 * r16871524;
        double r16871526 = r16871522 - r16871525;
        double r16871527 = r16871521 * r16871526;
        return r16871527;
}

double f(double x, double y, double z) {
        double r16871528 = y;
        double r16871529 = z;
        double r16871530 = r16871528 * r16871529;
        double r16871531 = -4.867016490751216e+264;
        bool r16871532 = r16871530 <= r16871531;
        double r16871533 = 1.0;
        double r16871534 = x;
        double r16871535 = r16871533 * r16871534;
        double r16871536 = -r16871528;
        double r16871537 = r16871529 * r16871534;
        double r16871538 = r16871536 * r16871537;
        double r16871539 = r16871535 + r16871538;
        double r16871540 = 2.649559227460045e+140;
        bool r16871541 = r16871530 <= r16871540;
        double r16871542 = -r16871530;
        double r16871543 = r16871542 * r16871534;
        double r16871544 = r16871535 + r16871543;
        double r16871545 = r16871541 ? r16871544 : r16871539;
        double r16871546 = r16871532 ? r16871539 : r16871545;
        return r16871546;
}

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) < -4.867016490751216e+264 or 2.649559227460045e+140 < (* y z)

    1. Initial program 24.1

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

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

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

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

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

    if -4.867016490751216e+264 < (* y z) < 2.649559227460045e+140

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

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

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

Reproduce

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