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

Percentage Accurate: 94.5% → 96.6%
Time: 11.0s
Alternatives: 12
Speedup: 0.6×

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 12 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.5% 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.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \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 (+ z -1.0)))))
   (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 / (z + -1.0));
	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 / (z + -1.0));
	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 / (z + -1.0))
	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(z + -1.0)))
	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 / (z + -1.0));
	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[(z + -1.0), $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}{z + -1}\\
\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 #s(literal 1 binary64) z))) < -inf.0

    1. Initial program 57.9%

      \[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}} \]

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

    1. Initial program 97.1%

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

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

Alternative 2: 67.0% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;t \leq 2.7 \cdot 10^{+270}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.8499999999999999e216 or 5.3999999999999998e67 < t < 2.6999999999999999e270

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8499999999999999e216 < t < 5.3999999999999998e67

    1. Initial program 95.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr76.6%

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

    if 2.6999999999999999e270 < t

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
    5. Step-by-step derivation
      1. associate-*r*77.2%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
      2. neg-mul-177.2%

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

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

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

Alternative 3: 66.9% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;t \leq 3 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.59999999999999991e216 or 5.3999999999999998e67 < t < 3e273

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4.59999999999999991e216 < t < 5.3999999999999998e67

    1. Initial program 95.0%

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

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

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

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

    if 3e273 < t

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
    5. Step-by-step derivation
      1. associate-*r*77.2%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
      2. neg-mul-177.2%

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

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

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

Alternative 4: 94.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999 < z < 1

    1. Initial program 93.6%

      \[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 \color{blue}{\frac{y + -1 \cdot \left(t \cdot z\right)}{z}} \]
    4. Step-by-step derivation
      1. mul-1-neg92.2%

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{z}{y - \color{blue}{z \cdot t}}} \]
    7. Applied egg-rr92.6%

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

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

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

    if 1 < z

    1. Initial program 96.7%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.7% 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 97.3%

      \[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*96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      21. +-commutative96.8%

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

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

    if -1 < z < 1

    1. Initial program 93.6%

      \[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 simplification94.4%

    \[\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 6: 73.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+117} \lor \neg \left(t \leq 6.6 \cdot 10^{+66}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.12000000000000002e117 or 6.6000000000000003e66 < t

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

    if -1.12000000000000002e117 < t < 6.6000000000000003e66

    1. Initial program 94.9%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num82.8%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr83.0%

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

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

Alternative 7: 93.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 93.6%

      \[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) \]

    if 1 < z

    1. Initial program 96.7%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1500:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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

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


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

    1. Initial program 98.1%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. clear-num69.1%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Applied egg-rr69.2%

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

    if -1500 < z < 3.7999999999999999e95

    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 0 87.8%

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

    if 3.7999999999999999e95 < z

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 44.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
    7. Simplified96.8%

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

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

    if -1 < z < 1

    1. Initial program 93.6%

      \[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) \]
    4. Taylor expanded in y around 0 38.2%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
    5. Step-by-step derivation
      1. associate-*r*38.2%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
      2. neg-mul-138.2%

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

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

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

Alternative 10: 42.4% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
    7. Simplified96.8%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x}{z}} \]
    10. Simplified46.2%

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

    if -1 < z < 1

    1. Initial program 93.6%

      \[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) \]
    4. Taylor expanded in y around 0 38.2%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
    5. Step-by-step derivation
      1. associate-*r*38.2%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
      2. neg-mul-138.2%

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

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

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

Alternative 11: 22.3% accurate, 2.8× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
  5. Step-by-step derivation
    1. associate-*r*24.5%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
    2. neg-mul-124.5%

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

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

    \[\leadsto x \cdot \left(-t\right) \]
  8. Add Preprocessing

Alternative 12: 9.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 95.4%

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(t \cdot x\right)} \]
  5. Step-by-step derivation
    1. associate-*r*24.5%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot x} \]
    2. neg-mul-124.5%

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

    \[\leadsto \color{blue}{\left(-t\right) \cdot x} \]
  7. Step-by-step derivation
    1. add-sqr-sqrt12.2%

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

      \[\leadsto \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot x \]
    3. sqr-neg12.8%

      \[\leadsto \sqrt{\color{blue}{t \cdot t}} \cdot x \]
    4. sqrt-unprod3.0%

      \[\leadsto \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot x \]
    5. add-sqr-sqrt6.3%

      \[\leadsto \color{blue}{t} \cdot x \]
    6. pow16.3%

      \[\leadsto \color{blue}{{\left(t \cdot x\right)}^{1}} \]
  8. Applied egg-rr6.3%

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

      \[\leadsto \color{blue}{t \cdot x} \]
  10. Simplified6.3%

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

Developer Target 1: 95.0% 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 2024135 
(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)))))