Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B

Percentage Accurate: 74.1% → 95.5%
Time: 5.3s
Alternatives: 18
Speedup: 0.3×

Specification

?
\[\begin{array}{l} \\ \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b):
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b)
	return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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: 74.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b):
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b)
	return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 95.5% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

Alternative 2: 95.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.4% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310 or 9.99999999999999934e-276 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.99999999999999934e-276

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{y \cdot b}{t}}} \]
      4. add-to-fractionN/A

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

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

        \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) \cdot t + y \cdot b} \cdot t} \]
    3. Applied rewrites62.3%

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

Alternative 4: 92.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ t_2 := \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 10^{-275}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+300}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
        (t_2 (/ z (* b (+ 1.0 (/ (* t (+ 1.0 a)) (* b y)))))))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -5e-310)
       t_1
       (if (<= t_1 1e-275) t_2 (if (<= t_1 2e+300) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double t_2 = z / (b * (1.0 + ((t * (1.0 + a)) / (b * y))));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -5e-310) {
		tmp = t_1;
	} else if (t_1 <= 1e-275) {
		tmp = t_2;
	} else if (t_1 <= 2e+300) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double t_2 = z / (b * (1.0 + ((t * (1.0 + a)) / (b * y))));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= -5e-310) {
		tmp = t_1;
	} else if (t_1 <= 1e-275) {
		tmp = t_2;
	} else if (t_1 <= 2e+300) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
	t_2 = z / (b * (1.0 + ((t * (1.0 + a)) / (b * y))))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t_2
	elif t_1 <= -5e-310:
		tmp = t_1
	elif t_1 <= 1e-275:
		tmp = t_2
	elif t_1 <= 2e+300:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
	t_2 = Float64(z / Float64(b * Float64(1.0 + Float64(Float64(t * Float64(1.0 + a)) / Float64(b * y)))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -5e-310)
		tmp = t_1;
	elseif (t_1 <= 1e-275)
		tmp = t_2;
	elseif (t_1 <= 2e+300)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	t_2 = z / (b * (1.0 + ((t * (1.0 + a)) / (b * y))));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t_2;
	elseif (t_1 <= -5e-310)
		tmp = t_1;
	elseif (t_1 <= 1e-275)
		tmp = t_2;
	elseif (t_1 <= 2e+300)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(b * N[(1.0 + N[(N[(t * N[(1.0 + a), $MachinePrecision]), $MachinePrecision] / N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -5e-310], t$95$1, If[LessEqual[t$95$1, 1e-275], t$95$2, If[LessEqual[t$95$1, 2e+300], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 10^{-275}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.99999999999999934e-276 or 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310 or 9.99999999999999934e-276 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

Alternative 5: 90.3% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.8% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{\mathsf{fma}\left(\frac{b}{t}, y, \color{blue}{a - \left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      20. metadata-eval73.9

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

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

Alternative 7: 77.8% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 10^{-275}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.99999999999999934e-276 or 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{1}{\frac{t}{y \cdot b}}}} \]
      4. add-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z}{b \cdot \left(1 + \frac{t \cdot \left(1 + a\right)}{b \cdot y}\right)} \]
      7. lower-*.f6448.5

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310 or 9.99999999999999934e-276 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a + \color{blue}{1}} \]
      3. add-flipN/A

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a - -1} \]
      5. lift--.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a - \color{blue}{-1}} \]
    6. Applied rewrites55.0%

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

