Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 90.0% → 94.3%
Time: 9.1s
Alternatives: 13
Speedup: 1.2×

Specification

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

\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\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 13 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: 90.0% accurate, 1.0× speedup?

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

\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}

Alternative 1: 94.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot 2 \leq 2 \cdot 10^{+82}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* x 2.0) 2e+82)
   (* 2.0 (/ (/ x z) (- y t)))
   (* (/ x (- y t)) (/ 2.0 z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x * 2.0) <= 2e+82) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (x / (y - t)) * (2.0 / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x * 2.0d0) <= 2d+82) then
        tmp = 2.0d0 * ((x / z) / (y - t))
    else
        tmp = (x / (y - t)) * (2.0d0 / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x * 2.0) <= 2e+82) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (x / (y - t)) * (2.0 / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x * 2.0) <= 2e+82:
		tmp = 2.0 * ((x / z) / (y - t))
	else:
		tmp = (x / (y - t)) * (2.0 / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x * 2.0) <= 2e+82)
		tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t)));
	else
		tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x * 2.0) <= 2e+82)
		tmp = 2.0 * ((x / z) / (y - t));
	else
		tmp = (x / (y - t)) * (2.0 / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], 2e+82], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < 1.9999999999999999e82

    1. Initial program 86.9%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*l/86.9%

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

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

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

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

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

    if 1.9999999999999999e82 < (*.f64 x 2)

    1. Initial program 66.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--68.8%

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

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

        \[\leadsto \frac{x \cdot 2}{\color{blue}{\left(y - t\right) \cdot z}} \]
      2. times-frac97.5%

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

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

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

