Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.4% → 90.1%
Time: 4.9s
Alternatives: 10
Speedup: 1.2×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 66.4% 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: 90.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := \mathsf{fma}\left(b - y, z, y\right)\\ t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\ t_4 := \mathsf{fma}\left(z, \frac{t - a}{t\_2}, x \cdot \frac{y}{t\_2}\right)\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 \leq 10^{+285}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y))))
        (t_2 (fma (- b y) z y))
        (t_3 (/ (+ (* x y) (* z (- t a))) t_1))
        (t_4 (fma z (/ (- t a) t_2) (* x (/ y t_2)))))
   (if (<= t_3 (- INFINITY))
     t_4
     (if (<= t_3 1e+285)
       (/ (fma y x (* (- t a) z)) t_1)
       (if (<= t_3 INFINITY) t_4 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double t_2 = fma((b - y), z, y);
	double t_3 = ((x * y) + (z * (t - a))) / t_1;
	double t_4 = fma(z, ((t - a) / t_2), (x * (y / t_2)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_4;
	} else if (t_3 <= 1e+285) {
		tmp = fma(y, x, ((t - a) * z)) / t_1;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_4;
	} else {
		tmp = (t - a) / (b - y);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	t_2 = fma(Float64(b - y), z, y)
	t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1)
	t_4 = fma(z, Float64(Float64(t - a) / t_2), Float64(x * Float64(y / t_2)))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_4;
	elseif (t_3 <= 1e+285)
		tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1);
	elseif (t_3 <= Inf)
		tmp = t_4;
	else
		tmp = Float64(Float64(t - a) / Float64(b - y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(x * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, 1e+285], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \mathsf{fma}\left(b - y, z, y\right)\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{t\_2}, x \cdot \frac{y}{t\_2}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 \leq 10^{+285}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 9.9999999999999998e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 31.8%

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

        \[\leadsto \color{blue}{\frac{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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999998e284

    1. Initial program 90.9%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. 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. lift-*.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, z \cdot \left(t - a\right)\right)}}{y + z \cdot \left(b - y\right)} \]
      7. *-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)} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(t - a\right) \cdot z}\right)}{y + z \cdot \left(b - y\right)} \]
      9. lift--.f6490.9

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

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

    if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 89.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\ t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x \cdot \frac{-1}{z - 1}\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 10^{+285}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y))))
        (t_2 (/ (+ (* x y) (* z (- t a))) t_1))
        (t_3 (fma z (/ (- t a) (fma (- b y) z y)) (* x (/ -1.0 (- z 1.0))))))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 1e+285)
       (/ (fma y x (* (- t a) z)) t_1)
       (if (<= t_2 INFINITY) t_3 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double t_2 = ((x * y) + (z * (t - a))) / t_1;
	double t_3 = fma(z, ((t - a) / fma((b - y), z, y)), (x * (-1.0 / (z - 1.0))));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= 1e+285) {
		tmp = fma(y, x, ((t - a) * z)) / t_1;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = (t - a) / (b - y);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1)
	t_3 = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), Float64(x * Float64(-1.0 / Float64(z - 1.0))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= 1e+285)
		tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1);
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(Float64(t - a) / Float64(b - y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 1e+285], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x \cdot \frac{-1}{z - 1}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 10^{+285}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 9.9999999999999998e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 31.8%

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

        \[\leadsto \color{blue}{\frac{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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999998e284

    1. Initial program 90.9%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. 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. lift-*.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, z \cdot \left(t - a\right)\right)}}{y + z \cdot \left(b - y\right)} \]
      7. *-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)} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(t - a\right) \cdot z}\right)}{y + z \cdot \left(b - y\right)} \]
      9. lift--.f6490.9

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

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

    if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\ t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 10^{+285}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y))))
        (t_2 (/ (+ (* x y) (* z (- t a))) t_1))
        (t_3 (fma z (/ (- t a) (fma (- b y) z y)) x)))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 1e+285)
       (/ (fma y x (* (- t a) z)) t_1)
       (if (<= t_2 INFINITY) t_3 (/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double t_2 = ((x * y) + (z * (t - a))) / t_1;
	double t_3 = fma(z, ((t - a) / fma((b - y), z, y)), x);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= 1e+285) {
		tmp = fma(y, x, ((t - a) * z)) / t_1;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = (t - a) / (b - y);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1)
	t_3 = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), x)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= 1e+285)
		tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / t_1);
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(Float64(t - a) / Float64(b - y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 1e+285], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 10^{+285}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{t\_1}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 9.9999999999999998e284 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 31.8%

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

        \[\leadsto \color{blue}{\frac{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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, \color{blue}{x}\right) \]
    5. Step-by-step derivation
      1. Applied rewrites82.7%

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

      if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9999999999999998e284

      1. Initial program 90.9%

        \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      2. 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. lift-*.f64N/A

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, z \cdot \left(t - a\right)\right)}}{y + z \cdot \left(b - y\right)} \]
        7. *-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)} \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(y, x, \color{blue}{\left(t - a\right) \cdot z}\right)}{y + z \cdot \left(b - y\right)} \]
        9. lift--.f6490.9

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

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

      if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

      1. Initial program 0.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    6. Recombined 3 regimes into one program.
    7. Add Preprocessing

    Alternative 4: 77.5% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1200000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 245:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (/ (- t a) (- b y))))
       (if (<= z -1200000000.0)
         t_1
         (if (<= z 245.0) (fma z (/ (- t a) (fma (- b y) z y)) x) t_1))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (t - a) / (b - y);
    	double tmp;
    	if (z <= -1200000000.0) {
    		tmp = t_1;
    	} else if (z <= 245.0) {
    		tmp = fma(z, ((t - a) / fma((b - y), z, y)), x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(t - a) / Float64(b - y))
    	tmp = 0.0
    	if (z <= -1200000000.0)
    		tmp = t_1;
    	elseif (z <= 245.0)
    		tmp = fma(z, Float64(Float64(t - a) / fma(Float64(b - y), z, y)), x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1200000000.0], t$95$1, If[LessEqual[z, 245.0], N[(z * N[(N[(t - a), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{t - a}{b - y}\\
    \mathbf{if}\;z \leq -1200000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 245:\\
    \;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.2e9 or 245 < z

      1. Initial program 45.1%

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

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

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

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

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

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

      if -1.2e9 < z < 245

      1. Initial program 87.3%

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

          \[\leadsto \color{blue}{\frac{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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, \color{blue}{x}\right) \]
      5. Step-by-step derivation
        1. Applied rewrites74.5%

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

      Alternative 5: 72.2% accurate, 1.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{-30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.29:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (/ (- t a) (- b y))))
         (if (<= z -6.5e-30) t_1 (if (<= z 0.29) (fma z (/ (- t a) y) x) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (t - a) / (b - y);
      	double tmp;
      	if (z <= -6.5e-30) {
      		tmp = t_1;
      	} else if (z <= 0.29) {
      		tmp = fma(z, ((t - a) / y), x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(Float64(t - a) / Float64(b - y))
      	tmp = 0.0
      	if (z <= -6.5e-30)
      		tmp = t_1;
      	elseif (z <= 0.29)
      		tmp = fma(z, Float64(Float64(t - a) / y), x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e-30], t$95$1, If[LessEqual[z, 0.29], N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{t - a}{b - y}\\
      \mathbf{if}\;z \leq -6.5 \cdot 10^{-30}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 0.29:\\
      \;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{y}, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -6.5000000000000005e-30 or 0.28999999999999998 < z

        1. Initial program 47.9%

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

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

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

            \[\leadsto \frac{t - a}{\color{blue}{b} - y} \]
          3. lift--.f6478.3

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

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

        if -6.5000000000000005e-30 < z < 0.28999999999999998

        1. Initial program 87.2%

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

            \[\leadsto \color{blue}{\frac{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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(b - y, z, y\right)}, \color{blue}{x}\right) \]
        5. Step-by-step derivation
          1. Applied rewrites75.1%

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

            \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{\color{blue}{y}}, x\right) \]
          3. Step-by-step derivation
            1. Applied rewrites65.3%

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

          Alternative 6: 59.7% accurate, 1.4× speedup?

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

            1. Initial program 53.2%

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

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

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

                \[\leadsto \frac{-1 \cdot x}{\color{blue}{z - 1}} \]
              3. mul-1-negN/A

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

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

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

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

            if -2.6999999999999999e-44 < y < 2.1000000000000002e63

            1. Initial program 79.0%

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

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

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

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

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

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

          Alternative 7: 52.3% accurate, 1.5× speedup?

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

            1. Initial program 58.7%

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

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

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

                \[\leadsto \frac{-1 \cdot x}{\color{blue}{z - 1}} \]
              3. mul-1-negN/A

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

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

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

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

            if -1.8499999999999999e-35 < y < 5.3999999999999995e-144

            1. Initial program 80.2%

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

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

                \[\leadsto \frac{t - a}{\color{blue}{b}} \]
              2. lift--.f6465.4

                \[\leadsto \frac{t - a}{b} \]
            4. Applied rewrites65.4%

              \[\leadsto \color{blue}{\frac{t - a}{b}} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 8: 44.5% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\ \;\;\;\;\frac{t - a}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (<= y -1.85e-35) x (if (<= y 5.4e-144) (/ (- t a) b) x)))
          double code(double x, double y, double z, double t, double a, double b) {
          	double tmp;
          	if (y <= -1.85e-35) {
          		tmp = x;
          	} else if (y <= 5.4e-144) {
          		tmp = (t - a) / b;
          	} else {
          		tmp = x;
          	}
          	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 <= (-1.85d-35)) then
                  tmp = x
              else if (y <= 5.4d-144) then
                  tmp = (t - a) / b
              else
                  tmp = x
              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 <= -1.85e-35) {
          		tmp = x;
          	} else if (y <= 5.4e-144) {
          		tmp = (t - a) / b;
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b):
          	tmp = 0
          	if y <= -1.85e-35:
          		tmp = x
          	elif y <= 5.4e-144:
          		tmp = (t - a) / b
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z, t, a, b)
          	tmp = 0.0
          	if (y <= -1.85e-35)
          		tmp = x;
          	elseif (y <= 5.4e-144)
          		tmp = Float64(Float64(t - a) / b);
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b)
          	tmp = 0.0;
          	if (y <= -1.85e-35)
          		tmp = x;
          	elseif (y <= 5.4e-144)
          		tmp = (t - a) / b;
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.85e-35], x, If[LessEqual[y, 5.4e-144], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1.85 \cdot 10^{-35}:\\
          \;\;\;\;x\\
          
          \mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\
          \;\;\;\;\frac{t - a}{b}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1.8499999999999999e-35 or 5.3999999999999995e-144 < y

            1. Initial program 58.7%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites32.9%

                \[\leadsto \color{blue}{x} \]

              if -1.8499999999999999e-35 < y < 5.3999999999999995e-144

              1. Initial program 80.2%

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

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

                  \[\leadsto \frac{t - a}{\color{blue}{b}} \]
                2. lift--.f6465.4

                  \[\leadsto \frac{t - a}{b} \]
              4. Applied rewrites65.4%

                \[\leadsto \color{blue}{\frac{t - a}{b}} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 9: 32.9% accurate, 2.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-191}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (<= y -1.4e-44) x (if (<= y 1.85e-191) (/ t b) x)))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if (y <= -1.4e-44) {
            		tmp = x;
            	} else if (y <= 1.85e-191) {
            		tmp = t / b;
            	} else {
            		tmp = x;
            	}
            	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 <= (-1.4d-44)) then
                    tmp = x
                else if (y <= 1.85d-191) then
                    tmp = t / b
                else
                    tmp = x
                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 <= -1.4e-44) {
            		tmp = x;
            	} else if (y <= 1.85e-191) {
            		tmp = t / b;
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if y <= -1.4e-44:
            		tmp = x
            	elif y <= 1.85e-191:
            		tmp = t / b
            	else:
            		tmp = x
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (y <= -1.4e-44)
            		tmp = x;
            	elseif (y <= 1.85e-191)
            		tmp = Float64(t / b);
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if (y <= -1.4e-44)
            		tmp = x;
            	elseif (y <= 1.85e-191)
            		tmp = t / b;
            	else
            		tmp = x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.4e-44], x, If[LessEqual[y, 1.85e-191], N[(t / b), $MachinePrecision], x]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1.4 \cdot 10^{-44}:\\
            \;\;\;\;x\\
            
            \mathbf{elif}\;y \leq 1.85 \cdot 10^{-191}:\\
            \;\;\;\;\frac{t}{b}\\
            
            \mathbf{else}:\\
            \;\;\;\;x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.4e-44 or 1.8499999999999998e-191 < y

              1. Initial program 59.8%

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

                \[\leadsto \color{blue}{x} \]
              3. Step-by-step derivation
                1. Applied rewrites31.6%

                  \[\leadsto \color{blue}{x} \]

                if -1.4e-44 < y < 1.8499999999999998e-191

                1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{t}{\color{blue}{b}} \]
                6. Step-by-step derivation
                  1. lower-/.f6435.6

                    \[\leadsto \frac{t}{b} \]
                7. Applied rewrites35.6%

                  \[\leadsto \frac{t}{\color{blue}{b}} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 10: 24.8% accurate, 23.9× speedup?

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

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

                \[\leadsto \color{blue}{x} \]
              3. Step-by-step derivation
                1. Applied rewrites24.8%

                  \[\leadsto \color{blue}{x} \]
                2. Add Preprocessing

                Reproduce

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