Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3

Percentage Accurate: 85.1% → 96.1%
Time: 7.3s
Alternatives: 9
Speedup: 0.8×

Specification

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

\\
\frac{x \cdot \left(y - z\right)}{y}
\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: 85.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-115} \lor \neg \left(y \leq 7.4 \cdot 10^{-177}\right):\\
\;\;\;\;x - \frac{x}{\frac{y}{z}}\\

\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.7e-115 or 7.39999999999999986e-177 < y

    1. Initial program 80.7%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/80.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--79.6%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/72.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.5%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.5%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity91.5%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified91.5%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 93.1%

      \[\leadsto x - \color{blue}{\frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. *-commutative93.1%

        \[\leadsto x - \frac{\color{blue}{x \cdot z}}{y} \]
      2. associate-/l*99.4%

        \[\leadsto x - \color{blue}{\frac{x}{\frac{y}{z}}} \]
    6. Simplified99.4%

      \[\leadsto x - \color{blue}{\frac{x}{\frac{y}{z}}} \]

    if -2.7e-115 < y < 7.39999999999999986e-177

    1. Initial program 88.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/98.1%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--88.3%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/90.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/98.2%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses98.2%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity98.2%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-115} \lor \neg \left(y \leq 7.4 \cdot 10^{-177}\right):\\ \;\;\;\;x - \frac{x}{\frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{x}{y}\\ \end{array} \]

Alternative 2: 69.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+61} \lor \neg \left(z \leq 3800000000000\right) \land \left(z \leq 3.5 \cdot 10^{+70} \lor \neg \left(z \leq 7.6 \cdot 10^{+117}\right)\right):\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -1.15e+61)
         (and (not (<= z 3800000000000.0))
              (or (<= z 3.5e+70) (not (<= z 7.6e+117)))))
   (* x (/ (- z) y))
   x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.15e+61) || (!(z <= 3800000000000.0) && ((z <= 3.5e+70) || !(z <= 7.6e+117)))) {
		tmp = x * (-z / y);
	} else {
		tmp = x;
	}
	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.15d+61)) .or. (.not. (z <= 3800000000000.0d0)) .and. (z <= 3.5d+70) .or. (.not. (z <= 7.6d+117))) then
        tmp = x * (-z / y)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.15e+61) || (!(z <= 3800000000000.0) && ((z <= 3.5e+70) || !(z <= 7.6e+117)))) {
		tmp = x * (-z / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -1.15e+61) or (not (z <= 3800000000000.0) and ((z <= 3.5e+70) or not (z <= 7.6e+117))):
		tmp = x * (-z / y)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -1.15e+61) || (!(z <= 3800000000000.0) && ((z <= 3.5e+70) || !(z <= 7.6e+117))))
		tmp = Float64(x * Float64(Float64(-z) / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -1.15e+61) || (~((z <= 3800000000000.0)) && ((z <= 3.5e+70) || ~((z <= 7.6e+117)))))
		tmp = x * (-z / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.15e+61], And[N[Not[LessEqual[z, 3800000000000.0]], $MachinePrecision], Or[LessEqual[z, 3.5e+70], N[Not[LessEqual[z, 7.6e+117]], $MachinePrecision]]]], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+61} \lor \neg \left(z \leq 3800000000000\right) \land \left(z \leq 3.5 \cdot 10^{+70} \lor \neg \left(z \leq 7.6 \cdot 10^{+117}\right)\right):\\
