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

Percentage Accurate: 100.0% → 100.0%
Time: 8.6s
Alternatives: 8
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.8× speedup?

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

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

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

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

      \[\leadsto \left(x + y\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + 1\right)} \]
    3. distribute-rgt-inN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(x + y\right) + 1 \cdot \left(x + y\right)} \]
    4. *-lft-identityN/A

      \[\leadsto \left(\mathsf{neg}\left(z\right)\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right)} \]
    5. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), x + y, x + y\right)} \]
    6. neg-sub0N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{0 - z}, x + y, x + y\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{0 - z}, x + y, x + y\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{fma}\left(0 - z, \color{blue}{x + y}, x + y\right) \]
    9. +-lowering-+.f64100.0

      \[\leadsto \mathsf{fma}\left(0 - z, x + y, \color{blue}{x + y}\right) \]
  4. Applied egg-rr100.0%

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

Alternative 2: 52.0% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\


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

    1. Initial program 100.0%

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

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

        \[\leadsto \left(x + y\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + 1\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(x + y\right) + 1 \cdot \left(x + y\right)} \]
      4. *-lft-identityN/A

        \[\leadsto \left(\mathsf{neg}\left(z\right)\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right)} \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), x + y, x + y\right)} \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{0 - z}, x + y, x + y\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{0 - z}, x + y, x + y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fma}\left(0 - z, \color{blue}{x + y}, x + y\right) \]
      9. +-lowering-+.f64100.0

        \[\leadsto \mathsf{fma}\left(0 - z, x + y, \color{blue}{x + y}\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{fma}\left(0 - z, x + y, \color{blue}{x}\right) \]
    6. Step-by-step derivation
      1. Simplified74.3%

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

        \[\leadsto \mathsf{fma}\left(0 - z, \color{blue}{x}, x\right) \]
      3. Step-by-step derivation
        1. Simplified48.3%

          \[\leadsto \mathsf{fma}\left(0 - z, \color{blue}{x}, x\right) \]
        2. Step-by-step derivation
          1. sub0-negN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, x, x\right) \]
          2. neg-lowering-neg.f6448.3

            \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, x, x\right) \]
        3. Applied egg-rr48.3%

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

        if -2e-257 < (+.f64 x y)

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{y} \cdot \left(1 - z\right) \]
        4. Step-by-step derivation
          1. Simplified47.2%

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

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

        Alternative 3: 52.0% accurate, 0.7× speedup?

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

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{x} \cdot \left(1 - z\right) \]
          4. Step-by-step derivation
            1. Simplified48.3%

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

            if -2e-257 < (+.f64 x y)

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{y} \cdot \left(1 - z\right) \]
            4. Step-by-step derivation
              1. Simplified47.2%

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

            Alternative 4: 51.7% accurate, 0.7× speedup?

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

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{x} \cdot \left(1 - z\right) \]
              4. Step-by-step derivation
                1. Simplified48.3%

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

                if -2e-257 < (+.f64 x y)

                1. Initial program 100.0%

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

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

                    \[\leadsto \color{blue}{y + x} \]
                  2. +-lowering-+.f6459.2

                    \[\leadsto \color{blue}{y + x} \]
                5. Simplified59.2%

                  \[\leadsto \color{blue}{y + x} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification53.9%

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

              Alternative 5: 26.3% accurate, 0.7× speedup?

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

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x} \cdot \left(1 - z\right) \]
                4. Step-by-step derivation
                  1. Simplified48.4%

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

                    \[\leadsto \color{blue}{x} \]
                  3. Step-by-step derivation
                    1. Simplified22.9%

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

                    if -1e-209 < (*.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) z))

                    1. Initial program 100.0%

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

                      \[\leadsto \color{blue}{y} \cdot \left(1 - z\right) \]
                    4. Step-by-step derivation
                      1. Simplified47.3%

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

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

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

                      Alternative 6: 100.0% accurate, 1.0× speedup?

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

                        \[\left(x + y\right) \cdot \left(1 - z\right) \]
                      2. Add Preprocessing
                      3. Add Preprocessing

                      Alternative 7: 50.8% accurate, 3.0× speedup?

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

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

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

                          \[\leadsto \color{blue}{y + x} \]
                        2. +-lowering-+.f6453.3

                          \[\leadsto \color{blue}{y + x} \]
                      5. Simplified53.3%

                        \[\leadsto \color{blue}{y + x} \]
                      6. Final simplification53.3%

                        \[\leadsto x + y \]
                      7. Add Preprocessing

                      Alternative 8: 26.4% accurate, 12.0× speedup?

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

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

                        \[\leadsto \color{blue}{x} \cdot \left(1 - z\right) \]
                      4. Step-by-step derivation
                        1. Simplified51.7%

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

                          \[\leadsto \color{blue}{x} \]
                        3. Step-by-step derivation
                          1. Simplified27.5%

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

                          Reproduce

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