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

Percentage Accurate: 100.0% → 100.0%
Time: 3.6s
Alternatives: 9
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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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 9 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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 - x, y, x\right) \end{array} \]
(FPCore (x y) :precision binary64 (fma (- 1.0 x) y x))
double code(double x, double y) {
	return fma((1.0 - x), y, x);
}
function code(x, y)
	return fma(Float64(1.0 - x), y, x)
end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(1 - x, y, x\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. Applied rewrites100.0%

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

Alternative 2: 81.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y\right) - x \cdot y\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+305} \lor \neg \left(t\_0 \leq \infty\right):\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;y - \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (+ x y) (* x y))))
   (if (or (<= t_0 -2e+305) (not (<= t_0 INFINITY))) (* (- y) x) (- y (- x)))))
double code(double x, double y) {
	double t_0 = (x + y) - (x * y);
	double tmp;
	if ((t_0 <= -2e+305) || !(t_0 <= ((double) INFINITY))) {
		tmp = -y * x;
	} else {
		tmp = y - -x;
	}
	return tmp;
}
public static double code(double x, double y) {
	double t_0 = (x + y) - (x * y);
	double tmp;
	if ((t_0 <= -2e+305) || !(t_0 <= Double.POSITIVE_INFINITY)) {
		tmp = -y * x;
	} else {
		tmp = y - -x;
	}
	return tmp;
}
def code(x, y):
	t_0 = (x + y) - (x * y)
	tmp = 0
	if (t_0 <= -2e+305) or not (t_0 <= math.inf):
		tmp = -y * x
	else:
		tmp = y - -x
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x + y) - Float64(x * y))
	tmp = 0.0
	if ((t_0 <= -2e+305) || !(t_0 <= Inf))
		tmp = Float64(Float64(-y) * x);
	else
		tmp = Float64(y - Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x + y) - (x * y);
	tmp = 0.0;
	if ((t_0 <= -2e+305) || ~((t_0 <= Inf)))
		tmp = -y * x;
	else
		tmp = y - -x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e+305], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[((-y) * x), $MachinePrecision], N[(y - (-x)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x + y\right) - x \cdot y\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+305} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\left(-y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -1.9999999999999999e305 or +inf.0 < (-.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 x around inf

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

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

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

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

        if -1.9999999999999999e305 < (-.f64 (+.f64 x y) (*.f64 x y)) < +inf.0

        1. Initial program 100.0%

          \[\left(x + y\right) - x \cdot y \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

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

            \[\leadsto \color{blue}{\left(x + y\right)} - x \cdot y \]
          3. associate--l+N/A

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

            \[\leadsto \color{blue}{\left(y - x \cdot y\right) + x} \]
          5. associate-+l-N/A

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

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

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

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

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

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

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

          \[\leadsto y - \color{blue}{-1 \cdot x} \]
        6. Step-by-step derivation
          1. Applied rewrites79.5%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -2 \cdot 10^{+305} \lor \neg \left(\left(x + y\right) - x \cdot y \leq \infty\right):\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;y - \left(-x\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 3: 62.8% accurate, 0.5× speedup?

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

          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. Applied rewrites100.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - x, y, x\right)} \]
          5. Taylor expanded in x around inf

            \[\leadsto \mathsf{fma}\left(-1 \cdot x, y, x\right) \]
          6. Step-by-step derivation
            1. Applied rewrites61.9%

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

            if -4.99999999999999973e-284 < (-.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. Applied rewrites69.1%

                \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
            5. Recombined 2 regimes into one program.
            6. Add Preprocessing

            Alternative 4: 62.8% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\ \;\;\;\;\left(1 - y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot y\\ \end{array} \end{array} \]
            (FPCore (x y)
             :precision binary64
             (if (<= (- (+ x y) (* x y)) -5e-284) (* (- 1.0 y) x) (* (- 1.0 x) y)))
            double code(double x, double y) {
            	double tmp;
            	if (((x + y) - (x * y)) <= -5e-284) {
            		tmp = (1.0 - y) * x;
            	} else {
            		tmp = (1.0 - x) * y;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8) :: tmp
                if (((x + y) - (x * y)) <= (-5d-284)) 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 (((x + y) - (x * y)) <= -5e-284) {
            		tmp = (1.0 - y) * x;
            	} else {
            		tmp = (1.0 - x) * y;
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if ((x + y) - (x * y)) <= -5e-284:
            		tmp = (1.0 - y) * x
            	else:
            		tmp = (1.0 - x) * y
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (Float64(Float64(x + y) - Float64(x * y)) <= -5e-284)
            		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 (((x + y) - (x * y)) <= -5e-284)
            		tmp = (1.0 - y) * x;
            	else
            		tmp = (1.0 - x) * y;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[N[(N[(x + y), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision], -5e-284], 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(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\
            \;\;\;\;\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)) < -4.99999999999999973e-284

              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. Applied rewrites61.9%

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

                if -4.99999999999999973e-284 < (-.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. Applied rewrites69.1%

                    \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
                5. Recombined 2 regimes into one program.
                6. Add Preprocessing

                Alternative 5: 38.3% accurate, 0.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) + y\\ \end{array} \end{array} \]
                (FPCore (x y)
                 :precision binary64
                 (if (<= (- (+ x y) (* x y)) -5e-284) x (+ (- x) y)))
                double code(double x, double y) {
                	double tmp;
                	if (((x + y) - (x * y)) <= -5e-284) {
                		tmp = x;
                	} else {
                		tmp = -x + y;
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8) :: tmp
                    if (((x + y) - (x * y)) <= (-5d-284)) then
                        tmp = x
                    else
                        tmp = -x + y
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y) {
                	double tmp;
                	if (((x + y) - (x * y)) <= -5e-284) {
                		tmp = x;
                	} else {
                		tmp = -x + y;
                	}
                	return tmp;
                }
                
                def code(x, y):
                	tmp = 0
                	if ((x + y) - (x * y)) <= -5e-284:
                		tmp = x
                	else:
                		tmp = -x + y
                	return tmp
                
                function code(x, y)
                	tmp = 0.0
                	if (Float64(Float64(x + y) - Float64(x * y)) <= -5e-284)
                		tmp = x;
                	else
                		tmp = Float64(Float64(-x) + y);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if (((x + y) - (x * y)) <= -5e-284)
                		tmp = x;
                	else
                		tmp = -x + y;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_] := If[LessEqual[N[(N[(x + y), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision], -5e-284], x, N[((-x) + y), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\
                \;\;\;\;x\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(-x\right) + y\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -4.99999999999999973e-284

                  1. Initial program 100.0%

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

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

                      \[\leadsto \color{blue}{x} \]

                    if -4.99999999999999973e-284 < (-.f64 (+.f64 x y) (*.f64 x y))

                    1. Initial program 100.0%

                      \[\left(x + y\right) - x \cdot y \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift--.f64N/A

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

                        \[\leadsto \color{blue}{\left(x + y\right)} - x \cdot y \]
                      3. associate--l+N/A

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

                        \[\leadsto \color{blue}{\left(y - x \cdot y\right) + x} \]
                      5. associate-+l-N/A

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

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

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

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

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

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

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

                      \[\leadsto y - \color{blue}{-1 \cdot x} \]
                    6. Step-by-step derivation
                      1. Applied rewrites75.6%

                        \[\leadsto y - \color{blue}{\left(-x\right)} \]
                      2. Applied rewrites43.9%

                        \[\leadsto \color{blue}{\left(-x\right) + y} \]
                    7. Recombined 2 regimes into one program.
                    8. Add Preprocessing

                    Alternative 6: 86.9% accurate, 0.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -260000000000:\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-18}:\\ \;\;\;\;y - \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot y\\ \end{array} \end{array} \]
                    (FPCore (x y)
                     :precision binary64
                     (if (<= y -260000000000.0)
                       (* (- y) x)
                       (if (<= y 1.7e-18) (- y (- x)) (* (- 1.0 x) y))))
                    double code(double x, double y) {
                    	double tmp;
                    	if (y <= -260000000000.0) {
                    		tmp = -y * x;
                    	} else if (y <= 1.7e-18) {
                    		tmp = y - -x;
                    	} else {
                    		tmp = (1.0 - x) * y;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8) :: tmp
                        if (y <= (-260000000000.0d0)) then
                            tmp = -y * x
                        else if (y <= 1.7d-18) then
                            tmp = 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 <= -260000000000.0) {
                    		tmp = -y * x;
                    	} else if (y <= 1.7e-18) {
                    		tmp = y - -x;
                    	} else {
                    		tmp = (1.0 - x) * y;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y):
                    	tmp = 0
                    	if y <= -260000000000.0:
                    		tmp = -y * x
                    	elif y <= 1.7e-18:
                    		tmp = y - -x
                    	else:
                    		tmp = (1.0 - x) * y
                    	return tmp
                    
                    function code(x, y)
                    	tmp = 0.0
                    	if (y <= -260000000000.0)
                    		tmp = Float64(Float64(-y) * x);
                    	elseif (y <= 1.7e-18)
                    		tmp = Float64(y - Float64(-x));
                    	else
                    		tmp = Float64(Float64(1.0 - x) * y);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y)
                    	tmp = 0.0;
                    	if (y <= -260000000000.0)
                    		tmp = -y * x;
                    	elseif (y <= 1.7e-18)
                    		tmp = y - -x;
                    	else
                    		tmp = (1.0 - x) * y;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_] := If[LessEqual[y, -260000000000.0], N[((-y) * x), $MachinePrecision], If[LessEqual[y, 1.7e-18], N[(y - (-x)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y \leq -260000000000:\\
                    \;\;\;\;\left(-y\right) \cdot x\\
                    
                    \mathbf{elif}\;y \leq 1.7 \cdot 10^{-18}:\\
                    \;\;\;\;y - \left(-x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(1 - x\right) \cdot y\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y < -2.6e11

                      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. Applied rewrites58.3%

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

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

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

                          if -2.6e11 < y < 1.70000000000000001e-18

                          1. Initial program 100.0%

                            \[\left(x + y\right) - x \cdot y \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift--.f64N/A

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

                              \[\leadsto \color{blue}{\left(x + y\right)} - x \cdot y \]
                            3. associate--l+N/A

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

                              \[\leadsto \color{blue}{\left(y - x \cdot y\right) + x} \]
                            5. associate-+l-N/A

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

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

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

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

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

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

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

                            \[\leadsto y - \color{blue}{-1 \cdot x} \]
                          6. Step-by-step derivation
                            1. Applied rewrites98.9%

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

                            if 1.70000000000000001e-18 < 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. Applied rewrites99.4%

                                \[\leadsto \color{blue}{\left(1 - x\right) \cdot y} \]
                            5. Recombined 3 regimes into one program.
                            6. Add Preprocessing

                            Alternative 7: 38.6% accurate, 0.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
                            (FPCore (x y) :precision binary64 (if (<= (- (+ x y) (* x y)) -5e-284) x y))
                            double code(double x, double y) {
                            	double tmp;
                            	if (((x + y) - (x * y)) <= -5e-284) {
                            		tmp = x;
                            	} else {
                            		tmp = y;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8) :: tmp
                                if (((x + y) - (x * y)) <= (-5d-284)) then
                                    tmp = x
                                else
                                    tmp = y
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y) {
                            	double tmp;
                            	if (((x + y) - (x * y)) <= -5e-284) {
                            		tmp = x;
                            	} else {
                            		tmp = y;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y):
                            	tmp = 0
                            	if ((x + y) - (x * y)) <= -5e-284:
                            		tmp = x
                            	else:
                            		tmp = y
                            	return tmp
                            
                            function code(x, y)
                            	tmp = 0.0
                            	if (Float64(Float64(x + y) - Float64(x * y)) <= -5e-284)
                            		tmp = x;
                            	else
                            		tmp = y;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y)
                            	tmp = 0.0;
                            	if (((x + y) - (x * y)) <= -5e-284)
                            		tmp = x;
                            	else
                            		tmp = y;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_] := If[LessEqual[N[(N[(x + y), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision], -5e-284], x, y]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\left(x + y\right) - x \cdot y \leq -5 \cdot 10^{-284}:\\
                            \;\;\;\;x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;y\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (-.f64 (+.f64 x y) (*.f64 x y)) < -4.99999999999999973e-284

                              1. Initial program 100.0%

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

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

                                  \[\leadsto \color{blue}{x} \]

                                if -4.99999999999999973e-284 < (-.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 x around 0

                                  \[\leadsto \color{blue}{y} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites44.5%

                                    \[\leadsto \color{blue}{y} \]
                                5. Recombined 2 regimes into one program.
                                6. Add Preprocessing

                                Alternative 8: 75.0% accurate, 2.0× speedup?

                                \[\begin{array}{l} \\ y - \left(-x\right) \end{array} \]
                                (FPCore (x y) :precision binary64 (- y (- x)))
                                double code(double x, double y) {
                                	return y - -x;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    code = y - -x
                                end function
                                
                                public static double code(double x, double y) {
                                	return y - -x;
                                }
                                
                                def code(x, y):
                                	return y - -x
                                
                                function code(x, y)
                                	return Float64(y - Float64(-x))
                                end
                                
                                function tmp = code(x, y)
                                	tmp = y - -x;
                                end
                                
                                code[x_, y_] := N[(y - (-x)), $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                y - \left(-x\right)
                                \end{array}
                                
                                Derivation
                                1. Initial program 100.0%

                                  \[\left(x + y\right) - x \cdot y \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift--.f64N/A

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

                                    \[\leadsto \color{blue}{\left(x + y\right)} - x \cdot y \]
                                  3. associate--l+N/A

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

                                    \[\leadsto \color{blue}{\left(y - x \cdot y\right) + x} \]
                                  5. associate-+l-N/A

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

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

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

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

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

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

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

                                  \[\leadsto y - \color{blue}{-1 \cdot x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites73.6%

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

                                  Alternative 9: 39.2% accurate, 12.0× speedup?

                                  \[\begin{array}{l} \\ x \end{array} \]
                                  (FPCore (x y) :precision binary64 x)
                                  double code(double x, double y) {
                                  	return x;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      code = x
                                  end function
                                  
                                  public static double code(double x, double y) {
                                  	return x;
                                  }
                                  
                                  def code(x, y):
                                  	return x
                                  
                                  function code(x, y)
                                  	return x
                                  end
                                  
                                  function tmp = code(x, y)
                                  	tmp = x;
                                  end
                                  
                                  code[x_, y_] := x
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  x
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 100.0%

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

                                    \[\leadsto \color{blue}{x} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites33.7%

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

                                    Reproduce

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