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

Percentage Accurate: 94.8% → 96.5%
Time: 8.7s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 94.8% 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}{z + -1}\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t\_1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
   (if (<= t_1 5e+306) (* t_1 x) (/ (* y x) z))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= 5e+306) {
		tmp = t_1 * x;
	} else {
		tmp = (y * x) / z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y / z) + (t / (z + (-1.0d0)))
    if (t_1 <= 5d+306) then
        tmp = t_1 * x
    else
        tmp = (y * x) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) + (t / (z + -1.0));
	double tmp;
	if (t_1 <= 5e+306) {
		tmp = t_1 * x;
	} else {
		tmp = (y * x) / z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) + (t / (z + -1.0))
	tmp = 0
	if t_1 <= 5e+306:
		tmp = t_1 * x
	else:
		tmp = (y * x) / z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))
	tmp = 0.0
	if (t_1 <= 5e+306)
		tmp = Float64(t_1 * x);
	else
		tmp = Float64(Float64(y * x) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) + (t / (z + -1.0));
	tmp = 0.0;
	if (t_1 <= 5e+306)
		tmp = t_1 * x;
	else
		tmp = (y * x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+306], N[(t$95$1 * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_1 \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.99999999999999993e306

    1. Initial program 96.2%

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

    if 4.99999999999999993e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 73.2%

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

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

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

Alternative 2: 65.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{+82}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.06000000000000006e82

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in53.2%

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

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

    if -1.06000000000000006e82 < t < 9.8000000000000002e-290

    1. Initial program 97.4%

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

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

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

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

    if 9.8000000000000002e-290 < t < 1.3e148

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(\frac{y}{t \cdot z} \cdot \left(-x\right)\right)\right)}^{1} \]
      4. sqrt-unprod12.2%

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

        \[\leadsto {\left(\sqrt{\color{blue}{t \cdot t}} \cdot \left(\frac{y}{t \cdot z} \cdot \left(-x\right)\right)\right)}^{1} \]
      6. sqrt-unprod12.1%

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

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

        \[\leadsto {\left(t \cdot \color{blue}{\frac{y \cdot \left(-x\right)}{t \cdot z}}\right)}^{1} \]
      9. times-frac11.9%

        \[\leadsto {\left(t \cdot \color{blue}{\left(\frac{y}{t} \cdot \frac{-x}{z}\right)}\right)}^{1} \]
      10. add-sqr-sqrt6.8%

        \[\leadsto {\left(t \cdot \left(\frac{y}{t} \cdot \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z}\right)\right)}^{1} \]
      11. sqrt-unprod31.6%

        \[\leadsto {\left(t \cdot \left(\frac{y}{t} \cdot \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z}\right)\right)}^{1} \]
      12. sqr-neg31.6%

        \[\leadsto {\left(t \cdot \left(\frac{y}{t} \cdot \frac{\sqrt{\color{blue}{x \cdot x}}}{z}\right)\right)}^{1} \]
      13. sqrt-unprod30.6%

        \[\leadsto {\left(t \cdot \left(\frac{y}{t} \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z}\right)\right)}^{1} \]
      14. add-sqr-sqrt58.2%

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

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

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

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

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

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

    if 1.3e148 < t

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{-1 \cdot \color{blue}{\left(-1 \cdot y - t\right)}}{z} \]
      9. *-commutative68.5%

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

        \[\leadsto x \cdot \color{blue}{\left(\frac{-1 \cdot y - t}{z} \cdot -1\right)} \]
      11. *-commutative68.5%

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot \left(-1 \cdot y - t\right)}{z}} \]
      13. sub-neg68.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      20. +-commutative68.5%

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
    5. Simplified68.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.06 \cdot 10^{+82}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq 9.8 \cdot 10^{-290}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+148}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\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 1.0)))
   (* 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 <= 1.0)) {
		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 <= 1.0d0))) 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 <= 1.0)) {
		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 <= 1.0):
		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 <= 1.0))
		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 <= 1.0)))
		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, 1.0]], $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 1\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 1 < z

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot \left(-1 \cdot y - t\right)}{z}} \]
      13. sub-neg94.3%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      20. +-commutative94.3%

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

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

    if -1 < z < 1

    1. Initial program 92.9%

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

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{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 1\right):\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.00000000000000001e78 or 2.99999999999999989e31 < t

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(-\frac{x}{1 - z}\right)} \]
      4. distribute-neg-frac267.4%

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

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

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

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

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

    if -1.00000000000000001e78 < t < 2.99999999999999989e31

    1. Initial program 92.9%

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

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

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

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

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

