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

Percentage Accurate: 84.0% → 95.8%
Time: 7.0s
Alternatives: 11
Speedup: 1.0×

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 11 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: 84.0% 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: 95.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 94.0%

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

    if -5.00000000000000022e92 < z

    1. Initial program 82.5%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/98.5%

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

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

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

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

Alternative 2: 69.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139} \lor \neg \left(z \leq 4.05 \cdot 10^{-115}\right) \land z \leq 3.45 \cdot 10^{-74}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.0%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/82.4%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{x}{y}\right)} \]
      3. associate-*l*78.3%

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

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

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

    if -4.4999999999999999e92 < z < 2.7999999999999999e-139 or 4.0499999999999999e-115 < z < 3.4499999999999999e-74

    1. Initial program 80.7%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/100.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub99.9%

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

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

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

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

    if 2.7999999999999999e-139 < z < 4.0499999999999999e-115 or 3.4499999999999999e-74 < z

    1. Initial program 84.7%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/96.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub96.7%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      4. associate-/r/74.3%

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

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

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;z \cdot \frac{-x}{y}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-139} \lor \neg \left(z \leq 4.05 \cdot 10^{-115}\right) \land z \leq 3.45 \cdot 10^{-74}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \end{array} \]

Alternative 3: 69.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.38 \cdot 10^{-139}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.3 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-74}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.39999999999999999e91

    1. Initial program 94.0%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/82.4%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{x}{y}\right)} \]
      3. associate-*l*78.3%

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

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

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

    if -4.39999999999999999e91 < z < 1.3800000000000001e-139 or 5.3e-115 < z < 1.7e-74

    1. Initial program 80.7%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/100.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub99.9%

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

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

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

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

    if 1.3800000000000001e-139 < z < 5.3e-115

    1. Initial program 86.3%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}} \]
    5. Applied egg-rr86.1%

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

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{y}{x \cdot z}}} \]
    7. Step-by-step derivation
      1. neg-mul-172.9%

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{-y}{x \cdot z}}} \]
    9. Step-by-step derivation
      1. clear-num72.9%

        \[\leadsto \color{blue}{\frac{x \cdot z}{-y}} \]
      2. neg-mul-172.9%

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

        \[\leadsto \color{blue}{\frac{x}{-1} \cdot \frac{z}{y}} \]
    10. Applied egg-rr85.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{z}}}}{-1} \]
      4. associate-/l/86.1%

        \[\leadsto \color{blue}{\frac{x}{-1 \cdot \frac{y}{z}}} \]
      5. neg-mul-186.1%

        \[\leadsto \frac{x}{\color{blue}{-\frac{y}{z}}} \]
    12. Simplified86.1%

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

    if 1.7e-74 < z

    1. Initial program 84.6%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/96.5%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      4. associate-/r/73.4%

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

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

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+91}:\\ \;\;\;\;z \cdot \frac{-x}{y}\\ \mathbf{elif}\;z \leq 1.38 \cdot 10^{-139}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{-\frac{y}{z}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-74}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \end{array} \]

Alternative 4: 69.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.05 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-74}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.39999999999999999e91

    1. Initial program 94.0%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/82.4%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{x}{y}\right)} \]
      3. associate-*l*78.3%

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

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

      \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{x}{y}} \]
    7. Step-by-step derivation
      1. associate-*r/84.2%

        \[\leadsto \color{blue}{\frac{\left(-z\right) \cdot x}{y}} \]
      2. distribute-lft-neg-in84.2%

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

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{y} \]
      4. associate-/l*78.3%

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

        \[\leadsto \color{blue}{\frac{-z}{-\frac{y}{-x}}} \]
      6. add-sqr-sqrt78.1%

        \[\leadsto \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{-\frac{y}{-x}} \]
      7. sqrt-unprod56.2%

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

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

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

        \[\leadsto \frac{\color{blue}{z}}{-\frac{y}{-x}} \]
      11. add-sqr-sqrt0.4%

        \[\leadsto \frac{z}{-\frac{y}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      12. sqrt-unprod37.1%

        \[\leadsto \frac{z}{-\frac{y}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      13. sqr-neg37.1%

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

        \[\leadsto \frac{z}{-\frac{y}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      15. add-sqr-sqrt78.3%

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

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

    if -4.39999999999999999e91 < z < 2.7999999999999999e-139 or 4.0499999999999999e-115 < z < 3.1000000000000002e-74

    1. Initial program 80.7%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/100.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub99.9%

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

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

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

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

    if 2.7999999999999999e-139 < z < 4.0499999999999999e-115

    1. Initial program 86.3%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}} \]
    5. Applied egg-rr86.1%

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

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{y}{x \cdot z}}} \]
    7. Step-by-step derivation
      1. neg-mul-172.9%

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{-y}{x \cdot z}}} \]
    9. Step-by-step derivation
      1. clear-num72.9%

        \[\leadsto \color{blue}{\frac{x \cdot z}{-y}} \]
      2. neg-mul-172.9%

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

        \[\leadsto \color{blue}{\frac{x}{-1} \cdot \frac{z}{y}} \]
    10. Applied egg-rr85.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{z}}}}{-1} \]
      4. associate-/l/86.1%

        \[\leadsto \color{blue}{\frac{x}{-1 \cdot \frac{y}{z}}} \]
      5. neg-mul-186.1%

        \[\leadsto \frac{x}{\color{blue}{-\frac{y}{z}}} \]
    12. Simplified86.1%

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

    if 3.1000000000000002e-74 < z

    1. Initial program 84.6%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/96.5%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      4. associate-/r/73.4%

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

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

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+91}:\\ \;\;\;\;\frac{z}{-\frac{y}{x}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.05 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{-\frac{y}{z}}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-74}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \end{array} \]

