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

Percentage Accurate: 94.1% → 96.5%
Time: 7.3s
Alternatives: 12
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

    1. Initial program 97.6%

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

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

Alternative 2: 68.4% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.79999999999999984e145 or 1.05e133 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

    if -4.79999999999999984e145 < t < -3.40000000000000015e-279

    1. Initial program 94.5%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
      2. associate-/r/74.7%

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

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

    if -3.40000000000000015e-279 < t < 1.05e133

    1. Initial program 95.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-279}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \end{array} \]

Alternative 3: 68.3% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.59999999999999974e145 or 1.6000000000000001e131 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

    if -3.59999999999999974e145 < t < -4.9999999999999998e-270

    1. Initial program 94.5%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
      2. associate-/r/74.7%

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
      3. un-div-inv74.9%

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

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

    if -4.9999999999999998e-270 < t < 1.6000000000000001e131

    1. Initial program 95.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    4. Simplified74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-270}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+131}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{t}}\\ \end{array} \]

Alternative 4: 92.8% accurate, 1.0× speedup?

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

    1. Initial program 97.9%

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

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

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

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

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

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

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

    if -2.2499999999999999e22 < z < 5.9000000000000003e-4

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 74.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

    if -2.2000000000000001e42 < z < 5.9000000000000003e-4

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

    if 5.9000000000000003e-4 < z

    1. Initial program 98.1%

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

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

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

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

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

Alternative 6: 92.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq 0.00059:\\
\;\;\;\;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 < -2.2499999999999999e22

    1. Initial program 97.8%

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

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

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

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

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

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

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

    if -2.2499999999999999e22 < z < 5.9000000000000003e-4

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

    if 5.9000000000000003e-4 < z

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 92.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq 0.00059:\\
\;\;\;\;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 < -2.2499999999999999e22

    1. Initial program 97.8%

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

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

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

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

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

    if -2.2499999999999999e22 < z < 5.9000000000000003e-4

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

    if 5.9000000000000003e-4 < z

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

Alternative 8: 41.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\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 -3.5e-35) (not (<= z 0.00059))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.5e-35) || !(z <= 0.00059)) {
		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 <= (-3.5d-35)) .or. (.not. (z <= 0.00059d0))) 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 <= -3.5e-35) || !(z <= 0.00059)) {
		tmp = t * (x / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -3.5e-35) or not (z <= 0.00059):
		tmp = t * (x / z)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -3.5e-35) || !(z <= 0.00059))
		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 <= -3.5e-35) || ~((z <= 0.00059)))
		tmp = t * (x / z);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e-35], N[Not[LessEqual[z, 0.00059]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\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 < -3.49999999999999996e-35 or 5.9000000000000003e-4 < z

    1. Initial program 98.0%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      2. cancel-sign-sub-inv96.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{x}{z}} \]
    7. Simplified51.9%

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

    if -3.49999999999999996e-35 < z < 5.9000000000000003e-4

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 43.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\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 -3.5e-35) (not (<= z 0.00059))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.5e-35) || !(z <= 0.00059)) {
		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 <= (-3.5d-35)) .or. (.not. (z <= 0.00059d0))) 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 <= -3.5e-35) || !(z <= 0.00059)) {
		tmp = x * (t / z);
	} else {
		tmp = t * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -3.5e-35) or not (z <= 0.00059):
		tmp = x * (t / z)
	else:
		tmp = t * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -3.5e-35) || !(z <= 0.00059))
		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 <= -3.5e-35) || ~((z <= 0.00059)))
		tmp = x * (t / z);
	else
		tmp = t * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e-35], N[Not[LessEqual[z, 0.00059]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\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 < -3.49999999999999996e-35 or 5.9000000000000003e-4 < z

    1. Initial program 98.0%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    3. 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} \]
    4. Simplified97.2%

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

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

    if -3.49999999999999996e-35 < z < 5.9000000000000003e-4

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.7% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.8999999999999998e145 or 3.0000000000000001e131 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

    if -3.8999999999999998e145 < t < 3.0000000000000001e131

    1. Initial program 95.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{+145} \lor \neg \left(t \leq 3 \cdot 10^{+131}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 11: 68.7% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.9999999999999998e146 or 1.5e130 < t

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999998e146 < t < 1.5e130

    1. Initial program 95.1%

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

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

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

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

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

Alternative 12: 22.1% 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 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 94.7% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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