Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A

Percentage Accurate: 100.0% → 100.0%
Time: 5.5s
Alternatives: 7
Speedup: 1.2×

Specification

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

\\
\left(x + y\right) - x \cdot y
\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 7 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: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(1 - y, x, y\right) \end{array} \]
(FPCore (x y) :precision binary64 (fma (- 1.0 y) x y))
double code(double x, double y) {
	return fma((1.0 - y), x, y);
}
function code(x, y)
	return fma(Float64(1.0 - y), x, y)
end
code[x_, y_] := N[(N[(1.0 - y), $MachinePrecision] * x + y), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(1 - y, x, y\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{y + x \cdot \left(1 - y\right)} \]
  4. Step-by-step derivation
    1. +-commutativeN/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - y, x, y\right)} \]
    4. lower--.f64100.0

      \[\leadsto \mathsf{fma}\left(\color{blue}{1 - y}, x, y\right) \]
  5. Applied rewrites100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - y, x, y\right)} \]
  6. Add Preprocessing

Alternative 2: 63.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (- (+ y x) (* y x)) -1e-303) (fma (- y) x x) (fma (- y) x y)))
double code(double x, double y) {
	double tmp;
	if (((y + x) - (y * x)) <= -1e-303) {
		tmp = fma(-y, x, x);
	} else {
		tmp = fma(-y, x, y);
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (Float64(Float64(y + x) - Float64(y * x)) <= -1e-303)
		tmp = fma(Float64(-y), x, x);
	else
		tmp = fma(Float64(-y), x, y);
	end
	return tmp
end
code[x_, y_] := If[LessEqual[N[(N[(y + x), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision], -1e-303], N[((-y) * x + x), $MachinePrecision], N[((-y) * x + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, x, y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -9.99999999999999931e-304

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\left(1 - y\right) \cdot x} \]
      3. lower--.f6465.6

        \[\leadsto \color{blue}{\left(1 - y\right)} \cdot x \]
    5. Applied rewrites65.6%

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

        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{x}, x\right) \]

      if -9.99999999999999931e-304 < (-.f64 (+.f64 x y) (*.f64 x y))

      1. Initial program 100.0%

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

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

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

          \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
        3. lower--.f6465.5

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

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

          \[\leadsto \mathsf{fma}\left(-y, \color{blue}{x}, y\right) \]
      7. Recombined 2 regimes into one program.
      8. Final simplification65.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, y\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 63.0% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot y\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= (- (+ y x) (* y x)) -1e-303) (fma (- y) x x) (* (- 1.0 x) y)))
      double code(double x, double y) {
      	double tmp;
      	if (((y + x) - (y * x)) <= -1e-303) {
      		tmp = fma(-y, x, x);
      	} else {
      		tmp = (1.0 - x) * y;
      	}
      	return tmp;
      }
      
      function code(x, y)
      	tmp = 0.0
      	if (Float64(Float64(y + x) - Float64(y * x)) <= -1e-303)
      		tmp = fma(Float64(-y), x, x);
      	else
      		tmp = Float64(Float64(1.0 - x) * y);
      	end
      	return tmp
      end
      
      code[x_, y_] := If[LessEqual[N[(N[(y + x), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision], -1e-303], N[((-y) * x + x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\
      \;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(1 - x\right) \cdot y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -9.99999999999999931e-304

        1. Initial program 100.0%

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

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

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

            \[\leadsto \color{blue}{\left(1 - y\right) \cdot x} \]
          3. lower--.f6465.6

            \[\leadsto \color{blue}{\left(1 - y\right)} \cdot x \]
        5. Applied rewrites65.6%

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

            \[\leadsto \mathsf{fma}\left(-y, \color{blue}{x}, x\right) \]

          if -9.99999999999999931e-304 < (-.f64 (+.f64 x y) (*.f64 x y))

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            3. lower--.f6465.5

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

            \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification65.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(-y, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot y\\ \end{array} \]
        9. Add Preprocessing

        Alternative 4: 63.0% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\ \;\;\;\;\left(1 - y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (if (<= (- (+ y x) (* y x)) -1e-303) (* (- 1.0 y) x) (* (- 1.0 x) y)))
        double code(double x, double y) {
        	double tmp;
        	if (((y + x) - (y * x)) <= -1e-303) {
        		tmp = (1.0 - y) * x;
        	} else {
        		tmp = (1.0 - x) * y;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: tmp
            if (((y + x) - (y * x)) <= (-1d-303)) then
                tmp = (1.0d0 - y) * x
            else
                tmp = (1.0d0 - x) * y
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (((y + x) - (y * x)) <= -1e-303) {
        		tmp = (1.0 - y) * x;
        	} else {
        		tmp = (1.0 - x) * y;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if ((y + x) - (y * x)) <= -1e-303:
        		tmp = (1.0 - y) * x
        	else:
        		tmp = (1.0 - x) * y
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (Float64(Float64(y + x) - Float64(y * x)) <= -1e-303)
        		tmp = Float64(Float64(1.0 - y) * x);
        	else
        		tmp = Float64(Float64(1.0 - x) * y);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (((y + x) - (y * x)) <= -1e-303)
        		tmp = (1.0 - y) * x;
        	else
        		tmp = (1.0 - x) * y;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[(N[(y + x), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision], -1e-303], N[(N[(1.0 - y), $MachinePrecision] * x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\left(y + x\right) - y \cdot x \leq -1 \cdot 10^{-303}:\\
        \;\;\;\;\left(1 - y\right) \cdot x\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(1 - x\right) \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -9.99999999999999931e-304

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(1 - y\right) \cdot x} \]
            3. lower--.f6465.6

              \[\leadsto \color{blue}{\left(1 - y\right)} \cdot x \]
          5. Applied rewrites65.6%

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

          if -9.99999999999999931e-304 < (-.f64 (+.f64 x y) (*.f64 x y))

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            3. lower--.f6465.5

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

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

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

        Alternative 5: 61.3% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-y\right) \cdot x\\ \mathbf{if}\;x \leq -1050000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1 \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (let* ((t_0 (* (- y) x)))
           (if (<= x -1050000000000.0) t_0 (if (<= x 1.0) (* 1.0 y) t_0))))
        double code(double x, double y) {
        	double t_0 = -y * x;
        	double tmp;
        	if (x <= -1050000000000.0) {
        		tmp = t_0;
        	} else if (x <= 1.0) {
        		tmp = 1.0 * y;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: t_0
            real(8) :: tmp
            t_0 = -y * x
            if (x <= (-1050000000000.0d0)) then
                tmp = t_0
            else if (x <= 1.0d0) then
                tmp = 1.0d0 * y
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double t_0 = -y * x;
        	double tmp;
        	if (x <= -1050000000000.0) {
        		tmp = t_0;
        	} else if (x <= 1.0) {
        		tmp = 1.0 * y;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = -y * x
        	tmp = 0
        	if x <= -1050000000000.0:
        		tmp = t_0
        	elif x <= 1.0:
        		tmp = 1.0 * y
        	else:
        		tmp = t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(Float64(-y) * x)
        	tmp = 0.0
        	if (x <= -1050000000000.0)
        		tmp = t_0;
        	elseif (x <= 1.0)
        		tmp = Float64(1.0 * y);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = -y * x;
        	tmp = 0.0;
        	if (x <= -1050000000000.0)
        		tmp = t_0;
        	elseif (x <= 1.0)
        		tmp = 1.0 * y;
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[((-y) * x), $MachinePrecision]}, If[LessEqual[x, -1050000000000.0], t$95$0, If[LessEqual[x, 1.0], N[(1.0 * y), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(-y\right) \cdot x\\
        \mathbf{if}\;x \leq -1050000000000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 1:\\
        \;\;\;\;1 \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -1.05e12 or 1 < x

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(1 - y\right) \cdot x} \]
            3. lower--.f64100.0

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

            \[\leadsto \color{blue}{\left(1 - y\right) \cdot x} \]
          6. Taylor expanded in y around inf

            \[\leadsto \left(-1 \cdot y\right) \cdot x \]
          7. Step-by-step derivation
            1. Applied rewrites45.0%

              \[\leadsto \left(-y\right) \cdot x \]

            if -1.05e12 < x < 1

            1. Initial program 100.0%

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

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

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

                \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
              3. lower--.f6472.3

                \[\leadsto \color{blue}{\left(1 - x\right)} \cdot y \]
            5. Applied rewrites72.3%

              \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            6. Taylor expanded in x around 0

              \[\leadsto 1 \cdot y \]
            7. Step-by-step derivation
              1. Applied rewrites69.0%

                \[\leadsto 1 \cdot y \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 6: 62.6% accurate, 1.3× speedup?

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

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

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

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

                \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
              3. lower--.f6459.6

                \[\leadsto \color{blue}{\left(1 - x\right)} \cdot y \]
            5. Applied rewrites59.6%

              \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            6. Add Preprocessing

            Alternative 7: 37.4% accurate, 2.0× speedup?

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

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

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

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

                \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
              3. lower--.f6459.6

                \[\leadsto \color{blue}{\left(1 - x\right)} \cdot y \]
            5. Applied rewrites59.6%

              \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            6. Taylor expanded in x around 0

              \[\leadsto 1 \cdot y \]
            7. Step-by-step derivation
              1. Applied rewrites38.4%

                \[\leadsto 1 \cdot y \]
              2. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2024298 
              (FPCore (x y)
                :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A"
                :precision binary64
                (- (+ x y) (* x y)))