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

Percentage Accurate: 99.2% → 99.2%
Time: 8.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 99.2% accurate, 1.0× speedup?

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

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

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Final simplification98.6%

    \[\leadsto 1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)} \]
  4. Add Preprocessing

Alternative 2: 89.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-46} \lor \neg \left(y \leq 3400000\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.7999999999999998e-46 or 3.4e6 < y

    1. Initial program 100.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac2100.0%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in100.0%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg100.0%

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

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

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

    if -2.7999999999999998e-46 < y < 3.4e6

    1. Initial program 97.1%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg92.2%

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

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg92.2%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    7. Applied egg-rr86.4%

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

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

Alternative 3: 87.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 2.55 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\

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


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

    1. Initial program 97.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg97.9%

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.2%

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

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.2%

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

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

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

        \[\leadsto 1 + \frac{\color{blue}{-\frac{x}{z}}}{t - y} \]
      2. distribute-neg-frac276.5%

        \[\leadsto 1 + \frac{\color{blue}{\frac{x}{-z}}}{t - y} \]
    7. Simplified76.5%

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

    if -3.7000000000000001e-205 < t < 2.54999999999999984e-61

    1. Initial program 98.3%

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

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

    if 2.54999999999999984e-61 < t

    1. Initial program 99.8%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg99.8%

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac295.3%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      6. remove-double-neg95.3%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.3%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    7. Applied egg-rr96.8%

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

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

Alternative 4: 92.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 7.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\

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


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

    1. Initial program 99.4%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac294.0%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in94.0%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg94.0%

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

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

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

    if -1.95e-110 < t < 7.80000000000000065e-61

    1. Initial program 96.5%

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

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

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

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

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

    if 7.80000000000000065e-61 < t

    1. Initial program 99.8%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg99.8%

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac295.3%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      6. remove-double-neg95.3%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.3%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    7. Applied egg-rr96.8%

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

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

Alternative 5: 92.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 2.35 \cdot 10^{-60}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\

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


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

    1. Initial program 99.4%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac293.9%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg93.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in93.9%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\left(-y\right) + \color{blue}{t}} \]
      7. +-commutative93.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg93.9%

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

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

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

    if -5.4000000000000001e-108 < t < 2.35e-60

    1. Initial program 96.5%

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

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

    if 2.35e-60 < t

    1. Initial program 99.8%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg99.8%

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac295.3%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in95.3%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      6. remove-double-neg95.3%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.3%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    7. Applied egg-rr96.8%

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

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

Alternative 6: 86.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-22}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-54}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.49999999999999977e-22

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.49999999999999977e-22 < y < 6.99999999999999964e-54

    1. Initial program 97.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac292.1%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg92.1%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in92.1%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg92.1%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    7. Applied egg-rr87.0%

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

    if 6.99999999999999964e-54 < y

    1. Initial program 100.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac2100.0%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in100.0%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg100.0%

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 92.9%

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

Alternative 7: 87.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-22}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-56}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.79999999999999995e-22

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.79999999999999995e-22 < y < 2.69999999999999995e-56

    1. Initial program 97.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac292.1%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg92.1%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in92.1%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg92.1%

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

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

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

    if 2.69999999999999995e-56 < y

    1. Initial program 100.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac2100.0%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in100.0%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg100.0%

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 92.9%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.6%

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

Alternative 8: 77.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-169} \lor \neg \left(z \leq 7.9 \cdot 10^{-109}\right):\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.40000000000000015e-169 or 7.8999999999999997e-109 < z

    1. Initial program 99.4%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac298.5%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in98.5%

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

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

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

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 79.5%

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

    if -4.40000000000000015e-169 < z < 7.8999999999999997e-109

    1. Initial program 96.2%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac289.9%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in89.9%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg89.9%

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

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

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

      \[\leadsto \color{blue}{1 + \frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. +-commutative71.8%

        \[\leadsto \color{blue}{\frac{x}{t \cdot y} + 1} \]
      2. *-commutative71.8%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} + 1 \]
    8. Simplified71.8%

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

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

Alternative 9: 77.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-130} \lor \neg \left(t \leq 8.4 \cdot 10^{-223}\right):\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.4999999999999994e-130 or 8.39999999999999929e-223 < t

    1. Initial program 99.2%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac295.5%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.5%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in95.5%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      6. remove-double-neg95.5%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.5%

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 76.9%

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

    if -7.4999999999999994e-130 < t < 8.39999999999999929e-223

    1. Initial program 95.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Step-by-step derivation
      1. sub-neg95.9%

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac299.9%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in99.9%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\left(-y\right) + \color{blue}{t}} \]
      7. +-commutative99.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg99.9%

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

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

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

        \[\leadsto 1 + \frac{\color{blue}{-\frac{x}{z}}}{t - y} \]
      2. distribute-neg-frac286.0%

        \[\leadsto 1 + \frac{\color{blue}{\frac{x}{-z}}}{t - y} \]
    7. Simplified86.0%

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{-z}}}{t - y} \]
    8. Taylor expanded in t around 0 77.8%

      \[\leadsto 1 + \color{blue}{\frac{x}{y \cdot z}} \]
    9. Step-by-step derivation
      1. *-commutative77.8%

        \[\leadsto 1 + \frac{x}{\color{blue}{z \cdot y}} \]
    10. Simplified77.8%

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

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

