Data.Colour.SRGB:transferFunction from colour-2.3.3

Percentage Accurate: 100.0% → 100.0%
Time: 2.0s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\left(x + 1\right) \cdot y - x \]
(FPCore (x y)
  :precision binary64
  (- (* (+ x 1.0) y) x))
double code(double x, double y) {
	return ((x + 1.0) * 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 = ((x + 1.0d0) * y) - x
end function
public static double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
def code(x, y):
	return ((x + 1.0) * y) - x
function code(x, y)
	return Float64(Float64(Float64(x + 1.0) * y) - x)
end
function tmp = code(x, y)
	tmp = ((x + 1.0) * y) - x;
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
\left(x + 1\right) \cdot y - x

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?

\[\left(x + 1\right) \cdot y - x \]
(FPCore (x y)
  :precision binary64
  (- (* (+ x 1.0) y) x))
double code(double x, double y) {
	return ((x + 1.0) * 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 = ((x + 1.0d0) * y) - x
end function
public static double code(double x, double y) {
	return ((x + 1.0) * y) - x;
}
def code(x, y):
	return ((x + 1.0) * y) - x
function code(x, y)
	return Float64(Float64(Float64(x + 1.0) * y) - x)
end
function tmp = code(x, y)
	tmp = ((x + 1.0) * y) - x;
end
code[x_, y_] := N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]
\left(x + 1\right) \cdot y - x

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\left(y \cdot x + y\right) - x \]
(FPCore (x y)
  :precision binary64
  (- (+ (* y x) y) x))
double code(double x, double y) {
	return ((y * x) + 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) + y) - x
end function
public static double code(double x, double y) {
	return ((y * x) + y) - x;
}
def code(x, y):
	return ((y * x) + y) - x
function code(x, y)
	return Float64(Float64(Float64(y * x) + y) - x)
end
function tmp = code(x, y)
	tmp = ((y * x) + y) - x;
end
code[x_, y_] := N[(N[(N[(y * x), $MachinePrecision] + y), $MachinePrecision] - x), $MachinePrecision]
\left(y \cdot x + y\right) - x
Derivation
  1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{y} \cdot x + y \cdot 1\right) - x \]
    9. *-rgt-identity100.0%

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

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

Alternative 2: 98.5% accurate, 0.6× speedup?

\[\begin{array}{l} t_0 := x \cdot y - x\\ \mathbf{if}\;x \leq -6.6 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 920000000:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (- (* x y) x)))
  (if (<= x -6.6e+16) t_0 (if (<= x 920000000.0) (- y x) t_0))))
