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

Percentage Accurate: 94.1% → 96.0%
Time: 7.5s
Alternatives: 11
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 94.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.0% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.5%

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

    if 5.00000000000000026e300 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))

    1. Initial program 64.9%

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

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

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

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-y, \frac{1}{-z}, -\frac{t}{1 - z}\right)} \]
      4. distribute-neg-frac64.9%

        \[\leadsto x \cdot \mathsf{fma}\left(-y, \frac{1}{-z}, \color{blue}{\frac{-t}{1 - z}}\right) \]
    3. Applied egg-rr64.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.75 \lor \neg \left(z \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\

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


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

    1. Initial program 98.5%

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

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

        \[\leadsto \color{blue}{\frac{y - -1 \cdot t}{\frac{z}{x}}} \]
      2. associate-/r/97.7%

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

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

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

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

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

    if -0.75 < z < 2.8000000000000002e-13

    1. Initial program 92.1%

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

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

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

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

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

Alternative 3: 66.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+260} \lor \neg \left(t \leq 8.5 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.80000000000000014e206 or 4.8000000000000001e95 < t < 6.49999999999999954e260 or 8.4999999999999994e297 < t

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000014e206 < t < 4.8000000000000001e95

    1. Initial program 95.8%

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

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

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

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-y, \frac{1}{-z}, -\frac{t}{1 - z}\right)} \]
      4. distribute-neg-frac95.6%

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

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-y, \frac{1}{-z}, \frac{-t}{1 - z}\right)} \]
    4. Step-by-step derivation
      1. fma-udef95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.49999999999999954e260 < t < 8.4999999999999994e297

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+206}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+95}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+260} \lor \neg \left(t \leq 8.5 \cdot 10^{+297}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 4: 67.9% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 7.5 \cdot 10^{+260} \lor \neg \left(t \leq 5.1 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.60000000000000001e146 or 1.10000000000000006e94 < t < 7.49999999999999947e260 or 5.0999999999999999e297 < t

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.60000000000000001e146 < t < 1.10000000000000006e94

    1. Initial program 96.1%

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

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

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

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

    if 7.49999999999999947e260 < t < 5.0999999999999999e297

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.6 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+94}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+260} \lor \neg \left(t \leq 5.1 \cdot 10^{+297}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 68.2% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 8.6 \cdot 10^{+260} \lor \neg \left(t \leq 1.82 \cdot 10^{+297}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.20000000000000002e144 or 9.4999999999999995e92 < t < 8.60000000000000048e260 or 1.8199999999999999e297 < t

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.20000000000000002e144 < t < 9.4999999999999995e92

    1. Initial program 96.1%

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

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

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

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

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

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

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

    if 8.60000000000000048e260 < t < 1.8199999999999999e297

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{+144}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+92}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{+260} \lor \neg \left(t \leq 1.82 \cdot 10^{+297}\right):\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-x\right)\\ \end{array} \]

Alternative 6: 73.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} \cdot x\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -12000000000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+165}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ y z) x)))
   (if (<= z -2.8e+136)
     t_1
     (if (<= z -12000000000.0)
       (* x (/ t z))
       (if (<= z 2.85e+35)
         (* x (- (/ y z) t))
         (if (<= z 6.9e+165) (/ (* t x) z) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) * x;
	double tmp;
	if (z <= -2.8e+136) {
		tmp = t_1;
	} else if (z <= -12000000000.0) {
		tmp = x * (t / z);
	} else if (z <= 2.85e+35) {
		tmp = x * ((y / z) - t);
	} else if (z <= 6.9e+165) {
		tmp = (t * x) / 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 <= (-2.8d+136)) then
        tmp = t_1
    else if (z <= (-12000000000.0d0)) then
        tmp = x * (t / z)
    else if (z <= 2.85d+35) then
        tmp = x * ((y / z) - t)
    else if (z <= 6.9d+165) then
        tmp = (t * x) / 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 <= -2.8e+136) {
		tmp = t_1;
	} else if (z <= -12000000000.0) {
		tmp = x * (t / z);
	} else if (z <= 2.85e+35) {
		tmp = x * ((y / z) - t);
	} else if (z <= 6.9e+165) {
		tmp = (t * x) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) * x
	tmp = 0
	if z <= -2.8e+136:
		tmp = t_1
	elif z <= -12000000000.0:
		tmp = x * (t / z)
	elif z <= 2.85e+35:
		tmp = x * ((y / z) - t)
	elif z <= 6.9e+165:
		tmp = (t * x) / 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 <= -2.8e+136)
		tmp = t_1;
	elseif (z <= -12000000000.0)
		tmp = Float64(x * Float64(t / z));
	elseif (z <= 2.85e+35)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 6.9e+165)
		tmp = Float64(Float64(t * x) / 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 <= -2.8e+136)
		tmp = t_1;
	elseif (z <= -12000000000.0)
		tmp = x * (t / z);
	elseif (z <= 2.85e+35)
		tmp = x * ((y / z) - t);
	elseif (z <= 6.9e+165)
		tmp = (t * x) / 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, -2.8e+136], t$95$1, If[LessEqual[z, -12000000000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e+35], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.9e+165], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -12000000000:\\
