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

Percentage Accurate: 94.0% → 96.4%
Time: 10.0s
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.0% 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.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 64.8%

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f6464.8

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
      4. div-invN/A

        \[\leadsto \color{blue}{\left(y \cdot \frac{1}{z}\right)} \cdot x \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
      7. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{1}{z} \cdot x\right)} \]
      8. lower-/.f6499.7

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{z}} \cdot x\right) \]
      2. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{1}{z} \cdot x\right)} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right) \cdot y} \]
      4. lower-*.f6499.7

        \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right) \cdot y} \]
      5. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right)} \cdot y \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{z}\right)} \cdot y \]
      7. lift-/.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\frac{1}{z}}\right) \cdot y \]
      8. div-invN/A

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot y \]
      9. lower-/.f6499.9

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

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

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

    1. Initial program 97.5%

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

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

Alternative 2: 93.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.75:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - \mathsf{fma}\left(z, t, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y + t}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -0.75)
   (* x (/ (+ y t) z))
   (if (<= z 1.0) (* x (- (/ y z) (fma z t t))) (/ x (/ z (+ y t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.75) {
		tmp = x * ((y + t) / z);
	} else if (z <= 1.0) {
		tmp = x * ((y / z) - fma(z, t, t));
	} else {
		tmp = x / (z / (y + t));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -0.75)
		tmp = Float64(x * Float64(Float64(y + t) / z));
	elseif (z <= 1.0)
		tmp = Float64(x * Float64(Float64(y / z) - fma(z, t, t)));
	else
		tmp = Float64(x / Float64(z / Float64(y + t)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.75], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - N[(z * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 98.2%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. lower-+.f6497.9

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

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

    if -0.75 < z < 1

    1. Initial program 93.2%

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
      3. lower-fma.f6492.5

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    5. Simplified92.5%

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

    if 1 < z

    1. Initial program 97.9%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. lower-+.f6497.1

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

      \[\leadsto x \cdot \color{blue}{\frac{y + t}{z}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto x \cdot \frac{\color{blue}{y + t}}{z} \]
      2. clear-numN/A

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{y + t}}} \]
      3. un-div-invN/A

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y + t}}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y + t}}} \]
      5. lower-/.f6497.2

        \[\leadsto \frac{x}{\color{blue}{\frac{z}{y + t}}} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x}{\frac{z}{\color{blue}{y + t}}} \]
      7. +-commutativeN/A

        \[\leadsto \frac{x}{\frac{z}{\color{blue}{t + y}}} \]
      8. lower-+.f6497.2

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

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

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

