Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, A

Percentage Accurate: 100.0% → 100.0%
Time: 1.3s
Alternatives: 4
Speedup: 1.0×

Specification

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

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 76.4% accurate, 0.4× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq -31500000000:\\ \;\;\;\;x + x\\ \mathbf{elif}\;x \leq \frac{329422299073093}{803469022129495137770981046170581301261101496891396417650688}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + x\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (if (<= x -31500000000)
  (+ x x)
  (if (<=
       x
       329422299073093/803469022129495137770981046170581301261101496891396417650688)
    (+ y x)
    (+ x x))))
double code(double x, double y) {
	double tmp;
	if (x <= -31500000000.0) {
		tmp = x + x;
	} else if (x <= 4.1e-46) {
		tmp = y + x;
	} else {
		tmp = x + x;
	}
	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 <= (-31500000000.0d0)) then
        tmp = x + x
    else if (x <= 4.1d-46) then
        tmp = y + x
    else
        tmp = x + x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -31500000000.0) {
		tmp = x + x;
	} else if (x <= 4.1e-46) {
		tmp = y + x;
	} else {
		tmp = x + x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -31500000000.0:
		tmp = x + x
	elif x <= 4.1e-46:
		tmp = y + x
	else:
		tmp = x + x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -31500000000.0)
		tmp = Float64(x + x);
	elseif (x <= 4.1e-46)
		tmp = Float64(y + x);
	else
		tmp = Float64(x + x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -31500000000.0)
		tmp = x + x;
	elseif (x <= 4.1e-46)
		tmp = y + x;
	else
		tmp = x + x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -31500000000], N[(x + x), $MachinePrecision], If[LessEqual[x, 329422299073093/803469022129495137770981046170581301261101496891396417650688], N[(y + x), $MachinePrecision], N[(x + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -31500000000:\\
\;\;\;\;x + x\\

\mathbf{elif}\;x \leq \frac{329422299073093}{803469022129495137770981046170581301261101496891396417650688}:\\
\;\;\;\;y + x\\

\mathbf{else}:\\
\;\;\;\;x + x\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.15e10 or 4.0999999999999999e-46 < x

    1. Initial program 100.0%

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

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

        \[\leadsto 2 \cdot \color{blue}{x} \]
    4. Applied rewrites50.3%

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

        \[\leadsto 2 \cdot \color{blue}{x} \]
      2. count-2-revN/A

        \[\leadsto x + \color{blue}{x} \]
      3. lift-+.f6450.3%

        \[\leadsto x + \color{blue}{x} \]
    6. Applied rewrites50.3%

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

    if -3.15e10 < x < 4.0999999999999999e-46

    1. Initial program 100.0%

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

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

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

    Alternative 3: 74.8% accurate, 0.4× speedup?

    \[\begin{array}{l} \mathbf{if}\;x \leq -31500000000:\\ \;\;\;\;x + x\\ \mathbf{elif}\;x \leq \frac{329422299073093}{803469022129495137770981046170581301261101496891396417650688}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x + x\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (if (<= x -31500000000)
      (+ x x)
      (if (<=
           x
           329422299073093/803469022129495137770981046170581301261101496891396417650688)
        y
        (+ x x))))
    double code(double x, double y) {
    	double tmp;
    	if (x <= -31500000000.0) {
    		tmp = x + x;
    	} else if (x <= 4.1e-46) {
    		tmp = y;
    	} else {
    		tmp = x + x;
    	}
    	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 <= (-31500000000.0d0)) then
            tmp = x + x
        else if (x <= 4.1d-46) then
            tmp = y
        else
            tmp = x + x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (x <= -31500000000.0) {
    		tmp = x + x;
    	} else if (x <= 4.1e-46) {
    		tmp = y;
    	} else {
    		tmp = x + x;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if x <= -31500000000.0:
    		tmp = x + x
    	elif x <= 4.1e-46:
    		tmp = y
    	else:
    		tmp = x + x
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (x <= -31500000000.0)
    		tmp = Float64(x + x);
    	elseif (x <= 4.1e-46)
    		tmp = y;
    	else
    		tmp = Float64(x + x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (x <= -31500000000.0)
    		tmp = x + x;
    	elseif (x <= 4.1e-46)
    		tmp = y;
    	else
    		tmp = x + x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[x, -31500000000], N[(x + x), $MachinePrecision], If[LessEqual[x, 329422299073093/803469022129495137770981046170581301261101496891396417650688], y, N[(x + x), $MachinePrecision]]]
    
    \begin{array}{l}
    \mathbf{if}\;x \leq -31500000000:\\
    \;\;\;\;x + x\\
    
    \mathbf{elif}\;x \leq \frac{329422299073093}{803469022129495137770981046170581301261101496891396417650688}:\\
    \;\;\;\;y\\
    
    \mathbf{else}:\\
    \;\;\;\;x + x\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -3.15e10 or 4.0999999999999999e-46 < x

      1. Initial program 100.0%

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

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

          \[\leadsto 2 \cdot \color{blue}{x} \]
      4. Applied rewrites50.3%

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

          \[\leadsto 2 \cdot \color{blue}{x} \]
        2. count-2-revN/A

          \[\leadsto x + \color{blue}{x} \]
        3. lift-+.f6450.3%

          \[\leadsto x + \color{blue}{x} \]
      6. Applied rewrites50.3%

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

      if -3.15e10 < x < 4.0999999999999999e-46

      1. Initial program 100.0%

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

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

          \[\leadsto 2 \cdot \color{blue}{x} \]
      4. Applied rewrites50.3%

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

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

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

      Alternative 4: 51.1% accurate, 7.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 + y\right) + x \]
      2. Taylor expanded in x around inf

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

          \[\leadsto 2 \cdot \color{blue}{x} \]
      4. Applied rewrites50.3%

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

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

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

        Reproduce

        ?
        herbie shell --seed 2025271 -o generate:evaluate
        (FPCore (x y)
          :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, A"
          :precision binary64
          (+ (+ x y) x))