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

Percentage Accurate: 94.5% → 98.2%
Time: 9.2s
Alternatives: 10
Speedup: 0.3×

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.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: 98.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} + \frac{t}{z + -1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+306}:\\ \;\;\;\;t\_1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{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))
     (if (<= t_1 1e+306) (* t_1 x) (/ y (/ z 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 if (t_1 <= 1e+306) {
		tmp = t_1 * x;
	} else {
		tmp = y / (z / 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 if (t_1 <= 1e+306) {
		tmp = t_1 * x;
	} else {
		tmp = y / (z / 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)
	elif t_1 <= 1e+306:
		tmp = t_1 * x
	else:
		tmp = y / (z / 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(y * Float64(x / z));
	elseif (t_1 <= 1e+306)
		tmp = Float64(t_1 * x);
	else
		tmp = Float64(y / Float64(z / 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);
	elseif (t_1 <= 1e+306)
		tmp = t_1 * x;
	else
		tmp = y / (z / 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[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(t$95$1 * x), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;t\_1 \cdot x\\

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


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

    1. Initial program 66.9%

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

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

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
      2. div-inv66.9%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      5. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
    5. Applied egg-rr99.9%

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

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

    1. Initial program 98.6%

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

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

    1. Initial program 57.1%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      5. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
    5. Applied egg-rr99.9%

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

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

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

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

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

Alternative 2: 73.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -4.05 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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

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

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

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


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

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(t + y\right) \cdot \frac{x}{z}} \]
    6. Taylor expanded in t around inf 76.1%

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

    if -3.0000000000000001e171 < z < -4.0499999999999999e158 or -2.80000000000000011e123 < z < -2.2999999999999999e57 or 1.35e108 < z

    1. Initial program 96.3%

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

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

    if -4.0499999999999999e158 < z < -2.80000000000000011e123

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e57 < z < -1.7999999999999998e32

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(t + y\right) \cdot \frac{x}{z}} \]
    6. Taylor expanded in t around inf 100.0%

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

        \[\leadsto \color{blue}{t \cdot \frac{x}{z}} \]
    8. Simplified100.0%

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

    if -1.7999999999999998e32 < z < 5.80000000000000025e23

    1. Initial program 92.3%

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

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

    if 5.80000000000000025e23 < z < 1.35e108

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+171}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{elif}\;z \leq -4.05 \cdot 10^{+158}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+123}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+57}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+32}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+108}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(-x\right)\\ t_2 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -5.7 \cdot 10^{+206}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{+117}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 10^{+157} \lor \neg \left(t \leq 2.2 \cdot 10^{+192}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- x))) (t_2 (* x (/ t z))))
   (if (<= t -5.7e+206)
     t_1
     (if (<= t -1.65e+117)
       t_2
       (if (<= t 1.85e+114)
         (/ x (/ z y))
         (if (or (<= t 1e+157) (not (<= t 2.2e+192))) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * -x;
	double t_2 = x * (t / z);
	double tmp;
	if (t <= -5.7e+206) {
		tmp = t_1;
	} else if (t <= -1.65e+117) {
		tmp = t_2;
	} else if (t <= 1.85e+114) {
		tmp = x / (z / y);
	} else if ((t <= 1e+157) || !(t <= 2.2e+192)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * -x
    t_2 = x * (t / z)
    if (t <= (-5.7d+206)) then
        tmp = t_1
    else if (t <= (-1.65d+117)) then
        tmp = t_2
    else if (t <= 1.85d+114) then
        tmp = x / (z / y)
    else if ((t <= 1d+157) .or. (.not. (t <= 2.2d+192))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * -x;
	double t_2 = x * (t / z);
	double tmp;
	if (t <= -5.7e+206) {
		tmp = t_1;
	} else if (t <= -1.65e+117) {
		tmp = t_2;
	} else if (t <= 1.85e+114) {
		tmp = x / (z / y);
	} else if ((t <= 1e+157) || !(t <= 2.2e+192)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * -x
	t_2 = x * (t / z)
	tmp = 0
	if t <= -5.7e+206:
		tmp = t_1
	elif t <= -1.65e+117:
		tmp = t_2
	elif t <= 1.85e+114:
		tmp = x / (z / y)
	elif (t <= 1e+157) or not (t <= 2.2e+192):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(-x))
	t_2 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (t <= -5.7e+206)
		tmp = t_1;
	elseif (t <= -1.65e+117)
		tmp = t_2;
	elseif (t <= 1.85e+114)
		tmp = Float64(x / Float64(z / y));
	elseif ((t <= 1e+157) || !(t <= 2.2e+192))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * -x;
	t_2 = x * (t / z);
	tmp = 0.0;
	if (t <= -5.7e+206)
		tmp = t_1;
	elseif (t <= -1.65e+117)
		tmp = t_2;
	elseif (t <= 1.85e+114)
		tmp = x / (z / y);
	elseif ((t <= 1e+157) || ~((t <= 2.2e+192)))
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.7e+206], t$95$1, If[LessEqual[t, -1.65e+117], t$95$2, If[LessEqual[t, 1.85e+114], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1e+157], N[Not[LessEqual[t, 2.2e+192]], $MachinePrecision]], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.65 \cdot 10^{+117}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 10^{+157} \lor \neg \left(t \leq 2.2 \cdot 10^{+192}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.6999999999999998e206 or 9.99999999999999983e156 < t < 2.2000000000000001e192

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-lft-neg-out59.3%

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

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

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

    if -5.6999999999999998e206 < t < -1.6499999999999999e117 or 1.85e114 < t < 9.99999999999999983e156 or 2.2000000000000001e192 < t

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

    if -1.6499999999999999e117 < t < 1.85e114

    1. Initial program 92.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.7 \cdot 10^{+206}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{+117}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 10^{+157} \lor \neg \left(t \leq 2.2 \cdot 10^{+192}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(-x\right)\\ t_2 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -2.4 \cdot 10^{+207}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{+86}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{+111}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+156} \lor \neg \left(t \leq 2.15 \cdot 10^{+192}\right):\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- x))) (t_2 (* x (/ t z))))
   (if (<= t -2.4e+207)
     t_1
     (if (<= t -8.5e+86)
       t_2
       (if (<= t 3.6e+111)
         (* (/ y z) x)
         (if (or (<= t 1.7e+156) (not (<= t 2.15e+192))) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * -x;
	double t_2 = x * (t / z);
	double tmp;
	if (t <= -2.4e+207) {
		tmp = t_1;
	} else if (t <= -8.5e+86) {
		tmp = t_2;
	} else if (t <= 3.6e+111) {
		tmp = (y / z) * x;
	} else if ((t <= 1.7e+156) || !(t <= 2.15e+192)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * -x
    t_2 = x * (t / z)
    if (t <= (-2.4d+207)) then
        tmp = t_1
    else if (t <= (-8.5d+86)) then
        tmp = t_2
    else if (t <= 3.6d+111) then
        tmp = (y / z) * x
    else if ((t <= 1.7d+156) .or. (.not. (t <= 2.15d+192))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * -x;
	double t_2 = x * (t / z);
	double tmp;
	if (t <= -2.4e+207) {
		tmp = t_1;
	} else if (t <= -8.5e+86) {
		tmp = t_2;
	} else if (t <= 3.6e+111) {
		tmp = (y / z) * x;
	} else if ((t <= 1.7e+156) || !(t <= 2.15e+192)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * -x
	t_2 = x * (t / z)
	tmp = 0
	if t <= -2.4e+207:
		tmp = t_1
	elif t <= -8.5e+86:
		tmp = t_2
	elif t <= 3.6e+111:
		tmp = (y / z) * x
	elif (t <= 1.7e+156) or not (t <= 2.15e+192):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(-x))
	t_2 = Float64(x * Float64(t / z))
	tmp = 0.0
	if (t <= -2.4e+207)
		tmp = t_1;
	elseif (t <= -8.5e+86)
		tmp = t_2;
	elseif (t <= 3.6e+111)
		tmp = Float64(Float64(y / z) * x);
	elseif ((t <= 1.7e+156) || !(t <= 2.15e+192))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * -x;
	t_2 = x * (t / z);
	tmp = 0.0;
	if (t <= -2.4e+207)
		tmp = t_1;
	elseif (t <= -8.5e+86)
		tmp = t_2;
	elseif (t <= 3.6e+111)
		tmp = (y / z) * x;
	elseif ((t <= 1.7e+156) || ~((t <= 2.15e+192)))
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+207], t$95$1, If[LessEqual[t, -8.5e+86], t$95$2, If[LessEqual[t, 3.6e+111], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[t, 1.7e+156], N[Not[LessEqual[t, 2.15e+192]], $MachinePrecision]], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -8.5 \cdot 10^{+86}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 1.7 \cdot 10^{+156} \lor \neg \left(t \leq 2.15 \cdot 10^{+192}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.4000000000000001e207 or 1.7e156 < t < 2.14999999999999988e192

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-lft-neg-out59.3%

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

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

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

    if -2.4000000000000001e207 < t < -8.5000000000000005e86 or 3.6000000000000002e111 < t < 1.7e156 or 2.14999999999999988e192 < t

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

    if -8.5000000000000005e86 < t < 3.6000000000000002e111

    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 inf 73.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+207}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{+111}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+156} \lor \neg \left(t \leq 2.15 \cdot 10^{+192}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+31} \lor \neg \left(z \leq 0.000115\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 -4.8e+31) (not (<= z 0.000115)))
   (* x (/ (+ y t) z))
   (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.8e+31) || !(z <= 0.000115)) {
		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 <= (-4.8d+31)) .or. (.not. (z <= 0.000115d0))) 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 <= -4.8e+31) || !(z <= 0.000115)) {
		tmp = x * ((y + t) / z);
	} else {
		tmp = x * ((y / z) - t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -4.8e+31) or not (z <= 0.000115):
		tmp = x * ((y + t) / z)
	else:
		tmp = x * ((y / z) - t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -4.8e+31) || !(z <= 0.000115))
		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 <= -4.8e+31) || ~((z <= 0.000115)))
		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, -4.8e+31], N[Not[LessEqual[z, 0.000115]], $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 -4.8 \cdot 10^{+31} \lor \neg \left(z \leq 0.000115\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 < -4.79999999999999965e31 or 1.15e-4 < 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 97.2%

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

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

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

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

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

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

    if -4.79999999999999965e31 < z < 1.15e-4

    1. Initial program 91.9%

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

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

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

Alternative 6: 93.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000008e-10 < z < 1.15e-4

    1. Initial program 92.3%

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

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

    if 1.15e-4 < z

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

Alternative 7: 74.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

    if -6.99999999999999994e-43 < y < 2.55000000000000004e-80

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

    if 2.55000000000000004e-80 < y

    1. Initial program 92.4%

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

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

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

Alternative 8: 45.4% 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}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ t z)) (* t (- x))))
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 = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
        tmp = x * (t / z)
    else
        tmp = t * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.0) || !(z <= 1.0)) {
		tmp = x * (t / z);
	} else {
		tmp = t * -x;
	}
	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 = t * -x
	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(t * Float64(-x));
	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 = t * -x;
	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[(t * (-x)), $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}:\\
\;\;\;\;t \cdot \left(-x\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.2%

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

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 91.8%

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-lft-neg-out40.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \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 9: 43.1% 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}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.0) (not (<= z 1.0))) (* t (/ x z)) (* t (- x))))
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 = t * -x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.0d0)) .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 <= -1.0) || !(z <= 1.0)) {
		tmp = t * (x / z);
	} else {
		tmp = t * -x;
	}
	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 = t * -x
	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(t * Float64(-x));
	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 = t * -x;
	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[(t * (-x)), $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}:\\
\;\;\;\;t \cdot \left(-x\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 84.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(t + y\right) \cdot \frac{x}{z}} \]
    6. Taylor expanded in t around inf 53.1%

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

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

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

    if -1 < z < 1

    1. Initial program 91.8%

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-lft-neg-out40.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \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 10: 23.6% 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 z around 0 66.0%

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. distribute-lft-neg-out27.0%

      \[\leadsto \color{blue}{\left(-t\right) \cdot x} \]
    3. *-commutative27.0%

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

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

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

Developer target: 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 2024097 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

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

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