Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.4% → 95.7%
Time: 6.3s
Alternatives: 13
Speedup: 1.3×

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 13 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: 95.7% accurate, 0.1× 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 := \frac{z}{t\_1}\\ t_4 := x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot t\_3, \frac{y}{t\_1} + \frac{t}{x} \cdot t\_3\right)\\ t_5 := \mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+303}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-277}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-292}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \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 (/ z t_1))
        (t_4 (* x (fma -1.0 (* (/ a x) t_3) (+ (/ y t_1) (* (/ t x) t_3)))))
        (t_5
         (-
          (fma (/ x z) (/ y (- b y)) (/ t (- b y)))
          (fma (/ y z) (/ (- t a) (pow (- b y) 2.0)) (/ a (- b y))))))
   (if (<= t_2 -2e+303)
     t_4
     (if (<= t_2 -4e-277)
       t_2
       (if (<= t_2 2e-292)
         t_5
         (if (<= t_2 5e+273) t_2 (if (<= t_2 INFINITY) t_4 t_5)))))))
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 = z / t_1;
	double t_4 = x * fma(-1.0, ((a / x) * t_3), ((y / t_1) + ((t / x) * t_3)));
	double t_5 = fma((x / z), (y / (b - y)), (t / (b - y))) - fma((y / z), ((t - a) / pow((b - y), 2.0)), (a / (b - y)));
	double tmp;
	if (t_2 <= -2e+303) {
		tmp = t_4;
	} else if (t_2 <= -4e-277) {
		tmp = t_2;
	} else if (t_2 <= 2e-292) {
		tmp = t_5;
	} else if (t_2 <= 5e+273) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_4;
	} else {
		tmp = t_5;
	}
	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 = Float64(z / t_1)
	t_4 = Float64(x * fma(-1.0, Float64(Float64(a / x) * t_3), Float64(Float64(y / t_1) + Float64(Float64(t / x) * t_3))))
	t_5 = Float64(fma(Float64(x / z), Float64(y / Float64(b - y)), Float64(t / Float64(b - y))) - fma(Float64(y / z), Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)), Float64(a / Float64(b - y))))
	tmp = 0.0
	if (t_2 <= -2e+303)
		tmp = t_4;
	elseif (t_2 <= -4e-277)
		tmp = t_2;
	elseif (t_2 <= 2e-292)
		tmp = t_5;
	elseif (t_2 <= 5e+273)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = t_4;
	else
		tmp = t_5;
	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 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(x * N[(-1.0 * N[(N[(a / x), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / z), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+303], t$95$4, If[LessEqual[t$95$2, -4e-277], t$95$2, If[LessEqual[t$95$2, 2e-292], t$95$5, If[LessEqual[t$95$2, 5e+273], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$4, t$95$5]]]]]]]]]]
\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 := \frac{z}{t\_1}\\
t_4 := x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot t\_3, \frac{y}{t\_1} + \frac{t}{x} \cdot t\_3\right)\\
t_5 := \mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+303}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-277}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-292}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;t\_2\\

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

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


