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

Percentage Accurate: 100.0% → 100.0%
Time: 4.4s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

\[\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, 1.0× speedup?

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

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

    \[\left(x + y\right) \cdot \left(1 - z\right) \]
  2. Final simplification100.0%

    \[\leadsto \left(1 - z\right) \cdot \left(x + y\right) \]

Alternative 2: 52.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(1 - z\right)\\ t_1 := x \cdot \left(-z\right)\\ \mathbf{if}\;1 - z \leq -1 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{elif}\;1 - z \leq -2 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;1 - z \leq 1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;1 - z \leq 1.0002:\\ \;\;\;\;x + y\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+86} \lor \neg \left(1 - z \leq 4 \cdot 10^{+113}\right) \land \left(1 - z \leq 2 \cdot 10^{+182} \lor \neg \left(1 - z \leq 2 \cdot 10^{+267}\right)\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (- 1.0 z))) (t_1 (* x (- z))))
   (if (<= (- 1.0 z) -1e+209)
     (* y (- z))
     (if (<= (- 1.0 z) -2e+142)
       t_1
       (if (<= (- 1.0 z) 1.0)
         t_0
         (if (<= (- 1.0 z) 1.0002)
           (+ x y)
           (if (or (<= (- 1.0 z) 5e+86)
                   (and (not (<= (- 1.0 z) 4e+113))
                        (or (<= (- 1.0 z) 2e+182)
                            (not (<= (- 1.0 z) 2e+267)))))
             t_0
             t_1)))))))