\;\;\;\;x \cdot \frac{-z}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.15e61 or 3.8e12 < z < 3.50000000000000002e70 or 7.6000000000000003e117 < z

    1. Initial program 88.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/83.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--80.1%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/78.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/89.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses89.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity89.4%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified89.4%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 76.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.6%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/71.5%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in71.5%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    6. Simplified71.5%

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

    if -1.15e61 < z < 3.8e12 or 3.50000000000000002e70 < z < 7.6000000000000003e117

    1. Initial program 77.1%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/84.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--82.4%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/95.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses95.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity95.4%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 77.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+61} \lor \neg \left(z \leq 3800000000000\right) \land \left(z \leq 3.5 \cdot 10^{+70} \lor \neg \left(z \leq 7.6 \cdot 10^{+117}\right)\right):\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 70.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{elif}\;z \leq 30000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+71} \lor \neg \left(z \leq 8 \cdot 10^{+117}\right):\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2.9e+60)
   (* x (/ (- z) y))
   (if (<= z 30000000000.0)
     x
     (if (or (<= z 2.2e+71) (not (<= z 8e+117))) (/ x (/ (- y) z)) x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.9e+60) {
		tmp = x * (-z / y);
	} else if (z <= 30000000000.0) {
		tmp = x;
	} else if ((z <= 2.2e+71) || !(z <= 8e+117)) {
		tmp = x / (-y / z);
	} else {
		tmp = x;
	}
	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 <= (-2.9d+60)) then
        tmp = x * (-z / y)
    else if (z <= 30000000000.0d0) then
        tmp = x
    else if ((z <= 2.2d+71) .or. (.not. (z <= 8d+117))) then
        tmp = x / (-y / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.9e+60) {
		tmp = x * (-z / y);
	} else if (z <= 30000000000.0) {
		tmp = x;
	} else if ((z <= 2.2e+71) || !(z <= 8e+117)) {
		tmp = x / (-y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -2.9e+60:
		tmp = x * (-z / y)
	elif z <= 30000000000.0:
		tmp = x
	elif (z <= 2.2e+71) or not (z <= 8e+117):
		tmp = x / (-y / z)
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -2.9e+60)
		tmp = Float64(x * Float64(Float64(-z) / y));
	elseif (z <= 30000000000.0)
		tmp = x;
	elseif ((z <= 2.2e+71) || !(z <= 8e+117))
		tmp = Float64(x / Float64(Float64(-y) / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -2.9e+60)
		tmp = x * (-z / y);
	elseif (z <= 30000000000.0)
		tmp = x;
	elseif ((z <= 2.2e+71) || ~((z <= 8e+117)))
		tmp = x / (-y / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -2.9e+60], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 30000000000.0], x, If[Or[LessEqual[z, 2.2e+71], N[Not[LessEqual[z, 8e+117]], $MachinePrecision]], N[(x / N[((-y) / z), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\

\mathbf{elif}\;z \leq 30000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+71} \lor \neg \left(z \leq 8 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{x}{\frac{-y}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9e60

    1. Initial program 88.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/77.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--73.1%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/82.2%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses82.2%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity82.2%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified82.2%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 75.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg75.4%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/73.2%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in73.2%

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

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

    if -2.9e60 < z < 3e10 or 2.19999999999999995e71 < z < 8.0000000000000004e117

    1. Initial program 77.1%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/84.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--82.4%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/95.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses95.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity95.4%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 77.1%

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

    if 3e10 < z < 2.19999999999999995e71 or 8.0000000000000004e117 < z

    1. Initial program 89.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/87.3%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--84.4%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/80.2%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.0%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.0%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.0%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 77.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg77.3%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/70.5%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in70.5%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    6. Simplified70.5%

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt42.2%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \]
      2. sqrt-unprod34.2%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
      3. sqr-neg34.2%

        \[\leadsto \frac{z}{y} \cdot \sqrt{\color{blue}{x \cdot x}} \]
      4. sqrt-unprod0.4%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      5. clear-num0.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{z}}} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right) \]
      6. add-sqr-sqrt1.9%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{x} \]
      7. associate-/r/1.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{z}}{x}}} \]
      8. frac-2neg1.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{-\frac{y}{z}}{-x}}} \]
      9. clear-num1.9%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{y}{z}}} \]
      10. add-sqr-sqrt1.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\frac{y}{z}} \]
      11. sqrt-unprod26.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\frac{y}{z}} \]
      12. sqr-neg26.8%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{-\frac{y}{z}} \]
      13. sqrt-unprod29.6%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\frac{y}{z}} \]
      14. add-sqr-sqrt72.2%

        \[\leadsto \frac{\color{blue}{x}}{-\frac{y}{z}} \]
      15. distribute-neg-frac72.2%

        \[\leadsto \frac{x}{\color{blue}{\frac{-y}{z}}} \]
    8. Applied egg-rr72.2%

      \[\leadsto \color{blue}{\frac{x}{\frac{-y}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{elif}\;z \leq 30000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+71} \lor \neg \left(z \leq 8 \cdot 10^{+117}\right):\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 70.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\

\mathbf{elif}\;z \leq 12500000000:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 7.6 \cdot 10^{+117}:\\
\;\;\;\;\frac{y}{\frac{y}{x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{-y}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.9999999999999998e60

    1. Initial program 88.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/77.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--73.1%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/82.2%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses82.2%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity82.2%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified82.2%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 75.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg75.4%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/73.2%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in73.2%

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

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

    if -2.9999999999999998e60 < z < 1.25e10

    1. Initial program 78.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/83.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--81.2%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.7%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.7%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.7%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 79.6%

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

    if 1.25e10 < z < 2.89999999999999989e84

    1. Initial program 82.3%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/90.9%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--87.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/82.2%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses99.7%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity99.7%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 65.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg65.4%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/50.7%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in50.7%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    6. Simplified50.7%

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out50.7%

        \[\leadsto \color{blue}{-\frac{z}{y} \cdot x} \]
      2. associate-/r/65.5%

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      3. distribute-neg-frac65.5%

        \[\leadsto \color{blue}{\frac{-z}{\frac{y}{x}}} \]
    8. Applied egg-rr65.5%

      \[\leadsto \color{blue}{\frac{-z}{\frac{y}{x}}} \]

    if 2.89999999999999989e84 < z < 7.6000000000000003e117

    1. Initial program 55.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Taylor expanded in y around inf 27.8%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
    3. Step-by-step derivation
      1. associate-/l*81.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
      2. div-inv80.7%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{y}{x}}} \]
      3. clear-num80.9%

        \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    4. Applied egg-rr80.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{y}} \]
    5. Step-by-step derivation
      1. clear-num80.7%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv81.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
    6. Applied egg-rr81.0%

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

    if 7.6000000000000003e117 < z

    1. Initial program 93.6%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--81.0%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.1%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.1%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity91.1%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 81.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg81.8%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/77.7%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in77.7%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    6. Simplified77.7%

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt46.9%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \]
      2. sqrt-unprod38.2%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \]
      3. sqr-neg38.2%

        \[\leadsto \frac{z}{y} \cdot \sqrt{\color{blue}{x \cdot x}} \]
      4. sqrt-unprod0.3%

        \[\leadsto \frac{z}{y} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \]
      5. clear-num0.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{z}}} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right) \]
      6. add-sqr-sqrt1.8%

        \[\leadsto \frac{1}{\frac{y}{z}} \cdot \color{blue}{x} \]
      7. associate-/r/1.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{y}{z}}{x}}} \]
      8. frac-2neg1.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{-\frac{y}{z}}{-x}}} \]
      9. clear-num1.8%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{y}{z}}} \]
      10. add-sqr-sqrt1.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\frac{y}{z}} \]
      11. sqrt-unprod28.4%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\frac{y}{z}} \]
      12. sqr-neg28.4%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{-\frac{y}{z}} \]
      13. sqrt-unprod30.6%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\frac{y}{z}} \]
      14. add-sqr-sqrt77.8%

        \[\leadsto \frac{\color{blue}{x}}{-\frac{y}{z}} \]
      15. distribute-neg-frac77.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{-y}{z}}} \]
    8. Applied egg-rr77.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+60}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{elif}\;z \leq 12500000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+84}:\\ \;\;\;\;\frac{-z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{+117}:\\ \;\;\;\;\frac{y}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{-y}{z}}\\ \end{array} \]