Alternative 10: 83.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-99}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6e-99 or 1.29999999999999998e-56 < y

    1. Initial program 100.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac298.8%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg98.8%

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

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

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

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

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 89.5%

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

    if -1.6e-99 < y < 1.29999999999999998e-56

    1. Initial program 96.4%

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

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    5. Applied egg-rr75.8%

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

Alternative 11: 84.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-99}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-57}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2000000000000001e-99 or 6.80000000000000032e-57 < y

    1. Initial program 100.0%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac298.8%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg98.8%

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

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

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

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

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 89.5%

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

    if -5.2000000000000001e-99 < y < 6.80000000000000032e-57

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-99}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-57}:\\ \;\;\;\;1 - \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 77.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-167}:\\
\;\;\;\;1\\

\mathbf{elif}\;z \leq 3.5 \cdot 10^{-109}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.20000000000000035e-167 or 3.5e-109 < z

    1. Initial program 99.4%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac298.5%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in98.5%

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

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

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

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 79.5%

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

    if -4.20000000000000035e-167 < z < 3.5e-109

    1. Initial program 96.2%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac289.9%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in89.9%

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg89.9%

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

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

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

      \[\leadsto \color{blue}{1 + \frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. +-commutative71.8%

        \[\leadsto \color{blue}{\frac{x}{t \cdot y} + 1} \]
      2. *-commutative71.8%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} + 1 \]
    8. Simplified71.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot t} + 1} \]
    9. Step-by-step derivation
      1. *-commutative71.8%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} + 1 \]
    10. Applied egg-rr73.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-167}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-109}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 77.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-134}:\\
\;\;\;\;1\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-221}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5000000000000002e-134 or 5.2000000000000004e-221 < t

    1. Initial program 99.2%

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

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

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg95.6%

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

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

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg95.6%

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

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

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
    6. Taylor expanded in x around 0 77.3%

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

    if -2.5000000000000002e-134 < t < 5.2000000000000004e-221

    1. Initial program 95.6%

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

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

        \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
      3. distribute-neg-frac299.9%

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
      4. sub-neg99.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
      5. distribute-neg-in99.9%

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

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\left(-y\right) + \color{blue}{t}} \]
      7. +-commutative99.9%

        \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
      8. sub-neg99.9%

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

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

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

        \[\leadsto 1 + \frac{\color{blue}{-\frac{x}{z}}}{t - y} \]
      2. distribute-neg-frac284.8%

        \[\leadsto 1 + \frac{\color{blue}{\frac{x}{-z}}}{t - y} \]
    7. Simplified84.8%

      \[\leadsto 1 + \frac{\color{blue}{\frac{x}{-z}}}{t - y} \]
    8. Taylor expanded in t around 0 75.9%

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

        \[\leadsto 1 + \frac{x}{\color{blue}{z \cdot y}} \]
    10. Simplified75.9%

      \[\leadsto 1 + \color{blue}{\frac{x}{z \cdot y}} \]
    11. Taylor expanded in x around 0 75.9%

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

        \[\leadsto 1 + \color{blue}{\frac{\frac{x}{z}}{y}} \]
    13. Simplified76.0%

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

Alternative 14: 98.5% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
    3. distribute-neg-frac296.3%

      \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
    4. sub-neg96.3%

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
    5. distribute-neg-in96.3%

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
    6. remove-double-neg96.3%

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

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
    8. sub-neg96.3%

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

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

Alternative 15: 76.2% accurate, 11.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 98.6%

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

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

      \[\leadsto 1 + \left(-\color{blue}{\frac{\frac{x}{y - z}}{y - t}}\right) \]
    3. distribute-neg-frac296.3%

      \[\leadsto 1 + \color{blue}{\frac{\frac{x}{y - z}}{-\left(y - t\right)}} \]
    4. sub-neg96.3%

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
    5. distribute-neg-in96.3%

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
    6. remove-double-neg96.3%

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

      \[\leadsto 1 + \frac{\frac{x}{y - z}}{\color{blue}{t + \left(-y\right)}} \]
    8. sub-neg96.3%

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

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

    \[\leadsto 1 + \frac{\color{blue}{\frac{x}{y}}}{t - y} \]
  6. Taylor expanded in x around 0 74.4%

    \[\leadsto \color{blue}{1} \]
  7. Add Preprocessing

Reproduce

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