double code(double x, double y) {
	double t_0 = (x * y) - x;
	double tmp;
	if (x <= -6.6e+16) {
		tmp = t_0;
	} else if (x <= 920000000.0) {
		tmp = y - x;
	} else {
		tmp = t_0;
	}
	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) :: t_0
    real(8) :: tmp
    t_0 = (x * y) - x
    if (x <= (-6.6d+16)) then
        tmp = t_0
    else if (x <= 920000000.0d0) then
        tmp = y - x
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x * y) - x;
	double tmp;
	if (x <= -6.6e+16) {
		tmp = t_0;
	} else if (x <= 920000000.0) {
		tmp = y - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = (x * y) - x
	tmp = 0
	if x <= -6.6e+16:
		tmp = t_0
	elif x <= 920000000.0:
		tmp = y - x
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x * y) - x)
	tmp = 0.0
	if (x <= -6.6e+16)
		tmp = t_0;
	elseif (x <= 920000000.0)
		tmp = Float64(y - x);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x * y) - x;
	tmp = 0.0;
	if (x <= -6.6e+16)
		tmp = t_0;
	elseif (x <= 920000000.0)
		tmp = y - x;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * y), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[x, -6.6e+16], t$95$0, If[LessEqual[x, 920000000.0], N[(y - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot y - x\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 920000000:\\
\;\;\;\;y - x\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.6e16 or 9.2e8 < x

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot y} - x \]
    3. Step-by-step derivation
      1. lower-*.f6462.4%

        \[\leadsto x \cdot \color{blue}{y} - x \]
    4. Applied rewrites62.4%

      \[\leadsto \color{blue}{x \cdot y} - x \]

    if -6.6e16 < x < 9.2e8

    1. Initial program 100.0%

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

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

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

    Alternative 3: 98.4% accurate, 0.6× speedup?

    \[\begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+23}:\\ \;\;\;\;y \cdot \left(1 + x\right)\\ \mathbf{elif}\;y \leq 1.65:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot x + y\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (if (<= y -3.8e+23)
      (* y (+ 1.0 x))
      (if (<= y 1.65) (- y x) (+ (* y x) y))))
    double code(double x, double y) {
    	double tmp;
    	if (y <= -3.8e+23) {
    		tmp = y * (1.0 + x);
    	} else if (y <= 1.65) {
    		tmp = y - x;
    	} else {
    		tmp = (y * 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 <= (-3.8d+23)) then
            tmp = y * (1.0d0 + x)
        else if (y <= 1.65d0) then
            tmp = y - x
        else
            tmp = (y * x) + y
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (y <= -3.8e+23) {
    		tmp = y * (1.0 + x);
    	} else if (y <= 1.65) {
    		tmp = y - x;
    	} else {
    		tmp = (y * x) + y;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= -3.8e+23:
    		tmp = y * (1.0 + x)
    	elif y <= 1.65:
    		tmp = y - x
    	else:
    		tmp = (y * x) + y
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= -3.8e+23)
    		tmp = Float64(y * Float64(1.0 + x));
    	elseif (y <= 1.65)
    		tmp = Float64(y - x);
    	else
    		tmp = Float64(Float64(y * x) + y);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= -3.8e+23)
    		tmp = y * (1.0 + x);
    	elseif (y <= 1.65)
    		tmp = y - x;
    	else
    		tmp = (y * x) + y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, -3.8e+23], N[(y * N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65], N[(y - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] + y), $MachinePrecision]]]
    
    \begin{array}{l}
    \mathbf{if}\;y \leq -3.8 \cdot 10^{+23}:\\
    \;\;\;\;y \cdot \left(1 + x\right)\\
    
    \mathbf{elif}\;y \leq 1.65:\\
    \;\;\;\;y - x\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot x + y\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -3.7999999999999997e23

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{-1 \cdot x} \]
      3. Step-by-step derivation
        1. lower-*.f6438.7%

          \[\leadsto -1 \cdot \color{blue}{x} \]
      4. Applied rewrites38.7%

        \[\leadsto \color{blue}{-1 \cdot x} \]
      5. Taylor expanded in x around 0

        \[\leadsto \color{blue}{y} \]
      6. Step-by-step derivation
        1. Applied rewrites39.2%

          \[\leadsto \color{blue}{y} \]
        2. Taylor expanded in y around inf

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

            \[\leadsto y \cdot \color{blue}{\left(1 + x\right)} \]
          2. lower-+.f6462.8%

            \[\leadsto y \cdot \left(1 + \color{blue}{x}\right) \]
        4. Applied rewrites62.8%

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

        if -3.7999999999999997e23 < y < 1.6499999999999999

        1. Initial program 100.0%

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

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

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

          if 1.6499999999999999 < y

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{-1 \cdot x} \]
          3. Step-by-step derivation
            1. lower-*.f6438.7%

              \[\leadsto -1 \cdot \color{blue}{x} \]
          4. Applied rewrites38.7%

            \[\leadsto \color{blue}{-1 \cdot x} \]
          5. Taylor expanded in x around 0

            \[\leadsto \color{blue}{y} \]
          6. Step-by-step derivation
            1. Applied rewrites39.2%

              \[\leadsto \color{blue}{y} \]
            2. Taylor expanded in y around inf

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

                \[\leadsto y \cdot \color{blue}{\left(1 + x\right)} \]
              2. lower-+.f6462.8%

                \[\leadsto y \cdot \left(1 + \color{blue}{x}\right) \]
            4. Applied rewrites62.8%

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

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

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

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

                \[\leadsto \left(x + 1\right) \cdot \color{blue}{y} \]
              5. distribute-lft1-inN/A

                \[\leadsto x \cdot y + \color{blue}{y} \]
              6. lower-+.f64N/A

                \[\leadsto x \cdot y + \color{blue}{y} \]
              7. *-commutativeN/A

                \[\leadsto y \cdot x + y \]
              8. lower-*.f6462.8%

                \[\leadsto y \cdot x + y \]
            6. Applied rewrites62.8%

              \[\leadsto y \cdot x + \color{blue}{y} \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 4: 98.4% accurate, 0.6× speedup?

          \[\begin{array}{l} t_0 := y \cdot \left(1 + x\right)\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+23}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.65:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
          (FPCore (x y)
            :precision binary64
            (let* ((t_0 (* y (+ 1.0 x))))
            (if (<= y -3.8e+23) t_0 (if (<= y 1.65) (- y x) t_0))))
          double code(double x, double y) {
          	double t_0 = y * (1.0 + x);
          	double tmp;
          	if (y <= -3.8e+23) {
          		tmp = t_0;
          	} else if (y <= 1.65) {
          		tmp = y - x;
          	} else {
          		tmp = t_0;
          	}
          	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) :: t_0
              real(8) :: tmp
              t_0 = y * (1.0d0 + x)
              if (y <= (-3.8d+23)) then
                  tmp = t_0
              else if (y <= 1.65d0) then
                  tmp = y - x
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double t_0 = y * (1.0 + x);
          	double tmp;
          	if (y <= -3.8e+23) {
          		tmp = t_0;
          	} else if (y <= 1.65) {
          		tmp = y - x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	t_0 = y * (1.0 + x)
          	tmp = 0
          	if y <= -3.8e+23:
          		tmp = t_0
          	elif y <= 1.65:
          		tmp = y - x
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y)
          	t_0 = Float64(y * Float64(1.0 + x))
          	tmp = 0.0
          	if (y <= -3.8e+23)
          		tmp = t_0;
          	elseif (y <= 1.65)
          		tmp = Float64(y - x);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	t_0 = y * (1.0 + x);
          	tmp = 0.0;
          	if (y <= -3.8e+23)
          		tmp = t_0;
          	elseif (y <= 1.65)
          		tmp = y - x;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(y * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e+23], t$95$0, If[LessEqual[y, 1.65], N[(y - x), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          t_0 := y \cdot \left(1 + x\right)\\
          \mathbf{if}\;y \leq -3.8 \cdot 10^{+23}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y \leq 1.65:\\
          \;\;\;\;y - x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -3.7999999999999997e23 or 1.6499999999999999 < y

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{-1 \cdot x} \]
            3. Step-by-step derivation
              1. lower-*.f6438.7%

                \[\leadsto -1 \cdot \color{blue}{x} \]
            4. Applied rewrites38.7%

              \[\leadsto \color{blue}{-1 \cdot x} \]
            5. Taylor expanded in x around 0

              \[\leadsto \color{blue}{y} \]
            6. Step-by-step derivation
              1. Applied rewrites39.2%

                \[\leadsto \color{blue}{y} \]
              2. Taylor expanded in y around inf

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

                  \[\leadsto y \cdot \color{blue}{\left(1 + x\right)} \]
                2. lower-+.f6462.8%

                  \[\leadsto y \cdot \left(1 + \color{blue}{x}\right) \]
              4. Applied rewrites62.8%

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

              if -3.7999999999999997e23 < y < 1.6499999999999999

              1. Initial program 100.0%

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

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

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

              Alternative 5: 86.8% accurate, 0.3× speedup?

              \[\begin{array}{l} t_0 := \left(x + 1\right) \cdot y - x\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;t\_0 \leq 8 \cdot 10^{+298}:\\ \;\;\;\;y - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
              (FPCore (x y)
                :precision binary64
                (let* ((t_0 (- (* (+ x 1.0) y) x)))
                (if (<= t_0 (- INFINITY))
                  (* x y)
                  (if (<= t_0 8e+298) (- y x) (* x y)))))
              double code(double x, double y) {
              	double t_0 = ((x + 1.0) * y) - x;
              	double tmp;
              	if (t_0 <= -((double) INFINITY)) {
              		tmp = x * y;
              	} else if (t_0 <= 8e+298) {
              		tmp = y - x;
              	} else {
              		tmp = x * y;
              	}
              	return tmp;
              }
              
              public static double code(double x, double y) {
              	double t_0 = ((x + 1.0) * y) - x;
              	double tmp;
              	if (t_0 <= -Double.POSITIVE_INFINITY) {
              		tmp = x * y;
              	} else if (t_0 <= 8e+298) {
              		tmp = y - x;
              	} else {
              		tmp = x * y;
              	}
              	return tmp;
              }
              
              def code(x, y):
              	t_0 = ((x + 1.0) * y) - x
              	tmp = 0
              	if t_0 <= -math.inf:
              		tmp = x * y
              	elif t_0 <= 8e+298:
              		tmp = y - x
              	else:
              		tmp = x * y
              	return tmp
              
              function code(x, y)
              	t_0 = Float64(Float64(Float64(x + 1.0) * y) - x)
              	tmp = 0.0
              	if (t_0 <= Float64(-Inf))
              		tmp = Float64(x * y);
              	elseif (t_0 <= 8e+298)
              		tmp = Float64(y - x);
              	else
              		tmp = Float64(x * y);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	t_0 = ((x + 1.0) * y) - x;
              	tmp = 0.0;
              	if (t_0 <= -Inf)
              		tmp = x * y;
              	elseif (t_0 <= 8e+298)
              		tmp = y - x;
              	else
              		tmp = x * y;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x + 1.0), $MachinePrecision] * y), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(x * y), $MachinePrecision], If[LessEqual[t$95$0, 8e+298], N[(y - x), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
              
              \begin{array}{l}
              t_0 := \left(x + 1\right) \cdot y - x\\
              \mathbf{if}\;t\_0 \leq -\infty:\\
              \;\;\;\;x \cdot y\\
              
              \mathbf{elif}\;t\_0 \leq 8 \cdot 10^{+298}:\\
              \;\;\;\;y - x\\
              
              \mathbf{else}:\\
              \;\;\;\;x \cdot y\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (-.f64 (*.f64 (+.f64 x #s(literal 1 binary64)) y) x) < -inf.0 or 7.9999999999999997e298 < (-.f64 (*.f64 (+.f64 x #s(literal 1 binary64)) y) x)

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{-1 \cdot x} \]
                3. Step-by-step derivation
                  1. lower-*.f6438.7%

                    \[\leadsto -1 \cdot \color{blue}{x} \]
                4. Applied rewrites38.7%

                  \[\leadsto \color{blue}{-1 \cdot x} \]
                5. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{y} \]
                6. Step-by-step derivation
                  1. Applied rewrites39.2%

                    \[\leadsto \color{blue}{y} \]
                  2. Taylor expanded in y around inf

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

                      \[\leadsto y \cdot \color{blue}{\left(1 + x\right)} \]
                    2. lower-+.f6462.8%

                      \[\leadsto y \cdot \left(1 + \color{blue}{x}\right) \]
                  4. Applied rewrites62.8%

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

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

                      \[\leadsto x \cdot y \]
                  7. Applied rewrites26.1%

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

                  if -inf.0 < (-.f64 (*.f64 (+.f64 x #s(literal 1 binary64)) y) x) < 7.9999999999999997e298

                  1. Initial program 100.0%

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

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

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

                  Alternative 6: 75.7% accurate, 3.0× speedup?

                  \[y - x \]
                  (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 - x)
                  end
                  
                  function tmp = code(x, y)
                  	tmp = y - x;
                  end
                  
                  code[x_, y_] := N[(y - x), $MachinePrecision]
                  
                  y - x
                  
                  Derivation
                  1. Initial program 100.0%

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

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

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

                    Alternative 7: 61.8% accurate, 0.8× speedup?

                    \[\begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{-36}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-108}:\\ \;\;\;\;-x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
                    (FPCore (x y)
                      :precision binary64
                      (if (<= y -1.5e-36) y (if (<= y 2.75e-108) (- x) y)))
                    double code(double x, double y) {
                    	double tmp;
                    	if (y <= -1.5e-36) {
                    		tmp = y;
                    	} else if (y <= 2.75e-108) {
                    		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 (y <= (-1.5d-36)) then
                            tmp = y
                        else if (y <= 2.75d-108) then
                            tmp = -x
                        else
                            tmp = y
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y) {
                    	double tmp;
                    	if (y <= -1.5e-36) {
                    		tmp = y;
                    	} else if (y <= 2.75e-108) {
                    		tmp = -x;
                    	} else {
                    		tmp = y;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y):
                    	tmp = 0
                    	if y <= -1.5e-36:
                    		tmp = y
                    	elif y <= 2.75e-108:
                    		tmp = -x
                    	else:
                    		tmp = y
                    	return tmp
                    
                    function code(x, y)
                    	tmp = 0.0
                    	if (y <= -1.5e-36)
                    		tmp = y;
                    	elseif (y <= 2.75e-108)
                    		tmp = Float64(-x);
                    	else
                    		tmp = y;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y)
                    	tmp = 0.0;
                    	if (y <= -1.5e-36)
                    		tmp = y;
                    	elseif (y <= 2.75e-108)
                    		tmp = -x;
                    	else
                    		tmp = y;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_] := If[LessEqual[y, -1.5e-36], y, If[LessEqual[y, 2.75e-108], (-x), y]]
                    
                    \begin{array}{l}
                    \mathbf{if}\;y \leq -1.5 \cdot 10^{-36}:\\
                    \;\;\;\;y\\
                    
                    \mathbf{elif}\;y \leq 2.75 \cdot 10^{-108}:\\
                    \;\;\;\;-x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;y\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y < -1.5000000000000001e-36 or 2.7500000000000002e-108 < y

                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{-1 \cdot x} \]
                      3. Step-by-step derivation
                        1. lower-*.f6438.7%

                          \[\leadsto -1 \cdot \color{blue}{x} \]
                      4. Applied rewrites38.7%

                        \[\leadsto \color{blue}{-1 \cdot x} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{y} \]
                      6. Step-by-step derivation
                        1. Applied rewrites39.2%

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

                        if -1.5000000000000001e-36 < y < 2.7500000000000002e-108

                        1. Initial program 100.0%

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

                          \[\leadsto \color{blue}{-1 \cdot x} \]
                        3. Step-by-step derivation
                          1. lower-*.f6438.7%

                            \[\leadsto -1 \cdot \color{blue}{x} \]
                        4. Applied rewrites38.7%

                          \[\leadsto \color{blue}{-1 \cdot x} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto -1 \cdot \color{blue}{x} \]
                          2. mul-1-negN/A

                            \[\leadsto \mathsf{neg}\left(x\right) \]
                          3. lower-neg.f6438.7%

                            \[\leadsto -x \]
                        6. Applied rewrites38.7%

                          \[\leadsto -x \]
                      7. Recombined 2 regimes into one program.
                      8. Add Preprocessing

                      Alternative 8: 39.2% accurate, 12.0× speedup?

                      \[y \]
                      (FPCore (x y)
                        :precision binary64
                        y)
                      double code(double x, double y) {
                      	return 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 = y
                      end function
                      
                      public static double code(double x, double y) {
                      	return y;
                      }
                      
                      def code(x, y):
                      	return y
                      
                      function code(x, y)
                      	return y
                      end
                      
                      function tmp = code(x, y)
                      	tmp = y;
                      end
                      
                      code[x_, y_] := y
                      
                      y
                      
                      Derivation
                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{-1 \cdot x} \]
                      3. Step-by-step derivation
                        1. lower-*.f6438.7%

                          \[\leadsto -1 \cdot \color{blue}{x} \]
                      4. Applied rewrites38.7%

                        \[\leadsto \color{blue}{-1 \cdot x} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{y} \]
                      6. Step-by-step derivation
                        1. Applied rewrites39.2%

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

                        Reproduce

                        ?
                        herbie shell --seed 2025258 
                        (FPCore (x y)
                          :name "Data.Colour.SRGB:transferFunction from colour-2.3.3"
                          :precision binary64
                          (- (* (+ x 1.0) y) x))