Alternative 5: 72.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x \cdot \left(-z\right)}{y}\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+84}:\\ \;\;\;\;\frac{-z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+117}:\\ \;\;\;\;\frac{y}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (* x (- z)) y)))
   (if (<= z -1.2e+61)
     t_0
     (if (<= z 2.2e+16)
       x
       (if (<= z 4.8e+84)
         (/ (- z) (/ y x))
         (if (<= z 7.8e+117) (/ y (/ y x)) t_0))))))
double code(double x, double y, double z) {
	double t_0 = (x * -z) / y;
	double tmp;
	if (z <= -1.2e+61) {
		tmp = t_0;
	} else if (z <= 2.2e+16) {
		tmp = x;
	} else if (z <= 4.8e+84) {
		tmp = -z / (y / x);
	} else if (z <= 7.8e+117) {
		tmp = y / (y / x);
	} 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 = (x * -z) / y
    if (z <= (-1.2d+61)) then
        tmp = t_0
    else if (z <= 2.2d+16) then
        tmp = x
    else if (z <= 4.8d+84) then
        tmp = -z / (y / x)
    else if (z <= 7.8d+117) then
        tmp = y / (y / x)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (x * -z) / y;
	double tmp;
	if (z <= -1.2e+61) {
		tmp = t_0;
	} else if (z <= 2.2e+16) {
		tmp = x;
	} else if (z <= 4.8e+84) {
		tmp = -z / (y / x);
	} else if (z <= 7.8e+117) {
		tmp = y / (y / x);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x * -z) / y
	tmp = 0
	if z <= -1.2e+61:
		tmp = t_0
	elif z <= 2.2e+16:
		tmp = x
	elif z <= 4.8e+84:
		tmp = -z / (y / x)
	elif z <= 7.8e+117:
		tmp = y / (y / x)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x * Float64(-z)) / y)
	tmp = 0.0
	if (z <= -1.2e+61)
		tmp = t_0;
	elseif (z <= 2.2e+16)
		tmp = x;
	elseif (z <= 4.8e+84)
		tmp = Float64(Float64(-z) / Float64(y / x));
	elseif (z <= 7.8e+117)
		tmp = Float64(y / Float64(y / x));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x * -z) / y;
	tmp = 0.0;
	if (z <= -1.2e+61)
		tmp = t_0;
	elseif (z <= 2.2e+16)
		tmp = x;
	elseif (z <= 4.8e+84)
		tmp = -z / (y / x);
	elseif (z <= 7.8e+117)
		tmp = y / (y / x);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * (-z)), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -1.2e+61], t$95$0, If[LessEqual[z, 2.2e+16], x, If[LessEqual[z, 4.8e+84], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+117], N[(y / N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+16}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{y}{\frac{y}{x}}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.1999999999999999e61 or 7.79999999999999981e117 < z

    1. Initial program 91.3%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/80.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.2%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/78.1%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/86.8%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses86.8%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity86.8%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified86.8%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 78.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. associate-*r/78.7%

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

        \[\leadsto \frac{\color{blue}{-z \cdot x}}{y} \]
      3. distribute-rgt-neg-in78.7%

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{y} \]
    6. Simplified78.7%

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

    if -1.1999999999999999e61 < z < 2.2e16

    1. Initial program 78.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/83.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--81.2%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/75.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/94.7%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses94.7%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity94.7%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 79.6%

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

    if 2.2e16 < z < 4.7999999999999999e84

    1. Initial program 82.3%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/90.9%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--87.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/82.2%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses99.7%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity99.7%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 65.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. mul-1-neg65.4%

        \[\leadsto \color{blue}{-\frac{z \cdot x}{y}} \]
      2. associate-*l/50.7%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      3. distribute-rgt-neg-in50.7%

        \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    6. Simplified50.7%

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out50.7%

        \[\leadsto \color{blue}{-\frac{z}{y} \cdot x} \]
      2. associate-/r/65.5%

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      3. distribute-neg-frac65.5%

        \[\leadsto \color{blue}{\frac{-z}{\frac{y}{x}}} \]
    8. Applied egg-rr65.5%

      \[\leadsto \color{blue}{\frac{-z}{\frac{y}{x}}} \]

    if 4.7999999999999999e84 < z < 7.79999999999999981e117

    1. Initial program 55.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Taylor expanded in y around inf 27.8%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
    3. Step-by-step derivation
      1. associate-/l*81.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
      2. div-inv80.7%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{y}{x}}} \]
      3. clear-num80.9%

        \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    4. Applied egg-rr80.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{y}} \]
    5. Step-by-step derivation
      1. clear-num80.7%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv81.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
    6. Applied egg-rr81.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+61}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+84}:\\ \;\;\;\;\frac{-z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+117}:\\ \;\;\;\;\frac{y}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\ \end{array} \]