double code(double x, double y, double z) {
	double t_0 = y * (1.0 - z);
	double t_1 = x * -z;
	double tmp;
	if ((1.0 - z) <= -1e+209) {
		tmp = y * -z;
	} else if ((1.0 - z) <= -2e+142) {
		tmp = t_1;
	} else if ((1.0 - z) <= 1.0) {
		tmp = t_0;
	} else if ((1.0 - z) <= 1.0002) {
		tmp = x + y;
	} else if (((1.0 - z) <= 5e+86) || (!((1.0 - z) <= 4e+113) && (((1.0 - z) <= 2e+182) || !((1.0 - z) <= 2e+267)))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = y * (1.0d0 - z)
    t_1 = x * -z
    if ((1.0d0 - z) <= (-1d+209)) then
        tmp = y * -z
    else if ((1.0d0 - z) <= (-2d+142)) then
        tmp = t_1
    else if ((1.0d0 - z) <= 1.0d0) then
        tmp = t_0
    else if ((1.0d0 - z) <= 1.0002d0) then
        tmp = x + y
    else if (((1.0d0 - z) <= 5d+86) .or. (.not. ((1.0d0 - z) <= 4d+113)) .and. ((1.0d0 - z) <= 2d+182) .or. (.not. ((1.0d0 - z) <= 2d+267))) 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 = y * (1.0 - z);
	double t_1 = x * -z;
	double tmp;
	if ((1.0 - z) <= -1e+209) {
		tmp = y * -z;
	} else if ((1.0 - z) <= -2e+142) {
		tmp = t_1;
	} else if ((1.0 - z) <= 1.0) {
		tmp = t_0;
	} else if ((1.0 - z) <= 1.0002) {
		tmp = x + y;
	} else if (((1.0 - z) <= 5e+86) || (!((1.0 - z) <= 4e+113) && (((1.0 - z) <= 2e+182) || !((1.0 - z) <= 2e+267)))) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (1.0 - z)
	t_1 = x * -z
	tmp = 0
	if (1.0 - z) <= -1e+209:
		tmp = y * -z
	elif (1.0 - z) <= -2e+142:
		tmp = t_1
	elif (1.0 - z) <= 1.0:
		tmp = t_0
	elif (1.0 - z) <= 1.0002:
		tmp = x + y
	elif ((1.0 - z) <= 5e+86) or (not ((1.0 - z) <= 4e+113) and (((1.0 - z) <= 2e+182) or not ((1.0 - z) <= 2e+267))):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(1.0 - z))
	t_1 = Float64(x * Float64(-z))
	tmp = 0.0
	if (Float64(1.0 - z) <= -1e+209)
		tmp = Float64(y * Float64(-z));
	elseif (Float64(1.0 - z) <= -2e+142)
		tmp = t_1;
	elseif (Float64(1.0 - z) <= 1.0)
		tmp = t_0;
	elseif (Float64(1.0 - z) <= 1.0002)
		tmp = Float64(x + y);
	elseif ((Float64(1.0 - z) <= 5e+86) || (!(Float64(1.0 - z) <= 4e+113) && ((Float64(1.0 - z) <= 2e+182) || !(Float64(1.0 - z) <= 2e+267))))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * (1.0 - z);
	t_1 = x * -z;
	tmp = 0.0;
	if ((1.0 - z) <= -1e+209)
		tmp = y * -z;
	elseif ((1.0 - z) <= -2e+142)
		tmp = t_1;
	elseif ((1.0 - z) <= 1.0)
		tmp = t_0;
	elseif ((1.0 - z) <= 1.0002)
		tmp = x + y;
	elseif (((1.0 - z) <= 5e+86) || (~(((1.0 - z) <= 4e+113)) && (((1.0 - z) <= 2e+182) || ~(((1.0 - z) <= 2e+267)))))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[N[(1.0 - z), $MachinePrecision], -1e+209], N[(y * (-z)), $MachinePrecision], If[LessEqual[N[(1.0 - z), $MachinePrecision], -2e+142], t$95$1, If[LessEqual[N[(1.0 - z), $MachinePrecision], 1.0], t$95$0, If[LessEqual[N[(1.0 - z), $MachinePrecision], 1.0002], N[(x + y), $MachinePrecision], If[Or[LessEqual[N[(1.0 - z), $MachinePrecision], 5e+86], And[N[Not[LessEqual[N[(1.0 - z), $MachinePrecision], 4e+113]], $MachinePrecision], Or[LessEqual[N[(1.0 - z), $MachinePrecision], 2e+182], N[Not[LessEqual[N[(1.0 - z), $MachinePrecision], 2e+267]], $MachinePrecision]]]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;1 - z \leq -2 \cdot 10^{+142}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;1 - z \leq 1:\\
\;\;\;\;t_0\\

\mathbf{elif}\;1 - z \leq 1.0002:\\
\;\;\;\;x + y\\

\mathbf{elif}\;1 - z \leq 5 \cdot 10^{+86} \lor \neg \left(1 - z \leq 4 \cdot 10^{+113}\right) \land \left(1 - z \leq 2 \cdot 10^{+182} \lor \neg \left(1 - z \leq 2 \cdot 10^{+267}\right)\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 1 z) < -1.0000000000000001e209

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(x + y\right)} \]
      2. *-commutative100.0%

        \[\leadsto -\color{blue}{\left(x + y\right) \cdot z} \]
      3. distribute-rgt-neg-out100.0%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*55.1%

        \[\leadsto \color{blue}{\left(-1 \cdot y\right) \cdot z} \]
      2. mul-1-neg55.1%

        \[\leadsto \color{blue}{\left(-y\right)} \cdot z \]
    7. Simplified55.1%

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

    if -1.0000000000000001e209 < (-.f64 1 z) < -2.0000000000000001e142 or 4.9999999999999998e86 < (-.f64 1 z) < 4e113 or 2.0000000000000001e182 < (-.f64 1 z) < 1.9999999999999999e267

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    4. Simplified53.2%

      \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    5. Taylor expanded in z around inf 53.2%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

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

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

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

    if -2.0000000000000001e142 < (-.f64 1 z) < 1 or 1.0002 < (-.f64 1 z) < 4.9999999999999998e86 or 4e113 < (-.f64 1 z) < 2.0000000000000001e182 or 1.9999999999999999e267 < (-.f64 1 z)

    1. Initial program 100.0%

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

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

    if 1 < (-.f64 1 z) < 1.0002

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified86.6%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;1 - z \leq -1 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{elif}\;1 - z \leq -2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;1 - z \leq 1:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{elif}\;1 - z \leq 1.0002:\\ \;\;\;\;x + y\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+86} \lor \neg \left(1 - z \leq 4 \cdot 10^{+113}\right) \land \left(1 - z \leq 2 \cdot 10^{+182} \lor \neg \left(1 - z \leq 2 \cdot 10^{+267}\right)\right):\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]

Alternative 3: 75.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(-z\right)\\ t_1 := x \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -2.15 \cdot 10^{+269}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+184}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{+113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -19:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+138} \lor \neg \left(z \leq 1.95 \cdot 10^{+208}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (- z))) (t_1 (* x (- z))))
   (if (<= z -2.15e+269)
     t_0
     (if (<= z -3e+184)
       t_1
       (if (<= z -5.2e+113)
         t_0
         (if (<= z -8.2e+89)
           t_1
           (if (<= z -19.0)
             t_0
             (if (<= z 1.0)
               (+ x y)
               (if (or (<= z 8e+138) (not (<= z 1.95e+208))) t_0 t_1)))))))))