\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)))) < -2e303 or 4.99999999999999961e273 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 32.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 t around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{t \cdot z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)}\right) \]
      10. div-add-revN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot \frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{t \cdot z + x \cdot y}{y + z \cdot \left(b - y\right)}\right) \]
    5. Applied rewrites48.0%

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

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

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

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

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

    if -2e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999988e-277 or 2.0000000000000001e-292 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999961e273

    1. Initial program 99.6%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing

    if -3.99999999999999988e-277 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e-292 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 7.5%

      \[\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. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -2 \cdot 10^{+303}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}, \frac{y}{y + z \cdot \left(b - y\right)} + \frac{t}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}\right)\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -4 \cdot 10^{-277}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 2 \cdot 10^{-292}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 5 \cdot 10^{+273}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq \infty:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}, \frac{y}{y + z \cdot \left(b - y\right)} + \frac{t}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, \frac{y}{b - y}, \frac{t}{b - y}\right) - \mathsf{fma}\left(\frac{y}{z}, \frac{t - a}{{\left(b - y\right)}^{2}}, \frac{a}{b - y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 91.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ t_2 := y + z \cdot \left(b - y\right)\\ t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_2}\\ t_4 := \frac{z}{t\_2}\\ t_5 := x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot t\_4, \frac{y}{t\_2} + \frac{t}{x} \cdot t\_4\right)\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{+303}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-277}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-292}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x \cdot \frac{y}{b - y} - \frac{\left(t - a\right) \cdot y}{{\left(b - y\right)}^{2}}}{-z}, -1, t\_1\right)\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+273}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- t a) (- b y)))
        (t_2 (+ y (* z (- b y))))
        (t_3 (/ (+ (* x y) (* z (- t a))) t_2))
        (t_4 (/ z t_2))
        (t_5 (* x (fma -1.0 (* (/ a x) t_4) (+ (/ y t_2) (* (/ t x) t_4))))))
   (if (<= t_3 -2e+303)
     t_5
     (if (<= t_3 -4e-277)
       t_3
       (if (<= t_3 2e-292)
         (fma
          (/ (- (* x (/ y (- b y))) (/ (* (- t a) y) (pow (- b y) 2.0))) (- z))
          -1.0
          t_1)
         (if (<= t_3 5e+273) t_3 (if (<= t_3 INFINITY) t_5 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t - a) / (b - y);
	double t_2 = y + (z * (b - y));
	double t_3 = ((x * y) + (z * (t - a))) / t_2;
	double t_4 = z / t_2;
	double t_5 = x * fma(-1.0, ((a / x) * t_4), ((y / t_2) + ((t / x) * t_4)));
	double tmp;
	if (t_3 <= -2e+303) {
		tmp = t_5;
	} else if (t_3 <= -4e-277) {
		tmp = t_3;
	} else if (t_3 <= 2e-292) {
		tmp = fma((((x * (y / (b - y))) - (((t - a) * y) / pow((b - y), 2.0))) / -z), -1.0, t_1);
	} else if (t_3 <= 5e+273) {
		tmp = t_3;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_5;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t - a) / Float64(b - y))
	t_2 = Float64(y + Float64(z * Float64(b - y)))
	t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_2)
	t_4 = Float64(z / t_2)
	t_5 = Float64(x * fma(-1.0, Float64(Float64(a / x) * t_4), Float64(Float64(y / t_2) + Float64(Float64(t / x) * t_4))))
	tmp = 0.0
	if (t_3 <= -2e+303)
		tmp = t_5;
	elseif (t_3 <= -4e-277)
		tmp = t_3;
	elseif (t_3 <= 2e-292)
		tmp = fma(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) - Float64(Float64(Float64(t - a) * y) / (Float64(b - y) ^ 2.0))) / Float64(-z)), -1.0, t_1);
	elseif (t_3 <= 5e+273)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = t_5;
	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]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(z / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x * N[(-1.0 * N[(N[(a / x), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(N[(y / t$95$2), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+303], t$95$5, If[LessEqual[t$95$3, -4e-277], t$95$3, If[LessEqual[t$95$3, 2e-292], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t - a), $MachinePrecision] * y), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision] * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 5e+273], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-277}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;t\_3\\

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

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


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

    1. Initial program 32.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 t around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{t \cdot z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)}\right) \]
      10. div-add-revN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot \frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{t \cdot z + x \cdot y}{y + z \cdot \left(b - y\right)}\right) \]
    5. Applied rewrites48.0%

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

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

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

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

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

    if -2e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999988e-277 or 2.0000000000000001e-292 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.99999999999999961e273

    1. Initial program 99.6%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing

    if -3.99999999999999988e-277 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e-292

    1. Initial program 17.5%

      \[\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(-1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \frac{t}{b - y}\right) - \frac{a}{b - y}} \]
    4. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -2 \cdot 10^{+303}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}, \frac{y}{y + z \cdot \left(b - y\right)} + \frac{t}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}\right)\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -4 \cdot 10^{-277}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 2 \cdot 10^{-292}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x \cdot \frac{y}{b - y} - \frac{\left(t - a\right) \cdot y}{{\left(b - y\right)}^{2}}}{-z}, -1, \frac{t - a}{b - y}\right)\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 5 \cdot 10^{+273}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq \infty:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-1, \frac{a}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}, \frac{y}{y + z \cdot \left(b - y\right)} + \frac{t}{x} \cdot \frac{z}{y + z \cdot \left(b - y\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+61} \lor \neg \left(z \leq 8 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3499999999999999e61 or 8e16 < z

    1. Initial program 43.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 z around inf

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. 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--.f6489.6

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

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

    if -2.3499999999999999e61 < z < 8e16

    1. Initial program 85.9%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification87.5%

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

Alternative 4: 72.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+61} \lor \neg \left(z \leq 6.8 \cdot 10^{+15}\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 -1.4e+61) (not (<= z 6.8e+15)))
   (/ (- 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 <= -1.4e+61) || !(z <= 6.8e+15)) {
		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 <= -1.4e+61) || !(z <= 6.8e+15))
		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, -1.4e+61], N[Not[LessEqual[z, 6.8e+15]], $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 -1.4 \cdot 10^{+61} \lor \neg \left(z \leq 6.8 \cdot 10^{+15}\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 < -1.4000000000000001e61 or 6.8e15 < z

    1. Initial program 43.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 z around inf

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. 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--.f6489.6

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

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

    if -1.4000000000000001e61 < z < 6.8e15

    1. Initial program 85.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 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 \frac{t \cdot z + x \cdot y}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

      \[\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 simplification79.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+61} \lor \neg \left(z \leq 6.8 \cdot 10^{+15}\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 5: 53.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-x}{z - 1}\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-74}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+43}:\\ \;\;\;\;\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 -9.2e+58)
     t_1
     (if (<= y -6.5e-74)
       (/ t (- b y))
       (if (<= y 5.5e+43) (/ (- 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 <= -9.2e+58) {
		tmp = t_1;
	} else if (y <= -6.5e-74) {
		tmp = t / (b - y);
	} else if (y <= 5.5e+43) {
		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 <= (-9.2d+58)) then
        tmp = t_1
    else if (y <= (-6.5d-74)) then
        tmp = t / (b - y)
    else if (y <= 5.5d+43) 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 <= -9.2e+58) {
		tmp = t_1;
	} else if (y <= -6.5e-74) {
		tmp = t / (b - y);
	} else if (y <= 5.5e+43) {
		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 <= -9.2e+58:
		tmp = t_1
	elif y <= -6.5e-74:
		tmp = t / (b - y)
	elif y <= 5.5e+43:
		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 <= -9.2e+58)
		tmp = t_1;
	elseif (y <= -6.5e-74)
		tmp = Float64(t / Float64(b - y));
	elseif (y <= 5.5e+43)
		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 <= -9.2e+58)
		tmp = t_1;
	elseif (y <= -6.5e-74)
		tmp = t / (b - y);
	elseif (y <= 5.5e+43)
		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, -9.2e+58], t$95$1, If[LessEqual[y, -6.5e-74], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+43], 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 -9.2 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{t}{b - y}\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{t - a}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.2000000000000001e58 or 5.49999999999999989e43 < y

    1. Initial program 50.7%

      \[\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}{-1 \cdot \frac{x}{z - 1}} \]
    4. 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--.f6459.4

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

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

    if -9.2000000000000001e58 < y < -6.5000000000000002e-74

    1. Initial program 70.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 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 \frac{t \cdot z + x \cdot y}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{b - \color{blue}{y}} \]
      2. lift--.f6451.6

        \[\leadsto \frac{t}{b - y} \]
    8. Applied rewrites51.6%

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

    if -6.5000000000000002e-74 < y < 5.49999999999999989e43

    1. Initial program 81.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 0

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

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

        \[\leadsto \frac{t - a}{b} \]
    5. Applied rewrites58.3%

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