Alternative 2: 72.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+35} \lor \neg \left(y \leq 5.8 \cdot 10^{+38}\right):\\ \;\;\;\;2 \cdot \frac{x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -6.4e+35) (not (<= y 5.8e+38)))
   (* 2.0 (/ x (* z y)))
   (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -6.4e+35) || !(y <= 5.8e+38)) {
		tmp = 2.0 * (x / (z * y));
	} else {
		tmp = x * ((-2.0 / t) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-6.4d+35)) .or. (.not. (y <= 5.8d+38))) then
        tmp = 2.0d0 * (x / (z * y))
    else
        tmp = x * (((-2.0d0) / t) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -6.4e+35) || !(y <= 5.8e+38)) {
		tmp = 2.0 * (x / (z * y));
	} else {
		tmp = x * ((-2.0 / t) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -6.4e+35) or not (y <= 5.8e+38):
		tmp = 2.0 * (x / (z * y))
	else:
		tmp = x * ((-2.0 / t) / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -6.4e+35) || !(y <= 5.8e+38))
		tmp = Float64(2.0 * Float64(x / Float64(z * y)));
	else
		tmp = Float64(x * Float64(Float64(-2.0 / t) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -6.4e+35) || ~((y <= 5.8e+38)))
		tmp = 2.0 * (x / (z * y));
	else
		tmp = x * ((-2.0 / t) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.4e+35], N[Not[LessEqual[y, 5.8e+38]], $MachinePrecision]], N[(2.0 * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+35} \lor \neg \left(y \leq 5.8 \cdot 10^{+38}\right):\\
\;\;\;\;2 \cdot \frac{x}{z \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.39999999999999965e35 or 5.80000000000000013e38 < y

    1. Initial program 78.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*l/78.5%

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

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

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

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

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

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

    if -6.39999999999999965e35 < y < 5.80000000000000013e38

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+35} \lor \neg \left(y \leq 5.8 \cdot 10^{+38}\right):\\ \;\;\;\;2 \cdot \frac{x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 3: 72.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+33} \lor \neg \left(y \leq 1.1 \cdot 10^{+39}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -1.75e+33) (not (<= y 1.1e+39)))
   (* (/ x z) (/ 2.0 y))
   (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.75e+33) || !(y <= 1.1e+39)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = x * ((-2.0 / t) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-1.75d+33)) .or. (.not. (y <= 1.1d+39))) then
        tmp = (x / z) * (2.0d0 / y)
    else
        tmp = x * (((-2.0d0) / t) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.75e+33) || !(y <= 1.1e+39)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = x * ((-2.0 / t) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -1.75e+33) or not (y <= 1.1e+39):
		tmp = (x / z) * (2.0 / y)
	else:
		tmp = x * ((-2.0 / t) / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -1.75e+33) || !(y <= 1.1e+39))
		tmp = Float64(Float64(x / z) * Float64(2.0 / y));
	else
		tmp = Float64(x * Float64(Float64(-2.0 / t) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -1.75e+33) || ~((y <= 1.1e+39)))
		tmp = (x / z) * (2.0 / y);
	else
		tmp = x * ((-2.0 / t) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.75e+33], N[Not[LessEqual[y, 1.1e+39]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+33} \lor \neg \left(y \leq 1.1 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.75000000000000005e33 or 1.1000000000000001e39 < y

    1. Initial program 78.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/78.5%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--85.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub086.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg86.5%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval86.5%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. times-frac84.8%

        \[\leadsto \color{blue}{\frac{2}{y} \cdot \frac{x}{z}} \]
    6. Simplified84.8%

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

    if -1.75000000000000005e33 < y < 1.1000000000000001e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+33} \lor \neg \left(y \leq 1.1 \cdot 10^{+39}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 4: 73.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+35} \lor \neg \left(y \leq 2.15 \cdot 10^{+39}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -5.5e+35) (not (<= y 2.15e+39)))
   (* (/ x z) (/ 2.0 y))
   (* (/ x z) (/ -2.0 t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -5.5e+35) || !(y <= 2.15e+39)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = (x / z) * (-2.0 / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-5.5d+35)) .or. (.not. (y <= 2.15d+39))) then
        tmp = (x / z) * (2.0d0 / y)
    else
        tmp = (x / z) * ((-2.0d0) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -5.5e+35) || !(y <= 2.15e+39)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = (x / z) * (-2.0 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -5.5e+35) or not (y <= 2.15e+39):
		tmp = (x / z) * (2.0 / y)
	else:
		tmp = (x / z) * (-2.0 / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -5.5e+35) || !(y <= 2.15e+39))
		tmp = Float64(Float64(x / z) * Float64(2.0 / y));
	else
		tmp = Float64(Float64(x / z) * Float64(-2.0 / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -5.5e+35) || ~((y <= 2.15e+39)))
		tmp = (x / z) * (2.0 / y);
	else
		tmp = (x / z) * (-2.0 / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.5e+35], N[Not[LessEqual[y, 2.15e+39]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+35} \lor \neg \left(y \leq 2.15 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.50000000000000001e35 or 2.15e39 < y

    1. Initial program 78.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/78.5%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--85.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub086.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg86.5%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval86.5%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. times-frac84.8%

        \[\leadsto \color{blue}{\frac{2}{y} \cdot \frac{x}{z}} \]
    6. Simplified84.8%

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

    if -5.50000000000000001e35 < y < 2.15e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. *-commutative94.3%

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

        \[\leadsto \frac{2}{y - t} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv95.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    5. Applied egg-rr95.2%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around 0 75.4%

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/75.4%

        \[\leadsto \color{blue}{\frac{-2 \cdot x}{t \cdot z}} \]
      2. *-commutative75.4%

        \[\leadsto \frac{\color{blue}{x \cdot -2}}{t \cdot z} \]
      3. *-commutative75.4%

        \[\leadsto \frac{x \cdot -2}{\color{blue}{z \cdot t}} \]
      4. times-frac80.1%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{-2}{t}} \]
    8. Simplified80.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+35} \lor \neg \left(y \leq 2.15 \cdot 10^{+39}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \end{array} \]

