AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1

Percentage Accurate: 60.7% → 97.5%
Time: 7.5s
Alternatives: 17
Speedup: 0.4×

Specification

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

\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\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 17 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: 60.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y + x\right) + t\\ t_2 := \frac{y + x}{t\_1}\\ t_3 := t + \left(x + y\right)\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{+74} \lor \neg \left(a \leq 30000000000\right):\\ \;\;\;\;\left(\left(\frac{t + y}{t\_1} + \frac{z}{a} \cdot t\_2\right) - \frac{b}{a} \cdot \frac{y}{t\_1}\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_2, z, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_3}, \frac{a}{b} \cdot \frac{t + y}{t\_3}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ y x) t)) (t_2 (/ (+ y x) t_1)) (t_3 (+ t (+ x y))))
   (if (or (<= a -1.25e+74) (not (<= a 30000000000.0)))
     (* (- (+ (/ (+ t y) t_1) (* (/ z a) t_2)) (* (/ b a) (/ y t_1))) a)
     (fma t_2 z (* b (fma -1.0 (/ y t_3) (* (/ a b) (/ (+ t y) t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y + x) + t;
	double t_2 = (y + x) / t_1;
	double t_3 = t + (x + y);
	double tmp;
	if ((a <= -1.25e+74) || !(a <= 30000000000.0)) {
		tmp = ((((t + y) / t_1) + ((z / a) * t_2)) - ((b / a) * (y / t_1))) * a;
	} else {
		tmp = fma(t_2, z, (b * fma(-1.0, (y / t_3), ((a / b) * ((t + y) / t_3)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y + x) + t)
	t_2 = Float64(Float64(y + x) / t_1)
	t_3 = Float64(t + Float64(x + y))
	tmp = 0.0
	if ((a <= -1.25e+74) || !(a <= 30000000000.0))
		tmp = Float64(Float64(Float64(Float64(Float64(t + y) / t_1) + Float64(Float64(z / a) * t_2)) - Float64(Float64(b / a) * Float64(y / t_1))) * a);
	else
		tmp = fma(t_2, z, Float64(b * fma(-1.0, Float64(y / t_3), Float64(Float64(a / b) * Float64(Float64(t + y) / t_3)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -1.25e+74], N[Not[LessEqual[a, 30000000000.0]], $MachinePrecision]], N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(t$95$2 * z + N[(b * N[(-1.0 * N[(y / t$95$3), $MachinePrecision] + N[(N[(a / b), $MachinePrecision] * N[(N[(t + y), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{y + x}{t\_1}\\
t_3 := t + \left(x + y\right)\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+74} \lor \neg \left(a \leq 30000000000\right):\\
\;\;\;\;\left(\left(\frac{t + y}{t\_1} + \frac{z}{a} \cdot t\_2\right) - \frac{b}{a} \cdot \frac{y}{t\_1}\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.24999999999999991e74 or 3e10 < a

    1. Initial program 43.6%

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

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

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

        \[\leadsto \left(\left(\frac{t}{t + \left(x + y\right)} + \left(\frac{y}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right)\right) - \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) \cdot \color{blue}{a} \]
    5. Applied rewrites99.0%

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

    if -1.24999999999999991e74 < a < 3e10

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 71.1% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot y\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_2}\\
t_4 := \left(a + z\right) - b\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+194}:\\
\;\;\;\;t\_4\\

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

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

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+246}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, t\_1\right)}{t\_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999989e194 or 4.00000000000000027e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 16.8%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6482.0

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites82.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -4.99999999999999989e194 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000009e42

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y + x, z, \left(\mathsf{neg}\left(b\right)\right) \cdot y\right)}{\left(x + t\right) + y} \]
      13. lower-neg.f6487.4

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

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

    if -2.00000000000000009e42 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999995e-8

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999995e-8 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000027e246

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \frac{\left(t + y\right) \cdot a + \left(-1 \cdot b\right) \cdot y}{\left(x + t\right) + y} \]
      4. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(t + y, a, \left(\mathsf{neg}\left(b\right)\right) \cdot y\right)}{\left(x + t\right) + y} \]
      12. lower-neg.f6478.4

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

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

Alternative 3: 68.5% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot y\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_2}\\
t_4 := \left(a + z\right) - b\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+194}:\\
\;\;\;\;t\_4\\

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

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

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+246}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, t\_1\right)}{t\_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999989e194 or 4.00000000000000027e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 16.8%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6482.0

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites82.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -4.99999999999999989e194 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000009e42

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y + x, z, \left(\mathsf{neg}\left(b\right)\right) \cdot y\right)}{\left(x + t\right) + y} \]
      13. lower-neg.f6487.4

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

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

    if -2.00000000000000009e42 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999995e-8

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{y + x}, z, a \cdot \left(t + y\right) - b \cdot y\right)}{\left(x + t\right) + y} \]
      14. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(y + x, z, \color{blue}{a \cdot t}\right)}{\left(x + t\right) + y} \]
    6. Step-by-step derivation
      1. lower-*.f6481.7

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

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

    if 9.9999999999999995e-8 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000027e246

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \frac{\left(t + y\right) \cdot a + \left(-1 \cdot b\right) \cdot y}{\left(x + t\right) + y} \]
      4. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(t + y, a, \left(\mathsf{neg}\left(b\right)\right) \cdot y\right)}{\left(x + t\right) + y} \]
      12. lower-neg.f6478.4

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

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