Alternative 6: 72.0% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.60000000000000046e-22 or 4.80000000000000012e-4 < z

    1. Initial program 47.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 z around inf

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. 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--.f6485.9

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

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

    if -7.60000000000000046e-22 < z < 4.80000000000000012e-4

    1. Initial program 86.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 z around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
      11. lift--.f6450.2

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - a}{y}, z, x\right) \]
    8. Recombined 2 regimes into one program.
    9. Final simplification74.7%

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

    Alternative 7: 46.5% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+59}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-74}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+43}:\\ \;\;\;\;\frac{t - a}{b}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= y -7.5e+59)
       x
       (if (<= y -6.5e-74)
         (/ t (- b y))
         (if (<= y 6e+43) (/ (- t a) b) (fma x z x)))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (y <= -7.5e+59) {
    		tmp = x;
    	} else if (y <= -6.5e-74) {
    		tmp = t / (b - y);
    	} else if (y <= 6e+43) {
    		tmp = (t - a) / b;
    	} else {
    		tmp = fma(x, z, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (y <= -7.5e+59)
    		tmp = x;
    	elseif (y <= -6.5e-74)
    		tmp = Float64(t / Float64(b - y));
    	elseif (y <= 6e+43)
    		tmp = Float64(Float64(t - a) / b);
    	else
    		tmp = fma(x, z, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.5e+59], x, If[LessEqual[y, -6.5e-74], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+43], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], N[(x * z + x), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -7.5 \cdot 10^{+59}:\\
    \;\;\;\;x\\
    
    \mathbf{elif}\;y \leq -6.5 \cdot 10^{-74}:\\
    \;\;\;\;\frac{t}{b - y}\\
    
    \mathbf{elif}\;y \leq 6 \cdot 10^{+43}:\\
    \;\;\;\;\frac{t - a}{b}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y < -7.4999999999999996e59

      1. Initial program 56.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 0

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

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

        if -7.4999999999999996e59 < y < -6.5000000000000002e-74

        1. Initial program 70.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 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 \frac{t \cdot z + x \cdot y}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
          2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto \frac{t}{b - \color{blue}{y}} \]
          2. lift--.f6451.6

            \[\leadsto \frac{t}{b - y} \]
        8. Applied rewrites51.6%

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

        if -6.5000000000000002e-74 < y < 6.00000000000000033e43

        1. Initial program 81.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 0

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

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

            \[\leadsto \frac{t - a}{b} \]
        5. Applied rewrites58.3%

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

        if 6.00000000000000033e43 < y

        1. Initial program 46.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 z around 0

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
          11. lift--.f6437.3

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

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

          \[\leadsto \mathsf{fma}\left(x, z, x\right) \]
        7. Step-by-step derivation
          1. Applied rewrites55.4%

            \[\leadsto \mathsf{fma}\left(x, z, x\right) \]
        8. Recombined 4 regimes into one program.
        9. Add Preprocessing

        Alternative 8: 68.2% accurate, 1.3× speedup?

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

          1. Initial program 47.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 z around inf

            \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
          4. 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--.f6485.9

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

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

          if -2.40000000000000002e-22 < z < 4.4000000000000002e-7

          1. Initial program 86.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 z around 0

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
            11. lift--.f6450.2

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

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

            \[\leadsto \mathsf{fma}\left(\frac{t}{y}, z, x\right) \]
          7. Step-by-step derivation
            1. Applied rewrites58.2%

              \[\leadsto \mathsf{fma}\left(\frac{t}{y}, z, x\right) \]
          8. Recombined 2 regimes into one program.
          9. Final simplification71.7%

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

          Alternative 9: 64.0% accurate, 1.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-56} \lor \neg \left(z \leq 2.9 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z - 1}\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (or (<= z -1.55e-56) (not (<= z 2.9e+15)))
             (/ (- t a) (- b y))
             (/ (- x) (- z 1.0))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double tmp;
          	if ((z <= -1.55e-56) || !(z <= 2.9e+15)) {
          		tmp = (t - a) / (b - y);
          	} else {
          		tmp = -x / (z - 1.0);
          	}
          	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 ((z <= (-1.55d-56)) .or. (.not. (z <= 2.9d+15))) then
                  tmp = (t - a) / (b - y)
              else
                  tmp = -x / (z - 1.0d0)
              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 ((z <= -1.55e-56) || !(z <= 2.9e+15)) {
          		tmp = (t - a) / (b - y);
          	} else {
          		tmp = -x / (z - 1.0);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b):
          	tmp = 0
          	if (z <= -1.55e-56) or not (z <= 2.9e+15):
          		tmp = (t - a) / (b - y)
          	else:
          		tmp = -x / (z - 1.0)
          	return tmp
          
          function code(x, y, z, t, a, b)
          	tmp = 0.0
          	if ((z <= -1.55e-56) || !(z <= 2.9e+15))
          		tmp = Float64(Float64(t - a) / Float64(b - y));
          	else
          		tmp = Float64(Float64(-x) / Float64(z - 1.0));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b)
          	tmp = 0.0;
          	if ((z <= -1.55e-56) || ~((z <= 2.9e+15)))
          		tmp = (t - a) / (b - y);
          	else
          		tmp = -x / (z - 1.0);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.55e-56], N[Not[LessEqual[z, 2.9e+15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -1.55 \cdot 10^{-56} \lor \neg \left(z \leq 2.9 \cdot 10^{+15}\right):\\
          \;\;\;\;\frac{t - a}{b - y}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-x}{z - 1}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -1.54999999999999994e-56 or 2.9e15 < z

            1. Initial program 47.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 z around inf

              \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
            4. 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--.f6485.2

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

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

            if -1.54999999999999994e-56 < z < 2.9e15

            1. Initial program 86.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}{-1 \cdot \frac{x}{z - 1}} \]
            4. 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.9

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

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

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

          Alternative 10: 44.7% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-51} \lor \neg \left(z \leq 850000000\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 -3e-51) (not (<= z 850000000.0))) (/ 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 <= -3e-51) || !(z <= 850000000.0)) {
          		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 <= -3e-51) || !(z <= 850000000.0))
          		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, -3e-51], N[Not[LessEqual[z, 850000000.0]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -3 \cdot 10^{-51} \lor \neg \left(z \leq 850000000\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 < -3.00000000000000002e-51 or 8.5e8 < z

            1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{t}{b - \color{blue}{y}} \]
              2. lift--.f6449.8

                \[\leadsto \frac{t}{b - y} \]
            8. Applied rewrites49.8%

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

            if -3.00000000000000002e-51 < z < 8.5e8

            1. Initial program 86.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 z around 0

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
              11. lift--.f6449.8

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

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

              \[\leadsto \mathsf{fma}\left(x, z, x\right) \]
            7. Step-by-step derivation
              1. Applied rewrites52.5%

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

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

            Alternative 11: 36.9% accurate, 1.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-51} \lor \neg \left(z \leq 120000000000\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 -3e-51) (not (<= z 120000000000.0))) (/ t b) (fma x z x)))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((z <= -3e-51) || !(z <= 120000000000.0)) {
            		tmp = t / b;
            	} else {
            		tmp = fma(x, z, x);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if ((z <= -3e-51) || !(z <= 120000000000.0))
            		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, -3e-51], N[Not[LessEqual[z, 120000000000.0]], $MachinePrecision]], N[(t / b), $MachinePrecision], N[(x * z + x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -3 \cdot 10^{-51} \lor \neg \left(z \leq 120000000000\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 < -3.00000000000000002e-51 or 1.2e11 < z

              1. Initial program 47.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 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 \frac{t \cdot z + x \cdot y}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
                2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{t}{b} \]
              8. Applied rewrites31.4%

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

              if -3.00000000000000002e-51 < z < 1.2e11

              1. Initial program 86.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 z around 0

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
                11. lift--.f6449.5

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

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

                \[\leadsto \mathsf{fma}\left(x, z, x\right) \]
              7. Step-by-step derivation
                1. Applied rewrites52.1%

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

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

              Alternative 12: 25.4% 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.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 z around 0

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{t - \left(a + \left(b - y\right) \cdot x\right)}{y}, z, x\right) \]
                11. lift--.f6428.8

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

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

                \[\leadsto \mathsf{fma}\left(x, z, x\right) \]
              7. Step-by-step derivation
                1. Applied rewrites28.7%

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

                Alternative 13: 25.2% accurate, 39.0× 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 67.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 z around 0

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Applied rewrites28.0%

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

                  Developer Target 1: 73.0% 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 2025064 
                  (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)))))