Alternative 8: 72.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a - -1}, \frac{y}{t}, t\_2\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \color{blue}{\frac{y \cdot z}{t}}}{1 + a} \]
      4. add-to-fractionN/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot t + y \cdot z}{t}}}{1 + a} \]
      5. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - -1\right)} \]
      13. lift--.f6443.3

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{x \cdot t + y \cdot z}}{t}}{a - -1} \]
      5. add-to-fractionN/A

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{a - -1} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{t} + x}}{a - -1} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z}{t}}{a - -1} + \frac{x}{a - -1}} \]
    8. Applied rewrites56.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999994e-28

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      4. div-flipN/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}}}{1 + a} \]
      5. mult-flip-revN/A

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{1 + a} \]
      7. lower-/.f6454.9

        \[\leadsto \frac{x + \frac{y}{\color{blue}{\frac{t}{z}}}}{1 + a} \]
    6. Applied rewrites54.9%

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

    if 1.99999999999999994e-28 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.00000000000000007e42

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{y \cdot b}{t}}} \]
      4. add-to-fractionN/A

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

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

        \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) \cdot t + y \cdot b} \cdot t} \]
    3. Applied rewrites62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x + \color{blue}{\frac{y \cdot z}{t}}\right) \cdot t}{t + b \cdot y} \]
      11. sum-to-multN/A

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

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

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

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

        \[\leadsto \frac{\left(1 + \frac{y \cdot z}{\color{blue}{x \cdot t}}\right) \cdot \left(x \cdot t\right)}{t + b \cdot y} \]
      16. sum-to-multN/A

        \[\leadsto \frac{\color{blue}{x \cdot t + y \cdot z}}{t + b \cdot y} \]
    8. Applied rewrites50.5%

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

    if 5.00000000000000007e42 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \color{blue}{\frac{y \cdot z}{t}}}{1 + a} \]
      4. add-to-fractionN/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot t + y \cdot z}{t}}}{1 + a} \]
      5. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - -1\right)} \]
      13. lift--.f6443.3

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{x \cdot t + y \cdot z}}{t}}{a - -1} \]
      5. add-to-fractionN/A

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{a - -1} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{t} + x}}{a - -1} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z}{t}}{a - -1} + \frac{x}{a - -1}} \]
    8. Applied rewrites57.4%

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites35.1%

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

Alternative 9: 71.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq -8.6 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-125}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

\mathbf{elif}\;t \leq 17200000000:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a - -1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.7500000000000001e124

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      4. div-flipN/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}}}{1 + a} \]
      5. mult-flip-revN/A

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{1 + a} \]
      7. lower-/.f6454.9

        \[\leadsto \frac{x + \frac{y}{\color{blue}{\frac{t}{z}}}}{1 + a} \]
    6. Applied rewrites54.9%

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

    if -1.7500000000000001e124 < t < -8.6e15 or 2.4000000000000001e-125 < t < 1.72e10

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{y \cdot b}{t}}} \]
      4. add-to-fractionN/A

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

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

        \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) \cdot t + y \cdot b} \cdot t} \]
    3. Applied rewrites62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e15 < t < 2.4000000000000001e-125

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if 1.72e10 < t

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      4. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{z}{t}}}{1 + a} \]
      6. *-commutativeN/A

        \[\leadsto \frac{x + \color{blue}{\frac{z}{t} \cdot y}}{1 + a} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y + x}}{1 + a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{1 + a} \]
      9. lower-fma.f6454.7

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}} \]
      13. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1} \]
      14. lift--.f6454.7

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

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

Alternative 10: 71.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{a - -1}, t\_2\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \color{blue}{\frac{y \cdot z}{t}}}{1 + a} \]
      4. add-to-fractionN/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot t + y \cdot z}{t}}}{1 + a} \]
      5. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - -1\right)} \]
      13. lift--.f6443.3

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{x \cdot t + y \cdot z}}{t}}{a - -1} \]
      5. add-to-fractionN/A

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{a - -1} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{t} + x}}{a - -1} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z}{t}}{a - -1} + \frac{x}{a - -1}} \]
    8. Applied rewrites56.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      5. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{z}{t}}}{1 + a} \]
      7. *-commutativeN/A

        \[\leadsto \frac{x + \color{blue}{\frac{z}{t} \cdot y}}{1 + a} \]
      8. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y + x}}{1 + a} \]
      9. div-addN/A

        \[\leadsto \color{blue}{\frac{\frac{z}{t} \cdot y}{1 + a} + \frac{x}{1 + a}} \]
      10. associate-/l*N/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)} \]
    6. Applied rewrites54.8%

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites35.1%

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

Alternative 11: 70.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{\left(a - -1\right) \cdot t}, \frac{x}{a - -1}\right)\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.999999999999985e-310

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \color{blue}{\frac{y \cdot z}{t}}}{1 + a} \]
      4. add-to-fractionN/A

        \[\leadsto \frac{\color{blue}{\frac{x \cdot t + y \cdot z}{t}}}{1 + a} \]
      5. associate-/l/N/A

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{t \cdot \left(a - -1\right)} \]
      13. lift--.f6443.3

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{x \cdot t + y \cdot z}}{t}}{a - -1} \]
      5. add-to-fractionN/A

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{a - -1} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{t} + x}}{a - -1} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z}{t}}{a - -1} + \frac{x}{a - -1}} \]
    8. Applied rewrites56.1%

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

    if -4.999999999999985e-310 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      4. div-flipN/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}}}{1 + a} \]
      5. mult-flip-revN/A

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{1 + a} \]
      7. lower-/.f6454.9

        \[\leadsto \frac{x + \frac{y}{\color{blue}{\frac{t}{z}}}}{1 + a} \]
    6. Applied rewrites54.9%

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites35.1%

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

