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

Percentage Accurate: 84.4% → 96.1%
Time: 6.5s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 84.4% 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.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1499999999999999e50 or 3.1999999999999997e-92 < y

    1. Initial program 78.3%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
    4. Add Preprocessing

    if -2.1499999999999999e50 < y < 3.1999999999999997e-92

    1. Initial program 90.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+50} \lor \neg \left(y \leq 3.2 \cdot 10^{-92}\right):\\ \;\;\;\;x \cdot \frac{y - z}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 95.9% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x (-.f64 y z)) y) < 4.99999999999999971e-68

    1. Initial program 81.2%

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

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

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

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

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

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

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

    if 4.99999999999999971e-68 < (/.f64 (*.f64 x (-.f64 y z)) y)

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.4% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000008e-10 or 3.9e9 < z

    1. Initial program 92.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. clear-num87.8%

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv87.9%

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

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

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

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

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

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

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

    if -1.25000000000000008e-10 < z < 3.9e9

    1. Initial program 76.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-10} \lor \neg \left(z \leq 3900000000\right):\\ \;\;\;\;\frac{x}{y} \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.3% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.19999999999999962e-10

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x}}{\frac{y}{z}} \]
    9. Applied egg-rr1.7%

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{z}}} \]
    10. Step-by-step derivation
      1. associate-/r/1.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
    11. Simplified1.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-z}{\frac{y}{\color{blue}{x}}} \]
    13. Applied egg-rr81.4%

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

    if -5.19999999999999962e-10 < z < 2.1e9

    1. Initial program 76.8%

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

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

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

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

    if 2.1e9 < z

    1. Initial program 88.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. clear-num88.8%

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv88.8%

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

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

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

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

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

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

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

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

Alternative 5: 73.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.59999999999999997e-11

    1. Initial program 94.7%

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

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

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

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

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

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

    if -1.59999999999999997e-11 < z < 3.3e10

    1. Initial program 76.8%

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

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

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

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

    if 3.3e10 < z

    1. Initial program 88.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. clear-num88.8%

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. un-div-inv88.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{-11}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\ \mathbf{elif}\;z \leq 33000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(-z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 89.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 82.2%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Add Preprocessing

    if 5.00000000000000043e-212 < x

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

Alternative 7: 52.4% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 84.9%

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

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

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

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

    if 1.00000000000000006e84 < x

    1. Initial program 83.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 10^{+84}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 96.0% 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. associate-/l*94.7%

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

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{y}} \]
  4. Add Preprocessing
  5. Final simplification94.7%

    \[\leadsto x \cdot \frac{y - z}{y} \]
  6. Add Preprocessing

Alternative 9: 96.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{y - z}}} \]
  7. Simplified95.9%

    \[\leadsto \color{blue}{\frac{x}{\frac{y}{y - z}}} \]
  8. Final simplification95.9%

    \[\leadsto \frac{x}{\frac{y}{y - z}} \]
  9. Add Preprocessing

Alternative 10: 51.2% 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. associate-/l*94.7%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification48.8%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.0% accurate, 0.4× 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 2024077 
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
  :precision binary64

  :alt
  (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))