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

Percentage Accurate: 94.4% → 94.1%
Time: 8.7s
Alternatives: 10
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 94.4% 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: 94.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < 1.00000000000000002e306

    1. Initial program 96.3%

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

    if 1.00000000000000002e306 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))))

    1. Initial program 80.0%

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

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

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

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

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

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

Alternative 2: 63.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-296}:\\
\;\;\;\;x \cdot \left(-t\right)\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-79}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.4e-69

    1. Initial program 92.4%

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

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

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

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

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

    if -4.4e-69 < y < -1.7999999999999999e-203 or -4.1999999999999999e-296 < y < 2.5e-79

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    7. Simplified61.8%

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

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

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

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

    if -1.7999999999999999e-203 < y < -4.1999999999999999e-296

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in61.4%

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

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

    if 2.5e-79 < y

    1. Initial program 94.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-69}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-203}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-79}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array} \]

Alternative 3: 64.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-296}:\\
\;\;\;\;x \cdot \left(-t\right)\\

\mathbf{elif}\;y \leq 2 \cdot 10^{-80}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.49999999999999951e-69

    1. Initial program 92.4%

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

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

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

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

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

    if -6.49999999999999951e-69 < y < -1e-203 or -1.69999999999999998e-296 < y < 1.99999999999999992e-80

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    7. Simplified61.8%

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

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

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

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

    if -1e-203 < y < -1.69999999999999998e-296

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot x} \]
      2. distribute-rgt-neg-in61.4%

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

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

    if 1.99999999999999992e-80 < y

    1. Initial program 94.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-69}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-203}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-80}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]

Alternative 4: 73.8% accurate, 0.8× speedup?

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

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

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

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

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

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


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

    1. Initial program 98.3%

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

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

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

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

    if -1.25e20 < z < 96000

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

    if 96000 < z < 7.8000000000000007e66

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.8000000000000007e66 < z < 1.05e214

    1. Initial program 90.9%

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

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

    if 1.05e214 < z

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    7. Simplified71.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+20}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 96000:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+66}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+214}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]

Alternative 5: 74.5% accurate, 0.8× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.79999999999999961e-69

    1. Initial program 92.4%

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

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

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

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

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

    if -7.79999999999999961e-69 < y < 1.3000000000000001e-78

    1. Initial program 94.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-t}{1 - z}} \]
      6. distribute-frac-neg76.8%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{t \cdot 1}{-\left(1 - z\right)}} \]
      15. *-rgt-identity76.8%

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

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

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

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

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

    if 1.3000000000000001e-78 < y < 4.79999999999999974e-12

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if 4.79999999999999974e-12 < y < 4.89999999999999972e-12

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.89999999999999972e-12 < y

    1. Initial program 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{-69}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-78}:\\ \;\;\;\;x \cdot \frac{t}{z + -1}\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-12}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]

Alternative 6: 93.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 6.8 \cdot 10^{-7}\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 6.8e-7)))
   (* 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 <= 6.8e-7)) {
		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 <= 6.8d-7))) 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 <= 6.8e-7)) {
		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 <= 6.8e-7):
		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 <= 6.8e-7))
		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 <= 6.8e-7)))
		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, 6.8e-7]], $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 6.8 \cdot 10^{-7}\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 6.79999999999999948e-7 < z

    1. Initial program 96.4%

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

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

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

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

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

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

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

    if -1 < z < 6.79999999999999948e-7

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-69} \lor \neg \left(y \leq 4.9 \cdot 10^{-12}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.5000000000000001e-69 or 4.89999999999999972e-12 < y

    1. Initial program 92.9%

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

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

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

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

    if -3.5000000000000001e-69 < y < 4.89999999999999972e-12

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-69} \lor \neg \left(y \leq 4.6 \cdot 10^{-81}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.00000000000000033e-69 or 4.59999999999999982e-81 < y

    1. Initial program 93.5%

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

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

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

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

    if -5.00000000000000033e-69 < y < 4.59999999999999982e-81

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{x}}} \]
    7. Simplified54.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-69} \lor \neg \left(y \leq 4.6 \cdot 10^{-81}\right):\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \]

Alternative 9: 33.7% accurate, 2.2× speedup?

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

\\
t \cdot \frac{x}{z}
\end{array}
Derivation
  1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 22.9% accurate, 2.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t \cdot x} \]
    2. distribute-rgt-neg-in19.7%

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

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

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

Developer target: 95.1% 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 2023279 
(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)))))