Alternative 12: 69.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-71}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-125}:\\ \;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\ \mathbf{elif}\;t \leq 13000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, t, y \cdot z\right)}{\mathsf{fma}\left(b, y, t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -3.1e-71)
   (/ (+ x (/ y (/ t z))) (+ 1.0 a))
   (if (<= t 1.1e-125)
     (/ (+ z (/ (* t x) y)) b)
     (if (<= t 13000000000.0)
       (/ (fma x t (* y z)) (fma b y t))
       (/ (fma y (/ z t) x) (- a -1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -3.1e-71) {
		tmp = (x + (y / (t / z))) / (1.0 + a);
	} else if (t <= 1.1e-125) {
		tmp = (z + ((t * x) / y)) / b;
	} else if (t <= 13000000000.0) {
		tmp = fma(x, t, (y * z)) / fma(b, y, t);
	} else {
		tmp = fma(y, (z / t), x) / (a - -1.0);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -3.1e-71)
		tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(1.0 + a));
	elseif (t <= 1.1e-125)
		tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b);
	elseif (t <= 13000000000.0)
		tmp = Float64(fma(x, t, Float64(y * z)) / fma(b, y, t));
	else
		tmp = Float64(fma(y, Float64(z / t), x) / Float64(a - -1.0));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.1e-71], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e-125], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 13000000000.0], N[(N[(x * t + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(b * y + t), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-71}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-125}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.10000000000000002e-71

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      4. div-flipN/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}}}{1 + a} \]
      5. mult-flip-revN/A

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{1 + a} \]
      7. lower-/.f6454.9

        \[\leadsto \frac{x + \frac{y}{\color{blue}{\frac{t}{z}}}}{1 + a} \]
    6. Applied rewrites54.9%

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

    if -3.10000000000000002e-71 < t < 1.09999999999999997e-125

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if 1.09999999999999997e-125 < t < 1.3e10

    1. Initial program 74.1%

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{y \cdot b}{t}}} \]
      4. add-to-fractionN/A

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

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

        \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) \cdot t + y \cdot b} \cdot t} \]
    3. Applied rewrites62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x + \color{blue}{\frac{y \cdot z}{t}}\right) \cdot t}{t + b \cdot y} \]
      11. sum-to-multN/A

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

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

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

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

        \[\leadsto \frac{\left(1 + \frac{y \cdot z}{\color{blue}{x \cdot t}}\right) \cdot \left(x \cdot t\right)}{t + b \cdot y} \]
      16. sum-to-multN/A

        \[\leadsto \frac{\color{blue}{x \cdot t + y \cdot z}}{t + b \cdot y} \]
    8. Applied rewrites50.5%

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

    if 1.3e10 < t

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      4. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{z}{t}}}{1 + a} \]
      6. *-commutativeN/A

        \[\leadsto \frac{x + \color{blue}{\frac{z}{t} \cdot y}}{1 + a} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y + x}}{1 + a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{1 + a} \]
      9. lower-fma.f6454.7

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}} \]
      13. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1} \]
      14. lift--.f6454.7

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

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

