Average Error: 3.4 → 1.6
Time: 13.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.916540598353502437035986625358608206882 \cdot 10^{-11}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;z \le 3.573364169001774355246161630241161945322 \cdot 10^{59}:\\ \;\;\;\;\left(1 - z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;z \le -6.916540598353502437035986625358608206882 \cdot 10^{-11}:\\
\;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r12541356 = x;
        double r12541357 = 1.0;
        double r12541358 = y;
        double r12541359 = z;
        double r12541360 = r12541358 * r12541359;
        double r12541361 = r12541357 - r12541360;
        double r12541362 = r12541356 * r12541361;
        return r12541362;
}

double f(double x, double y, double z) {
        double r12541363 = z;
        double r12541364 = -6.916540598353502e-11;
        bool r12541365 = r12541363 <= r12541364;
        double r12541366 = 1.0;
        double r12541367 = x;
        double r12541368 = r12541366 * r12541367;
        double r12541369 = -r12541363;
        double r12541370 = y;
        double r12541371 = r12541370 * r12541367;
        double r12541372 = r12541369 * r12541371;
        double r12541373 = r12541368 + r12541372;
        double r12541374 = 3.5733641690017744e+59;
        bool r12541375 = r12541363 <= r12541374;
        double r12541376 = r12541363 * r12541370;
        double r12541377 = r12541366 - r12541376;
        double r12541378 = r12541377 * r12541367;
        double r12541379 = r12541375 ? r12541378 : r12541373;
        double r12541380 = r12541365 ? r12541373 : r12541379;
        return r12541380;
}

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 z < -6.916540598353502e-11 or 3.5733641690017744e+59 < z

    1. Initial program 8.6

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

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Taylor expanded around inf 8.6

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

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

    if -6.916540598353502e-11 < z < 3.5733641690017744e+59

    1. Initial program 0.2

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

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Taylor expanded around inf 0.2

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(-\left(y \cdot x\right) \cdot z\right)}\]
    7. Taylor expanded around inf 0.2

      \[\leadsto \color{blue}{1 \cdot x - x \cdot \left(z \cdot y\right)}\]
    8. Simplified0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.916540598353502437035986625358608206882 \cdot 10^{-11}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;z \le 3.573364169001774355246161630241161945322 \cdot 10^{59}:\\ \;\;\;\;\left(1 - z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-z\right) \cdot \left(y \cdot x\right)\\ \end{array}\]

Reproduce

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