double code(double x, double y, double z) {
	double t_0 = y * -z;
	double t_1 = x * -z;
	double tmp;
	if (z <= -2.15e+269) {
		tmp = t_0;
	} else if (z <= -3e+184) {
		tmp = t_1;
	} else if (z <= -5.2e+113) {
		tmp = t_0;
	} else if (z <= -8.2e+89) {
		tmp = t_1;
	} else if (z <= -19.0) {
		tmp = t_0;
	} else if (z <= 1.0) {
		tmp = x + y;
	} else if ((z <= 8e+138) || !(z <= 1.95e+208)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = y * -z
    t_1 = x * -z
    if (z <= (-2.15d+269)) then
        tmp = t_0
    else if (z <= (-3d+184)) then
        tmp = t_1
    else if (z <= (-5.2d+113)) then
        tmp = t_0
    else if (z <= (-8.2d+89)) then
        tmp = t_1
    else if (z <= (-19.0d0)) then
        tmp = t_0
    else if (z <= 1.0d0) then
        tmp = x + y
    else if ((z <= 8d+138) .or. (.not. (z <= 1.95d+208))) 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 = y * -z;
	double t_1 = x * -z;
	double tmp;
	if (z <= -2.15e+269) {
		tmp = t_0;
	} else if (z <= -3e+184) {
		tmp = t_1;
	} else if (z <= -5.2e+113) {
		tmp = t_0;
	} else if (z <= -8.2e+89) {
		tmp = t_1;
	} else if (z <= -19.0) {
		tmp = t_0;
	} else if (z <= 1.0) {
		tmp = x + y;
	} else if ((z <= 8e+138) || !(z <= 1.95e+208)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * -z
	t_1 = x * -z
	tmp = 0
	if z <= -2.15e+269:
		tmp = t_0
	elif z <= -3e+184:
		tmp = t_1
	elif z <= -5.2e+113:
		tmp = t_0
	elif z <= -8.2e+89:
		tmp = t_1
	elif z <= -19.0:
		tmp = t_0
	elif z <= 1.0:
		tmp = x + y
	elif (z <= 8e+138) or not (z <= 1.95e+208):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64(-z))
	t_1 = Float64(x * Float64(-z))
	tmp = 0.0
	if (z <= -2.15e+269)
		tmp = t_0;
	elseif (z <= -3e+184)
		tmp = t_1;
	elseif (z <= -5.2e+113)
		tmp = t_0;
	elseif (z <= -8.2e+89)
		tmp = t_1;
	elseif (z <= -19.0)
		tmp = t_0;
	elseif (z <= 1.0)
		tmp = Float64(x + y);
	elseif ((z <= 8e+138) || !(z <= 1.95e+208))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * -z;
	t_1 = x * -z;
	tmp = 0.0;
	if (z <= -2.15e+269)
		tmp = t_0;
	elseif (z <= -3e+184)
		tmp = t_1;
	elseif (z <= -5.2e+113)
		tmp = t_0;
	elseif (z <= -8.2e+89)
		tmp = t_1;
	elseif (z <= -19.0)
		tmp = t_0;
	elseif (z <= 1.0)
		tmp = x + y;
	elseif ((z <= 8e+138) || ~((z <= 1.95e+208)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-z)), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -2.15e+269], t$95$0, If[LessEqual[z, -3e+184], t$95$1, If[LessEqual[z, -5.2e+113], t$95$0, If[LessEqual[z, -8.2e+89], t$95$1, If[LessEqual[z, -19.0], t$95$0, If[LessEqual[z, 1.0], N[(x + y), $MachinePrecision], If[Or[LessEqual[z, 8e+138], N[Not[LessEqual[z, 1.95e+208]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(-z\right)\\
t_1 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+269}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -3 \cdot 10^{+184}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -5.2 \cdot 10^{+113}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -19:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 8 \cdot 10^{+138} \lor \neg \left(z \leq 1.95 \cdot 10^{+208}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.14999999999999992e269 or -2.99999999999999986e184 < z < -5.1999999999999998e113 or -8.1999999999999997e89 < z < -19 or 1 < z < 8.0000000000000003e138 or 1.95e208 < z

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(x + y\right)} \]
      2. *-commutative96.2%

        \[\leadsto -\color{blue}{\left(x + y\right) \cdot z} \]
      3. distribute-rgt-neg-out96.2%

        \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(-z\right)} \]
      4. +-commutative96.2%

        \[\leadsto \color{blue}{\left(y + x\right)} \cdot \left(-z\right) \]
    4. Simplified96.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*48.0%

        \[\leadsto \color{blue}{\left(-1 \cdot y\right) \cdot z} \]
      2. mul-1-neg48.0%

        \[\leadsto \color{blue}{\left(-y\right)} \cdot z \]
    7. Simplified48.0%

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

    if -2.14999999999999992e269 < z < -2.99999999999999986e184 or -5.1999999999999998e113 < z < -8.1999999999999997e89 or 8.0000000000000003e138 < z < 1.95e208

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    4. Simplified53.2%

      \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    5. Taylor expanded in z around inf 53.2%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

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

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

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

    if -19 < z < 1

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified97.5%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+269}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+184}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{+113}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -19:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+138} \lor \neg \left(z \leq 1.95 \cdot 10^{+208}\right):\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \]

Alternative 4: 97.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;1 - z \leq -5000 \lor \neg \left(1 - z \leq 2\right):\\ \;\;\;\;z \cdot \left(\left(-y\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= (- 1.0 z) -5000.0) (not (<= (- 1.0 z) 2.0)))
   (* z (- (- y) x))
   (+ x y)))