Alternative 13: 69.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-71}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\ \mathbf{elif}\;t \leq 4050000:\\ \;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -3.1e-71)
   (/ (+ x (/ y (/ t z))) (+ 1.0 a))
   (if (<= t 4050000.0)
     (/ (+ z (/ (* t x) y)) b)
     (/ (fma y (/ z t) x) (- a -1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -3.1e-71) {
		tmp = (x + (y / (t / z))) / (1.0 + a);
	} else if (t <= 4050000.0) {
		tmp = (z + ((t * x) / y)) / b;
	} else {
		tmp = fma(y, (z / t), x) / (a - -1.0);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -3.1e-71)
		tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(1.0 + a));
	elseif (t <= 4050000.0)
		tmp = Float64(Float64(z + Float64(Float64(t * x) / y)) / b);
	else
		tmp = Float64(fma(y, Float64(z / t), x) / Float64(a - -1.0));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.1e-71], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4050000.0], N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / N[(a - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-71}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{1 + a}\\

\mathbf{elif}\;t \leq 4050000:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.10000000000000002e-71

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      3. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      4. div-flipN/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}}}{1 + a} \]
      5. mult-flip-revN/A

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{1 + a} \]
      7. lower-/.f6454.9

        \[\leadsto \frac{x + \frac{y}{\color{blue}{\frac{t}{z}}}}{1 + a} \]
    6. Applied rewrites54.9%

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

    if -3.10000000000000002e-71 < t < 4.05e6

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if 4.05e6 < t

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      4. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{z}{t}}}{1 + a} \]
      6. *-commutativeN/A

        \[\leadsto \frac{x + \color{blue}{\frac{z}{t} \cdot y}}{1 + a} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y + x}}{1 + a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{1 + a} \]
      9. lower-fma.f6454.7

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}} \]
      13. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1} \]
      14. lift--.f6454.7

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

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