Alternative 5: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.7 \cdot 10^{+38} \lor \neg \left(y \leq 5.5 \cdot 10^{+40}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -5.7e+38) (not (<= y 5.5e+40)))
   (* (/ x z) (/ 2.0 y))
   (* -2.0 (/ (/ x z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -5.7e+38) || !(y <= 5.5e+40)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = -2.0 * ((x / z) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-5.7d+38)) .or. (.not. (y <= 5.5d+40))) then
        tmp = (x / z) * (2.0d0 / y)
    else
        tmp = (-2.0d0) * ((x / z) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -5.7e+38) || !(y <= 5.5e+40)) {
		tmp = (x / z) * (2.0 / y);
	} else {
		tmp = -2.0 * ((x / z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -5.7e+38) or not (y <= 5.5e+40):
		tmp = (x / z) * (2.0 / y)
	else:
		tmp = -2.0 * ((x / z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -5.7e+38) || !(y <= 5.5e+40))
		tmp = Float64(Float64(x / z) * Float64(2.0 / y));
	else
		tmp = Float64(-2.0 * Float64(Float64(x / z) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -5.7e+38) || ~((y <= 5.5e+40)))
		tmp = (x / z) * (2.0 / y);
	else
		tmp = -2.0 * ((x / z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.7e+38], N[Not[LessEqual[y, 5.5e+40]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.7 \cdot 10^{+38} \lor \neg \left(y \leq 5.5 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.6999999999999997e38 or 5.49999999999999974e40 < y

    1. Initial program 78.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/78.5%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--85.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub086.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-86.5%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg86.5%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval86.5%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. times-frac84.8%

        \[\leadsto \color{blue}{\frac{2}{y} \cdot \frac{x}{z}} \]
    6. Simplified84.8%

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

    if -5.6999999999999997e38 < y < 5.49999999999999974e40

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot z} \cdot -2} \]
      2. *-commutative75.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \cdot -2 \]
    6. Simplified80.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.7 \cdot 10^{+38} \lor \neg \left(y \leq 5.5 \cdot 10^{+40}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \end{array} \]

Alternative 6: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{x}{z \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.75e+34)
   (* x (/ (/ 2.0 y) z))
   (if (<= y 2.3e+39) (* x (/ (/ -2.0 t) z)) (* 2.0 (/ x (* z y))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.75e+34) {
		tmp = x * ((2.0 / y) / z);
	} else if (y <= 2.3e+39) {
		tmp = x * ((-2.0 / t) / z);
	} else {
		tmp = 2.0 * (x / (z * y));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.75d+34)) then
        tmp = x * ((2.0d0 / y) / z)
    else if (y <= 2.3d+39) then
        tmp = x * (((-2.0d0) / t) / z)
    else
        tmp = 2.0d0 * (x / (z * y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.75e+34) {
		tmp = x * ((2.0 / y) / z);
	} else if (y <= 2.3e+39) {
		tmp = x * ((-2.0 / t) / z);
	} else {
		tmp = 2.0 * (x / (z * y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.75e+34:
		tmp = x * ((2.0 / y) / z)
	elif y <= 2.3e+39:
		tmp = x * ((-2.0 / t) / z)
	else:
		tmp = 2.0 * (x / (z * y))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.75e+34)
		tmp = Float64(x * Float64(Float64(2.0 / y) / z));
	elseif (y <= 2.3e+39)
		tmp = Float64(x * Float64(Float64(-2.0 / t) / z));
	else
		tmp = Float64(2.0 * Float64(x / Float64(z * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.75e+34)
		tmp = x * ((2.0 / y) / z);
	elseif (y <= 2.3e+39)
		tmp = x * ((-2.0 / t) / z);
	else
		tmp = 2.0 * (x / (z * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e+34], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+39], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.74999999999999999e34

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/74.6%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--82.2%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg85.2%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative85.2%

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-85.2%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg85.2%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval85.2%

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

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

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

    if -1.74999999999999999e34 < y < 2.30000000000000012e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

      \[\leadsto x \cdot \frac{\color{blue}{\frac{-2}{t}}}{z} \]

    if 2.30000000000000012e39 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*l/82.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{x}{z \cdot y}\\ \end{array} \]

Alternative 7: 73.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+39}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+38}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3.5e+39)
   (/ 2.0 (* z (/ y x)))
   (if (<= y 8.5e+38) (* -2.0 (/ (/ x z) t)) (* (/ x z) (/ 2.0 y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.5e+39) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 8.5e+38) {
		tmp = -2.0 * ((x / z) / t);
	} else {
		tmp = (x / z) * (2.0 / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-3.5d+39)) then
        tmp = 2.0d0 / (z * (y / x))
    else if (y <= 8.5d+38) then
        tmp = (-2.0d0) * ((x / z) / t)
    else
        tmp = (x / z) * (2.0d0 / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.5e+39) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 8.5e+38) {
		tmp = -2.0 * ((x / z) / t);
	} else {
		tmp = (x / z) * (2.0 / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -3.5e+39:
		tmp = 2.0 / (z * (y / x))
	elif y <= 8.5e+38:
		tmp = -2.0 * ((x / z) / t)
	else:
		tmp = (x / z) * (2.0 / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -3.5e+39)
		tmp = Float64(2.0 / Float64(z * Float64(y / x)));
	elseif (y <= 8.5e+38)
		tmp = Float64(-2.0 * Float64(Float64(x / z) / t));
	else
		tmp = Float64(Float64(x / z) * Float64(2.0 / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -3.5e+39)
		tmp = 2.0 / (z * (y / x));
	elseif (y <= 8.5e+38)
		tmp = -2.0 * ((x / z) / t);
	else
		tmp = (x / z) * (2.0 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+39], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+38], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.5000000000000002e39

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--82.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 78.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{y}{x} \cdot z}} \]
    8. Simplified83.6%

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

    if -3.5000000000000002e39 < y < 8.4999999999999997e38

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot z} \cdot -2} \]
      2. *-commutative75.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \cdot -2 \]
    6. Simplified80.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t} \cdot -2} \]

    if 8.4999999999999997e38 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/82.3%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg87.8%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative87.8%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub087.8%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-87.8%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg87.8%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval87.8%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. times-frac86.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+39}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+38}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]