Alternative 5: 73.8% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.79999999999999981e86

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\frac{-1 \cdot y - t}{z} \cdot -1\right)} \]
      11. *-commutative98.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      20. +-commutative98.0%

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

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

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

    if -5.79999999999999981e86 < z < 2.4999999999999998e44

    1. Initial program 93.8%

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

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

    if 2.4999999999999998e44 < z

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 46.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.00079 \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 -0.00079) (not (<= z 1.0))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -0.00079) || !(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 <= (-0.00079d0)) .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 <= -0.00079) || !(z <= 1.0)) {
		tmp = x * (t / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -0.00079) 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 <= -0.00079) || !(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 <= -0.00079) || ~((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, -0.00079], 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 -0.00079 \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 < -7.90000000000000012e-4 or 1 < z

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      20. +-commutative94.4%

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

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

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

    if -7.90000000000000012e-4 < z < 1

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in41.9%

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

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

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

Alternative 7: 43.9% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(-\frac{x}{1 - z}\right)} \]
      4. distribute-neg-frac251.4%

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

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

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

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

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

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

    if -7.90000000000000012e-4 < z < 1

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in41.9%

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

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

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

Alternative 8: 65.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+82}:\\
\;\;\;\;t \cdot \left(-x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.5000000000000003e82

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in53.2%

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

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

    if -6.5000000000000003e82 < t < 9.00000000000000016e147

    1. Initial program 93.1%

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

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

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

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

    if 9.00000000000000016e147 < t

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{-1 \cdot \color{blue}{\left(-1 \cdot y - t\right)}}{z} \]
      9. *-commutative68.5%

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

        \[\leadsto x \cdot \color{blue}{\left(\frac{-1 \cdot y - t}{z} \cdot -1\right)} \]
      11. *-commutative68.5%

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot \left(-1 \cdot y - t\right)}{z}} \]
      13. sub-neg68.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      20. +-commutative68.5%

        \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
    5. Simplified68.5%

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

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

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

Alternative 9: 24.0% 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.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. distribute-rgt-neg-in28.5%

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

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

Alternative 10: 10.0% accurate, 3.7× speedup?

\[\begin{array}{l} \\ t \cdot x \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 * 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 x
\end{array}
Derivation
  1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. distribute-rgt-neg-in28.5%

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

    \[\leadsto \color{blue}{t \cdot \left(-x\right)} \]
  9. Step-by-step derivation
    1. neg-sub028.5%

      \[\leadsto t \cdot \color{blue}{\left(0 - x\right)} \]
    2. sub-neg28.5%

      \[\leadsto t \cdot \color{blue}{\left(0 + \left(-x\right)\right)} \]
    3. add-sqr-sqrt17.1%

      \[\leadsto t \cdot \left(0 + \color{blue}{\sqrt{-x} \cdot \sqrt{-x}}\right) \]
    4. sqrt-unprod22.8%

      \[\leadsto t \cdot \left(0 + \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}\right) \]
    5. sqr-neg22.8%

      \[\leadsto t \cdot \left(0 + \sqrt{\color{blue}{x \cdot x}}\right) \]
    6. sqrt-unprod4.5%

      \[\leadsto t \cdot \left(0 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}\right) \]
    7. add-sqr-sqrt11.2%

      \[\leadsto t \cdot \left(0 + \color{blue}{x}\right) \]
  10. Applied egg-rr11.2%

    \[\leadsto t \cdot \color{blue}{\left(0 + x\right)} \]
  11. Step-by-step derivation
    1. +-lft-identity11.2%

      \[\leadsto t \cdot \color{blue}{x} \]
  12. Simplified11.2%

    \[\leadsto t \cdot \color{blue}{x} \]
  13. Add Preprocessing

Developer Target 1: 95.1% accurate, 0.2× 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 2024170 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))

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