Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C

Percentage Accurate: 94.6% → 96.5%
Time: 7.7s
Alternatives: 11
Speedup: 0.5×

Specification

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

\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - 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 11 alternatives:

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

Initial Program: 94.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot x}{z}\\

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


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

    1. Initial program 57.7%

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

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

    if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 97.5%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \leq -\infty:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{z} - \frac{t}{1 - z}\right) \cdot x\\ \end{array} \]

Alternative 2: 73.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+225}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+61}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+44} \lor \neg \left(z \leq 2.3 \cdot 10^{+85}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ t z))))
   (if (<= z -1.7e+225)
     t_1
     (if (<= z -1.45e+61)
       (* (/ y z) x)
       (if (or (<= z -6.6e+44) (not (<= z 2.3e+85)))
         t_1
         (* x (- (/ y z) t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (z <= -1.7e+225) {
		tmp = t_1;
	} else if (z <= -1.45e+61) {
		tmp = (y / z) * x;
	} else if ((z <= -6.6e+44) || !(z <= 2.3e+85)) {
		tmp = t_1;
	} else {
		tmp = x * ((y / 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) :: t_1
    real(8) :: tmp
    t_1 = x * (t / z)
    if (z <= (-1.7d+225)) then
        tmp = t_1
    else if (z <= (-1.45d+61)) then
        tmp = (y / z) * x
    else if ((z <= (-6.6d+44)) .or. (.not. (z <= 2.3d+85))) then
        tmp = t_1
    else
        tmp = x * ((y / z) - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t / z);
	double tmp;
	if (z <= -1.7e+225) {
		tmp = t_1;
	} else if (z <= -1.45e+61) {
		tmp = (y / z) * x;
	} else if ((z <= -6.6e+44) || !(z <= 2.3e+85)) {
		tmp = t_1;
	} else {
		tmp = x * ((y / z) - t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t / z)
	tmp = 0
	if z <= -1.7e+225:
		tmp = t_1
	elif z <= -1.45e+61:
		tmp = (y / z) * x
	elif (z <= -6.6e+44) or not (z <= 2.3e+85):
		tmp = t_1
	else:
		tmp = x * ((y / z) - t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (z <= -1.7e+225)
		tmp = t_1;
	elseif (z <= -1.45e+61)
		tmp = Float64(Float64(y / z) * x);
	elseif ((z <= -6.6e+44) || !(z <= 2.3e+85))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(Float64(y / z) - t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t / z);
	tmp = 0.0;
	if (z <= -1.7e+225)
		tmp = t_1;
	elseif (z <= -1.45e+61)
		tmp = (y / z) * x;
	elseif ((z <= -6.6e+44) || ~((z <= 2.3e+85)))
		tmp = t_1;
	else
		tmp = x * ((y / z) - t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+225], t$95$1, If[LessEqual[z, -1.45e+61], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[z, -6.6e+44], N[Not[LessEqual[z, 2.3e+85]], $MachinePrecision]], t$95$1, N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+225}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -6.6 \cdot 10^{+44} \lor \neg \left(z \leq 2.3 \cdot 10^{+85}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.70000000000000009e225 or -1.45e61 < z < -6.60000000000000027e44 or 2.2999999999999999e85 < z

    1. Initial program 95.7%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg66.3%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative66.3%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in66.3%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-171.2%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative71.2%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/71.0%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval71.0%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-171.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity71.2%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub071.2%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-71.2%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval71.2%

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around inf 71.2%

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

    if -1.70000000000000009e225 < z < -1.45e61

    1. Initial program 96.6%

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

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

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

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

    if -6.60000000000000027e44 < z < 2.2999999999999999e85

    1. Initial program 93.4%

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot x + \color{blue}{\left(-t\right)} \cdot x \]
      4. distribute-rgt-out87.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+61}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+44} \lor \neg \left(z \leq 2.3 \cdot 10^{+85}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \]

Alternative 3: 93.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      3. neg-mul-195.7%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - \left(-t\right)}}} \]
    5. Taylor expanded in z around 0 95.7%

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

    if -1.79999999999999992e-11 < z < 0.0519999999999999976

    1. Initial program 92.0%

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

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

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

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

    if 0.0519999999999999976 < z

    1. Initial program 96.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    3. Step-by-step derivation
      1. cancel-sign-sub-inv94.0%

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
    4. Simplified94.0%

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

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

Alternative 4: 64.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq -8.6 \cdot 10^{+23}:\\
\;\;\;\;x \cdot \frac{t}{z}\\

\mathbf{elif}\;t \leq 1.45 \cdot 10^{+113}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3e253 or 1.44999999999999992e113 < t

    1. Initial program 95.6%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg84.6%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative84.6%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in84.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-186.0%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative86.0%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/85.9%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval85.9%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-185.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity86.0%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub086.0%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-86.0%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval86.0%

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around 0 58.2%

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

        \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
    7. Simplified58.2%

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

    if -2.3e253 < t < -8.5999999999999997e23

    1. Initial program 91.5%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg60.0%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative60.0%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in60.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-170.5%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative70.5%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/70.4%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval70.4%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-170.4%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity70.5%

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

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-70.5%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval70.5%

        \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
    4. Simplified70.5%

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around inf 55.2%

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

    if -8.5999999999999997e23 < t < 1.44999999999999992e113

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{+253}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq -8.6 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+113}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 64.9% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;t \leq 1.92 \cdot 10^{+118}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.9999999999999996e253 or 1.9199999999999999e118 < t

    1. Initial program 95.6%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg84.6%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative84.6%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in84.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-186.0%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative86.0%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/85.9%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval85.9%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-185.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity86.0%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub086.0%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-86.0%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval86.0%

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

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around 0 58.2%

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

        \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
    7. Simplified58.2%

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

    if -5.9999999999999996e253 < t < -1.85e24

    1. Initial program 91.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      3. neg-mul-169.6%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - \left(-t\right)}}} \]
    5. Taylor expanded in y around 0 55.2%

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

    if -1.85e24 < t < 1.9199999999999999e118

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+253}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq -1.85 \cdot 10^{+24}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 1.92 \cdot 10^{+118}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 6: 64.2% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+168}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.09999999999999994e253 or 6.49999999999999999e168 < t

    1. Initial program 98.0%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg89.3%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative89.3%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in89.3%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-191.3%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative91.3%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/91.3%

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

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-191.3%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity91.3%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub091.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-91.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval91.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
    4. Simplified91.3%

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around 0 64.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
    7. Simplified64.7%

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

    if -5.09999999999999994e253 < t < -1.85e24

    1. Initial program 91.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      3. neg-mul-169.6%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - \left(-t\right)}}} \]
    5. Taylor expanded in y around 0 55.2%

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

    if -1.85e24 < t < 6.49999999999999999e168

    1. Initial program 94.1%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1 \cdot \left(1 - z\right) - \frac{z}{y} \cdot t}{\frac{z}{y} \cdot \left(1 - z\right)}} \]
      3. *-un-lft-identity78.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}} \]
    6. Simplified77.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+253}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq -1.85 \cdot 10^{+24}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+168}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 7: 75.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+23} \lor \neg \left(t \leq 4.3 \cdot 10^{+109}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.5000000000000001e23 or 4.3000000000000001e109 < t

    1. Initial program 93.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg74.6%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative74.6%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in74.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-179.7%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative79.7%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/79.6%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval79.6%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-179.6%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity79.7%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub079.7%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-79.7%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval79.7%

        \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
    4. Simplified79.7%

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

    if -8.5000000000000001e23 < t < 4.3000000000000001e109

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+23} \lor \neg \left(t \leq 4.3 \cdot 10^{+109}\right):\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 8: 93.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.052\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\

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


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

    1. Initial program 96.9%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    3. Step-by-step derivation
      1. cancel-sign-sub-inv95.1%

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

        \[\leadsto x \cdot \frac{y + \color{blue}{1} \cdot t}{z} \]
      3. *-lft-identity95.1%

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

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

    if -1 < z < 0.0519999999999999976

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.052\right):\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \]