Alternative 4: 68.6% accurate, 0.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.0000000000000002e166 or 4.00000000000000027e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 20.8%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6481.0

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites81.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -5.0000000000000002e166 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999995e-8

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{y + x}, z, a \cdot \left(t + y\right) - b \cdot y\right)}{\left(x + t\right) + y} \]
      14. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(y + x, z, \color{blue}{a \cdot t}\right)}{\left(x + t\right) + y} \]
    6. Step-by-step derivation
      1. lower-*.f6476.4

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

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

    if 9.9999999999999995e-8 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000027e246

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \frac{\left(t + y\right) \cdot a + \left(-1 \cdot b\right) \cdot y}{\left(x + t\right) + y} \]
      4. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(t + y, a, \left(\mathsf{neg}\left(b\right)\right) \cdot y\right)}{\left(x + t\right) + y} \]
      12. lower-neg.f6478.4

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

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

Alternative 5: 65.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+112}:\\
\;\;\;\;\frac{t\_3 \cdot y}{t\_1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999945e193 or 1.00000000000000004e93 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 29.7%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6479.9

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites79.9%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -9.99999999999999945e193 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5e112

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if -5e112 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000004e93

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x} \]
      5. lower-+.f6470.2

        \[\leadsto \frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + \color{blue}{x}} \]
    5. Applied rewrites70.2%

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

Alternative 6: 87.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+283} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+246}\right):\\
\;\;\;\;\left(a + z\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999955e282 or 4.00000000000000027e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 9.2%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6482.7

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites82.7%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -9.99999999999999955e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000027e246

    1. Initial program 99.6%

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

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

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

Alternative 7: 87.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+283} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+246}\right):\\
\;\;\;\;\left(a + z\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999955e282 or 4.00000000000000027e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 9.2%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6482.7

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites82.7%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -9.99999999999999955e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000027e246

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{y + x}, z, a \cdot \left(t + y\right) - b \cdot y\right)}{\left(x + t\right) + y} \]
      14. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+166} \lor \neg \left(t\_2 \leq 10^{+93}\right):\\