Alternative 6: 93.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+212}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\

\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{x}{y}\\


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

    1. Initial program 94.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/64.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--59.3%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/64.8%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses64.8%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity64.8%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified64.8%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around inf 94.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    5. Step-by-step derivation
      1. associate-*r/94.1%

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

        \[\leadsto \frac{\color{blue}{-z \cdot x}}{y} \]
      3. distribute-rgt-neg-in94.1%

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

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

    if -5.7999999999999997e212 < z

    1. Initial program 81.3%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/85.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--83.1%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/77.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/95.0%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses95.0%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity95.0%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified95.0%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+212}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{x}{y}\\ \end{array} \]

Alternative 7: 51.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-8}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\


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

    1. Initial program 86.9%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/79.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.1%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/80.2%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.4%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.4%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity91.4%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified91.4%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 53.2%

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

    if 2e-8 < x

    1. Initial program 68.7%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Taylor expanded in y around inf 29.1%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
    3. Step-by-step derivation
      1. associate-/l*62.4%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
      2. div-inv62.3%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{y}{x}}} \]
      3. clear-num62.4%

        \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    4. Applied egg-rr62.4%

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

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

Alternative 8: 51.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+42}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.00000000000000004e42

    1. Initial program 87.3%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-*l/80.4%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
      2. distribute-rgt-out--77.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
      3. associate-*r/80.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
      4. associate-*l/91.6%

        \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
      5. *-inverses91.6%

        \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
      6. *-lft-identity91.6%

        \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
    3. Simplified91.6%

      \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
    4. Taylor expanded in z around 0 53.1%

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

    if 1.00000000000000004e42 < x

    1. Initial program 65.6%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Taylor expanded in y around inf 26.8%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
    3. Step-by-step derivation
      1. associate-/l*63.5%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
      2. div-inv63.4%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{y}{x}}} \]
      3. clear-num63.5%

        \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    4. Applied egg-rr63.5%

      \[\leadsto \color{blue}{y \cdot \frac{x}{y}} \]
    5. Step-by-step derivation
      1. clear-num63.4%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv63.5%

        \[\leadsto \color{blue}{\frac{y}{\frac{y}{x}}} \]
    6. Applied egg-rr63.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 10^{+42}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{y}{x}}\\ \end{array} \]

