Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B

Percentage Accurate: 88.9% → 97.2%
Time: 13.0s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 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: 88.9% accurate, 1.0× speedup?

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

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

Alternative 1: 97.2% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 93.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - z\right) \cdot \left(y - z\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;\frac{x}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- t z) (- y z))))
   (if (<= t_1 (- INFINITY))
     (/ (/ x (- y z)) t)
     (if (<= t_1 2e+279) (/ x t_1) (/ (/ x (- z t)) z)))))
double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (x / (y - z)) / t;
	} else if (t_1 <= 2e+279) {
		tmp = x / t_1;
	} else {
		tmp = (x / (z - t)) / z;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (x / (y - z)) / t;
	} else if (t_1 <= 2e+279) {
		tmp = x / t_1;
	} else {
		tmp = (x / (z - t)) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (t - z) * (y - z)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (x / (y - z)) / t
	elif t_1 <= 2e+279:
		tmp = x / t_1
	else:
		tmp = (x / (z - t)) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(t - z) * Float64(y - z))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(x / Float64(y - z)) / t);
	elseif (t_1 <= 2e+279)
		tmp = Float64(x / t_1);
	else
		tmp = Float64(Float64(x / Float64(z - t)) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (t - z) * (y - z);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (x / (y - z)) / t;
	elseif (t_1 <= 2e+279)
		tmp = x / t_1;
	else
		tmp = (x / (z - t)) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+279], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;\frac{x}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0

    1. Initial program 66.9%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    5. Simplified100.0%

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

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

    if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000012e279

    1. Initial program 99.1%

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

    if 2.00000000000000012e279 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 72.7%

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{\color{blue}{-z}} \]
    7. Simplified88.0%

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

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

Alternative 3: 77.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-32}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{z}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -7.8e+164)
   (/ (/ x z) z)
   (if (<= z -1.6e-32)
     (/ x (* z (- z y)))
     (if (<= z 8.2e+26)
       (/ (/ x t) (- y z))
       (if (<= z 9.4e+157) (/ x (* z (- z t))) (/ (* x (/ 1.0 z)) z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7.8e+164) {
		tmp = (x / z) / z;
	} else if (z <= -1.6e-32) {
		tmp = x / (z * (z - y));
	} else if (z <= 8.2e+26) {
		tmp = (x / t) / (y - z);
	} else if (z <= 9.4e+157) {
		tmp = x / (z * (z - t));
	} else {
		tmp = (x * (1.0 / z)) / 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 (z <= (-7.8d+164)) then
        tmp = (x / z) / z
    else if (z <= (-1.6d-32)) then
        tmp = x / (z * (z - y))
    else if (z <= 8.2d+26) then
        tmp = (x / t) / (y - z)
    else if (z <= 9.4d+157) then
        tmp = x / (z * (z - t))
    else
        tmp = (x * (1.0d0 / z)) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7.8e+164) {
		tmp = (x / z) / z;
	} else if (z <= -1.6e-32) {
		tmp = x / (z * (z - y));
	} else if (z <= 8.2e+26) {
		tmp = (x / t) / (y - z);
	} else if (z <= 9.4e+157) {
		tmp = x / (z * (z - t));
	} else {
		tmp = (x * (1.0 / z)) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -7.8e+164:
		tmp = (x / z) / z
	elif z <= -1.6e-32:
		tmp = x / (z * (z - y))
	elif z <= 8.2e+26:
		tmp = (x / t) / (y - z)
	elif z <= 9.4e+157:
		tmp = x / (z * (z - t))
	else:
		tmp = (x * (1.0 / z)) / z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -7.8e+164)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= -1.6e-32)
		tmp = Float64(x / Float64(z * Float64(z - y)));
	elseif (z <= 8.2e+26)
		tmp = Float64(Float64(x / t) / Float64(y - z));
	elseif (z <= 9.4e+157)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = Float64(Float64(x * Float64(1.0 / z)) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -7.8e+164)
		tmp = (x / z) / z;
	elseif (z <= -1.6e-32)
		tmp = x / (z * (z - y));
	elseif (z <= 8.2e+26)
		tmp = (x / t) / (y - z);
	elseif (z <= 9.4e+157)
		tmp = x / (z * (z - t));
	else
		tmp = (x * (1.0 / z)) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e+164], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1.6e-32], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+26], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.4e+157], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\

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

