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

Percentage Accurate: 94.5% → 98.3%
Time: 7.3s
Alternatives: 9
Speedup: 0.9×

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 9 alternatives:

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

Initial Program: 94.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+292}:\\
\;\;\;\;x \cdot t\_2\\

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


\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 or 1e292 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

      1. Initial program 97.7%

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

    Alternative 2: 74.5% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{z}\\ t_2 := \left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-143}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-185}:\\ \;\;\;\;\frac{x \cdot t}{z - 1}\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (/ (* x y) z)) (t_2 (* (- (/ y z) t) x)))
       (if (<= y -4e+61)
         t_1
         (if (<= y -2.4e-143)
           t_2
           (if (<= y 3.8e-185)
             (/ (* x t) (- z 1.0))
             (if (<= y 1.18e-20) t_2 t_1))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (x * y) / z;
    	double t_2 = ((y / z) - t) * x;
    	double tmp;
    	if (y <= -4e+61) {
    		tmp = t_1;
    	} else if (y <= -2.4e-143) {
    		tmp = t_2;
    	} else if (y <= 3.8e-185) {
    		tmp = (x * t) / (z - 1.0);
    	} else if (y <= 1.18e-20) {
    		tmp = t_2;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = (x * y) / z
        t_2 = ((y / z) - t) * x
        if (y <= (-4d+61)) then
            tmp = t_1
        else if (y <= (-2.4d-143)) then
            tmp = t_2
        else if (y <= 3.8d-185) then
            tmp = (x * t) / (z - 1.0d0)
        else if (y <= 1.18d-20) then
            tmp = t_2
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = (x * y) / z;
    	double t_2 = ((y / z) - t) * x;
    	double tmp;
    	if (y <= -4e+61) {
    		tmp = t_1;
    	} else if (y <= -2.4e-143) {
    		tmp = t_2;
    	} else if (y <= 3.8e-185) {
    		tmp = (x * t) / (z - 1.0);
    	} else if (y <= 1.18e-20) {
    		tmp = t_2;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = (x * y) / z
    	t_2 = ((y / z) - t) * x
    	tmp = 0
    	if y <= -4e+61:
    		tmp = t_1
    	elif y <= -2.4e-143:
    		tmp = t_2
    	elif y <= 3.8e-185:
    		tmp = (x * t) / (z - 1.0)
    	elif y <= 1.18e-20:
    		tmp = t_2
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(x * y) / z)
    	t_2 = Float64(Float64(Float64(y / z) - t) * x)
    	tmp = 0.0
    	if (y <= -4e+61)
    		tmp = t_1;
    	elseif (y <= -2.4e-143)
    		tmp = t_2;
    	elseif (y <= 3.8e-185)
    		tmp = Float64(Float64(x * t) / Float64(z - 1.0));
    	elseif (y <= 1.18e-20)
    		tmp = t_2;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = (x * y) / z;
    	t_2 = ((y / z) - t) * x;
    	tmp = 0.0;
    	if (y <= -4e+61)
    		tmp = t_1;
    	elseif (y <= -2.4e-143)
    		tmp = t_2;
    	elseif (y <= 3.8e-185)
    		tmp = (x * t) / (z - 1.0);
    	elseif (y <= 1.18e-20)
    		tmp = t_2;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4e+61], t$95$1, If[LessEqual[y, -2.4e-143], t$95$2, If[LessEqual[y, 3.8e-185], N[(N[(x * t), $MachinePrecision] / N[(z - 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.18e-20], t$95$2, t$95$1]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x \cdot y}{z}\\
    t_2 := \left(\frac{y}{z} - t\right) \cdot x\\
    \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq -2.4 \cdot 10^{-143}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;y \leq 3.8 \cdot 10^{-185}:\\
    \;\;\;\;\frac{x \cdot t}{z - 1}\\
    
    \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -3.9999999999999998e61 or 1.1800000000000001e-20 < y

      1. Initial program 88.2%

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

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

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

          \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
        3. lower-*.f6488.0

          \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
      5. Applied rewrites88.0%

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

      if -3.9999999999999998e61 < y < -2.3999999999999999e-143 or 3.7999999999999999e-185 < y < 1.1800000000000001e-20

      1. Initial program 98.6%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
        8. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-t\right) \cdot \color{blue}{x} \]
        2. Taylor expanded in t around 0

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

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

          if -2.3999999999999999e-143 < y < 3.7999999999999999e-185

          1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
            12. lower--.f6475.8

              \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
          5. Applied rewrites75.8%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-143}:\\ \;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-185}:\\ \;\;\;\;\frac{x \cdot t}{z - 1}\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\ \;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]
        6. Add Preprocessing

        Alternative 3: 69.6% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{z}\\ t_2 := \left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-179}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{z} \cdot x\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (/ (* x y) z)) (t_2 (* (- (/ y z) t) x)))
           (if (<= y -4e+61)
             t_1
             (if (<= y -2.1e-179)
               t_2
               (if (<= y 5.6e-226) (* (/ t z) x) (if (<= y 1.18e-20) t_2 t_1))))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (x * y) / z;
        	double t_2 = ((y / z) - t) * x;
        	double tmp;
        	if (y <= -4e+61) {
        		tmp = t_1;
        	} else if (y <= -2.1e-179) {
        		tmp = t_2;
        	} else if (y <= 5.6e-226) {
        		tmp = (t / z) * x;
        	} else if (y <= 1.18e-20) {
        		tmp = t_2;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: t_2
            real(8) :: tmp
            t_1 = (x * y) / z
            t_2 = ((y / z) - t) * x
            if (y <= (-4d+61)) then
                tmp = t_1
            else if (y <= (-2.1d-179)) then
                tmp = t_2
            else if (y <= 5.6d-226) then
                tmp = (t / z) * x
            else if (y <= 1.18d-20) then
                tmp = t_2
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = (x * y) / z;
        	double t_2 = ((y / z) - t) * x;
        	double tmp;
        	if (y <= -4e+61) {
        		tmp = t_1;
        	} else if (y <= -2.1e-179) {
        		tmp = t_2;
        	} else if (y <= 5.6e-226) {
        		tmp = (t / z) * x;
        	} else if (y <= 1.18e-20) {
        		tmp = t_2;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = (x * y) / z
        	t_2 = ((y / z) - t) * x
        	tmp = 0
        	if y <= -4e+61:
        		tmp = t_1
        	elif y <= -2.1e-179:
        		tmp = t_2
        	elif y <= 5.6e-226:
        		tmp = (t / z) * x
        	elif y <= 1.18e-20:
        		tmp = t_2
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(x * y) / z)
        	t_2 = Float64(Float64(Float64(y / z) - t) * x)
        	tmp = 0.0
        	if (y <= -4e+61)
        		tmp = t_1;
        	elseif (y <= -2.1e-179)
        		tmp = t_2;
        	elseif (y <= 5.6e-226)
        		tmp = Float64(Float64(t / z) * x);
        	elseif (y <= 1.18e-20)
        		tmp = t_2;
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = (x * y) / z;
        	t_2 = ((y / z) - t) * x;
        	tmp = 0.0;
        	if (y <= -4e+61)
        		tmp = t_1;
        	elseif (y <= -2.1e-179)
        		tmp = t_2;
        	elseif (y <= 5.6e-226)
        		tmp = (t / z) * x;
        	elseif (y <= 1.18e-20)
        		tmp = t_2;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4e+61], t$95$1, If[LessEqual[y, -2.1e-179], t$95$2, If[LessEqual[y, 5.6e-226], N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 1.18e-20], t$95$2, t$95$1]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{x \cdot y}{z}\\
        t_2 := \left(\frac{y}{z} - t\right) \cdot x\\
        \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq -2.1 \cdot 10^{-179}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;y \leq 5.6 \cdot 10^{-226}:\\
        \;\;\;\;\frac{t}{z} \cdot x\\
        
        \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -3.9999999999999998e61 or 1.1800000000000001e-20 < y

          1. Initial program 88.2%

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

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

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

              \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
            3. lower-*.f6488.0

              \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
          5. Applied rewrites88.0%

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

          if -3.9999999999999998e61 < y < -2.0999999999999999e-179 or 5.60000000000000016e-226 < y < 1.1800000000000001e-20

          1. Initial program 98.8%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
            8. distribute-lft-out--N/A

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

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

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

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

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

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

              \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
            15. lower-*.f6467.6

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

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

            \[\leadsto -1 \cdot \color{blue}{\left(t \cdot x\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites31.9%

              \[\leadsto \left(-t\right) \cdot \color{blue}{x} \]
            2. Taylor expanded in t around 0

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

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

              if -2.0999999999999999e-179 < y < 5.60000000000000016e-226

              1. Initial program 92.0%

                \[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 \color{blue}{\left(\frac{y}{z} - \frac{t}{1 - z}\right)} \]
                2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
              9. Step-by-step derivation
                1. Applied rewrites69.1%

                  \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
              10. Recombined 3 regimes into one program.
              11. Final simplification78.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+61}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-179}:\\ \;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{z} \cdot x\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{-20}:\\ \;\;\;\;\left(\frac{y}{z} - t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array} \]
              12. Add Preprocessing

              Alternative 4: 95.2% accurate, 0.9× speedup?

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

                1. Initial program 96.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. +-commutativeN/A

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

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

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

                if -6.5e-29 < z < 1

                1. Initial program 88.6%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
                  8. distribute-lft-out--N/A

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

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

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

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

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

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

                    \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
                  15. lower-*.f6496.3

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

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

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

              Alternative 5: 93.7% accurate, 1.1× speedup?

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

                1. Initial program 96.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. +-commutativeN/A

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

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

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

                if -7.5e7 < z < 1

                1. Initial program 89.1%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
                  8. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-t\right) \cdot \color{blue}{x} \]
                  2. Taylor expanded in t around 0

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

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

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

                  Alternative 6: 68.3% accurate, 1.2× speedup?

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

                    1. Initial program 92.1%

                      \[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 \color{blue}{\left(\frac{y}{z} - \frac{t}{1 - z}\right)} \]
                      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
                    9. Step-by-step derivation
                      1. Applied rewrites58.3%

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

                      if -4.7999999999999999e84 < t < 6.8000000000000003e111

                      1. Initial program 92.7%

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

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

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

                          \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
                        3. lower-*.f6482.7

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

                        \[\leadsto \color{blue}{\frac{y \cdot x}{z}} \]
                    10. Recombined 2 regimes into one program.
                    11. Final simplification74.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+84}:\\ \;\;\;\;\frac{t}{z} \cdot x\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+111}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot x\\ \end{array} \]
                    12. Add Preprocessing

                    Alternative 7: 62.0% accurate, 2.0× speedup?

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

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

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

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

                        \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
                      3. lower-*.f6465.0

                        \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
                    5. Applied rewrites65.0%

                      \[\leadsto \color{blue}{\frac{y \cdot x}{z}} \]
                    6. Final simplification65.0%

                      \[\leadsto \frac{x \cdot y}{z} \]
                    7. Add Preprocessing

                    Alternative 8: 61.6% accurate, 2.0× speedup?

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

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

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

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

                        \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
                      3. lower-*.f6465.0

                        \[\leadsto \frac{\color{blue}{y \cdot x}}{z} \]
                    5. Applied rewrites65.0%

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

                        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
                      2. Add Preprocessing

                      Alternative 9: 22.9% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
                        8. distribute-lft-out--N/A

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

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

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

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

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

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

                          \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
                        15. lower-*.f6467.3

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

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

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

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

                        Developer Target 1: 94.9% 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 2024249 
                        (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)))))