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

Percentage Accurate: 100.0% → 100.0%
Time: 4.5s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 100.0% accurate, 0.8× speedup?

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

\\
z \cdot \left(x + y\right) + \left(x + y\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(x + y\right) \cdot \left(z + 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-commutative100.0%

      \[\leadsto \left(x + y\right) \cdot \color{blue}{\left(1 + z\right)} \]
    2. distribute-lft-in100.0%

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

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

    \[\leadsto \color{blue}{\left(x + y\right) + \left(x + y\right) \cdot z} \]
  5. Final simplification100.0%

    \[\leadsto z \cdot \left(x + y\right) + \left(x + y\right) \]
  6. Add Preprocessing

Alternative 2: 51.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-214}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+157}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.0)
   (* x z)
   (if (<= z -1.16e-58)
     x
     (if (<= z -1.22e-214)
       y
       (if (<= z 8.5e-82)
         x
         (if (<= z 1.36e-8) y (if (<= z 9e+157) (* y z) (* x z))))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= -1.16e-58) {
		tmp = x;
	} else if (z <= -1.22e-214) {
		tmp = y;
	} else if (z <= 8.5e-82) {
		tmp = x;
	} else if (z <= 1.36e-8) {
		tmp = y;
	} else if (z <= 9e+157) {
		tmp = y * z;
	} else {
		tmp = x * 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 (z <= (-1.0d0)) then
        tmp = x * z
    else if (z <= (-1.16d-58)) then
        tmp = x
    else if (z <= (-1.22d-214)) then
        tmp = y
    else if (z <= 8.5d-82) then
        tmp = x
    else if (z <= 1.36d-8) then
        tmp = y
    else if (z <= 9d+157) then
        tmp = y * z
    else
        tmp = x * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= -1.16e-58) {
		tmp = x;
	} else if (z <= -1.22e-214) {
		tmp = y;
	} else if (z <= 8.5e-82) {
		tmp = x;
	} else if (z <= 1.36e-8) {
		tmp = y;
	} else if (z <= 9e+157) {
		tmp = y * z;
	} else {
		tmp = x * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.0:
		tmp = x * z
	elif z <= -1.16e-58:
		tmp = x
	elif z <= -1.22e-214:
		tmp = y
	elif z <= 8.5e-82:
		tmp = x
	elif z <= 1.36e-8:
		tmp = y
	elif z <= 9e+157:
		tmp = y * z
	else:
		tmp = x * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.0)
		tmp = Float64(x * z);
	elseif (z <= -1.16e-58)
		tmp = x;
	elseif (z <= -1.22e-214)
		tmp = y;
	elseif (z <= 8.5e-82)
		tmp = x;
	elseif (z <= 1.36e-8)
		tmp = y;
	elseif (z <= 9e+157)
		tmp = Float64(y * z);
	else
		tmp = Float64(x * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.0)
		tmp = x * z;
	elseif (z <= -1.16e-58)
		tmp = x;
	elseif (z <= -1.22e-214)
		tmp = y;
	elseif (z <= 8.5e-82)
		tmp = x;
	elseif (z <= 1.36e-8)
		tmp = y;
	elseif (z <= 9e+157)
		tmp = y * z;
	else
		tmp = x * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(x * z), $MachinePrecision], If[LessEqual[z, -1.16e-58], x, If[LessEqual[z, -1.22e-214], y, If[LessEqual[z, 8.5e-82], x, If[LessEqual[z, 1.36e-8], y, If[LessEqual[z, 9e+157], N[(y * z), $MachinePrecision], N[(x * z), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;z \leq -1.16 \cdot 10^{-58}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -1.22 \cdot 10^{-214}:\\
\;\;\;\;y\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-82}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\
\;\;\;\;y\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+157}:\\
\;\;\;\;y \cdot z\\

\mathbf{else}:\\
\;\;\;\;x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1 or 8.9999999999999997e157 < z

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in44.5%

        \[\leadsto \color{blue}{x \cdot z + x \cdot 1} \]
      3. *-rgt-identity44.5%

        \[\leadsto x \cdot z + \color{blue}{x} \]
    5. Applied egg-rr44.5%

      \[\leadsto \color{blue}{x \cdot z + x} \]
    6. Taylor expanded in z around inf 44.3%

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

    if -1 < z < -1.16000000000000007e-58 or -1.22000000000000004e-214 < z < 8.4999999999999997e-82

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 49.9%

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

    if -1.16000000000000007e-58 < z < -1.22000000000000004e-214 or 8.4999999999999997e-82 < z < 1.3599999999999999e-8

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{y \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 51.5%

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

    if 1.3599999999999999e-8 < z < 8.9999999999999997e157

    1. Initial program 100.0%

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

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

        \[\leadsto y \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in58.4%

        \[\leadsto \color{blue}{y \cdot z + y \cdot 1} \]
      3. *-rgt-identity58.4%

        \[\leadsto y \cdot z + \color{blue}{y} \]
    5. Applied egg-rr58.4%

      \[\leadsto \color{blue}{y \cdot z + y} \]
    6. Taylor expanded in z around inf 46.8%

      \[\leadsto \color{blue}{y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative46.8%

        \[\leadsto \color{blue}{z \cdot y} \]
    8. Simplified46.8%

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification47.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{-214}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+157}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-215}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.0)
   (* x z)
   (if (<= z -1.35e-58)
     x
     (if (<= z -5.4e-215)
       y
       (if (<= z 3.8e-82) x (if (<= z 1.36e-8) y (* x z)))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= -1.35e-58) {
		tmp = x;
	} else if (z <= -5.4e-215) {
		tmp = y;
	} else if (z <= 3.8e-82) {
		tmp = x;
	} else if (z <= 1.36e-8) {
		tmp = y;
	} else {
		tmp = x * 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 (z <= (-1.0d0)) then
        tmp = x * z
    else if (z <= (-1.35d-58)) then
        tmp = x
    else if (z <= (-5.4d-215)) then
        tmp = y
    else if (z <= 3.8d-82) then
        tmp = x
    else if (z <= 1.36d-8) then
        tmp = y
    else
        tmp = x * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= -1.35e-58) {
		tmp = x;
	} else if (z <= -5.4e-215) {
		tmp = y;
	} else if (z <= 3.8e-82) {
		tmp = x;
	} else if (z <= 1.36e-8) {
		tmp = y;
	} else {
		tmp = x * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.0:
		tmp = x * z
	elif z <= -1.35e-58:
		tmp = x
	elif z <= -5.4e-215:
		tmp = y
	elif z <= 3.8e-82:
		tmp = x
	elif z <= 1.36e-8:
		tmp = y
	else:
		tmp = x * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.0)
		tmp = Float64(x * z);
	elseif (z <= -1.35e-58)
		tmp = x;
	elseif (z <= -5.4e-215)
		tmp = y;
	elseif (z <= 3.8e-82)
		tmp = x;
	elseif (z <= 1.36e-8)
		tmp = y;
	else
		tmp = Float64(x * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.0)
		tmp = x * z;
	elseif (z <= -1.35e-58)
		tmp = x;
	elseif (z <= -5.4e-215)
		tmp = y;
	elseif (z <= 3.8e-82)
		tmp = x;
	elseif (z <= 1.36e-8)
		tmp = y;
	else
		tmp = x * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(x * z), $MachinePrecision], If[LessEqual[z, -1.35e-58], x, If[LessEqual[z, -5.4e-215], y, If[LessEqual[z, 3.8e-82], x, If[LessEqual[z, 1.36e-8], y, N[(x * z), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-58}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -5.4 \cdot 10^{-215}:\\
\;\;\;\;y\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-82}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\
\;\;\;\;y\\

\mathbf{else}:\\
\;\;\;\;x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1 or 1.3599999999999999e-8 < z

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in44.3%

        \[\leadsto \color{blue}{x \cdot z + x \cdot 1} \]
      3. *-rgt-identity44.3%

        \[\leadsto x \cdot z + \color{blue}{x} \]
    5. Applied egg-rr44.3%

      \[\leadsto \color{blue}{x \cdot z + x} \]
    6. Taylor expanded in z around inf 42.4%

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

    if -1 < z < -1.3499999999999999e-58 or -5.40000000000000035e-215 < z < 3.8000000000000002e-82

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 49.9%

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

    if -1.3499999999999999e-58 < z < -5.40000000000000035e-215 or 3.8000000000000002e-82 < z < 1.3599999999999999e-8

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{y \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 51.5%

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

Alternative 4: 75.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;z \leq -1.5 \cdot 10^{-13}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-10}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+45} \lor \neg \left(z \leq 5.3 \cdot 10^{+157}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ z 1.0))))
   (if (<= z -1.5e-13)
     t_0
     (if (<= z 8.8e-10)
       (+ x y)
       (if (or (<= z 1.2e+45) (not (<= z 5.3e+157))) t_0 (* y z))))))
double code(double x, double y, double z) {
	double t_0 = x * (z + 1.0);
	double tmp;
	if (z <= -1.5e-13) {
		tmp = t_0;
	} else if (z <= 8.8e-10) {
		tmp = x + y;
	} else if ((z <= 1.2e+45) || !(z <= 5.3e+157)) {
		tmp = t_0;
	} else {
		tmp = y * 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) :: t_0
    real(8) :: tmp
    t_0 = x * (z + 1.0d0)
    if (z <= (-1.5d-13)) then
        tmp = t_0
    else if (z <= 8.8d-10) then
        tmp = x + y
    else if ((z <= 1.2d+45) .or. (.not. (z <= 5.3d+157))) then
        tmp = t_0
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x * (z + 1.0);
	double tmp;
	if (z <= -1.5e-13) {
		tmp = t_0;
	} else if (z <= 8.8e-10) {
		tmp = x + y;
	} else if ((z <= 1.2e+45) || !(z <= 5.3e+157)) {
		tmp = t_0;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (z + 1.0)
	tmp = 0
	if z <= -1.5e-13:
		tmp = t_0
	elif z <= 8.8e-10:
		tmp = x + y
	elif (z <= 1.2e+45) or not (z <= 5.3e+157):
		tmp = t_0
	else:
		tmp = y * z
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (z <= -1.5e-13)
		tmp = t_0;
	elseif (z <= 8.8e-10)
		tmp = Float64(x + y);
	elseif ((z <= 1.2e+45) || !(z <= 5.3e+157))
		tmp = t_0;
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (z + 1.0);
	tmp = 0.0;
	if (z <= -1.5e-13)
		tmp = t_0;
	elseif (z <= 8.8e-10)
		tmp = x + y;
	elseif ((z <= 1.2e+45) || ~((z <= 5.3e+157)))
		tmp = t_0;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-13], t$95$0, If[LessEqual[z, 8.8e-10], N[(x + y), $MachinePrecision], If[Or[LessEqual[z, 1.2e+45], N[Not[LessEqual[z, 5.3e+157]], $MachinePrecision]], t$95$0, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{-10}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+45} \lor \neg \left(z \leq 5.3 \cdot 10^{+157}\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.49999999999999992e-13 or 8.7999999999999996e-10 < z < 1.19999999999999995e45 or 5.2999999999999998e157 < z

    1. Initial program 100.0%

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

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

    if -1.49999999999999992e-13 < z < 8.7999999999999996e-10

    1. Initial program 100.0%

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

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

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

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

    if 1.19999999999999995e45 < z < 5.2999999999999998e157

    1. Initial program 100.0%

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

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

        \[\leadsto y \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in60.8%

        \[\leadsto \color{blue}{y \cdot z + y \cdot 1} \]
      3. *-rgt-identity60.8%

        \[\leadsto y \cdot z + \color{blue}{y} \]
    5. Applied egg-rr60.8%

      \[\leadsto \color{blue}{y \cdot z + y} \]
    6. Taylor expanded in z around inf 60.8%

      \[\leadsto \color{blue}{y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative60.8%

        \[\leadsto \color{blue}{z \cdot y} \]
    8. Simplified60.8%

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-10}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+45} \lor \neg \left(z \leq 5.3 \cdot 10^{+157}\right):\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(x + y\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 32000000:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1 or 3.2e7 < z

    1. Initial program 100.0%

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

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

        \[\leadsto z \cdot \color{blue}{\left(y + x\right)} \]
    5. Simplified98.7%

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

    if -1 < z < 2.2999999999999999e-9

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative98.0%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified98.0%

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

    if 2.2999999999999999e-9 < z < 3.2e7

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.9%

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

Alternative 6: 75.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 4500000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+163}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.0)
   (* x z)
   (if (<= z 4500000.0) (+ x y) (if (<= z 8.6e+163) (* y z) (* x z)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= 4500000.0) {
		tmp = x + y;
	} else if (z <= 8.6e+163) {
		tmp = y * z;
	} else {
		tmp = x * 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 (z <= (-1.0d0)) then
        tmp = x * z
    else if (z <= 4500000.0d0) then
        tmp = x + y
    else if (z <= 8.6d+163) then
        tmp = y * z
    else
        tmp = x * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.0) {
		tmp = x * z;
	} else if (z <= 4500000.0) {
		tmp = x + y;
	} else if (z <= 8.6e+163) {
		tmp = y * z;
	} else {
		tmp = x * z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.0:
		tmp = x * z
	elif z <= 4500000.0:
		tmp = x + y
	elif z <= 8.6e+163:
		tmp = y * z
	else:
		tmp = x * z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.0)
		tmp = Float64(x * z);
	elseif (z <= 4500000.0)
		tmp = Float64(x + y);
	elseif (z <= 8.6e+163)
		tmp = Float64(y * z);
	else
		tmp = Float64(x * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.0)
		tmp = x * z;
	elseif (z <= 4500000.0)
		tmp = x + y;
	elseif (z <= 8.6e+163)
		tmp = y * z;
	else
		tmp = x * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(x * z), $MachinePrecision], If[LessEqual[z, 4500000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 8.6e+163], N[(y * z), $MachinePrecision], N[(x * z), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;z \leq 4500000:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 8.6 \cdot 10^{+163}:\\
\;\;\;\;y \cdot z\\

\mathbf{else}:\\
\;\;\;\;x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1 or 8.6000000000000004e163 < z

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in44.5%

        \[\leadsto \color{blue}{x \cdot z + x \cdot 1} \]
      3. *-rgt-identity44.5%

        \[\leadsto x \cdot z + \color{blue}{x} \]
    5. Applied egg-rr44.5%

      \[\leadsto \color{blue}{x \cdot z + x} \]
    6. Taylor expanded in z around inf 44.3%

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

    if -1 < z < 4.5e6

    1. Initial program 100.0%

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

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

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

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

    if 4.5e6 < z < 8.6000000000000004e163

    1. Initial program 100.0%

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

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

        \[\leadsto y \cdot \color{blue}{\left(z + 1\right)} \]
      2. distribute-lft-in58.7%

        \[\leadsto \color{blue}{y \cdot z + y \cdot 1} \]
      3. *-rgt-identity58.7%

        \[\leadsto y \cdot z + \color{blue}{y} \]
    5. Applied egg-rr58.7%

      \[\leadsto \color{blue}{y \cdot z + y} \]
    6. Taylor expanded in z around inf 57.1%

      \[\leadsto \color{blue}{y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative57.1%

        \[\leadsto \color{blue}{z \cdot y} \]
    8. Simplified57.1%

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 4500000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+163}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -5.2e-179) (* x (+ z 1.0)) (* y (+ z 1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -5.2e-179) {
		tmp = x * (z + 1.0);
	} else {
		tmp = y * (z + 1.0);
	}
	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 <= (-5.2d-179)) then
        tmp = x * (z + 1.0d0)
    else
        tmp = y * (z + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -5.2e-179) {
		tmp = x * (z + 1.0);
	} else {
		tmp = y * (z + 1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -5.2e-179:
		tmp = x * (z + 1.0)
	else:
		tmp = y * (z + 1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -5.2e-179)
		tmp = Float64(x * Float64(z + 1.0));
	else
		tmp = Float64(y * Float64(z + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -5.2e-179)
		tmp = x * (z + 1.0);
	else
		tmp = y * (z + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -5.2e-179], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-179}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.20000000000000011e-179

    1. Initial program 100.0%

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

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

    if -5.20000000000000011e-179 < x

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(1 + z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.4%

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

Alternative 8: 100.0% accurate, 1.0× speedup?

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

\\
\left(x + y\right) \cdot \left(z + 1\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

Alternative 9: 32.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.1 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z) :precision binary64 (if (<= y 1.1e-63) x y))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 1.1e-63) {
		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 (y <= 1.1d-63) 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 (y <= 1.1e-63) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 1.1e-63:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 1.1e-63)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 1.1e-63)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 1.1e-63], x, y]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1 \cdot 10^{-63}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.1e-63

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 28.8%

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

    if 1.1e-63 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(1 + z\right)} \]
    4. Taylor expanded in z around 0 36.4%

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

Alternative 10: 26.4% accurate, 7.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(z + 1\right) \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 47.0%

    \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
  4. Taylor expanded in z around 0 24.4%

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

Reproduce

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