Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I

Percentage Accurate: 96.0% → 97.9%
Time: 7.1s
Alternatives: 4
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ x \cdot \left(1 - y \cdot z\right) \end{array} \]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
def code(x, y, z):
	return x * (1.0 - (y * z))
function code(x, y, z)
	return Float64(x * Float64(1.0 - Float64(y * z)))
end
function tmp = code(x, y, z)
	tmp = x * (1.0 - (y * z));
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - y \cdot z\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 4 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(1 - y \cdot z\right) \end{array} \]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
def code(x, y, z):
	return x * (1.0 - (y * z))
function code(x, y, z)
	return Float64(x * Float64(1.0 - Float64(y * z)))
end
function tmp = code(x, y, z)
	tmp = x * (1.0 - (y * z));
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - y \cdot z\right)
\end{array}

Alternative 1: 97.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot z \leq -\infty:\\ \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* y z) (- INFINITY)) (* (* (- y) x) z) (* x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y * z) <= -((double) INFINITY)) {
		tmp = (-y * x) * z;
	} else {
		tmp = x * (1.0 - (y * z));
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if ((y * z) <= -Double.POSITIVE_INFINITY) {
		tmp = (-y * x) * z;
	} else {
		tmp = x * (1.0 - (y * z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y * z) <= -math.inf:
		tmp = (-y * x) * z
	else:
		tmp = x * (1.0 - (y * z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(y * z) <= Float64(-Inf))
		tmp = Float64(Float64(Float64(-y) * x) * z);
	else
		tmp = Float64(x * Float64(1.0 - Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y * z) <= -Inf)
		tmp = (-y * x) * z;
	else
		tmp = x * (1.0 - (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], (-Infinity)], N[(N[((-y) * x), $MachinePrecision] * z), $MachinePrecision], N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -\infty:\\
\;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y z) < -inf.0

    1. Initial program 58.9%

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(y \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot z\right) \]
      4. lower-neg.f6458.9

        \[\leadsto x \cdot \left(\color{blue}{\left(-y\right)} \cdot z\right) \]
    5. Applied rewrites58.9%

      \[\leadsto x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites58.9%

        \[\leadsto x \cdot \frac{z \cdot \left(\left(-y\right) \cdot y\right)}{\color{blue}{y}} \]
      2. Step-by-step derivation
        1. Applied rewrites58.9%

          \[\leadsto x \cdot \frac{z}{\color{blue}{\frac{-1}{y}}} \]
        2. Taylor expanded in y around inf

          \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto -1 \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
          2. associate-*r*N/A

            \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
          4. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \color{blue}{\left(y \cdot x\right)}\right) \cdot z \]
          5. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
          7. mul-1-negN/A

            \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot x\right) \cdot z \]
          8. lower-neg.f64100.0

            \[\leadsto \left(\color{blue}{\left(-y\right)} \cdot x\right) \cdot z \]
        4. Applied rewrites100.0%

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

        if -inf.0 < (*.f64 y z)

        1. Initial program 98.2%

          \[x \cdot \left(1 - y \cdot z\right) \]
        2. Add Preprocessing
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 2: 95.9% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot z \leq -\infty:\\ \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\ \mathbf{elif}\;y \cdot z \leq -5 \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\ \;\;\;\;x \cdot \left(\left(-y\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= (* y z) (- INFINITY))
         (* (* (- y) x) z)
         (if (or (<= (* y z) -5.0) (not (<= (* y z) 5e-6)))
           (* x (* (- y) z))
           (* x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if ((y * z) <= -((double) INFINITY)) {
      		tmp = (-y * x) * z;
      	} else if (((y * z) <= -5.0) || !((y * z) <= 5e-6)) {
      		tmp = x * (-y * z);
      	} else {
      		tmp = x * 1.0;
      	}
      	return tmp;
      }
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if ((y * z) <= -Double.POSITIVE_INFINITY) {
      		tmp = (-y * x) * z;
      	} else if (((y * z) <= -5.0) || !((y * z) <= 5e-6)) {
      		tmp = x * (-y * z);
      	} else {
      		tmp = x * 1.0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if (y * z) <= -math.inf:
      		tmp = (-y * x) * z
      	elif ((y * z) <= -5.0) or not ((y * z) <= 5e-6):
      		tmp = x * (-y * z)
      	else:
      		tmp = x * 1.0
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (Float64(y * z) <= Float64(-Inf))
      		tmp = Float64(Float64(Float64(-y) * x) * z);
      	elseif ((Float64(y * z) <= -5.0) || !(Float64(y * z) <= 5e-6))
      		tmp = Float64(x * Float64(Float64(-y) * z));
      	else
      		tmp = Float64(x * 1.0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if ((y * z) <= -Inf)
      		tmp = (-y * x) * z;
      	elseif (((y * z) <= -5.0) || ~(((y * z) <= 5e-6)))
      		tmp = x * (-y * z);
      	else
      		tmp = x * 1.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], (-Infinity)], N[(N[((-y) * x), $MachinePrecision] * z), $MachinePrecision], If[Or[LessEqual[N[(y * z), $MachinePrecision], -5.0], N[Not[LessEqual[N[(y * z), $MachinePrecision], 5e-6]], $MachinePrecision]], N[(x * N[((-y) * z), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \cdot z \leq -\infty:\\
      \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\
      
      \mathbf{elif}\;y \cdot z \leq -5 \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\
      \;\;\;\;x \cdot \left(\left(-y\right) \cdot z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 y z) < -inf.0

        1. Initial program 58.9%

          \[x \cdot \left(1 - y \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(y \cdot z\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
          2. lower-*.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot z\right) \]
          4. lower-neg.f6458.9

            \[\leadsto x \cdot \left(\color{blue}{\left(-y\right)} \cdot z\right) \]
        5. Applied rewrites58.9%

          \[\leadsto x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites58.9%

            \[\leadsto x \cdot \frac{z \cdot \left(\left(-y\right) \cdot y\right)}{\color{blue}{y}} \]
          2. Step-by-step derivation
            1. Applied rewrites58.9%

              \[\leadsto x \cdot \frac{z}{\color{blue}{\frac{-1}{y}}} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
            3. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto -1 \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
              4. *-commutativeN/A

                \[\leadsto \left(-1 \cdot \color{blue}{\left(y \cdot x\right)}\right) \cdot z \]
              5. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
              6. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
              7. mul-1-negN/A

                \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot x\right) \cdot z \]
              8. lower-neg.f64100.0

                \[\leadsto \left(\color{blue}{\left(-y\right)} \cdot x\right) \cdot z \]
            4. Applied rewrites100.0%

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

            if -inf.0 < (*.f64 y z) < -5 or 5.00000000000000041e-6 < (*.f64 y z)

            1. Initial program 96.2%

              \[x \cdot \left(1 - y \cdot z\right) \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

              \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(y \cdot z\right)\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
              2. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
              3. mul-1-negN/A

                \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot z\right) \]
              4. lower-neg.f6494.2

                \[\leadsto x \cdot \left(\color{blue}{\left(-y\right)} \cdot z\right) \]
            5. Applied rewrites94.2%

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

            if -5 < (*.f64 y z) < 5.00000000000000041e-6

            1. Initial program 100.0%

              \[x \cdot \left(1 - y \cdot z\right) \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto x \cdot \color{blue}{1} \]
            4. Step-by-step derivation
              1. Applied rewrites99.3%

                \[\leadsto x \cdot \color{blue}{1} \]
            5. Recombined 3 regimes into one program.
            6. Final simplification97.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -\infty:\\ \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\ \mathbf{elif}\;y \cdot z \leq -5 \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\ \;\;\;\;x \cdot \left(\left(-y\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \]
            7. Add Preprocessing

            Alternative 3: 92.8% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot z \leq -2 \cdot 10^{+33} \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\ \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= (* y z) -2e+33) (not (<= (* y z) 5e-6)))
               (* (* (- y) x) z)
               (* x 1.0)))
            double code(double x, double y, double z) {
            	double tmp;
            	if (((y * z) <= -2e+33) || !((y * z) <= 5e-6)) {
            		tmp = (-y * x) * z;
            	} else {
            		tmp = x * 1.0;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: tmp
                if (((y * z) <= (-2d+33)) .or. (.not. ((y * z) <= 5d-6))) then
                    tmp = (-y * x) * z
                else
                    tmp = x * 1.0d0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if (((y * z) <= -2e+33) || !((y * z) <= 5e-6)) {
            		tmp = (-y * x) * z;
            	} else {
            		tmp = x * 1.0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if ((y * z) <= -2e+33) or not ((y * z) <= 5e-6):
            		tmp = (-y * x) * z
            	else:
            		tmp = x * 1.0
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((Float64(y * z) <= -2e+33) || !(Float64(y * z) <= 5e-6))
            		tmp = Float64(Float64(Float64(-y) * x) * z);
            	else
            		tmp = Float64(x * 1.0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if (((y * z) <= -2e+33) || ~(((y * z) <= 5e-6)))
            		tmp = (-y * x) * z;
            	else
            		tmp = x * 1.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[N[(y * z), $MachinePrecision], -2e+33], N[Not[LessEqual[N[(y * z), $MachinePrecision], 5e-6]], $MachinePrecision]], N[(N[((-y) * x), $MachinePrecision] * z), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \cdot z \leq -2 \cdot 10^{+33} \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\
            \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 y z) < -1.9999999999999999e33 or 5.00000000000000041e-6 < (*.f64 y z)

              1. Initial program 90.7%

                \[x \cdot \left(1 - y \cdot z\right) \]
              2. Add Preprocessing
              3. Taylor expanded in y around inf

                \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(y \cdot z\right)\right)} \]
              4. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot y\right) \cdot z\right)} \]
                3. mul-1-negN/A

                  \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot z\right) \]
                4. lower-neg.f6490.0

                  \[\leadsto x \cdot \left(\color{blue}{\left(-y\right)} \cdot z\right) \]
              5. Applied rewrites90.0%

                \[\leadsto x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites62.5%

                  \[\leadsto x \cdot \frac{z \cdot \left(\left(-y\right) \cdot y\right)}{\color{blue}{y}} \]
                2. Step-by-step derivation
                  1. Applied rewrites89.9%

                    \[\leadsto x \cdot \frac{z}{\color{blue}{\frac{-1}{y}}} \]
                  2. Taylor expanded in y around inf

                    \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
                  3. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto -1 \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
                    2. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
                    3. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(-1 \cdot \left(x \cdot y\right)\right) \cdot z} \]
                    4. *-commutativeN/A

                      \[\leadsto \left(-1 \cdot \color{blue}{\left(y \cdot x\right)}\right) \cdot z \]
                    5. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
                    6. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\left(-1 \cdot y\right) \cdot x\right)} \cdot z \]
                    7. mul-1-negN/A

                      \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot x\right) \cdot z \]
                    8. lower-neg.f6495.2

                      \[\leadsto \left(\color{blue}{\left(-y\right)} \cdot x\right) \cdot z \]
                  4. Applied rewrites95.2%

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

                  if -1.9999999999999999e33 < (*.f64 y z) < 5.00000000000000041e-6

                  1. Initial program 100.0%

                    \[x \cdot \left(1 - y \cdot z\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around 0

                    \[\leadsto x \cdot \color{blue}{1} \]
                  4. Step-by-step derivation
                    1. Applied rewrites97.3%

                      \[\leadsto x \cdot \color{blue}{1} \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification96.3%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -2 \cdot 10^{+33} \lor \neg \left(y \cdot z \leq 5 \cdot 10^{-6}\right):\\ \;\;\;\;\left(\left(-y\right) \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 4: 51.0% accurate, 2.3× speedup?

                  \[\begin{array}{l} \\ x \cdot 1 \end{array} \]
                  (FPCore (x y z) :precision binary64 (* x 1.0))
                  double code(double x, double y, double z) {
                  	return x * 1.0;
                  }
                  
                  real(8) function code(x, y, z)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      code = x * 1.0d0
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	return x * 1.0;
                  }
                  
                  def code(x, y, z):
                  	return x * 1.0
                  
                  function code(x, y, z)
                  	return Float64(x * 1.0)
                  end
                  
                  function tmp = code(x, y, z)
                  	tmp = x * 1.0;
                  end
                  
                  code[x_, y_, z_] := N[(x * 1.0), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  x \cdot 1
                  \end{array}
                  
                  Derivation
                  1. Initial program 95.5%

                    \[x \cdot \left(1 - y \cdot z\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around 0

                    \[\leadsto x \cdot \color{blue}{1} \]
                  4. Step-by-step derivation
                    1. Applied rewrites51.8%

                      \[\leadsto x \cdot \color{blue}{1} \]
                    2. Add Preprocessing

                    Reproduce

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