\;\;\;\;x \cdot \frac{t}{z}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.8000000000000002e136 or 6.90000000000000006e165 < z

    1. Initial program 97.4%

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

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

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

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

    if -2.8000000000000002e136 < z < -1.2e10

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e10 < z < 2.84999999999999997e35

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

    if 2.84999999999999997e35 < z < 6.90000000000000006e165

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+136}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -12000000000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+165}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 7: 73.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} \cdot x\\ \mathbf{if}\;z \leq -1.55 \cdot 10^{+136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -13:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{+166}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ y z) x)))
   (if (<= z -1.55e+136)
     t_1
     (if (<= z -13.0)
       (* x (/ t (+ z -1.0)))
       (if (<= z 1.65e+35)
         (* x (- (/ y z) t))
         (if (<= z 1.56e+166) (/ (* t x) z) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) * x;
	double tmp;
	if (z <= -1.55e+136) {
		tmp = t_1;
	} else if (z <= -13.0) {
		tmp = x * (t / (z + -1.0));
	} else if (z <= 1.65e+35) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.56e+166) {
		tmp = (t * x) / 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 <= (-1.55d+136)) then
        tmp = t_1
    else if (z <= (-13.0d0)) then
        tmp = x * (t / (z + (-1.0d0)))
    else if (z <= 1.65d+35) then
        tmp = x * ((y / z) - t)
    else if (z <= 1.56d+166) then
        tmp = (t * x) / 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 <= -1.55e+136) {
		tmp = t_1;
	} else if (z <= -13.0) {
		tmp = x * (t / (z + -1.0));
	} else if (z <= 1.65e+35) {
		tmp = x * ((y / z) - t);
	} else if (z <= 1.56e+166) {
		tmp = (t * x) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) * x
	tmp = 0
	if z <= -1.55e+136:
		tmp = t_1
	elif z <= -13.0:
		tmp = x * (t / (z + -1.0))
	elif z <= 1.65e+35:
		tmp = x * ((y / z) - t)
	elif z <= 1.56e+166:
		tmp = (t * x) / 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 <= -1.55e+136)
		tmp = t_1;
	elseif (z <= -13.0)
		tmp = Float64(x * Float64(t / Float64(z + -1.0)));
	elseif (z <= 1.65e+35)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	elseif (z <= 1.56e+166)
		tmp = Float64(Float64(t * x) / 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 <= -1.55e+136)
		tmp = t_1;
	elseif (z <= -13.0)
		tmp = x * (t / (z + -1.0));
	elseif (z <= 1.65e+35)
		tmp = x * ((y / z) - t);
	elseif (z <= 1.56e+166)
		tmp = (t * x) / 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, -1.55e+136], t$95$1, If[LessEqual[z, -13.0], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+35], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.56e+166], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -13:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.54999999999999992e136 or 1.5599999999999999e166 < z

    1. Initial program 97.4%

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

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

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

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

    if -1.54999999999999992e136 < z < -13

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -13 < z < 1.6500000000000001e35

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

    if 1.6500000000000001e35 < z < 1.5599999999999999e166

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+136}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;z \leq -13:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{+166}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]

Alternative 8: 88.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \lor \neg \left(z \leq 2.8 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\

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


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

    1. Initial program 98.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - -1 \cdot t}}} \]
      3. associate-/r/82.1%

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

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

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

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

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

    if -1.05000000000000004 < z < 2.8000000000000002e-13

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

Alternative 9: 92.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 98.5%

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

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

        \[\leadsto \color{blue}{\frac{y - -1 \cdot t}{\frac{z}{x}}} \]
      2. associate-/r/97.7%

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

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

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

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

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

    if -1 < z < 2.8000000000000002e-13

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

Alternative 10: 42.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1.45 \cdot 10^{-49}\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.45e-49))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.0) || !(z <= 1.45e-49)) {
		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.45d-49))) 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.45e-49)) {
		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.45e-49):
		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.45e-49))
		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.45e-49)))
		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.45e-49]], $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.45 \cdot 10^{-49}\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.45e-49 < z

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < z < 1.45e-49

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 23.3% accurate, 2.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 94.6% 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 2023230 
(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)))))