Alternative 5: 69.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-114}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-78}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.4999999999999999e92

    1. Initial program 94.0%

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

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

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

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

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

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

    if -4.4999999999999999e92 < z < 2.7999999999999999e-139 or 1.0199999999999999e-114 < z < 1.6e-78

    1. Initial program 80.7%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/100.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub99.9%

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

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

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

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

    if 2.7999999999999999e-139 < z < 1.0199999999999999e-114

    1. Initial program 86.3%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/99.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}} \]
    5. Applied egg-rr86.1%

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

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{y}{x \cdot z}}} \]
    7. Step-by-step derivation
      1. neg-mul-172.9%

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{-y}{x \cdot z}}} \]
    9. Step-by-step derivation
      1. clear-num72.9%

        \[\leadsto \color{blue}{\frac{x \cdot z}{-y}} \]
      2. neg-mul-172.9%

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

        \[\leadsto \color{blue}{\frac{x}{-1} \cdot \frac{z}{y}} \]
    10. Applied egg-rr85.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{z}}}}{-1} \]
      4. associate-/l/86.1%

        \[\leadsto \color{blue}{\frac{x}{-1 \cdot \frac{y}{z}}} \]
      5. neg-mul-186.1%

        \[\leadsto \frac{x}{\color{blue}{-\frac{y}{z}}} \]
    12. Simplified86.1%

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

    if 1.6e-78 < z

    1. Initial program 84.6%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/96.5%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x}}} \]
      4. associate-/r/73.4%

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

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

      \[\leadsto \color{blue}{\frac{z}{y} \cdot \left(-x\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{-\frac{y}{z}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-78}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \end{array} \]

Alternative 6: 71.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+91} \lor \neg \left(z \leq 4 \cdot 10^{-74}\right):\\
\;\;\;\;z \cdot \frac{-x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.39999999999999999e91 or 3.99999999999999983e-74 < z

    1. Initial program 88.0%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/91.5%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{x}{y}\right)} \]
      3. associate-*l*73.8%

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

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

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

    if -4.39999999999999999e91 < z < 3.99999999999999983e-74

    1. Initial program 81.0%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{y - z}{y} \cdot x} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+91} \lor \neg \left(z \leq 4 \cdot 10^{-74}\right):\\ \;\;\;\;z \cdot \frac{-x}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 51.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+108}:\\
\;\;\;\;x\\

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


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

    1. Initial program 85.4%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/94.9%

        \[\leadsto \color{blue}{\frac{y - z}{y} \cdot x} \]
      3. *-commutative94.9%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub94.9%

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

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

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

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

    if 1.35e108 < x

    1. Initial program 79.7%

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

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

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

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

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

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

Alternative 8: 51.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+134}:\\
\;\;\;\;x\\

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


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

    1. Initial program 85.6%

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

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
      2. associate-*l/94.9%

        \[\leadsto \color{blue}{\frac{y - z}{y} \cdot x} \]
      3. *-commutative94.9%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
      4. div-sub94.9%

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

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

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

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

    if 4.80000000000000011e134 < x

    1. Initial program 77.6%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{y}} \]
      2. clear-num32.4%

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

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

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

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

Alternative 9: 96.1% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
    2. associate-*l/95.5%

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{y}\right)} \]
  4. Final simplification95.5%

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

Alternative 10: 96.1% accurate, 1.0× speedup?

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

\\
x \cdot \frac{y - z}{y}
\end{array}
Derivation
  1. Initial program 84.7%

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

      \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
    2. associate-*l/95.5%

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

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

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

    \[\leadsto x \cdot \frac{y - z}{y} \]

Alternative 11: 50.8% 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 84.7%

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

      \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{y} \]
    2. associate-*l/95.5%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification45.7%

    \[\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 2023325 
(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))