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

Percentage Accurate: 94.5% → 98.2%
Time: 3.2s
Alternatives: 9
Speedup: 0.3×

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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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}

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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+298}:\\
\;\;\;\;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 3.9999999999999998e298 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 70.0%

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

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

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

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

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

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

        \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
      6. lower-neg.f6488.1

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

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

      \[\leadsto \frac{y \cdot x}{z} \]
    6. Step-by-step derivation
      1. Applied rewrites98.0%

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

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

          \[\leadsto \frac{y \cdot x}{z} \]
        3. associate-/l*N/A

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

          \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
        5. lift-/.f6498.0

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

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

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

      1. Initial program 98.2%

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

    Alternative 2: 93.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7800:\\ \;\;\;\;x \cdot \frac{t + y}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - \left(-t\right)\right) \cdot x}{z}\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -7800.0)
       (* x (/ (+ t y) z))
       (if (<= z 1.0) (* x (- (/ y z) t)) (/ (* (- y (- t)) x) z))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -7800.0) {
    		tmp = x * ((t + y) / z);
    	} else if (z <= 1.0) {
    		tmp = x * ((y / z) - t);
    	} else {
    		tmp = ((y - -t) * x) / z;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t)
    use fmin_fmax_functions
        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 <= (-7800.0d0)) then
            tmp = x * ((t + y) / z)
        else if (z <= 1.0d0) then
            tmp = x * ((y / z) - t)
        else
            tmp = ((y - -t) * x) / z
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -7800.0) {
    		tmp = x * ((t + y) / z);
    	} else if (z <= 1.0) {
    		tmp = x * ((y / z) - t);
    	} else {
    		tmp = ((y - -t) * x) / z;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -7800.0:
    		tmp = x * ((t + y) / z)
    	elif z <= 1.0:
    		tmp = x * ((y / z) - t)
    	else:
    		tmp = ((y - -t) * x) / z
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -7800.0)
    		tmp = Float64(x * Float64(Float64(t + y) / z));
    	elseif (z <= 1.0)
    		tmp = Float64(x * Float64(Float64(y / z) - t));
    	else
    		tmp = Float64(Float64(Float64(y - Float64(-t)) * x) / z);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -7800.0)
    		tmp = x * ((t + y) / z);
    	elseif (z <= 1.0)
    		tmp = x * ((y / z) - t);
    	else
    		tmp = ((y - -t) * x) / z;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -7800.0], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - (-t)), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -7800:\\
    \;\;\;\;x \cdot \frac{t + y}{z}\\
    
    \mathbf{elif}\;z \leq 1:\\
    \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(y - \left(-t\right)\right) \cdot x}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -7800

      1. Initial program 97.3%

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

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

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

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

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

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

          \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
        6. lower-neg.f6486.0

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

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

        \[\leadsto \frac{y \cdot x}{z} \]
      6. Step-by-step derivation
        1. Applied rewrites53.0%

          \[\leadsto \frac{y \cdot x}{z} \]
        2. Taylor expanded in x around 0

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

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

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

            \[\leadsto x \cdot \frac{t + y}{z} \]
          4. lower-+.f6496.7

            \[\leadsto x \cdot \frac{t + y}{z} \]
        4. Applied rewrites96.7%

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

        if -7800 < z < 1

        1. Initial program 92.2%

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

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

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

          if 1 < z

          1. Initial program 96.7%

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

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

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

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

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

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

              \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
            6. lower-neg.f6485.3

              \[\leadsto \frac{\left(y - \left(-t\right)\right) \cdot x}{z} \]
          4. Applied rewrites85.3%

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

        Alternative 3: 91.0% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t + y}{z}\\ \mathbf{if}\;z \leq -7800:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* x (/ (+ t y) z))))
           (if (<= z -7800.0) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * ((t + y) / z);
        	double tmp;
        	if (z <= -7800.0) {
        		tmp = t_1;
        	} else if (z <= 1.0) {
        		tmp = x * ((y / z) - t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t)
        use fmin_fmax_functions
            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 + y) / z)
            if (z <= (-7800.0d0)) then
                tmp = t_1
            else if (z <= 1.0d0) then
                tmp = x * ((y / z) - t)
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = x * ((t + y) / z);
        	double tmp;
        	if (z <= -7800.0) {
        		tmp = t_1;
        	} else if (z <= 1.0) {
        		tmp = x * ((y / z) - t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = x * ((t + y) / z)
        	tmp = 0
        	if z <= -7800.0:
        		tmp = t_1
        	elif z <= 1.0:
        		tmp = x * ((y / z) - t)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(x * Float64(Float64(t + y) / z))
        	tmp = 0.0
        	if (z <= -7800.0)
        		tmp = t_1;
        	elseif (z <= 1.0)
        		tmp = Float64(x * Float64(Float64(y / z) - t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = x * ((t + y) / z);
        	tmp = 0.0;
        	if (z <= -7800.0)
        		tmp = t_1;
        	elseif (z <= 1.0)
        		tmp = x * ((y / z) - t);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7800.0], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x \cdot \frac{t + y}{z}\\
        \mathbf{if}\;z \leq -7800:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 1:\\
        \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -7800 or 1 < z

          1. Initial program 97.0%

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

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

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

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

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

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

              \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
            6. lower-neg.f6485.6

              \[\leadsto \frac{\left(y - \left(-t\right)\right) \cdot x}{z} \]
          4. Applied rewrites85.6%

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

            \[\leadsto \frac{y \cdot x}{z} \]
          6. Step-by-step derivation
            1. Applied rewrites52.4%

              \[\leadsto \frac{y \cdot x}{z} \]
            2. Taylor expanded in x around 0

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

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

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

                \[\leadsto x \cdot \frac{t + y}{z} \]
              4. lower-+.f6496.3

                \[\leadsto x \cdot \frac{t + y}{z} \]
            4. Applied rewrites96.3%

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

            if -7800 < z < 1

            1. Initial program 92.2%

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

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

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

            Alternative 4: 73.4% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+112}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+53}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+77}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (<= z -5.8e+112)
               (* x (/ y z))
               (if (<= z 5e+53)
                 (* x (- (/ y z) t))
                 (if (<= z 4.9e+77) (/ (* t x) z) (/ (* y x) z)))))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (z <= -5.8e+112) {
            		tmp = x * (y / z);
            	} else if (z <= 5e+53) {
            		tmp = x * ((y / z) - t);
            	} else if (z <= 4.9e+77) {
            		tmp = (t * x) / z;
            	} else {
            		tmp = (y * x) / z;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z, t)
            use fmin_fmax_functions
                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 <= (-5.8d+112)) then
                    tmp = x * (y / z)
                else if (z <= 5d+53) then
                    tmp = x * ((y / z) - t)
                else if (z <= 4.9d+77) then
                    tmp = (t * x) / z
                else
                    tmp = (y * x) / z
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if (z <= -5.8e+112) {
            		tmp = x * (y / z);
            	} else if (z <= 5e+53) {
            		tmp = x * ((y / z) - t);
            	} else if (z <= 4.9e+77) {
            		tmp = (t * x) / z;
            	} else {
            		tmp = (y * x) / z;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if z <= -5.8e+112:
            		tmp = x * (y / z)
            	elif z <= 5e+53:
            		tmp = x * ((y / z) - t)
            	elif z <= 4.9e+77:
            		tmp = (t * x) / z
            	else:
            		tmp = (y * x) / z
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (z <= -5.8e+112)
            		tmp = Float64(x * Float64(y / z));
            	elseif (z <= 5e+53)
            		tmp = Float64(x * Float64(Float64(y / z) - t));
            	elseif (z <= 4.9e+77)
            		tmp = Float64(Float64(t * x) / z);
            	else
            		tmp = Float64(Float64(y * x) / z);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if (z <= -5.8e+112)
            		tmp = x * (y / z);
            	elseif (z <= 5e+53)
            		tmp = x * ((y / z) - t);
            	elseif (z <= 4.9e+77)
            		tmp = (t * x) / z;
            	else
            		tmp = (y * x) / z;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e+112], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+53], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+77], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -5.8 \cdot 10^{+112}:\\
            \;\;\;\;x \cdot \frac{y}{z}\\
            
            \mathbf{elif}\;z \leq 5 \cdot 10^{+53}:\\
            \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
            
            \mathbf{elif}\;z \leq 4.9 \cdot 10^{+77}:\\
            \;\;\;\;\frac{t \cdot x}{z}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{y \cdot x}{z}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if z < -5.8000000000000004e112

              1. Initial program 96.1%

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

                \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
              3. Step-by-step derivation
                1. lift-/.f6460.5

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

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

              if -5.8000000000000004e112 < z < 5.0000000000000004e53

              1. Initial program 93.7%

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

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

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

                if 5.0000000000000004e53 < z < 4.90000000000000039e77

                1. Initial program 99.0%

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

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

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

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

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

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

                    \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                  6. lower-neg.f6495.1

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

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

                  \[\leadsto \frac{t \cdot x}{z} \]
                6. Step-by-step derivation
                  1. Applied rewrites54.8%

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

                  if 4.90000000000000039e77 < z

                  1. Initial program 95.8%

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

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

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

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

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

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

                      \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                    6. lower-neg.f6482.2

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

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

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

                      \[\leadsto \frac{y \cdot x}{z} \]
                  7. Recombined 4 regimes into one program.
                  8. Add Preprocessing

                  Alternative 5: 66.3% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.28 \cdot 10^{+179}:\\ \;\;\;\;\left(-t\right) \cdot x\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+90}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= t -1.28e+179)
                     (* (- t) x)
                     (if (<= t 9.5e+90) (/ (* y x) z) (* x (/ t z)))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (t <= -1.28e+179) {
                  		tmp = -t * x;
                  	} else if (t <= 9.5e+90) {
                  		tmp = (y * x) / z;
                  	} else {
                  		tmp = x * (t / z);
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if (t <= (-1.28d+179)) then
                          tmp = -t * x
                      else if (t <= 9.5d+90) then
                          tmp = (y * x) / 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 (t <= -1.28e+179) {
                  		tmp = -t * x;
                  	} else if (t <= 9.5e+90) {
                  		tmp = (y * x) / z;
                  	} else {
                  		tmp = x * (t / z);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if t <= -1.28e+179:
                  		tmp = -t * x
                  	elif t <= 9.5e+90:
                  		tmp = (y * x) / z
                  	else:
                  		tmp = x * (t / z)
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (t <= -1.28e+179)
                  		tmp = Float64(Float64(-t) * x);
                  	elseif (t <= 9.5e+90)
                  		tmp = Float64(Float64(y * x) / z);
                  	else
                  		tmp = Float64(x * Float64(t / z));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (t <= -1.28e+179)
                  		tmp = -t * x;
                  	elseif (t <= 9.5e+90)
                  		tmp = (y * x) / z;
                  	else
                  		tmp = x * (t / z);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[t, -1.28e+179], N[((-t) * x), $MachinePrecision], If[LessEqual[t, 9.5e+90], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;t \leq -1.28 \cdot 10^{+179}:\\
                  \;\;\;\;\left(-t\right) \cdot x\\
                  
                  \mathbf{elif}\;t \leq 9.5 \cdot 10^{+90}:\\
                  \;\;\;\;\frac{y \cdot x}{z}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x \cdot \frac{t}{z}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if t < -1.28e179

                    1. Initial program 95.8%

                      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
                    2. 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}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

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

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

                        \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
                      4. mul-1-negN/A

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

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

                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                      7. lower-*.f64N/A

                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                      8. *-commutativeN/A

                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                      9. lower-*.f6447.5

                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                    4. Applied rewrites47.5%

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

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

                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                      2. lower-*.f64N/A

                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                      3. mul-1-negN/A

                        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot x \]
                      4. lift-neg.f6441.3

                        \[\leadsto \left(-t\right) \cdot x \]
                    7. Applied rewrites41.3%

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

                    if -1.28e179 < t < 9.4999999999999994e90

                    1. Initial program 94.0%

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

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

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

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

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

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

                        \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                      6. lower-neg.f6476.5

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

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

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

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

                      if 9.4999999999999994e90 < t

                      1. Initial program 96.2%

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

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

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

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

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

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

                          \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                        6. lower-neg.f6458.0

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

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

                        \[\leadsto \frac{y \cdot x}{z} \]
                      6. Step-by-step derivation
                        1. Applied rewrites32.5%

                          \[\leadsto \frac{y \cdot x}{z} \]
                        2. Taylor expanded in x around 0

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

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

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

                            \[\leadsto x \cdot \frac{t + y}{z} \]
                          4. lower-+.f6466.1

                            \[\leadsto x \cdot \frac{t + y}{z} \]
                        4. Applied rewrites66.1%

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

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

                            \[\leadsto x \cdot \frac{t}{z} \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 6: 65.4% accurate, 1.1× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.28 \cdot 10^{+179}:\\ \;\;\;\;\left(-t\right) \cdot x\\ \mathbf{elif}\;t \leq 10^{+91}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= t -1.28e+179)
                           (* (- t) x)
                           (if (<= t 1e+91) (* y (/ x z)) (* x (/ t z)))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (t <= -1.28e+179) {
                        		tmp = -t * x;
                        	} else if (t <= 1e+91) {
                        		tmp = y * (x / z);
                        	} else {
                        		tmp = x * (t / z);
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8) :: tmp
                            if (t <= (-1.28d+179)) then
                                tmp = -t * x
                            else if (t <= 1d+91) then
                                tmp = y * (x / 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 (t <= -1.28e+179) {
                        		tmp = -t * x;
                        	} else if (t <= 1e+91) {
                        		tmp = y * (x / z);
                        	} else {
                        		tmp = x * (t / z);
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if t <= -1.28e+179:
                        		tmp = -t * x
                        	elif t <= 1e+91:
                        		tmp = y * (x / z)
                        	else:
                        		tmp = x * (t / z)
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (t <= -1.28e+179)
                        		tmp = Float64(Float64(-t) * x);
                        	elseif (t <= 1e+91)
                        		tmp = Float64(y * Float64(x / z));
                        	else
                        		tmp = Float64(x * Float64(t / z));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if (t <= -1.28e+179)
                        		tmp = -t * x;
                        	elseif (t <= 1e+91)
                        		tmp = y * (x / z);
                        	else
                        		tmp = x * (t / z);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[t, -1.28e+179], N[((-t) * x), $MachinePrecision], If[LessEqual[t, 1e+91], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;t \leq -1.28 \cdot 10^{+179}:\\
                        \;\;\;\;\left(-t\right) \cdot x\\
                        
                        \mathbf{elif}\;t \leq 10^{+91}:\\
                        \;\;\;\;y \cdot \frac{x}{z}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;x \cdot \frac{t}{z}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if t < -1.28e179

                          1. Initial program 95.8%

                            \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
                          2. 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}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

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

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

                              \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
                            4. mul-1-negN/A

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

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

                              \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                            7. lower-*.f64N/A

                              \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                            8. *-commutativeN/A

                              \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                            9. lower-*.f6447.5

                              \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                          4. Applied rewrites47.5%

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

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

                              \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                            2. lower-*.f64N/A

                              \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                            3. mul-1-negN/A

                              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot x \]
                            4. lift-neg.f6441.3

                              \[\leadsto \left(-t\right) \cdot x \]
                          7. Applied rewrites41.3%

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

                          if -1.28e179 < t < 1.00000000000000008e91

                          1. Initial program 94.0%

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

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

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

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

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

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

                              \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                            6. lower-neg.f6476.5

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

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

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

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

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

                                \[\leadsto \frac{y \cdot x}{z} \]
                              3. associate-/l*N/A

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

                                \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
                              5. lift-/.f6473.0

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

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

                            if 1.00000000000000008e91 < t

                            1. Initial program 96.2%

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

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

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

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

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

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

                                \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                              6. lower-neg.f6458.0

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

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

                              \[\leadsto \frac{y \cdot x}{z} \]
                            6. Step-by-step derivation
                              1. Applied rewrites32.5%

                                \[\leadsto \frac{y \cdot x}{z} \]
                              2. Taylor expanded in x around 0

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

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

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

                                  \[\leadsto x \cdot \frac{t + y}{z} \]
                                4. lower-+.f6466.1

                                  \[\leadsto x \cdot \frac{t + y}{z} \]
                              4. Applied rewrites66.1%

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

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

                                  \[\leadsto x \cdot \frac{t}{z} \]
                              7. Recombined 3 regimes into one program.
                              8. Add Preprocessing

                              Alternative 7: 44.3% accurate, 1.1× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t}{z}\\ \mathbf{if}\;z \leq -7800:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\left(-t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (let* ((t_1 (* x (/ t z))))
                                 (if (<= z -7800.0) t_1 (if (<= z 1.0) (* (- t) x) t_1))))
                              double code(double x, double y, double z, double t) {
                              	double t_1 = x * (t / z);
                              	double tmp;
                              	if (z <= -7800.0) {
                              		tmp = t_1;
                              	} else if (z <= 1.0) {
                              		tmp = -t * x;
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y, z, t)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  real(8), intent (in) :: t
                                  real(8) :: t_1
                                  real(8) :: tmp
                                  t_1 = x * (t / z)
                                  if (z <= (-7800.0d0)) then
                                      tmp = t_1
                                  else if (z <= 1.0d0) then
                                      tmp = -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 = x * (t / z);
                              	double tmp;
                              	if (z <= -7800.0) {
                              		tmp = t_1;
                              	} else if (z <= 1.0) {
                              		tmp = -t * x;
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t):
                              	t_1 = x * (t / z)
                              	tmp = 0
                              	if z <= -7800.0:
                              		tmp = t_1
                              	elif z <= 1.0:
                              		tmp = -t * x
                              	else:
                              		tmp = t_1
                              	return tmp
                              
                              function code(x, y, z, t)
                              	t_1 = Float64(x * Float64(t / z))
                              	tmp = 0.0
                              	if (z <= -7800.0)
                              		tmp = t_1;
                              	elseif (z <= 1.0)
                              		tmp = Float64(Float64(-t) * x);
                              	else
                              		tmp = t_1;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t)
                              	t_1 = x * (t / z);
                              	tmp = 0.0;
                              	if (z <= -7800.0)
                              		tmp = t_1;
                              	elseif (z <= 1.0)
                              		tmp = -t * x;
                              	else
                              		tmp = t_1;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7800.0], t$95$1, If[LessEqual[z, 1.0], N[((-t) * x), $MachinePrecision], t$95$1]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := x \cdot \frac{t}{z}\\
                              \mathbf{if}\;z \leq -7800:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;z \leq 1:\\
                              \;\;\;\;\left(-t\right) \cdot x\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if z < -7800 or 1 < z

                                1. Initial program 97.0%

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

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

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

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

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

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

                                    \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                                  6. lower-neg.f6485.6

                                    \[\leadsto \frac{\left(y - \left(-t\right)\right) \cdot x}{z} \]
                                4. Applied rewrites85.6%

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

                                  \[\leadsto \frac{y \cdot x}{z} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites52.4%

                                    \[\leadsto \frac{y \cdot x}{z} \]
                                  2. Taylor expanded in x around 0

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

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

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

                                      \[\leadsto x \cdot \frac{t + y}{z} \]
                                    4. lower-+.f6496.3

                                      \[\leadsto x \cdot \frac{t + y}{z} \]
                                  4. Applied rewrites96.3%

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

                                    \[\leadsto x \cdot \frac{t}{z} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites55.5%

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

                                    if -7800 < z < 1

                                    1. Initial program 92.2%

                                      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
                                    2. 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}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

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

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

                                        \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
                                      4. mul-1-negN/A

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

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

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                      7. lower-*.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                      8. *-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                                      9. lower-*.f6489.1

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

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

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

                                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                      2. lower-*.f64N/A

                                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                      3. mul-1-negN/A

                                        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot x \]
                                      4. lift-neg.f6433.5

                                        \[\leadsto \left(-t\right) \cdot x \]
                                    7. Applied rewrites33.5%

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

                                  Alternative 8: 42.1% accurate, 1.1× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -7800:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\left(-t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                  (FPCore (x y z t)
                                   :precision binary64
                                   (let* ((t_1 (* t (/ x z))))
                                     (if (<= z -7800.0) t_1 (if (<= z 1.0) (* (- t) x) t_1))))
                                  double code(double x, double y, double z, double t) {
                                  	double t_1 = t * (x / z);
                                  	double tmp;
                                  	if (z <= -7800.0) {
                                  		tmp = t_1;
                                  	} else if (z <= 1.0) {
                                  		tmp = -t * x;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t)
                                  use fmin_fmax_functions
                                      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 * (x / z)
                                      if (z <= (-7800.0d0)) then
                                          tmp = t_1
                                      else if (z <= 1.0d0) then
                                          tmp = -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 * (x / z);
                                  	double tmp;
                                  	if (z <= -7800.0) {
                                  		tmp = t_1;
                                  	} else if (z <= 1.0) {
                                  		tmp = -t * x;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	t_1 = t * (x / z)
                                  	tmp = 0
                                  	if z <= -7800.0:
                                  		tmp = t_1
                                  	elif z <= 1.0:
                                  		tmp = -t * x
                                  	else:
                                  		tmp = t_1
                                  	return tmp
                                  
                                  function code(x, y, z, t)
                                  	t_1 = Float64(t * Float64(x / z))
                                  	tmp = 0.0
                                  	if (z <= -7800.0)
                                  		tmp = t_1;
                                  	elseif (z <= 1.0)
                                  		tmp = Float64(Float64(-t) * x);
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t)
                                  	t_1 = t * (x / z);
                                  	tmp = 0.0;
                                  	if (z <= -7800.0)
                                  		tmp = t_1;
                                  	elseif (z <= 1.0)
                                  		tmp = -t * x;
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7800.0], t$95$1, If[LessEqual[z, 1.0], N[((-t) * x), $MachinePrecision], t$95$1]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := t \cdot \frac{x}{z}\\
                                  \mathbf{if}\;z \leq -7800:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;z \leq 1:\\
                                  \;\;\;\;\left(-t\right) \cdot x\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if z < -7800 or 1 < z

                                    1. Initial program 97.0%

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

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

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

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

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

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

                                        \[\leadsto \frac{\left(y - \left(\mathsf{neg}\left(t\right)\right)\right) \cdot x}{z} \]
                                      6. lower-neg.f6485.6

                                        \[\leadsto \frac{\left(y - \left(-t\right)\right) \cdot x}{z} \]
                                    4. Applied rewrites85.6%

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

                                      \[\leadsto \frac{y \cdot x}{z} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites52.4%

                                        \[\leadsto \frac{y \cdot x}{z} \]
                                      2. Taylor expanded in y around 0

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

                                          \[\leadsto t \cdot \frac{x}{\color{blue}{z}} \]
                                        2. lower-*.f64N/A

                                          \[\leadsto t \cdot \frac{x}{\color{blue}{z}} \]
                                        3. lift-/.f6451.0

                                          \[\leadsto t \cdot \frac{x}{z} \]
                                      4. Applied rewrites51.0%

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

                                      if -7800 < z < 1

                                      1. Initial program 92.2%

                                        \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
                                      2. 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}} \]
                                      3. Step-by-step derivation
                                        1. lower-/.f64N/A

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

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

                                          \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
                                        4. mul-1-negN/A

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

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

                                          \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                        7. lower-*.f64N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                        8. *-commutativeN/A

                                          \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                                        9. lower-*.f6489.1

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

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

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

                                          \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                        2. lower-*.f64N/A

                                          \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                        3. mul-1-negN/A

                                          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot x \]
                                        4. lift-neg.f6433.5

                                          \[\leadsto \left(-t\right) \cdot x \]
                                      7. Applied rewrites33.5%

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

                                    Alternative 9: 23.1% accurate, 3.2× 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;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(x, y, z, t)
                                    use fmin_fmax_functions
                                        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 94.5%

                                      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
                                    2. 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}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

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

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

                                        \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
                                      4. mul-1-negN/A

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

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

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                      7. lower-*.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
                                      8. *-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                                      9. lower-*.f6460.3

                                        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
                                    4. Applied rewrites60.3%

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

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

                                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                      2. lower-*.f64N/A

                                        \[\leadsto \left(-1 \cdot t\right) \cdot x \]
                                      3. mul-1-negN/A

                                        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot x \]
                                      4. lift-neg.f6423.1

                                        \[\leadsto \left(-t\right) \cdot x \]
                                    7. Applied rewrites23.1%

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

                                    Reproduce

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