Alternative 9: 50.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 82.3%

    \[\frac{x \cdot \left(y - z\right)}{y} \]
  2. Step-by-step derivation
    1. associate-*l/84.1%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \left(y - z\right)} \]
    2. distribute-rgt-out--81.3%

      \[\leadsto \color{blue}{y \cdot \frac{x}{y} - z \cdot \frac{x}{y}} \]
    3. associate-*r/76.5%

      \[\leadsto \color{blue}{\frac{y \cdot x}{y}} - z \cdot \frac{x}{y} \]
    4. associate-*l/92.8%

      \[\leadsto \color{blue}{\frac{y}{y} \cdot x} - z \cdot \frac{x}{y} \]
    5. *-inverses92.8%

      \[\leadsto \color{blue}{1} \cdot x - z \cdot \frac{x}{y} \]
    6. *-lft-identity92.8%

      \[\leadsto \color{blue}{x} - z \cdot \frac{x}{y} \]
  3. Simplified92.8%

    \[\leadsto \color{blue}{x - z \cdot \frac{x}{y}} \]
  4. Taylor expanded in z around 0 53.4%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification53.4%

    \[\leadsto x \]

Developer target: 96.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\ \;\;\;\;x - \frac{z \cdot x}{y}\\ \mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< z -2.060202331921739e+104)
   (- x (/ (* z x) y))
   (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - z) * (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 < (-2.060202331921739d+104)) then
        tmp = x - ((z * x) / y)
    else if (z < 1.6939766013828526d+213) then
        tmp = x / (y / (y - z))
    else
        tmp = (y - z) * (x / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - z) * (x / y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z < -2.060202331921739e+104:
		tmp = x - ((z * x) / y)
	elif z < 1.6939766013828526e+213:
		tmp = x / (y / (y - z))
	else:
		tmp = (y - z) * (x / y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z < -2.060202331921739e+104)
		tmp = Float64(x - Float64(Float64(z * x) / y));
	elseif (z < 1.6939766013828526e+213)
		tmp = Float64(x / Float64(y / Float64(y - z)));
	else
		tmp = Float64(Float64(y - z) * Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z < -2.060202331921739e+104)
		tmp = x - ((z * x) / y);
	elseif (z < 1.6939766013828526e+213)
		tmp = x / (y / (y - z));
	else
		tmp = (y - z) * (x / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\

\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023228 
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
  :precision binary64

  :herbie-target
  (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))

  (/ (* x (- y z)) y))