Alternative 3: 93.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y + t}{z}\\ \mathbf{if}\;z \leq -0.75:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - \mathsf{fma}\left(z, t, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (+ y t) z))))
   (if (<= z -0.75) t_1 (if (<= z 1.0) (* x (- (/ y z) (fma z t t))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y + t) / z);
	double tmp;
	if (z <= -0.75) {
		tmp = t_1;
	} else if (z <= 1.0) {
		tmp = x * ((y / z) - fma(z, t, t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y + t) / z))
	tmp = 0.0
	if (z <= -0.75)
		tmp = t_1;
	elseif (z <= 1.0)
		tmp = Float64(x * Float64(Float64(y / z) - fma(z, t, t)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.75], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - N[(z * t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 98.1%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. lower-+.f6497.5

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

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

    if -0.75 < z < 1

    1. Initial program 93.2%

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
      3. lower-fma.f6492.5

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    5. Simplified92.5%

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 93.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y + t}{z}\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \mathsf{fma}\left(t, -1, \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (+ y t) z))))
   (if (<= z -1.0) t_1 (if (<= z 1.0) (* x (fma t -1.0 (/ y z))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y + t) / z);
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= 1.0) {
		tmp = x * fma(t, -1.0, (y / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y + t) / z))
	tmp = 0.0
	if (z <= -1.0)
		tmp = t_1;
	elseif (z <= 1.0)
		tmp = Float64(x * fma(t, -1.0, Float64(y / z)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(t * -1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 98.1%

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

      \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
      3. metadata-evalN/A

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

        \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
      5. lower-+.f6497.5

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

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

    if -1 < z < 1

    1. Initial program 93.2%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - \frac{t}{1 - z}\right) \]
      2. lift--.f64N/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \frac{t}{\color{blue}{1 - z}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\frac{t}{1 - z}}\right) \]
      4. sub-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(\mathsf{neg}\left(\frac{t}{1 - z}\right)\right)\right)} \]
      5. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{t}{1 - z}\right)\right) + \frac{y}{z}\right)} \]
      6. lift-/.f64N/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\frac{t}{1 - z}}\right)\right) + \frac{y}{z}\right) \]
      7. distribute-neg-frac2N/A

        \[\leadsto x \cdot \left(\color{blue}{\frac{t}{\mathsf{neg}\left(\left(1 - z\right)\right)}} + \frac{y}{z}\right) \]
      8. div-invN/A

        \[\leadsto x \cdot \left(\color{blue}{t \cdot \frac{1}{\mathsf{neg}\left(\left(1 - z\right)\right)}} + \frac{y}{z}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(t, \frac{1}{\mathsf{neg}\left(\left(1 - z\right)\right)}, \frac{y}{z}\right)} \]
      10. lower-/.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{\frac{1}{\mathsf{neg}\left(\left(1 - z\right)\right)}}, \frac{y}{z}\right) \]
      11. lift--.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \frac{1}{\mathsf{neg}\left(\color{blue}{\left(1 - z\right)}\right)}, \frac{y}{z}\right) \]
      12. sub-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \frac{1}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)}, \frac{y}{z}\right) \]
      13. distribute-neg-inN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \frac{1}{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)}}, \frac{y}{z}\right) \]
      14. metadata-evalN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \frac{1}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)}, \frac{y}{z}\right) \]
      15. remove-double-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(t, \frac{1}{-1 + \color{blue}{z}}, \frac{y}{z}\right) \]
      16. lower-+.f6493.3

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(t, \color{blue}{-1}, \frac{y}{z}\right) \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 5: 82.1% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y + t}{z}\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{-99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-61}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ (+ y t) z))))
       (if (<= z -1.1e-99) t_1 (if (<= z 2.5e-61) (* y (/ x z)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * ((y + t) / z);
    	double tmp;
    	if (z <= -1.1e-99) {
    		tmp = t_1;
    	} else if (z <= 2.5e-61) {
    		tmp = y * (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 = x * ((y + t) / z)
        if (z <= (-1.1d-99)) then
            tmp = t_1
        else if (z <= 2.5d-61) then
            tmp = y * (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 = x * ((y + t) / z);
    	double tmp;
    	if (z <= -1.1e-99) {
    		tmp = t_1;
    	} else if (z <= 2.5e-61) {
    		tmp = y * (x / z);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * ((y + t) / z)
    	tmp = 0
    	if z <= -1.1e-99:
    		tmp = t_1
    	elif z <= 2.5e-61:
    		tmp = y * (x / z)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(Float64(y + t) / z))
    	tmp = 0.0
    	if (z <= -1.1e-99)
    		tmp = t_1;
    	elseif (z <= 2.5e-61)
    		tmp = Float64(y * Float64(x / z));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * ((y + t) / z);
    	tmp = 0.0;
    	if (z <= -1.1e-99)
    		tmp = t_1;
    	elseif (z <= 2.5e-61)
    		tmp = y * (x / z);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e-99], t$95$1, If[LessEqual[z, 2.5e-61], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{y + t}{z}\\
    \mathbf{if}\;z \leq -1.1 \cdot 10^{-99}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 2.5 \cdot 10^{-61}:\\
    \;\;\;\;y \cdot \frac{x}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.10000000000000002e-99 or 2.4999999999999999e-61 < z

      1. Initial program 98.5%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. cancel-sign-sub-invN/A

          \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
        3. metadata-evalN/A

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

          \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
        5. lower-+.f6490.2

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

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

      if -1.10000000000000002e-99 < z < 2.4999999999999999e-61

      1. Initial program 90.8%

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

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f6470.7

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

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
        3. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
        4. div-invN/A

          \[\leadsto \color{blue}{\left(y \cdot \frac{1}{z}\right)} \cdot x \]
        5. associate-*l*N/A

          \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
        6. lower-*.f64N/A

          \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
        7. lower-*.f64N/A

          \[\leadsto y \cdot \color{blue}{\left(\frac{1}{z} \cdot x\right)} \]
        8. lower-/.f6477.1

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

        \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot x\right)} \]
      8. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto y \cdot \left(\color{blue}{\frac{1}{z}} \cdot x\right) \]
        2. lift-*.f64N/A

          \[\leadsto y \cdot \color{blue}{\left(\frac{1}{z} \cdot x\right)} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right) \cdot y} \]
        4. lower-*.f6477.1

          \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right) \cdot y} \]
        5. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{z} \cdot x\right)} \cdot y \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(x \cdot \frac{1}{z}\right)} \cdot y \]
        7. lift-/.f64N/A

          \[\leadsto \left(x \cdot \color{blue}{\frac{1}{z}}\right) \cdot y \]
        8. div-invN/A

          \[\leadsto \color{blue}{\frac{x}{z}} \cdot y \]
        9. lower-/.f6477.2

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-99}:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-61}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y + t}{z}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 74.9% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z + -1}\\ \mathbf{if}\;t \leq -1.02 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+165}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ t (+ z -1.0)))))
       (if (<= t -1.02e+21) t_1 (if (<= t 1.8e+165) (* (/ y z) x) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * (t / (z + -1.0));
    	double tmp;
    	if (t <= -1.02e+21) {
    		tmp = t_1;
    	} else if (t <= 1.8e+165) {
    		tmp = (y / z) * x;
    	} 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 * (t / (z + (-1.0d0)))
        if (t <= (-1.02d+21)) then
            tmp = t_1
        else if (t <= 1.8d+165) then
            tmp = (y / z) * x
        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 * (t / (z + -1.0));
    	double tmp;
    	if (t <= -1.02e+21) {
    		tmp = t_1;
    	} else if (t <= 1.8e+165) {
    		tmp = (y / z) * x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * (t / (z + -1.0))
    	tmp = 0
    	if t <= -1.02e+21:
    		tmp = t_1
    	elif t <= 1.8e+165:
    		tmp = (y / z) * x
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(t / Float64(z + -1.0)))
    	tmp = 0.0
    	if (t <= -1.02e+21)
    		tmp = t_1;
    	elseif (t <= 1.8e+165)
    		tmp = Float64(Float64(y / z) * x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * (t / (z + -1.0));
    	tmp = 0.0;
    	if (t <= -1.02e+21)
    		tmp = t_1;
    	elseif (t <= 1.8e+165)
    		tmp = (y / z) * x;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.02e+21], t$95$1, If[LessEqual[t, 1.8e+165], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{t}{z + -1}\\
    \mathbf{if}\;t \leq -1.02 \cdot 10^{+21}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 1.8 \cdot 10^{+165}:\\
    \;\;\;\;\frac{y}{z} \cdot x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -1.02e21 or 1.7999999999999999e165 < t

      1. Initial program 95.1%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot \frac{t}{1 - z}} \]
        4. *-commutativeN/A

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

          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \frac{t}{1 - z}\right)} \]
        6. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \frac{t}{1 - z}\right)} \]
        7. mul-1-negN/A

          \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t}{1 - z}\right)\right)} \]
        8. distribute-neg-frac2N/A

          \[\leadsto x \cdot \color{blue}{\frac{t}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
        9. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{t}{\mathsf{neg}\left(\left(1 - z\right)\right)}} \]
        10. sub-negN/A

          \[\leadsto x \cdot \frac{t}{\mathsf{neg}\left(\color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)} \]
        11. mul-1-negN/A

          \[\leadsto x \cdot \frac{t}{\mathsf{neg}\left(\left(1 + \color{blue}{-1 \cdot z}\right)\right)} \]
        12. distribute-neg-inN/A

          \[\leadsto x \cdot \frac{t}{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(-1 \cdot z\right)\right)}} \]
        13. metadata-evalN/A

          \[\leadsto x \cdot \frac{t}{\color{blue}{-1} + \left(\mathsf{neg}\left(-1 \cdot z\right)\right)} \]
        14. mul-1-negN/A

          \[\leadsto x \cdot \frac{t}{-1 + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right)} \]
        15. remove-double-negN/A

          \[\leadsto x \cdot \frac{t}{-1 + \color{blue}{z}} \]
        16. +-commutativeN/A

          \[\leadsto x \cdot \frac{t}{\color{blue}{z + -1}} \]
        17. lower-+.f6478.9

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

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

      if -1.02e21 < t < 1.7999999999999999e165

      1. Initial program 95.6%

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

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f6481.4

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

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

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

    Alternative 7: 68.8% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -1.5 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+165}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ t z))))
       (if (<= t -1.5e+148) t_1 (if (<= t 3e+165) (* (/ y z) x) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * (t / z);
    	double tmp;
    	if (t <= -1.5e+148) {
    		tmp = t_1;
    	} else if (t <= 3e+165) {
    		tmp = (y / z) * x;
    	} 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 * (t / z)
        if (t <= (-1.5d+148)) then
            tmp = t_1
        else if (t <= 3d+165) then
            tmp = (y / z) * x
        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 * (t / z);
    	double tmp;
    	if (t <= -1.5e+148) {
    		tmp = t_1;
    	} else if (t <= 3e+165) {
    		tmp = (y / z) * x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * (t / z)
    	tmp = 0
    	if t <= -1.5e+148:
    		tmp = t_1
    	elif t <= 3e+165:
    		tmp = (y / z) * x
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(t / z))
    	tmp = 0.0
    	if (t <= -1.5e+148)
    		tmp = t_1;
    	elseif (t <= 3e+165)
    		tmp = Float64(Float64(y / z) * x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * (t / z);
    	tmp = 0.0;
    	if (t <= -1.5e+148)
    		tmp = t_1;
    	elseif (t <= 3e+165)
    		tmp = (y / z) * x;
    	else
    		tmp = t_1;
    	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.5e+148], t$95$1, If[LessEqual[t, 3e+165], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{t}{z}\\
    \mathbf{if}\;t \leq -1.5 \cdot 10^{+148}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 3 \cdot 10^{+165}:\\
    \;\;\;\;\frac{y}{z} \cdot x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -1.50000000000000007e148 or 2.9999999999999999e165 < t

      1. Initial program 95.3%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. cancel-sign-sub-invN/A

          \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
        3. metadata-evalN/A

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

          \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
        5. lower-+.f6467.6

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t}{z}} \]
      7. Step-by-step derivation
        1. lower-/.f6459.6

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

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

      if -1.50000000000000007e148 < t < 2.9999999999999999e165

      1. Initial program 95.5%

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

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f6478.1

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+148}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+165}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 44.8% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;z \leq -0.75:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \left(t \cdot \left(-1 - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ t z))))
       (if (<= z -0.75) t_1 (if (<= z 1.0) (* x (* t (- -1.0 z))) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * (t / z);
    	double tmp;
    	if (z <= -0.75) {
    		tmp = t_1;
    	} else if (z <= 1.0) {
    		tmp = x * (t * (-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) :: tmp
        t_1 = x * (t / z)
        if (z <= (-0.75d0)) then
            tmp = t_1
        else if (z <= 1.0d0) then
            tmp = x * (t * ((-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 * (t / z);
    	double tmp;
    	if (z <= -0.75) {
    		tmp = t_1;
    	} else if (z <= 1.0) {
    		tmp = x * (t * (-1.0 - z));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * (t / z)
    	tmp = 0
    	if z <= -0.75:
    		tmp = t_1
    	elif z <= 1.0:
    		tmp = x * (t * (-1.0 - z))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(t / z))
    	tmp = 0.0
    	if (z <= -0.75)
    		tmp = t_1;
    	elseif (z <= 1.0)
    		tmp = Float64(x * Float64(t * Float64(-1.0 - z)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * (t / z);
    	tmp = 0.0;
    	if (z <= -0.75)
    		tmp = t_1;
    	elseif (z <= 1.0)
    		tmp = x * (t * (-1.0 - z));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.75], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(t * N[(-1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{t}{z}\\
    \mathbf{if}\;z \leq -0.75:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1:\\
    \;\;\;\;x \cdot \left(t \cdot \left(-1 - z\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -0.75 or 1 < z

      1. Initial program 98.1%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. cancel-sign-sub-invN/A

          \[\leadsto x \cdot \frac{\color{blue}{y + \left(\mathsf{neg}\left(-1\right)\right) \cdot t}}{z} \]
        3. metadata-evalN/A

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

          \[\leadsto x \cdot \frac{y + \color{blue}{t}}{z} \]
        5. lower-+.f6497.5

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t}{z}} \]
      7. Step-by-step derivation
        1. lower-/.f6458.4

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

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

      if -0.75 < z < 1

      1. Initial program 93.2%

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

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

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
        3. lower-fma.f6492.5

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
      5. Simplified92.5%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(t + t \cdot z\right)\right)} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(t + t \cdot z\right)\right)} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \color{blue}{x \cdot \left(\mathsf{neg}\left(\left(t + t \cdot z\right)\right)\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\mathsf{neg}\left(\left(t + t \cdot z\right)\right)\right)} \]
        4. *-rgt-identityN/A

          \[\leadsto x \cdot \left(\mathsf{neg}\left(\left(\color{blue}{t \cdot 1} + t \cdot z\right)\right)\right) \]
        5. distribute-lft-inN/A

          \[\leadsto x \cdot \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(1 + z\right)}\right)\right) \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(\mathsf{neg}\left(\left(1 + z\right)\right)\right)\right)} \]
        7. +-commutativeN/A

          \[\leadsto x \cdot \left(t \cdot \left(\mathsf{neg}\left(\color{blue}{\left(z + 1\right)}\right)\right)\right) \]
        8. distribute-neg-inN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) \]
        9. mul-1-negN/A

          \[\leadsto x \cdot \left(t \cdot \left(\color{blue}{-1 \cdot z} + \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
        10. sub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 \cdot z - 1\right)}\right) \]
        11. lower-*.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-1 \cdot z - 1\right)\right)} \]
        12. sub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 \cdot z + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) \]
        13. metadata-evalN/A

          \[\leadsto x \cdot \left(t \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
        14. +-commutativeN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
        15. mul-1-negN/A

          \[\leadsto x \cdot \left(t \cdot \left(-1 + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) \]
        16. unsub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 - z\right)}\right) \]
        17. lower--.f6435.1

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

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-1 - z\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 20.5% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+36}:\\ \;\;\;\;z \cdot \left(t \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-1 - z\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -4e+36) (* z (* t (- x))) (* x (* t (- -1.0 z)))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -4e+36) {
    		tmp = z * (t * -x);
    	} else {
    		tmp = x * (t * (-1.0 - z));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if (z <= (-4d+36)) then
            tmp = z * (t * -x)
        else
            tmp = x * (t * ((-1.0d0) - z))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -4e+36) {
    		tmp = z * (t * -x);
    	} else {
    		tmp = x * (t * (-1.0 - z));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -4e+36:
    		tmp = z * (t * -x)
    	else:
    		tmp = x * (t * (-1.0 - z))
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -4e+36)
    		tmp = Float64(z * Float64(t * Float64(-x)));
    	else
    		tmp = Float64(x * Float64(t * Float64(-1.0 - z)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -4e+36)
    		tmp = z * (t * -x);
    	else
    		tmp = x * (t * (-1.0 - z));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -4e+36], N[(z * N[(t * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * N[(-1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -4 \cdot 10^{+36}:\\
    \;\;\;\;z \cdot \left(t \cdot \left(-x\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \left(t \cdot \left(-1 - z\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.00000000000000017e36

      1. Initial program 98.1%

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

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

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
        3. lower-fma.f645.6

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
      5. Simplified5.6%

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
      6. Taylor expanded in z around inf

        \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot z\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto -1 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot z\right)} \]
        2. associate-*r*N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \left(t \cdot x\right)\right) \cdot z} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t \cdot x\right)\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t \cdot x\right)\right)} \]
        5. mul-1-negN/A

          \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(t \cdot x\right)\right)} \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto z \cdot \color{blue}{\left(t \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \]
        7. mul-1-negN/A

          \[\leadsto z \cdot \left(t \cdot \color{blue}{\left(-1 \cdot x\right)}\right) \]
        8. lower-*.f64N/A

          \[\leadsto z \cdot \color{blue}{\left(t \cdot \left(-1 \cdot x\right)\right)} \]
        9. mul-1-negN/A

          \[\leadsto z \cdot \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
        10. lower-neg.f6413.3

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

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

      if -4.00000000000000017e36 < z

      1. Initial program 94.7%

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

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

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
        3. lower-fma.f6468.9

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
      5. Simplified68.9%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(t + t \cdot z\right)\right)} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(t + t \cdot z\right)\right)} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \color{blue}{x \cdot \left(\mathsf{neg}\left(\left(t + t \cdot z\right)\right)\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\mathsf{neg}\left(\left(t + t \cdot z\right)\right)\right)} \]
        4. *-rgt-identityN/A

          \[\leadsto x \cdot \left(\mathsf{neg}\left(\left(\color{blue}{t \cdot 1} + t \cdot z\right)\right)\right) \]
        5. distribute-lft-inN/A

          \[\leadsto x \cdot \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(1 + z\right)}\right)\right) \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(\mathsf{neg}\left(\left(1 + z\right)\right)\right)\right)} \]
        7. +-commutativeN/A

          \[\leadsto x \cdot \left(t \cdot \left(\mathsf{neg}\left(\color{blue}{\left(z + 1\right)}\right)\right)\right) \]
        8. distribute-neg-inN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) \]
        9. mul-1-negN/A

          \[\leadsto x \cdot \left(t \cdot \left(\color{blue}{-1 \cdot z} + \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
        10. sub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 \cdot z - 1\right)}\right) \]
        11. lower-*.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-1 \cdot z - 1\right)\right)} \]
        12. sub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 \cdot z + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) \]
        13. metadata-evalN/A

          \[\leadsto x \cdot \left(t \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
        14. +-commutativeN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
        15. mul-1-negN/A

          \[\leadsto x \cdot \left(t \cdot \left(-1 + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) \]
        16. unsub-negN/A

          \[\leadsto x \cdot \left(t \cdot \color{blue}{\left(-1 - z\right)}\right) \]
        17. lower--.f6426.2

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

        \[\leadsto \color{blue}{x \cdot \left(t \cdot \left(-1 - z\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 9.7% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ z \cdot \left(t \cdot \left(-x\right)\right) \end{array} \]
    (FPCore (x y z t) :precision binary64 (* z (* t (- x))))
    double code(double x, double y, double z, double t) {
    	return z * (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 = z * (t * -x)
    end function
    
    public static double code(double x, double y, double z, double t) {
    	return z * (t * -x);
    }
    
    def code(x, y, z, t):
    	return z * (t * -x)
    
    function code(x, y, z, t)
    	return Float64(z * Float64(t * Float64(-x)))
    end
    
    function tmp = code(x, y, z, t)
    	tmp = z * (t * -x);
    end
    
    code[x_, y_, z_, t_] := N[(z * N[(t * (-x)), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    z \cdot \left(t \cdot \left(-x\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 95.4%

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
      3. lower-fma.f6455.8

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    5. Simplified55.8%

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    6. Taylor expanded in z around inf

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -1 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot z\right)} \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(t \cdot x\right)\right) \cdot z} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t \cdot x\right)\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t \cdot x\right)\right)} \]
      5. mul-1-negN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(t \cdot x\right)\right)} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(t \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \]
      7. mul-1-negN/A

        \[\leadsto z \cdot \left(t \cdot \color{blue}{\left(-1 \cdot x\right)}\right) \]
      8. lower-*.f64N/A

        \[\leadsto z \cdot \color{blue}{\left(t \cdot \left(-1 \cdot x\right)\right)} \]
      9. mul-1-negN/A

        \[\leadsto z \cdot \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      10. lower-neg.f6410.6

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

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

    Alternative 11: 5.7% accurate, 2.6× speedup?

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

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

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

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \left(\frac{y}{z} - \left(\color{blue}{z \cdot t} + t\right)\right) \]
      3. lower-fma.f6455.8

        \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    5. Simplified55.8%

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\mathsf{fma}\left(z, t, t\right)}\right) \]
    6. Taylor expanded in z around inf

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(t \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(-1 \cdot t\right) \cdot z\right)} \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(z \cdot \left(-1 \cdot t\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(z \cdot \left(-1 \cdot t\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(t\right)\right)}\right) \]
      5. lower-neg.f646.6

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

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

    Developer Target 1: 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 2024207 
    (FPCore (x y z t)
      :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
      :precision binary64
    
      :alt
      (! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
    
      (* x (- (/ y z) (/ t (- 1.0 z)))))