double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - z) <= -5000.0) || !((1.0 - z) <= 2.0)) {
		tmp = z * (-y - x);
	} 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 (((1.0d0 - z) <= (-5000.0d0)) .or. (.not. ((1.0d0 - z) <= 2.0d0))) then
        tmp = z * (-y - x)
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - z) <= -5000.0) || !((1.0 - z) <= 2.0)) {
		tmp = z * (-y - x);
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if ((1.0 - z) <= -5000.0) or not ((1.0 - z) <= 2.0):
		tmp = z * (-y - x)
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((Float64(1.0 - z) <= -5000.0) || !(Float64(1.0 - z) <= 2.0))
		tmp = Float64(z * Float64(Float64(-y) - x));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (((1.0 - z) <= -5000.0) || ~(((1.0 - z) <= 2.0)))
		tmp = z * (-y - x);
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[N[(1.0 - z), $MachinePrecision], -5000.0], N[Not[LessEqual[N[(1.0 - z), $MachinePrecision], 2.0]], $MachinePrecision]], N[(z * N[((-y) - x), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;1 - z \leq -5000 \lor \neg \left(1 - z \leq 2\right):\\
\;\;\;\;z \cdot \left(\left(-y\right) - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 1 z) < -5e3 or 2 < (-.f64 1 z)

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(x + y\right)} \]
      2. *-commutative97.6%

        \[\leadsto -\color{blue}{\left(x + y\right) \cdot z} \]
      3. distribute-rgt-neg-out97.6%

        \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(-z\right)} \]
      4. +-commutative97.6%

        \[\leadsto \color{blue}{\left(y + x\right)} \cdot \left(-z\right) \]
    4. Simplified97.6%

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

    if -5e3 < (-.f64 1 z) < 2

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified97.5%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;1 - z \leq -5000 \lor \neg \left(1 - z \leq 2\right):\\ \;\;\;\;z \cdot \left(\left(-y\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 74.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -12600 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -12600.0) (not (<= z 1.0))) (* x (- z)) (+ x y)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -12600.0) || !(z <= 1.0)) {
		tmp = x * -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 ((z <= (-12600.0d0)) .or. (.not. (z <= 1.0d0))) then
        tmp = x * -z
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -12600.0) || !(z <= 1.0)) {
		tmp = x * -z;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -12600.0) or not (z <= 1.0):
		tmp = x * -z
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -12600.0) || !(z <= 1.0))
		tmp = Float64(x * Float64(-z));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -12600.0) || ~((z <= 1.0)))
		tmp = x * -z;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -12600.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -12600 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-z\right)\\

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


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

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    5. Taylor expanded in z around inf 55.1%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*98.3%

        \[\leadsto \left(1 - z\right) \cdot y + \color{blue}{\left(-1 \cdot x\right) \cdot z} \]
      2. mul-1-neg98.3%

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

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

    if -12600 < z < 1

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified96.2%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -12600 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 6: 61.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{-127}:\\
\;\;\;\;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 y < 1.45e-127

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(1 - z\right) \cdot x} \]
    4. Simplified60.2%

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

    if 1.45e-127 < y

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.45 \cdot 10^{-127}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \end{array} \]

Alternative 7: 31.2% accurate, 2.3× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if 3.8999999999999998e-97 < y

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \left(1 - z\right) \cdot y + \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*86.8%

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

        \[\leadsto \left(1 - z\right) \cdot y + \color{blue}{\left(-x\right)} \cdot z \]
    6. Simplified86.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 8: 50.5% accurate, 2.3× 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. Taylor expanded in z around 0 51.6%

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

      \[\leadsto \color{blue}{y + x} \]
  4. Simplified51.6%

    \[\leadsto \color{blue}{y + x} \]
  5. Final simplification51.6%

    \[\leadsto x + y \]

Alternative 9: 26.0% 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(1 - z\right) \]
  2. Taylor expanded in x around inf 50.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification24.4%

    \[\leadsto x \]

Reproduce

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