Alternative 8: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+39}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.9e+41)
   (/ 2.0 (* z (/ y x)))
   (if (<= y 4e+39) (* -2.0 (/ (/ x z) t)) (/ 2.0 (/ y (/ x z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.9e+41) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 4e+39) {
		tmp = -2.0 * ((x / z) / t);
	} else {
		tmp = 2.0 / (y / (x / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.9d+41)) then
        tmp = 2.0d0 / (z * (y / x))
    else if (y <= 4d+39) then
        tmp = (-2.0d0) * ((x / z) / t)
    else
        tmp = 2.0d0 / (y / (x / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.9e+41) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 4e+39) {
		tmp = -2.0 * ((x / z) / t);
	} else {
		tmp = 2.0 / (y / (x / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2.9e+41:
		tmp = 2.0 / (z * (y / x))
	elif y <= 4e+39:
		tmp = -2.0 * ((x / z) / t)
	else:
		tmp = 2.0 / (y / (x / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.9e+41)
		tmp = Float64(2.0 / Float64(z * Float64(y / x)));
	elseif (y <= 4e+39)
		tmp = Float64(-2.0 * Float64(Float64(x / z) / t));
	else
		tmp = Float64(2.0 / Float64(y / Float64(x / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.9e+41)
		tmp = 2.0 / (z * (y / x));
	elseif (y <= 4e+39)
		tmp = -2.0 * ((x / z) / t);
	else
		tmp = 2.0 / (y / (x / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e+41], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+39], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+39}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.89999999999999988e41

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--82.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 78.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{y}{x} \cdot z}} \]
    8. Simplified83.6%

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

    if -2.89999999999999988e41 < y < 3.99999999999999976e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \color{blue}{x \cdot \frac{2}{y \cdot z - t \cdot z}} \]
      2. distribute-rgt-out--87.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{y + \left(-t\right)}}}{z} \]
      5. +-commutative88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.1%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg88.1%

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval88.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot z} \cdot -2} \]
      2. *-commutative75.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \cdot -2 \]
    6. Simplified80.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t} \cdot -2} \]

    if 3.99999999999999976e39 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*l/82.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+39}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\ \end{array} \]