Alternative 14: 67.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4050000:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.10000000000000002e-71 or 4.05e6 < t

    1. Initial program 74.1%

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\color{blue}{1 + a}} \]
    3. Step-by-step derivation
      1. lower-+.f6455.0

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{1 + \color{blue}{a}} \]
    4. Applied rewrites55.0%

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

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

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

        \[\leadsto \frac{x + \frac{\color{blue}{y \cdot z}}{t}}{1 + a} \]
      4. associate-/l*N/A

        \[\leadsto \frac{x + \color{blue}{y \cdot \frac{z}{t}}}{1 + a} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{x + y \cdot \color{blue}{\frac{z}{t}}}{1 + a} \]
      6. *-commutativeN/A

        \[\leadsto \frac{x + \color{blue}{\frac{z}{t} \cdot y}}{1 + a} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y + x}}{1 + a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{1 + a} \]
      9. lower-fma.f6454.7

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}} \]
      13. metadata-evalN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{a - -1} \]
      14. lift--.f6454.7

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

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

    if -3.10000000000000002e-71 < t < 4.05e6

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 59.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z + \frac{t \cdot x}{y}}{b}\\ \mathbf{if}\;y \leq -4.9 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{a - -1}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ z (/ (* t x) y)) b)))
   (if (<= y -4.9e+54) t_1 (if (<= y 6.3e-46) (/ x (- a -1.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + ((t * x) / y)) / b;
	double tmp;
	if (y <= -4.9e+54) {
		tmp = t_1;
	} else if (y <= 6.3e-46) {
		tmp = x / (a - -1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + ((t * x) / y)) / b
    if (y <= (-4.9d+54)) then
        tmp = t_1
    else if (y <= 6.3d-46) then
        tmp = x / (a - (-1.0d0))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + ((t * x) / y)) / b;
	double tmp;
	if (y <= -4.9e+54) {
		tmp = t_1;
	} else if (y <= 6.3e-46) {
		tmp = x / (a - -1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + ((t * x) / y)) / b
	tmp = 0
	if y <= -4.9e+54:
		tmp = t_1
	elif y <= 6.3e-46:
		tmp = x / (a - -1.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + Float64(Float64(t * x) / y)) / b)
	tmp = 0.0
	if (y <= -4.9e+54)
		tmp = t_1;
	elseif (y <= 6.3e-46)
		tmp = Float64(x / Float64(a - -1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + ((t * x) / y)) / b;
	tmp = 0.0;
	if (y <= -4.9e+54)
		tmp = t_1;
	elseif (y <= 6.3e-46)
		tmp = x / (a - -1.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -4.9e+54], t$95$1, If[LessEqual[y, 6.3e-46], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{if}\;y \leq -4.9 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 6.3 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{a - -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.90000000000000001e54 or 6.30000000000000001e-46 < y

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6441.9

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    6. Applied rewrites41.9%

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

    if -4.90000000000000001e54 < y < 6.30000000000000001e-46

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{x}{\color{blue}{1 + a}} \]
      2. lower-+.f6440.7

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites40.7%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{x}{a + \color{blue}{1}} \]
      3. add-flipN/A

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

        \[\leadsto \frac{x}{a - -1} \]
      5. lift--.f6440.7

        \[\leadsto \frac{x}{a - \color{blue}{-1}} \]
    6. Applied rewrites40.7%

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

Alternative 16: 55.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+105}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 0.00021:\\ \;\;\;\;\frac{x}{a - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -4.1e+105) (/ z b) (if (<= y 0.00021) (/ x (- a -1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -4.1e+105) {
		tmp = z / b;
	} else if (y <= 0.00021) {
		tmp = x / (a - -1.0);
	} else {
		tmp = 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 (y <= (-4.1d+105)) then
        tmp = z / b
    else if (y <= 0.00021d0) then
        tmp = x / (a - (-1.0d0))
    else
        tmp = 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 (y <= -4.1e+105) {
		tmp = z / b;
	} else if (y <= 0.00021) {
		tmp = x / (a - -1.0);
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -4.1e+105:
		tmp = z / b
	elif y <= 0.00021:
		tmp = x / (a - -1.0)
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -4.1e+105)
		tmp = Float64(z / b);
	elseif (y <= 0.00021)
		tmp = Float64(x / Float64(a - -1.0));
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -4.1e+105)
		tmp = z / b;
	elseif (y <= 0.00021)
		tmp = x / (a - -1.0);
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.1e+105], N[(z / b), $MachinePrecision], If[LessEqual[y, 0.00021], N[(x / N[(a - -1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+105}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 0.00021:\\
\;\;\;\;\frac{x}{a - -1}\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1000000000000002e105 or 2.1000000000000001e-4 < y

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites35.1%

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

    if -4.1000000000000002e105 < y < 2.1000000000000001e-4

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{x}{\color{blue}{1 + a}} \]
      2. lower-+.f6440.7

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites40.7%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{x}{a + \color{blue}{1}} \]
      3. add-flipN/A

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

        \[\leadsto \frac{x}{a - -1} \]
      5. lift--.f6440.7

        \[\leadsto \frac{x}{a - \color{blue}{-1}} \]
    6. Applied rewrites40.7%

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

Alternative 17: 41.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+58}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-139}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.25e+58) (/ z b) (if (<= y 4.8e-139) (/ x a) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.25e+58) {
		tmp = z / b;
	} else if (y <= 4.8e-139) {
		tmp = x / a;
	} else {
		tmp = 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 (y <= (-1.25d+58)) then
        tmp = z / b
    else if (y <= 4.8d-139) then
        tmp = x / a
    else
        tmp = 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 (y <= -1.25e+58) {
		tmp = z / b;
	} else if (y <= 4.8e-139) {
		tmp = x / a;
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.25e+58:
		tmp = z / b
	elif y <= 4.8e-139:
		tmp = x / a
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.25e+58)
		tmp = Float64(z / b);
	elseif (y <= 4.8e-139)
		tmp = Float64(x / a);
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -1.25e+58)
		tmp = z / b;
	elseif (y <= 4.8e-139)
		tmp = x / a;
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.25e+58], N[(z / b), $MachinePrecision], If[LessEqual[y, 4.8e-139], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+58}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-139}:\\
\;\;\;\;\frac{x}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.24999999999999996e58 or 4.80000000000000029e-139 < y

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites35.1%

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

    if -1.24999999999999996e58 < y < 4.80000000000000029e-139

    1. Initial program 74.1%

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

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

        \[\leadsto \frac{x}{\color{blue}{1 + a}} \]
      2. lower-+.f6440.7

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites40.7%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]
    5. Taylor expanded in a around inf

      \[\leadsto \frac{x}{\color{blue}{a}} \]
    6. Step-by-step derivation
      1. lower-/.f6424.2

        \[\leadsto \frac{x}{a} \]
    7. Applied rewrites24.2%

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

Alternative 18: 24.2% accurate, 5.8× speedup?

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

\\
\frac{x}{a}
\end{array}
Derivation
  1. Initial program 74.1%

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

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

      \[\leadsto \frac{x}{\color{blue}{1 + a}} \]
    2. lower-+.f6440.7

      \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
  4. Applied rewrites40.7%

    \[\leadsto \color{blue}{\frac{x}{1 + a}} \]
  5. Taylor expanded in a around inf

    \[\leadsto \frac{x}{\color{blue}{a}} \]
  6. Step-by-step derivation
    1. lower-/.f6424.2

      \[\leadsto \frac{x}{a} \]
  7. Applied rewrites24.2%

    \[\leadsto \frac{x}{\color{blue}{a}} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025152 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64
  (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))