\mathbf{elif}\;z \leq 9.4 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{z}}{z}\\


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

    1. Initial program 71.4%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg98.1%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+98.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub098.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg98.1%

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

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

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

    if -7.79999999999999971e164 < z < -1.6000000000000001e-32

    1. Initial program 94.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+70.5%

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

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{\left(-\left(-z\right)\right)} - y\right)} \]
      8. remove-double-neg70.5%

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

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

    if -1.6000000000000001e-32 < z < 8.19999999999999967e26

    1. Initial program 90.7%

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

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

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

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

    if 8.19999999999999967e26 < z < 9.40000000000000061e157

    1. Initial program 96.0%

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

      \[\leadsto \frac{x}{\color{blue}{-1 \cdot \left(z \cdot \left(t - z\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg76.6%

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(t - z\right)}} \]
      2. distribute-rgt-neg-in76.6%

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg76.6%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg76.6%

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

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

    if 9.40000000000000061e157 < z

    1. Initial program 77.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(y - z\right)}} \]
      4. neg-sub099.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg99.8%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+99.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub099.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg99.8%

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z}} \]
    7. Step-by-step derivation
      1. div-inv97.8%

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

      \[\leadsto \frac{\color{blue}{x \cdot \frac{1}{z}}}{z} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 4: 72.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+157}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{z}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z (- z t)))))
   (if (<= z -8e+164)
     (/ (/ x z) z)
     (if (<= z -4.8e-58)
       t_1
       (if (<= z 1.2e-20)
         (/ (/ x t) y)
         (if (<= z 3.2e+157) t_1 (/ (* x (/ 1.0 z)) z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (z <= -8e+164) {
		tmp = (x / z) / z;
	} else if (z <= -4.8e-58) {
		tmp = t_1;
	} else if (z <= 1.2e-20) {
		tmp = (x / t) / y;
	} else if (z <= 3.2e+157) {
		tmp = t_1;
	} else {
		tmp = (x * (1.0 / z)) / 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) :: t_1
    real(8) :: tmp
    t_1 = x / (z * (z - t))
    if (z <= (-8d+164)) then
        tmp = (x / z) / z
    else if (z <= (-4.8d-58)) then
        tmp = t_1
    else if (z <= 1.2d-20) then
        tmp = (x / t) / y
    else if (z <= 3.2d+157) then
        tmp = t_1
    else
        tmp = (x * (1.0d0 / z)) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (z <= -8e+164) {
		tmp = (x / z) / z;
	} else if (z <= -4.8e-58) {
		tmp = t_1;
	} else if (z <= 1.2e-20) {
		tmp = (x / t) / y;
	} else if (z <= 3.2e+157) {
		tmp = t_1;
	} else {
		tmp = (x * (1.0 / z)) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (z * (z - t))
	tmp = 0
	if z <= -8e+164:
		tmp = (x / z) / z
	elif z <= -4.8e-58:
		tmp = t_1
	elif z <= 1.2e-20:
		tmp = (x / t) / y
	elif z <= 3.2e+157:
		tmp = t_1
	else:
		tmp = (x * (1.0 / z)) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (z <= -8e+164)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= -4.8e-58)
		tmp = t_1;
	elseif (z <= 1.2e-20)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 3.2e+157)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * Float64(1.0 / z)) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * (z - t));
	tmp = 0.0;
	if (z <= -8e+164)
		tmp = (x / z) / z;
	elseif (z <= -4.8e-58)
		tmp = t_1;
	elseif (z <= 1.2e-20)
		tmp = (x / t) / y;
	elseif (z <= 3.2e+157)
		tmp = t_1;
	else
		tmp = (x * (1.0 / z)) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+164], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -4.8e-58], t$95$1, If[LessEqual[z, 1.2e-20], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 3.2e+157], t$95$1, N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{z}}{z}\\


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

    1. Initial program 71.4%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg98.1%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+98.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub098.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg98.1%

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

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

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

    if -8e164 < z < -4.8000000000000001e-58 or 1.19999999999999996e-20 < z < 3.1999999999999999e157

    1. Initial program 95.2%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(t - z\right)}} \]
      2. distribute-rgt-neg-in73.8%

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

        \[\leadsto \frac{x}{z \cdot \left(-\color{blue}{\left(t + \left(-z\right)\right)}\right)} \]
      4. +-commutative73.8%

        \[\leadsto \frac{x}{z \cdot \left(-\color{blue}{\left(\left(-z\right) + t\right)}\right)} \]
      5. distribute-neg-in73.8%

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg73.8%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg73.8%

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

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

    if -4.8000000000000001e-58 < z < 1.19999999999999996e-20

    1. Initial program 90.0%

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

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

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

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

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

    if 3.1999999999999999e157 < z

    1. Initial program 77.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(y - z\right)}} \]
      4. neg-sub099.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg99.8%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+99.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub099.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg99.8%

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z}} \]
    7. Step-by-step derivation
      1. div-inv97.8%

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

      \[\leadsto \frac{\color{blue}{x \cdot \frac{1}{z}}}{z} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 72.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z}\\ t_2 := \frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-58}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-24}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+157}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x z) z)) (t_2 (/ x (* z (- z t)))))
   (if (<= z -1.15e+165)
     t_1
     (if (<= z -5e-58)
       t_2
       (if (<= z 1.55e-24) (/ (/ x t) y) (if (<= z 3.2e+157) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double t_2 = x / (z * (z - t));
	double tmp;
	if (z <= -1.15e+165) {
		tmp = t_1;
	} else if (z <= -5e-58) {
		tmp = t_2;
	} else if (z <= 1.55e-24) {
		tmp = (x / t) / y;
	} else if (z <= 3.2e+157) {
		tmp = t_2;
	} 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 / z) / z
    t_2 = x / (z * (z - t))
    if (z <= (-1.15d+165)) then
        tmp = t_1
    else if (z <= (-5d-58)) then
        tmp = t_2
    else if (z <= 1.55d-24) then
        tmp = (x / t) / y
    else if (z <= 3.2d+157) then
        tmp = t_2
    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 / z) / z;
	double t_2 = x / (z * (z - t));
	double tmp;
	if (z <= -1.15e+165) {
		tmp = t_1;
	} else if (z <= -5e-58) {
		tmp = t_2;
	} else if (z <= 1.55e-24) {
		tmp = (x / t) / y;
	} else if (z <= 3.2e+157) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / z) / z
	t_2 = x / (z * (z - t))
	tmp = 0
	if z <= -1.15e+165:
		tmp = t_1
	elif z <= -5e-58:
		tmp = t_2
	elif z <= 1.55e-24:
		tmp = (x / t) / y
	elif z <= 3.2e+157:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	t_2 = Float64(x / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (z <= -1.15e+165)
		tmp = t_1;
	elseif (z <= -5e-58)
		tmp = t_2;
	elseif (z <= 1.55e-24)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 3.2e+157)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) / z;
	t_2 = x / (z * (z - t));
	tmp = 0.0;
	if (z <= -1.15e+165)
		tmp = t_1;
	elseif (z <= -5e-58)
		tmp = t_2;
	elseif (z <= 1.55e-24)
		tmp = (x / t) / y;
	elseif (z <= 3.2e+157)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+165], t$95$1, If[LessEqual[z, -5e-58], t$95$2, If[LessEqual[z, 1.55e-24], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 3.2e+157], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-58}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-24}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.15000000000000008e165 or 3.1999999999999999e157 < z

    1. Initial program 74.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(y - z\right)}} \]
      4. neg-sub098.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg98.9%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. +-commutative98.9%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+98.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub098.9%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg98.9%

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

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

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

    if -1.15000000000000008e165 < z < -4.99999999999999977e-58 or 1.55e-24 < z < 3.1999999999999999e157

    1. Initial program 95.2%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(t - z\right)}} \]
      2. distribute-rgt-neg-in73.8%

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

        \[\leadsto \frac{x}{z \cdot \left(-\color{blue}{\left(t + \left(-z\right)\right)}\right)} \]
      4. +-commutative73.8%

        \[\leadsto \frac{x}{z \cdot \left(-\color{blue}{\left(\left(-z\right) + t\right)}\right)} \]
      5. distribute-neg-in73.8%

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg73.8%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg73.8%

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

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

    if -4.99999999999999977e-58 < z < 1.55e-24

    1. Initial program 90.0%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 79.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-32} \lor \neg \left(z \leq 6.5 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.80000000000000008e-32 or 6.50000000000000022e26 < z

    1. Initial program 84.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg76.6%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac289.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg89.7%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(t + \left(-z\right)\right)}} \]
      5. +-commutative89.7%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in89.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg89.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg89.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    5. Simplified89.7%

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

    if -3.80000000000000008e-32 < z < 6.50000000000000022e26

    1. Initial program 90.7%

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

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

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

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

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