\;\;\;\;\left(a + z\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.0000000000000002e166 or 1.00000000000000004e93 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 32.1%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6479.0

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites79.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -5.0000000000000002e166 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000004e93

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{y + x}, z, a \cdot \left(t + y\right) - b \cdot y\right)}{\left(x + t\right) + y} \]
      14. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(y + x, z, \color{blue}{a \cdot t}\right)}{\left(x + t\right) + y} \]
    6. Step-by-step derivation
      1. lower-*.f6473.7

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

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

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

Alternative 9: 66.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+112} \lor \neg \left(t\_1 \leq 10^{+93}\right):\\
\;\;\;\;\left(a + z\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5e112 or 1.00000000000000004e93 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 36.0%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6477.1

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites77.1%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -5e112 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000004e93

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x} \]
      5. lower-+.f6470.2

        \[\leadsto \frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + \color{blue}{x}} \]
    5. Applied rewrites70.2%

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

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

Alternative 10: 56.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+166} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+50}\right):\\
\;\;\;\;\left(a + z\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.0000000000000002e166 or 2.0000000000000002e50 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 36.5%

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

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

        \[\leadsto \left(a + z\right) - \color{blue}{b} \]
      2. lower-+.f6476.0

        \[\leadsto \left(a + z\right) - b \]
    5. Applied rewrites76.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -5.0000000000000002e166 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000002e50

    1. Initial program 99.6%

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

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

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

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

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

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

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

        \[\leadsto z \cdot \frac{x + y}{t + \color{blue}{\left(x + y\right)}} \]
      6. lower-+.f6446.7

        \[\leadsto z \cdot \frac{x + y}{t + \left(x + \color{blue}{y}\right)} \]
    6. Applied rewrites46.7%

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

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

Alternative 11: 92.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y + x\right) + t\\ t_2 := t + \left(x + y\right)\\ t_3 := \frac{y + x}{t\_1}\\ \mathbf{if}\;b \leq -7 \cdot 10^{-6} \lor \neg \left(b \leq 8.2 \cdot 10^{-96}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_3, z, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_2}, \frac{a}{b} \cdot \frac{t + y}{t\_2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{t + y}{t\_1} + \frac{z}{a} \cdot t\_3\right) - \frac{b \cdot y}{a \cdot t\_1}\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ y x) t)) (t_2 (+ t (+ x y))) (t_3 (/ (+ y x) t_1)))
   (if (or (<= b -7e-6) (not (<= b 8.2e-96)))
     (fma t_3 z (* b (fma -1.0 (/ y t_2) (* (/ a b) (/ (+ t y) t_2)))))
     (* (- (+ (/ (+ t y) t_1) (* (/ z a) t_3)) (/ (* b y) (* a t_1))) a))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y + x) + t;
	double t_2 = t + (x + y);
	double t_3 = (y + x) / t_1;
	double tmp;
	if ((b <= -7e-6) || !(b <= 8.2e-96)) {
		tmp = fma(t_3, z, (b * fma(-1.0, (y / t_2), ((a / b) * ((t + y) / t_2)))));
	} else {
		tmp = ((((t + y) / t_1) + ((z / a) * t_3)) - ((b * y) / (a * t_1))) * a;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y + x) + t)
	t_2 = Float64(t + Float64(x + y))
	t_3 = Float64(Float64(y + x) / t_1)
	tmp = 0.0
	if ((b <= -7e-6) || !(b <= 8.2e-96))
		tmp = fma(t_3, z, Float64(b * fma(-1.0, Float64(y / t_2), Float64(Float64(a / b) * Float64(Float64(t + y) / t_2)))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(t + y) / t_1) + Float64(Float64(z / a) * t_3)) - Float64(Float64(b * y) / Float64(a * t_1))) * a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[b, -7e-6], N[Not[LessEqual[b, 8.2e-96]], $MachinePrecision]], N[(t$95$3 * z + N[(b * N[(-1.0 * N[(y / t$95$2), $MachinePrecision] + N[(N[(a / b), $MachinePrecision] * N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.99999999999999989e-6 or 8.20000000000000048e-96 < b

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999989e-6 < b < 8.20000000000000048e-96

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{t + y}{\left(y + x\right) + t} + \frac{z}{a} \cdot \frac{y + x}{\left(y + x\right) + t}\right) - \frac{b \cdot y}{a \cdot \left(\left(y + x\right) + t\right)}\right) \cdot a \]
      11. lift-+.f6489.6

        \[\leadsto \left(\left(\frac{t + y}{\left(y + x\right) + t} + \frac{z}{a} \cdot \frac{y + x}{\left(y + x\right) + t}\right) - \frac{b \cdot y}{a \cdot \left(\left(y + x\right) + t\right)}\right) \cdot a \]
    7. Applied rewrites89.6%

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

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

Alternative 12: 89.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{if}\;b \leq -2 \cdot 10^{-30} \lor \neg \left(b \leq 6.3 \cdot 10^{-96}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_1}, \frac{a}{b} \cdot \frac{t + y}{t\_1}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2e-30 or 6.2999999999999996e-96 < b

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, b \cdot \mathsf{fma}\left(-1, \frac{y}{t + \left(x + y\right)}, \frac{a}{b} \cdot \frac{t + y}{t + \left(x + y\right)}\right)\right) \]
      14. lower-+.f6496.3

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

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

    if -2e-30 < b < 6.2999999999999996e-96

    1. Initial program 58.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, \color{blue}{a}\right) \]
    6. Recombined 2 regimes into one program.
    7. Final simplification92.5%

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

    Alternative 13: 58.0% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+134} \lor \neg \left(t \leq 4.3 \cdot 10^{+39}\right):\\ \;\;\;\;\frac{t + y}{t + \left(x + y\right)} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (or (<= t -2.7e+134) (not (<= t 4.3e+39)))
       (* (/ (+ t y) (+ t (+ x y))) a)
       (- (+ a z) b)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((t <= -2.7e+134) || !(t <= 4.3e+39)) {
    		tmp = ((t + y) / (t + (x + y))) * a;
    	} else {
    		tmp = (a + z) - b;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8) :: tmp
        if ((t <= (-2.7d+134)) .or. (.not. (t <= 4.3d+39))) then
            tmp = ((t + y) / (t + (x + y))) * a
        else
            tmp = (a + z) - b
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((t <= -2.7e+134) || !(t <= 4.3e+39)) {
    		tmp = ((t + y) / (t + (x + y))) * a;
    	} else {
    		tmp = (a + z) - b;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	tmp = 0
    	if (t <= -2.7e+134) or not (t <= 4.3e+39):
    		tmp = ((t + y) / (t + (x + y))) * a
    	else:
    		tmp = (a + z) - b
    	return tmp
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((t <= -2.7e+134) || !(t <= 4.3e+39))
    		tmp = Float64(Float64(Float64(t + y) / Float64(t + Float64(x + y))) * a);
    	else
    		tmp = Float64(Float64(a + z) - b);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	tmp = 0.0;
    	if ((t <= -2.7e+134) || ~((t <= 4.3e+39)))
    		tmp = ((t + y) / (t + (x + y))) * a;
    	else
    		tmp = (a + z) - b;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.7e+134], N[Not[LessEqual[t, 4.3e+39]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq -2.7 \cdot 10^{+134} \lor \neg \left(t \leq 4.3 \cdot 10^{+39}\right):\\
    \;\;\;\;\frac{t + y}{t + \left(x + y\right)} \cdot a\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(a + z\right) - b\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -2.7e134 or 4.3e39 < t

      1. Initial program 50.7%

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

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

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

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

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

        \[\leadsto \left(\frac{t}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) \cdot a \]
      7. Step-by-step derivation
        1. div-add-revN/A

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

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

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

          \[\leadsto \frac{t + y}{t + \left(x + y\right)} \cdot a \]
        5. lower-+.f6467.5

          \[\leadsto \frac{t + y}{t + \left(x + y\right)} \cdot a \]
      8. Applied rewrites67.5%

        \[\leadsto \frac{t + y}{t + \left(x + y\right)} \cdot a \]

      if -2.7e134 < t < 4.3e39

      1. Initial program 66.1%

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

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

          \[\leadsto \left(a + z\right) - \color{blue}{b} \]
        2. lower-+.f6464.2

          \[\leadsto \left(a + z\right) - b \]
      5. Applied rewrites64.2%

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification65.3%

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

    Alternative 14: 44.5% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{+55}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+31}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= t -2.15e+55) a (if (<= t 5.2e+31) z a)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (t <= -2.15e+55) {
    		tmp = a;
    	} else if (t <= 5.2e+31) {
    		tmp = z;
    	} else {
    		tmp = a;
    	}
    	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 (t <= (-2.15d+55)) then
            tmp = a
        else if (t <= 5.2d+31) then
            tmp = z
        else
            tmp = a
        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 (t <= -2.15e+55) {
    		tmp = a;
    	} else if (t <= 5.2e+31) {
    		tmp = z;
    	} else {
    		tmp = a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	tmp = 0
    	if t <= -2.15e+55:
    		tmp = a
    	elif t <= 5.2e+31:
    		tmp = z
    	else:
    		tmp = a
    	return tmp
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (t <= -2.15e+55)
    		tmp = a;
    	elseif (t <= 5.2e+31)
    		tmp = z;
    	else
    		tmp = a;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	tmp = 0.0;
    	if (t <= -2.15e+55)
    		tmp = a;
    	elseif (t <= 5.2e+31)
    		tmp = z;
    	else
    		tmp = a;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e+55], a, If[LessEqual[t, 5.2e+31], z, a]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq -2.15 \cdot 10^{+55}:\\
    \;\;\;\;a\\
    
    \mathbf{elif}\;t \leq 5.2 \cdot 10^{+31}:\\
    \;\;\;\;z\\
    
    \mathbf{else}:\\
    \;\;\;\;a\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -2.1499999999999999e55 or 5.2e31 < t

      1. Initial program 52.4%

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

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

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

        if -2.1499999999999999e55 < t < 5.2e31

        1. Initial program 66.7%

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

          \[\leadsto \color{blue}{z} \]
        4. Step-by-step derivation
          1. Applied rewrites47.4%

            \[\leadsto \color{blue}{z} \]
        5. Recombined 2 regimes into one program.
        6. Add Preprocessing

        Alternative 15: 56.2% accurate, 3.5× speedup?

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

          1. Initial program 60.6%

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

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

              \[\leadsto \left(a + z\right) - \color{blue}{b} \]
            2. lower-+.f6460.8

              \[\leadsto \left(a + z\right) - b \]
          5. Applied rewrites60.8%

            \[\leadsto \color{blue}{\left(a + z\right) - b} \]

          if 3.80000000000000002e125 < x

          1. Initial program 64.3%

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

            \[\leadsto \color{blue}{z} \]
          4. Step-by-step derivation
            1. Applied rewrites70.4%

              \[\leadsto \color{blue}{z} \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 16: 51.9% accurate, 4.5× speedup?

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

            1. Initial program 61.2%

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

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

                \[\leadsto \left(a + z\right) - \color{blue}{b} \]
              2. lower-+.f6460.1

                \[\leadsto \left(a + z\right) - b \]
            5. Applied rewrites60.1%

              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
            6. Taylor expanded in b around 0

              \[\leadsto a + \color{blue}{z} \]
            7. Step-by-step derivation
              1. lift-+.f6455.8

                \[\leadsto a + z \]
            8. Applied rewrites55.8%

              \[\leadsto a + \color{blue}{z} \]

            if 1.1200000000000001e211 < x

            1. Initial program 60.6%

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

              \[\leadsto \color{blue}{z} \]
            4. Step-by-step derivation
              1. Applied rewrites71.4%

                \[\leadsto \color{blue}{z} \]
            5. Recombined 2 regimes into one program.
            6. Add Preprocessing

            Alternative 17: 32.2% accurate, 45.0× speedup?

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

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

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

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

              Developer Target 1: 82.1% accurate, 0.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\ t_3 := \frac{t\_2}{t\_1}\\ t_4 := \left(z + a\right) - b\\ \mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\ \;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
              (FPCore (x y z t a b)
               :precision binary64
               (let* ((t_1 (+ (+ x t) y))
                      (t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
                      (t_3 (/ t_2 t_1))
                      (t_4 (- (+ z a) b)))
                 (if (< t_3 -3.5813117084150564e+153)
                   t_4
                   (if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
              double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = (x + t) + y;
              	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
              	double t_3 = t_2 / t_1;
              	double t_4 = (z + a) - b;
              	double tmp;
              	if (t_3 < -3.5813117084150564e+153) {
              		tmp = t_4;
              	} else if (t_3 < 1.2285964308315609e+82) {
              		tmp = 1.0 / (t_1 / t_2);
              	} else {
              		tmp = t_4;
              	}
              	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) :: t_2
                  real(8) :: t_3
                  real(8) :: t_4
                  real(8) :: tmp
                  t_1 = (x + t) + y
                  t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
                  t_3 = t_2 / t_1
                  t_4 = (z + a) - b
                  if (t_3 < (-3.5813117084150564d+153)) then
                      tmp = t_4
                  else if (t_3 < 1.2285964308315609d+82) then
                      tmp = 1.0d0 / (t_1 / t_2)
                  else
                      tmp = t_4
                  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 + t) + y;
              	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
              	double t_3 = t_2 / t_1;
              	double t_4 = (z + a) - b;
              	double tmp;
              	if (t_3 < -3.5813117084150564e+153) {
              		tmp = t_4;
              	} else if (t_3 < 1.2285964308315609e+82) {
              		tmp = 1.0 / (t_1 / t_2);
              	} else {
              		tmp = t_4;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a, b):
              	t_1 = (x + t) + y
              	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
              	t_3 = t_2 / t_1
              	t_4 = (z + a) - b
              	tmp = 0
              	if t_3 < -3.5813117084150564e+153:
              		tmp = t_4
              	elif t_3 < 1.2285964308315609e+82:
              		tmp = 1.0 / (t_1 / t_2)
              	else:
              		tmp = t_4
              	return tmp
              
              function code(x, y, z, t, a, b)
              	t_1 = Float64(Float64(x + t) + y)
              	t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b))
              	t_3 = Float64(t_2 / t_1)
              	t_4 = Float64(Float64(z + a) - b)
              	tmp = 0.0
              	if (t_3 < -3.5813117084150564e+153)
              		tmp = t_4;
              	elseif (t_3 < 1.2285964308315609e+82)
              		tmp = Float64(1.0 / Float64(t_1 / t_2));
              	else
              		tmp = t_4;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a, b)
              	t_1 = (x + t) + y;
              	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
              	t_3 = t_2 / t_1;
              	t_4 = (z + a) - b;
              	tmp = 0.0;
              	if (t_3 < -3.5813117084150564e+153)
              		tmp = t_4;
              	elseif (t_3 < 1.2285964308315609e+82)
              		tmp = 1.0 / (t_1 / t_2);
              	else
              		tmp = t_4;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \left(x + t\right) + y\\
              t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
              t_3 := \frac{t\_2}{t\_1}\\
              t_4 := \left(z + a\right) - b\\
              \mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
              \;\;\;\;t\_4\\
              
              \mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
              \;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_4\\
              
              
              \end{array}
              \end{array}
              

              Reproduce

              ?
              herbie shell --seed 2025051 
              (FPCore (x y z t a b)
                :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
                :precision binary64
              
                :alt
                (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))
              
                (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))