Alternative 9: 93.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      3. neg-mul-195.7%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - \left(-t\right)}}} \]
    5. Taylor expanded in z around 0 95.7%

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

    if -1.79999999999999992e-11 < z < 0.0519999999999999976

    1. Initial program 92.0%

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot x + \color{blue}{\left(-t\right)} \cdot x \]
      4. distribute-rgt-out91.4%

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

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

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

    if 0.0519999999999999976 < z

    1. Initial program 96.4%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    3. Step-by-step derivation
      1. cancel-sign-sub-inv94.0%

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
    4. Simplified94.0%

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

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

Alternative 10: 44.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-11} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\


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

    1. Initial program 96.8%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg53.3%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative53.3%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in53.3%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-156.3%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative56.3%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/56.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval56.2%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-156.2%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity56.3%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub056.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-56.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval56.3%

        \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
    4. Simplified56.3%

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around inf 54.5%

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

    if -1.79999999999999992e-11 < z < 1

    1. Initial program 92.2%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
      2. mul-1-neg42.0%

        \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
      3. *-commutative42.0%

        \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
      4. distribute-rgt-neg-in42.0%

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. neg-mul-141.9%

        \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
      7. *-commutative41.9%

        \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
      8. associate-*r/41.9%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
      9. metadata-eval41.9%

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

        \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
      11. neg-mul-141.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      13. *-rgt-identity41.9%

        \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
      14. neg-sub041.9%

        \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
      15. associate--r-41.9%

        \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
      16. metadata-eval41.9%

        \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
    4. Simplified41.9%

      \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
    5. Taylor expanded in z around 0 41.3%

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

        \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
    7. Simplified41.3%

      \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{-11} \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 11: 23.3% accurate, 2.8× speedup?

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