Alternative 9: 73.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+34}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -4.4e+34)
   (/ 2.0 (* z (/ y x)))
   (if (<= y 1.25e+39) (/ (/ -2.0 t) (/ z x)) (/ 2.0 (/ y (/ x z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4.4e+34) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 1.25e+39) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = 2.0 / (y / (x / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-4.4d+34)) then
        tmp = 2.0d0 / (z * (y / x))
    else if (y <= 1.25d+39) then
        tmp = ((-2.0d0) / t) / (z / x)
    else
        tmp = 2.0d0 / (y / (x / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4.4e+34) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 1.25e+39) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = 2.0 / (y / (x / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -4.4e+34:
		tmp = 2.0 / (z * (y / x))
	elif y <= 1.25e+39:
		tmp = (-2.0 / t) / (z / x)
	else:
		tmp = 2.0 / (y / (x / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -4.4e+34)
		tmp = Float64(2.0 / Float64(z * Float64(y / x)));
	elseif (y <= 1.25e+39)
		tmp = Float64(Float64(-2.0 / t) / Float64(z / x));
	else
		tmp = Float64(2.0 / Float64(y / Float64(x / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -4.4e+34)
		tmp = 2.0 / (z * (y / x));
	elseif (y <= 1.25e+39)
		tmp = (-2.0 / t) / (z / x);
	else
		tmp = 2.0 / (y / (x / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e+34], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+39], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.4000000000000005e34

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--82.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 78.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{y}{x} \cdot z}} \]
    8. Simplified83.6%

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

    if -4.4000000000000005e34 < y < 1.25000000000000004e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. *-commutative94.3%

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

        \[\leadsto \frac{2}{y - t} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv95.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    5. Applied egg-rr95.2%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Step-by-step derivation
      1. flip--70.0%

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

        \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    7. Applied egg-rr70.0%

      \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    8. Taylor expanded in y around 0 80.9%

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

    if 1.25000000000000004e39 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*l/82.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+34}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\ \end{array} \]

Alternative 10: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{y}}{\frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.9e+34)
   (/ 2.0 (* z (/ y x)))
   (if (<= y 8.2e+40) (/ (/ -2.0 t) (/ z x)) (/ (/ 2.0 y) (/ z x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.9e+34) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 8.2e+40) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = (2.0 / y) / (z / x);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.9d+34)) then
        tmp = 2.0d0 / (z * (y / x))
    else if (y <= 8.2d+40) then
        tmp = ((-2.0d0) / t) / (z / x)
    else
        tmp = (2.0d0 / y) / (z / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.9e+34) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 8.2e+40) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = (2.0 / y) / (z / x);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2.9e+34:
		tmp = 2.0 / (z * (y / x))
	elif y <= 8.2e+40:
		tmp = (-2.0 / t) / (z / x)
	else:
		tmp = (2.0 / y) / (z / x)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.9e+34)
		tmp = Float64(2.0 / Float64(z * Float64(y / x)));
	elseif (y <= 8.2e+40)
		tmp = Float64(Float64(-2.0 / t) / Float64(z / x));
	else
		tmp = Float64(Float64(2.0 / y) / Float64(z / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.9e+34)
		tmp = 2.0 / (z * (y / x));
	elseif (y <= 8.2e+40)
		tmp = (-2.0 / t) / (z / x);
	else
		tmp = (2.0 / y) / (z / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e+34], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+40], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 8.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.9000000000000001e34

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--82.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 78.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{y}{x} \cdot z}} \]
    8. Simplified83.6%

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

    if -2.9000000000000001e34 < y < 8.2000000000000003e40

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. *-commutative94.3%

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

        \[\leadsto \frac{2}{y - t} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv95.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    5. Applied egg-rr95.2%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Step-by-step derivation
      1. flip--70.0%

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

        \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    7. Applied egg-rr70.0%

      \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    8. Taylor expanded in y around 0 80.9%

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

    if 8.2000000000000003e40 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.9%

        \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(y - t\right)}} \]
      2. times-frac94.5%

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

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

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

        \[\leadsto \frac{2}{y - t} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv94.6%

        \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    5. Applied egg-rr94.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Step-by-step derivation
      1. flip--50.6%

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

        \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    7. Applied egg-rr50.7%

      \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    8. Taylor expanded in y around inf 86.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{y}}{\frac{z}{x}}\\ \end{array} \]

