Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.3% → 89.0%
Time: 13.4s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 66.3% accurate, 1.0× speedup?

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

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

Alternative 1: 89.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+70} \lor \neg \left(z \leq 2700000000\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{b - y} - \frac{y}{{\left(b - y\right)}^{2}} \cdot \frac{t - a}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -6.5e+70) (not (<= z 2700000000.0)))
   (-
    (/ (fma (/ x z) y (- t a)) (- b y))
    (* (/ y (pow (- b y) 2.0)) (/ (- t a) z)))
   (/ (fma y x (* (- t a) z)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -6.5e+70) || !(z <= 2700000000.0)) {
		tmp = (fma((x / z), y, (t - a)) / (b - y)) - ((y / pow((b - y), 2.0)) * ((t - a) / z));
	} else {
		tmp = fma(y, x, ((t - a) * z)) / (y + (z * (b - y)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -6.5e+70) || !(z <= 2700000000.0))
		tmp = Float64(Float64(fma(Float64(x / z), y, Float64(t - a)) / Float64(b - y)) - Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(Float64(t - a) / z)));
	else
		tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(y + Float64(z * Float64(b - y))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.5e+70], N[Not[LessEqual[z, 2700000000.0]], $MachinePrecision]], N[(N[(N[(N[(x / z), $MachinePrecision] * y + N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+70} \lor \neg \left(z \leq 2700000000\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{b - y} - \frac{y}{{\left(b - y\right)}^{2}} \cdot \frac{t - a}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\


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

    1. Initial program 40.8%

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

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right) - \left(\frac{a}{b - y} + \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

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

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

        \[\leadsto \left(\color{blue}{\left(\frac{x \cdot y}{z \cdot \left(b - y\right)} + \frac{t}{b - y}\right)} - \frac{a}{b - y}\right) - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      4. associate--l+N/A

        \[\leadsto \color{blue}{\left(\frac{x \cdot y}{z \cdot \left(b - y\right)} + \left(\frac{t}{b - y} - \frac{a}{b - y}\right)\right)} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      5. times-fracN/A

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

        \[\leadsto \left(\color{blue}{\frac{\frac{x}{z} \cdot y}{b - y}} + \left(\frac{t}{b - y} - \frac{a}{b - y}\right)\right) - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      7. div-subN/A

        \[\leadsto \left(\frac{\frac{x}{z} \cdot y}{b - y} + \color{blue}{\frac{t - a}{b - y}}\right) - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      8. div-add-revN/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y + \left(t - a\right)}{b - y}} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot y + \left(t - a\right)}{b - y}} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      10. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}}{b - y} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{x}{z}}, y, t - a\right)}{b - y} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      12. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{z}, y, \color{blue}{t - a}\right)}{b - y} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      13. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{\color{blue}{b - y}} - \frac{y \cdot \left(t - a\right)}{z \cdot {\left(b - y\right)}^{2}} \]
      14. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{b - y} - \frac{y \cdot \left(t - a\right)}{\color{blue}{{\left(b - y\right)}^{2} \cdot z}} \]
    5. Applied rewrites88.0%

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

    if -6.49999999999999978e70 < z < 2.7e9

    1. Initial program 88.5%

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(t - a\right) \cdot z}\right)}{y + z \cdot \left(b - y\right)} \]
      7. lower-*.f6488.5

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}}{y + z \cdot \left(b - y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+70} \lor \neg \left(z \leq 2700000000\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{z}, y, t - a\right)}{b - y} - \frac{y}{{\left(b - y\right)}^{2}} \cdot \frac{t - a}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+70} \lor \neg \left(z \leq 1.1 \cdot 10^{+63}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -9.5e+70) (not (<= z 1.1e+63)))
   (/ (- t a) (- b y))
   (/ (fma y x (* (- t a) z)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -9.5e+70) || !(z <= 1.1e+63)) {
		tmp = (t - a) / (b - y);
	} else {
		tmp = fma(y, x, ((t - a) * z)) / (y + (z * (b - y)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -9.5e+70) || !(z <= 1.1e+63))
		tmp = Float64(Float64(t - a) / Float64(b - y));
	else
		tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(y + Float64(z * Float64(b - y))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e+70], N[Not[LessEqual[z, 1.1e+63]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+70} \lor \neg \left(z \leq 1.1 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\


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

    1. Initial program 36.9%

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

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

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. lower--.f6482.6

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Applied rewrites82.6%

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -9.5000000000000002e70 < z < 1.0999999999999999e63

    1. Initial program 87.0%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lower-fma.f6487.0

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(t - a\right) \cdot z}\right)}{y + z \cdot \left(b - y\right)} \]
      7. lower-*.f6487.0

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}}{y + z \cdot \left(b - y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+70} \lor \neg \left(z \leq 1.1 \cdot 10^{+63}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{y + z \cdot \left(b - y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -980000000000 \lor \neg \left(z \leq 1.8 \cdot 10^{-32}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -980000000000.0) (not (<= z 1.8e-32)))
   (/ (- t a) (- b y))
   (/ (fma t z (* y x)) (fma (- b y) z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -980000000000.0) || !(z <= 1.8e-32)) {
		tmp = (t - a) / (b - y);
	} else {
		tmp = fma(t, z, (y * x)) / fma((b - y), z, y);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -980000000000.0) || !(z <= 1.8e-32))
		tmp = Float64(Float64(t - a) / Float64(b - y));
	else
		tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -980000000000.0], N[Not[LessEqual[z, 1.8e-32]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -980000000000 \lor \neg \left(z \leq 1.8 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.8e11 or 1.79999999999999996e-32 < z

    1. Initial program 48.3%

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

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

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. lower--.f6477.4

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Applied rewrites77.4%

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -9.8e11 < z < 1.79999999999999996e-32

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -980000000000 \lor \neg \left(z \leq 1.8 \cdot 10^{-32}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{-58} \lor \neg \left(z \leq 1.15 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1.12e-58) (not (<= z 1.15e-29)))
   (/ (- t a) (- b y))
   (* (/ y (fma (- b y) z y)) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.12e-58) || !(z <= 1.15e-29)) {
		tmp = (t - a) / (b - y);
	} else {
		tmp = (y / fma((b - y), z, y)) * x;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.12e-58) || !(z <= 1.15e-29))
		tmp = Float64(Float64(t - a) / Float64(b - y));
	else
		tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.12e-58], N[Not[LessEqual[z, 1.15e-29]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-58} \lor \neg \left(z \leq 1.15 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.11999999999999992e-58 or 1.14999999999999996e-29 < z

    1. Initial program 51.2%

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

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

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. lower--.f6475.0

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Applied rewrites75.0%

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -1.11999999999999992e-58 < z < 1.14999999999999996e-29

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(b - y, z, y\right)}} \cdot x \]
      8. lower--.f6461.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{-58} \lor \neg \left(z \leq 1.15 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.5% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.9999999999999995e59 or 1.0200000000000001e75 < y

    1. Initial program 46.2%

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

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

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

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

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

        \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
      5. lower--.f6463.5

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Applied rewrites63.5%

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

    if -9.9999999999999995e59 < y < 1.0200000000000001e75

    1. Initial program 80.4%

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

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

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. lower--.f6464.9

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Applied rewrites64.9%

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+60} \lor \neg \left(y \leq 1.02 \cdot 10^{+75}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 54.1% accurate, 1.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -115 or 1.05000000000000009e34 < y

    1. Initial program 50.0%

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

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

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

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

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

        \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
      5. lower--.f6456.9

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Applied rewrites56.9%

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

    if -115 < y < 1.05000000000000009e34

    1. Initial program 82.4%

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

      \[\leadsto \color{blue}{\frac{t - a}{b}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b}} \]
      2. lower--.f6456.7

        \[\leadsto \frac{\color{blue}{t - a}}{b} \]
    5. Applied rewrites56.7%

      \[\leadsto \color{blue}{\frac{t - a}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -115 \lor \neg \left(y \leq 1.05 \cdot 10^{+34}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 43.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-109} \lor \neg \left(y \leq 1.12 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{1 - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.5000000000000003e-109 or 1.12e27 < y

    1. Initial program 55.3%

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

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

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

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

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

        \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
      5. lower--.f6450.4

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Applied rewrites50.4%

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

    if -5.5000000000000003e-109 < y < 1.12e27

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{\color{blue}{\mathsf{fma}\left(b - y, z, y\right)}} \cdot t \]
      8. lower--.f6439.6

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

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

      \[\leadsto \frac{t}{\color{blue}{b - y}} \]
    7. Step-by-step derivation
      1. Applied rewrites41.7%

        \[\leadsto \frac{t}{\color{blue}{b - y}} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification46.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{-109} \lor \neg \left(y \leq 1.12 \cdot 10^{+27}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b - y}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 8: 44.6% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-58} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (or (<= z -2.2e-58) (not (<= z 1.65e-26))) (/ t (- b y)) (fma x z x)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((z <= -2.2e-58) || !(z <= 1.65e-26)) {
    		tmp = t / (b - y);
    	} else {
    		tmp = fma(x, z, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((z <= -2.2e-58) || !(z <= 1.65e-26))
    		tmp = Float64(t / Float64(b - y));
    	else
    		tmp = fma(x, z, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e-58], N[Not[LessEqual[z, 1.65e-26]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -2.2 \cdot 10^{-58} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\
    \;\;\;\;\frac{t}{b - y}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -2.20000000000000006e-58 or 1.6499999999999999e-26 < z

      1. Initial program 51.2%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{z}{\color{blue}{\mathsf{fma}\left(b - y, z, y\right)}} \cdot t \]
        8. lower--.f6430.1

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

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

        \[\leadsto \frac{t}{\color{blue}{b - y}} \]
      7. Step-by-step derivation
        1. Applied rewrites41.4%

          \[\leadsto \frac{t}{\color{blue}{b - y}} \]

        if -2.20000000000000006e-58 < z < 1.6499999999999999e-26

        1. Initial program 90.1%

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

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

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

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

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

            \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
          5. lower--.f6449.4

            \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
        5. Applied rewrites49.4%

          \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
        6. Taylor expanded in z around 0

          \[\leadsto x + \color{blue}{x \cdot z} \]
        7. Step-by-step derivation
          1. Applied rewrites49.4%

            \[\leadsto \mathsf{fma}\left(x, \color{blue}{z}, x\right) \]
        8. Recombined 2 regimes into one program.
        9. Final simplification44.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-58} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\ \end{array} \]
        10. Add Preprocessing

        Alternative 9: 36.5% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-39} \lor \neg \left(z \leq 8.5 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{t}{b}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (or (<= z -2.7e-39) (not (<= z 8.5e-28))) (/ t b) (fma x z x)))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if ((z <= -2.7e-39) || !(z <= 8.5e-28)) {
        		tmp = t / b;
        	} else {
        		tmp = fma(x, z, x);
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if ((z <= -2.7e-39) || !(z <= 8.5e-28))
        		tmp = Float64(t / b);
        	else
        		tmp = fma(x, z, x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.7e-39], N[Not[LessEqual[z, 8.5e-28]], $MachinePrecision]], N[(t / b), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -2.7 \cdot 10^{-39} \lor \neg \left(z \leq 8.5 \cdot 10^{-28}\right):\\
        \;\;\;\;\frac{t}{b}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -2.7000000000000001e-39 or 8.49999999999999925e-28 < z

          1. Initial program 50.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{z}{\color{blue}{\mathsf{fma}\left(b - y, z, y\right)}} \cdot t \]
            8. lower--.f6429.4

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

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

            \[\leadsto \frac{t}{\color{blue}{b}} \]
          7. Step-by-step derivation
            1. Applied rewrites28.7%

              \[\leadsto \frac{t}{\color{blue}{b}} \]

            if -2.7000000000000001e-39 < z < 8.49999999999999925e-28

            1. Initial program 89.0%

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

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

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

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

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

                \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
              5. lower--.f6448.2

                \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
            5. Applied rewrites48.2%

              \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
            6. Taylor expanded in z around 0

              \[\leadsto x + \color{blue}{x \cdot z} \]
            7. Step-by-step derivation
              1. Applied rewrites48.2%

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{z}, x\right) \]
            8. Recombined 2 regimes into one program.
            9. Final simplification37.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-39} \lor \neg \left(z \leq 8.5 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{t}{b}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 10: 25.7% accurate, 5.6× speedup?

            \[\begin{array}{l} \\ \mathsf{fma}\left(x, z, x\right) \end{array} \]
            (FPCore (x y z t a b) :precision binary64 (fma x z x))
            double code(double x, double y, double z, double t, double a, double b) {
            	return fma(x, z, x);
            }
            
            function code(x, y, z, t, a, b)
            	return fma(x, z, x)
            end
            
            code[x_, y_, z_, t_, a_, b_] := N[(x * z + x), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \mathsf{fma}\left(x, z, x\right)
            \end{array}
            
            Derivation
            1. Initial program 67.4%

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

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

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

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

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

                \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
              5. lower--.f6432.2

                \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
            5. Applied rewrites32.2%

              \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
            6. Taylor expanded in z around 0

              \[\leadsto x + \color{blue}{x \cdot z} \]
            7. Step-by-step derivation
              1. Applied rewrites23.0%

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{z}, x\right) \]
              2. Add Preprocessing

              Alternative 11: 3.8% accurate, 6.5× speedup?

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

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

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

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

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

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

                  \[\leadsto \frac{x}{1 - \color{blue}{z}} \]
                5. lower--.f6432.2

                  \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
              5. Applied rewrites32.2%

                \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
              6. Taylor expanded in z around 0

                \[\leadsto x + \color{blue}{x \cdot z} \]
              7. Step-by-step derivation
                1. Applied rewrites23.0%

                  \[\leadsto \mathsf{fma}\left(x, \color{blue}{z}, x\right) \]
                2. Taylor expanded in z around inf

                  \[\leadsto x \cdot z \]
                3. Step-by-step derivation
                  1. Applied rewrites2.9%

                    \[\leadsto z \cdot x \]
                  2. Add Preprocessing

                  Developer Target 1: 73.6% accurate, 0.6× speedup?

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

                  Reproduce

                  ?
                  herbie shell --seed 2024364 
                  (FPCore (x y z t a b)
                    :name "Development.Shake.Progress:decay from shake-0.15.5"
                    :precision binary64
                  
                    :alt
                    (! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
                  
                    (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))