Alternative 7: 79.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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


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

    1. Initial program 83.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg84.1%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub084.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg84.1%

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

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

    if -2.69999999999999981e-32 < z < 1.34999999999999993e31

    1. Initial program 90.7%

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

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

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

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

    if 1.34999999999999993e31 < z

    1. Initial program 85.0%

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{\color{blue}{-z}} \]
    7. Simplified89.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 79.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 7.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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


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

    1. Initial program 83.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg84.1%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub084.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg84.1%

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

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

    if -3.80000000000000008e-32 < z < 7.39999999999999977e26

    1. Initial program 90.7%

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

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

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

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

    if 7.39999999999999977e26 < z

    1. Initial program 85.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg76.9%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac289.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(t + \left(-z\right)\right)}} \]
      5. +-commutative89.0%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    5. Simplified89.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 79.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\

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


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

    1. Initial program 83.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg84.1%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub084.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg84.1%

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

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

    if -8.80000000000000022e-33 < z < 2.39999999999999998e27

    1. Initial program 90.7%

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

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

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

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

    if 2.39999999999999998e27 < z

    1. Initial program 85.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg76.9%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac289.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(t + \left(-z\right)\right)}} \]
      5. +-commutative89.0%

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg89.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    5. Simplified89.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 72.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq 160:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.49999999999999995e-66

    1. Initial program 82.9%

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

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

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

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

    if -7.49999999999999995e-66 < t < 160

    1. Initial program 91.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+78.4%

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

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{\left(-\left(-z\right)\right)} - y\right)} \]
      8. remove-double-neg78.4%

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

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

    if 160 < t

    1. Initial program 84.0%

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

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

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

      \[\leadsto \frac{\frac{x}{\color{blue}{t}}}{y - z} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 66.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+73} \lor \neg \left(z \leq 6.6 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.20000000000000001e73 or 6.6e28 < z

    1. Initial program 81.6%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg94.3%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+94.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub094.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg94.3%

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

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

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

    if -1.20000000000000001e73 < z < 6.6e28

    1. Initial program 91.9%

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

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

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

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

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

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

Alternative 12: 50.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+86} \lor \neg \left(z \leq 9.5 \cdot 10^{+122}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.49999999999999996e86 or 9.49999999999999986e122 < z

    1. Initial program 79.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(y - z\right)}} \]
      4. neg-sub096.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg96.0%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. +-commutative96.0%

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+96.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub096.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg96.0%

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-y}} \]
    9. Step-by-step derivation
      1. div-inv47.3%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{-y}} \]
      2. add-sqr-sqrt21.7%

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

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

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

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

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

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

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

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

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

    if -6.49999999999999996e86 < z < 9.49999999999999986e122

    1. Initial program 91.4%

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

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

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

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

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

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