Alternative 11: 73.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+37}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot 2}{z}}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -6.4e+37)
   (/ 2.0 (* z (/ y x)))
   (if (<= y 4.3e+39) (/ (/ -2.0 t) (/ z x)) (/ (/ (* x 2.0) z) y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6.4e+37) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 4.3e+39) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = ((x * 2.0) / z) / y;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-6.4d+37)) then
        tmp = 2.0d0 / (z * (y / x))
    else if (y <= 4.3d+39) then
        tmp = ((-2.0d0) / t) / (z / x)
    else
        tmp = ((x * 2.0d0) / z) / y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6.4e+37) {
		tmp = 2.0 / (z * (y / x));
	} else if (y <= 4.3e+39) {
		tmp = (-2.0 / t) / (z / x);
	} else {
		tmp = ((x * 2.0) / z) / y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -6.4e+37:
		tmp = 2.0 / (z * (y / x))
	elif y <= 4.3e+39:
		tmp = (-2.0 / t) / (z / x)
	else:
		tmp = ((x * 2.0) / z) / y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -6.4e+37)
		tmp = Float64(2.0 / Float64(z * Float64(y / x)));
	elseif (y <= 4.3e+39)
		tmp = Float64(Float64(-2.0 / t) / Float64(z / x));
	else
		tmp = Float64(Float64(Float64(x * 2.0) / z) / y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -6.4e+37)
		tmp = 2.0 / (z * (y / x));
	elseif (y <= 4.3e+39)
		tmp = (-2.0 / t) / (z / x);
	else
		tmp = ((x * 2.0) / z) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e+37], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e+39], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.40000000000000027e37

    1. Initial program 74.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--82.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 78.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{y}{x} \cdot z}} \]
    8. Simplified83.6%

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

    if -6.40000000000000027e37 < y < 4.3e39

    1. Initial program 87.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
    4. Step-by-step derivation
      1. *-commutative94.3%

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

        \[\leadsto \frac{2}{y - t} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv95.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    5. Applied egg-rr95.2%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Step-by-step derivation
      1. flip--70.0%

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

        \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    7. Applied egg-rr70.0%

      \[\leadsto \frac{\color{blue}{\frac{2}{y \cdot y - t \cdot t} \cdot \left(y + t\right)}}{\frac{z}{x}} \]
    8. Taylor expanded in y around 0 80.9%

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

    if 4.3e39 < y

    1. Initial program 82.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--87.9%

        \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(y - t\right)}} \]
      2. times-frac94.5%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      2. frac-times94.5%

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

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

      \[\leadsto \color{blue}{\frac{2}{\frac{z}{x} \cdot \left(y - t\right)}} \]
    6. Taylor expanded in y around inf 81.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+37}:\\ \;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot 2}{z}}{y}\\ \end{array} \]

Alternative 12: 92.2% accurate, 1.2× speedup?

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

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

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
  2. Step-by-step derivation
    1. associate-*l/83.4%

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

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

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

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

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

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

Alternative 13: 54.4% accurate, 1.6× speedup?

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

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

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
  2. Step-by-step derivation
    1. associate-*l/83.4%

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

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

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

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

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

    \[\leadsto 2 \cdot \color{blue}{\frac{x}{y \cdot z}} \]
  5. Final simplification48.8%

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

Developer target: 97.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\ \mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
        (t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
   (if (< t_2 -2.559141628295061e-13)
     t_1
     (if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / ((y - t) * z)) * 2.0;
	double t_2 = (x * 2.0) / ((y * z) - (t * z));
	double tmp;
	if (t_2 < -2.559141628295061e-13) {
		tmp = t_1;
	} else if (t_2 < 1.045027827330126e-269) {
		tmp = ((x / z) * 2.0) / (y - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x / ((y - t) * z)) * 2.0d0
    t_2 = (x * 2.0d0) / ((y * z) - (t * z))
    if (t_2 < (-2.559141628295061d-13)) then
        tmp = t_1
    else if (t_2 < 1.045027827330126d-269) then
        tmp = ((x / z) * 2.0d0) / (y - t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / ((y - t) * z)) * 2.0;
	double t_2 = (x * 2.0) / ((y * z) - (t * z));
	double tmp;
	if (t_2 < -2.559141628295061e-13) {
		tmp = t_1;
	} else if (t_2 < 1.045027827330126e-269) {
		tmp = ((x / z) * 2.0) / (y - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / ((y - t) * z)) * 2.0
	t_2 = (x * 2.0) / ((y * z) - (t * z))
	tmp = 0
	if t_2 < -2.559141628295061e-13:
		tmp = t_1
	elif t_2 < 1.045027827330126e-269:
		tmp = ((x / z) * 2.0) / (y - t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0)
	t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z)))
	tmp = 0.0
	if (t_2 < -2.559141628295061e-13)
		tmp = t_1;
	elseif (t_2 < 1.045027827330126e-269)
		tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / ((y - t) * z)) * 2.0;
	t_2 = (x * 2.0) / ((y * z) - (t * z));
	tmp = 0.0;
	if (t_2 < -2.559141628295061e-13)
		tmp = t_1;
	elseif (t_2 < 1.045027827330126e-269)
		tmp = ((x / z) * 2.0) / (y - t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023240 
(FPCore (x y z t)
  :name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))

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