\\
t \cdot \left(-x\right)
\end{array}
Derivation
  1. Initial program 94.4%

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot x\right)}{1 - z}} \]
    2. mul-1-neg47.3%

      \[\leadsto \frac{\color{blue}{-t \cdot x}}{1 - z} \]
    3. *-commutative47.3%

      \[\leadsto \frac{-\color{blue}{x \cdot t}}{1 - z} \]
    4. distribute-rgt-neg-in47.3%

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

      \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
    6. neg-mul-148.8%

      \[\leadsto x \cdot \frac{\color{blue}{-1 \cdot t}}{1 - z} \]
    7. *-commutative48.8%

      \[\leadsto x \cdot \frac{\color{blue}{t \cdot -1}}{1 - z} \]
    8. associate-*r/48.7%

      \[\leadsto x \cdot \color{blue}{\left(t \cdot \frac{-1}{1 - z}\right)} \]
    9. metadata-eval48.7%

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

      \[\leadsto x \cdot \left(t \cdot \color{blue}{\frac{1}{-1 \cdot \left(1 - z\right)}}\right) \]
    11. neg-mul-148.7%

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

      \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
    13. *-rgt-identity48.8%

      \[\leadsto x \cdot \frac{\color{blue}{t}}{-\left(1 - z\right)} \]
    14. neg-sub048.8%

      \[\leadsto x \cdot \frac{t}{\color{blue}{0 - \left(1 - z\right)}} \]
    15. associate--r-48.8%

      \[\leadsto x \cdot \frac{t}{\color{blue}{\left(0 - 1\right) + z}} \]
    16. metadata-eval48.8%

      \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + z} \]
  4. Simplified48.8%

    \[\leadsto \color{blue}{x \cdot \frac{t}{-1 + z}} \]
  5. Taylor expanded in z around 0 27.4%

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

      \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
  7. Simplified27.4%

    \[\leadsto x \cdot \color{blue}{\left(-t\right)} \]
  8. Final simplification27.4%

    \[\leadsto t \cdot \left(-x\right) \]

Developer target: 94.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023192 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :herbie-target
  (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))

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