Optimisation.CirclePacking:place from circle-packing-0.1.0.4, I

Percentage Accurate: 100.0% → 100.0%
Time: 1.7s
Alternatives: 5
Speedup: 1.0×

Specification

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

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

Alternative 1: 98.4% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{min}\left(x, z\right) + \mathsf{min}\left(y, \mathsf{max}\left(x, z\right)\right)\\ t_1 := \mathsf{max}\left(y, \mathsf{max}\left(x, z\right)\right)\\ \mathbf{if}\;t\_0 + t\_1 \leq -1 \cdot 10^{-249}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (+ (fmin x z) (fmin y (fmax x z))))
       (t_1 (fmax y (fmax x z))))
  (if (<= (+ t_0 t_1) -1e-249) t_0 t_1)))
double code(double x, double y, double z) {
	double t_0 = fmin(x, z) + fmin(y, fmax(x, z));
	double t_1 = fmax(y, fmax(x, z));
	double tmp;
	if ((t_0 + t_1) <= -1e-249) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = fmin(x, z) + fmin(y, fmax(x, z))
    t_1 = fmax(y, fmax(x, z))
    if ((t_0 + t_1) <= (-1d-249)) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = fmin(x, z) + fmin(y, fmax(x, z));
	double t_1 = fmax(y, fmax(x, z));
	double tmp;
	if ((t_0 + t_1) <= -1e-249) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = fmin(x, z) + fmin(y, fmax(x, z))
	t_1 = fmax(y, fmax(x, z))
	tmp = 0
	if (t_0 + t_1) <= -1e-249:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(fmin(x, z) + fmin(y, fmax(x, z)))
	t_1 = fmax(y, fmax(x, z))
	tmp = 0.0
	if (Float64(t_0 + t_1) <= -1e-249)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = min(x, z) + min(y, max(x, z));
	t_1 = max(y, max(x, z));
	tmp = 0.0;
	if ((t_0 + t_1) <= -1e-249)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Min[x, z], $MachinePrecision] + N[Min[y, N[Max[x, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Max[y, N[Max[x, z], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$0 + t$95$1), $MachinePrecision], -1e-249], t$95$0, t$95$1]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(x, z\right) + \mathsf{min}\left(y, \mathsf{max}\left(x, z\right)\right)\\
t_1 := \mathsf{max}\left(y, \mathsf{max}\left(x, z\right)\right)\\
\mathbf{if}\;t\_0 + t\_1 \leq -1 \cdot 10^{-249}:\\
\;\;\;\;t\_0\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 x y) z) < -1.0000000000000001e-249

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + z} \]
    3. Step-by-step derivation
      1. lower-+.f6466.9%

        \[\leadsto x + \color{blue}{z} \]
    4. Applied rewrites66.9%

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

      \[\leadsto z \]
    6. Step-by-step derivation
      1. Applied rewrites33.3%

        \[\leadsto z \]
      2. Taylor expanded in z around 0

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

          \[\leadsto x + \color{blue}{y} \]
      4. Applied rewrites67.7%

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

      if -1.0000000000000001e-249 < (+.f64 (+.f64 x y) z)

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{x + z} \]
      3. Step-by-step derivation
        1. lower-+.f6466.9%

          \[\leadsto x + \color{blue}{z} \]
      4. Applied rewrites66.9%

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

        \[\leadsto z \]
      6. Step-by-step derivation
        1. Applied rewrites33.3%

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

      Alternative 2: 97.6% accurate, 0.0× speedup?

      \[\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) + \mathsf{max}\left(\mathsf{max}\left(x, y\right), \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\right) \]
      (FPCore (x y z)
        :precision binary64
        (+ (fmin (fmin x y) z) (fmax (fmax x y) (fmax (fmin x y) z))))
      double code(double x, double y, double z) {
      	return fmin(fmin(x, y), z) + fmax(fmax(x, y), fmax(fmin(x, y), z));
      }
      
      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, z)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          code = fmin(fmin(x, y), z) + fmax(fmax(x, y), fmax(fmin(x, y), z))
      end function
      
      public static double code(double x, double y, double z) {
      	return fmin(fmin(x, y), z) + fmax(fmax(x, y), fmax(fmin(x, y), z));
      }
      
      def code(x, y, z):
      	return fmin(fmin(x, y), z) + fmax(fmax(x, y), fmax(fmin(x, y), z))
      
      function code(x, y, z)
      	return Float64(fmin(fmin(x, y), z) + fmax(fmax(x, y), fmax(fmin(x, y), z)))
      end
      
      function tmp = code(x, y, z)
      	tmp = min(min(x, y), z) + max(max(x, y), max(min(x, y), z));
      end
      
      code[x_, y_, z_] := N[(N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision] + N[Max[N[Max[x, y], $MachinePrecision], N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
      
      \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) + \mathsf{max}\left(\mathsf{max}\left(x, y\right), \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\right)
      
      Derivation
      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{x + z} \]
      3. Step-by-step derivation
        1. lower-+.f6466.9%

          \[\leadsto x + \color{blue}{z} \]
      4. Applied rewrites66.9%

        \[\leadsto \color{blue}{x + z} \]
      5. Add Preprocessing

      Alternative 3: 49.0% accurate, 0.0× speedup?

      \[\mathsf{max}\left(y, \mathsf{max}\left(x, z\right)\right) \]
      (FPCore (x y z)
        :precision binary64
        (fmax y (fmax x z)))
      double code(double x, double y, double z) {
      	return fmax(y, fmax(x, z));
      }
      
      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, z)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          code = fmax(y, fmax(x, z))
      end function
      
      public static double code(double x, double y, double z) {
      	return fmax(y, fmax(x, z));
      }
      
      def code(x, y, z):
      	return fmax(y, fmax(x, z))
      
      function code(x, y, z)
      	return fmax(y, fmax(x, z))
      end
      
      function tmp = code(x, y, z)
      	tmp = max(y, max(x, z));
      end
      
      code[x_, y_, z_] := N[Max[y, N[Max[x, z], $MachinePrecision]], $MachinePrecision]
      
      \mathsf{max}\left(y, \mathsf{max}\left(x, z\right)\right)
      
      Derivation
      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{x + z} \]
      3. Step-by-step derivation
        1. lower-+.f6466.9%

          \[\leadsto x + \color{blue}{z} \]
      4. Applied rewrites66.9%

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

        \[\leadsto z \]
      6. Step-by-step derivation
        1. Applied rewrites33.3%

          \[\leadsto z \]
        2. Add Preprocessing

        Alternative 4: 34.1% accurate, 0.1× speedup?

        \[\mathsf{min}\left(y, z\right) \]
        (FPCore (x y z)
          :precision binary64
          (fmin y z))
        double code(double x, double y, double z) {
        	return fmin(y, z);
        }
        
        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, z)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            code = fmin(y, z)
        end function
        
        public static double code(double x, double y, double z) {
        	return fmin(y, z);
        }
        
        def code(x, y, z):
        	return fmin(y, z)
        
        function code(x, y, z)
        	return fmin(y, z)
        end
        
        function tmp = code(x, y, z)
        	tmp = min(y, z);
        end
        
        code[x_, y_, z_] := N[Min[y, z], $MachinePrecision]
        
        \mathsf{min}\left(y, z\right)
        
        Derivation
        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{x + z} \]
        3. Step-by-step derivation
          1. lower-+.f6466.9%

            \[\leadsto x + \color{blue}{z} \]
        4. Applied rewrites66.9%

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

          \[\leadsto z \]
        6. Step-by-step derivation
          1. Applied rewrites33.3%

            \[\leadsto z \]
          2. Taylor expanded in y around inf

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

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

            Reproduce

            ?
            herbie shell --seed 2025258 
            (FPCore (x y z)
              :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, I"
              :precision binary64
              (+ (+ x y) z))