Alternative 13: 48.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+171} \lor \neg \left(z \leq 9 \cdot 10^{+122}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.9999999999999999e171 or 8.99999999999999995e122 < z

    1. Initial program 76.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+97.7%

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg97.7%

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-y}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity48.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{y \cdot z}} \]
    11. Step-by-step derivation
      1. *-lft-identity42.6%

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    12. Simplified42.6%

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

    if -6.9999999999999999e171 < z < 8.99999999999999995e122

    1. Initial program 91.6%

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

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

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

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

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

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

Alternative 14: 45.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4e12 or 1.1200000000000001e-12 < z

    1. Initial program 83.8%

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. sub-neg88.3%

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

        \[\leadsto \frac{\frac{x}{z}}{0 - \color{blue}{\left(\left(-z\right) + y\right)}} \]
      7. associate--r+88.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - \left(-z\right)\right) - y}} \]
      8. neg-sub088.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg88.3%

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-y}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity43.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{y \cdot z}} \]
    11. Step-by-step derivation
      1. *-lft-identity32.4%

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    12. Simplified32.4%

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

    if -4e12 < z < 1.1200000000000001e-12

    1. Initial program 91.1%

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

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

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

Alternative 15: 39.3% accurate, 1.8× speedup?

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

\\
\frac{x}{t \cdot y}
\end{array}
Derivation
  1. Initial program 87.2%

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

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

Developer Target 1: 87.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / 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) :: tmp
    t_1 = (y - z) * (t - z)
    if ((x / t_1) < 0.0d0) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x * (1.0d0 / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (x / t_1) < 0.0:
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x * (1.0 / t_1)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (Float64(x / t_1) < 0.0)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x * Float64(1.0 / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if ((x / t_1) < 0.0)
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x * (1.0 / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024170 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))

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