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

Percentage Accurate: 75.7% → 93.4%
Time: 5.8s
Alternatives: 17
Speedup: 0.3×

Specification

?
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
(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]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 75.7% accurate, 1.0× speedup?

\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
(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]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}

Alternative 1: 93.4% accurate, 0.1× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+159}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -9.9999999999999998e-46 or 9.9999999999999993e158 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

    if -9.9999999999999998e-46 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302

    1. Initial program 75.7%

      \[\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-/.f6474.4%

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

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

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

    1. Initial program 75.7%

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

    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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 2: 91.9% accurate, 0.2× speedup?

\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\ t_3 := \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-302}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, t\_3\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\ \mathbf{elif}\;t\_1 \leq 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t\_2}, t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \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 (fma a t (fma b y t)))
       (t_3 (/ x (fma (/ y t) b (- a -1.0)))))
  (if (<= t_1 -5e-302)
    (fma (/ z t_2) y t_3)
    (if (<= t_1 0.0)
      (/ (fma x (/ t y) z) b)
      (if (<= t_1 1e+159)
        t_1
        (if (<= t_1 INFINITY) (fma z (/ y t_2) t_3) (/ 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 = fma(a, t, fma(b, y, t));
	double t_3 = x / fma((y / t), b, (a - -1.0));
	double tmp;
	if (t_1 <= -5e-302) {
		tmp = fma((z / t_2), y, t_3);
	} else if (t_1 <= 0.0) {
		tmp = fma(x, (t / y), z) / b;
	} else if (t_1 <= 1e+159) {
		tmp = t_1;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fma(z, (y / t_2), t_3);
	} 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 = fma(a, t, fma(b, y, t))
	t_3 = Float64(x / fma(Float64(y / t), b, Float64(a - -1.0)))
	tmp = 0.0
	if (t_1 <= -5e-302)
		tmp = fma(Float64(z / t_2), y, t_3);
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(x, Float64(t / y), z) / b);
	elseif (t_1 <= 1e+159)
		tmp = t_1;
	elseif (t_1 <= Inf)
		tmp = fma(z, Float64(y / t_2), t_3);
	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[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-302], N[(N[(z / t$95$2), $MachinePrecision] * y + t$95$3), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+159], t$95$1, If[LessEqual[t$95$1, Infinity], N[(z * N[(y / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
t_3 := \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, t\_3\right)\\

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

\mathbf{elif}\;t\_1 \leq 10^{+159}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 75.7%

      \[\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. div-addN/A

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

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

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

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

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

    1. Initial program 75.7%

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

    if 9.9999999999999993e158 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\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)))

    1. Initial program 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 3: 91.0% accurate, 0.2× speedup?

\[\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 -\infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-302}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+278}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{1}{b}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\right)\\ \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 (- INFINITY))
    (fma (/ z (fma a t (fma b y t))) y (/ x a))
    (if (<= t_1 -5e-302)
      t_1
      (if (<= t_1 0.0)
        (/ (fma x (/ t y) z) b)
        (if (<= t_1 4e+278)
          t_1
          (fma z (/ 1.0 b) (/ x (fma (/ y t) b (- a -1.0))))))))))
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 <= -((double) INFINITY)) {
		tmp = fma((z / fma(a, t, fma(b, y, t))), y, (x / a));
	} else if (t_1 <= -5e-302) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = fma(x, (t / y), z) / b;
	} else if (t_1 <= 4e+278) {
		tmp = t_1;
	} else {
		tmp = fma(z, (1.0 / b), (x / fma((y / t), b, (a - -1.0))));
	}
	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 <= Float64(-Inf))
		tmp = fma(Float64(z / fma(a, t, fma(b, y, t))), y, Float64(x / a));
	elseif (t_1 <= -5e-302)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(x, Float64(t / y), z) / b);
	elseif (t_1 <= 4e+278)
		tmp = t_1;
	else
		tmp = fma(z, Float64(1.0 / b), Float64(x / fma(Float64(y / t), b, Float64(a - -1.0))));
	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, (-Infinity)], N[(N[(z / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-302], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(t / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 4e+278], t$95$1, N[(z * N[(1.0 / b), $MachinePrecision] + N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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 -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, y, \frac{x}{a}\right)\\

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

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

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\

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


\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 75.7%

      \[\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. div-addN/A

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

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

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

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

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

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

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

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

    1. Initial program 75.7%

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

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

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{b}}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\right) \]
    4. Step-by-step derivation
      1. lower-/.f6459.0%

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

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

Alternative 4: 88.7% accurate, 0.2× speedup?

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

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

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

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

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


\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 75.7%

      \[\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. div-addN/A

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302 or 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 75.7%

      \[\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-/.f6474.4%

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

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

    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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 5: 88.3% accurate, 0.2× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{1}{b}, \frac{x}{t\_1}\right)\\


\end{array}
Derivation
  1. Split input into 5 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 75.7%

      \[\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. div-addN/A

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

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

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

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

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

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

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

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

    1. Initial program 75.7%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, \color{blue}{a - \left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      22. metadata-eval77.3%

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

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

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

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{b}}, \frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\right) \]
    4. Step-by-step derivation
      1. lower-/.f6459.0%

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

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

Alternative 6: 87.0% accurate, 0.2× speedup?

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

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

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

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

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


\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 75.7%

      \[\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. div-addN/A

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.0000000000000003e-302 or 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 75.7%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, \color{blue}{a - \left(\mathsf{neg}\left(1\right)\right)}\right)} \]
      22. metadata-eval77.3%

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

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

    if -5.0000000000000003e-302 < (/.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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

    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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 7: 77.6% accurate, 0.2× speedup?

\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, \frac{x}{a}\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+213}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{t\_2}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \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 (fma a t (fma b y t))))
  (if (<= t_1 (- INFINITY))
    (fma (/ z t_2) y (/ x a))
    (if (<= t_1 4e+213)
      (/ (fma t x (* z y)) t_2)
      (if (<= t_1 INFINITY)
        (fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 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 t_2 = fma(a, t, fma(b, y, t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = fma((z / t_2), y, (x / a));
	} else if (t_1 <= 4e+213) {
		tmp = fma(t, x, (z * y)) / t_2;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fma((z / t), (y / (1.0 + a)), (x / (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)))
	t_2 = fma(a, t, fma(b, y, t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = fma(Float64(z / t_2), y, Float64(x / a));
	elseif (t_1 <= 4e+213)
		tmp = Float64(fma(t, x, Float64(z * y)) / t_2);
	elseif (t_1 <= Inf)
		tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / 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]}, Block[{t$95$2 = N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z / t$95$2), $MachinePrecision] * y + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t\_2}, y, \frac{x}{a}\right)\\

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

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

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


\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 75.7%

      \[\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. div-addN/A

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

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

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

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

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

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

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

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

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e213 < (/.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 75.7%

      \[\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. div-addN/A

        \[\leadsto \color{blue}{\frac{x}{\left(a + 1\right) + \frac{y \cdot b}{t}} + \frac{\frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}} \]
      4. +-commutativeN/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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\right) \]
    8. Step-by-step derivation
      1. lower-+.f6456.0%

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 8: 77.5% accurate, 0.2× speedup?

\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t\_2}, \frac{x}{a}\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+213}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{t\_2}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \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 (fma a t (fma b y t))))
  (if (<= t_1 (- INFINITY))
    (fma z (/ y t_2) (/ x a))
    (if (<= t_1 4e+213)
      (/ (fma t x (* z y)) t_2)
      (if (<= t_1 INFINITY)
        (fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 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 t_2 = fma(a, t, fma(b, y, t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = fma(z, (y / t_2), (x / a));
	} else if (t_1 <= 4e+213) {
		tmp = fma(t, x, (z * y)) / t_2;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fma((z / t), (y / (1.0 + a)), (x / (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)))
	t_2 = fma(a, t, fma(b, y, t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = fma(z, Float64(y / t_2), Float64(x / a));
	elseif (t_1 <= 4e+213)
		tmp = Float64(fma(t, x, Float64(z * y)) / t_2);
	elseif (t_1 <= Inf)
		tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / 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]}, Block[{t$95$2 = N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / t$95$2), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{t\_2}, \frac{x}{a}\right)\\

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

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

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


\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 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \mathsf{fma}\left(z, \frac{y}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}, \color{blue}{\frac{x}{a}}\right) \]
    4. Step-by-step derivation
      1. lower-/.f6447.8%

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

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

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

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e213 < (/.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 75.7%

      \[\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. div-addN/A

        \[\leadsto \color{blue}{\frac{x}{\left(a + 1\right) + \frac{y \cdot b}{t}} + \frac{\frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}} \]
      4. +-commutativeN/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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\right) \]
    8. Step-by-step derivation
      1. lower-+.f6456.0%

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 9: 77.0% accurate, 0.3× speedup?

\[\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 4 \cdot 10^{+213}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{1 + a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \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 4e+213)
    (/ (fma t x (* z y)) (fma a t (fma b y t)))
    (if (<= t_1 INFINITY)
      (fma (/ z t) (/ y (+ 1.0 a)) (/ x (+ 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 <= 4e+213) {
		tmp = fma(t, x, (z * y)) / fma(a, t, fma(b, y, t));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fma((z / t), (y / (1.0 + a)), (x / (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 <= 4e+213)
		tmp = Float64(fma(t, x, Float64(z * y)) / fma(a, t, fma(b, y, t)));
	elseif (t_1 <= Inf)
		tmp = fma(Float64(z / t), Float64(y / Float64(1.0 + a)), Float64(x / 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, 4e+213], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / t), $MachinePrecision] * N[(y / N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\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 4 \cdot 10^{+213}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\

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

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


\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))) < 3.9999999999999999e213

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e213 < (/.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 75.7%

      \[\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. div-addN/A

        \[\leadsto \color{blue}{\frac{x}{\left(a + 1\right) + \frac{y \cdot b}{t}} + \frac{\frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}} \]
      4. +-commutativeN/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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\right) \]
    8. Step-by-step derivation
      1. lower-+.f6456.0%

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \frac{y}{1 + a}, \frac{x}{\color{blue}{1 + a}}\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 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

Alternative 10: 68.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{y \cdot z}{t + \mathsf{fma}\left(a, t, b \cdot y\right)}\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1e-8

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

    if -1e-8 < y < 2.2000000000000001e-74

    1. Initial program 75.7%

      \[\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-+.f6456.4%

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

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

    if 2.2000000000000001e-74 < y < 1.2e49

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

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

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

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

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

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

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

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

    if 1.2e49 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
      8. lower-/.f6440.7%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
    7. Applied rewrites40.7%

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

Alternative 11: 67.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+45}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1e-8

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

    if -1e-8 < y < 5.3999999999999997e45

    1. Initial program 75.7%

      \[\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-+.f6456.4%

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

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

    if 5.3999999999999997e45 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
      8. lower-/.f6440.7%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
    7. Applied rewrites40.7%

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

Alternative 12: 63.6% accurate, 1.1× speedup?

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

\mathbf{elif}\;y \leq 4 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1e-8

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

    if -1e-8 < y < 3.9999999999999998e-74

    1. Initial program 75.7%

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

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

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

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

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

        \[\leadsto \frac{x}{1 + \left(a + \frac{b \cdot y}{\color{blue}{t}}\right)} \]
      5. lower-*.f6451.6%

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

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

    if 3.9999999999999998e-74 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
      8. lower-/.f6440.7%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
    7. Applied rewrites40.7%

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

Alternative 13: 58.1% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := \frac{z + \frac{t \cdot x}{y}}{b}\\ \mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{1 + a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (/ (+ z (/ (* t x) y)) b)))
  (if (<= y -7.4e-110) t_1 (if (<= y 4.1e-116) (/ x (+ 1.0 a)) 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 <= -7.4e-110) {
		tmp = t_1;
	} else if (y <= 4.1e-116) {
		tmp = x / (1.0 + a);
	} 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 <= (-7.4d-110)) then
        tmp = t_1
    else if (y <= 4.1d-116) then
        tmp = x / (1.0d0 + a)
    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 <= -7.4e-110) {
		tmp = t_1;
	} else if (y <= 4.1e-116) {
		tmp = x / (1.0 + a);
	} 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 <= -7.4e-110:
		tmp = t_1
	elif y <= 4.1e-116:
		tmp = x / (1.0 + a)
	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 <= -7.4e-110)
		tmp = t_1;
	elseif (y <= 4.1e-116)
		tmp = Float64(x / Float64(1.0 + a));
	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 <= -7.4e-110)
		tmp = t_1;
	elseif (y <= 4.1e-116)
		tmp = x / (1.0 + a);
	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, -7.4e-110], t$95$1, If[LessEqual[y, 4.1e-116], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z + \frac{t \cdot x}{y}}{b}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

    if -7.4000000000000003e-110 < y < 4.0999999999999999e-116

    1. Initial program 75.7%

      \[\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-+.f6441.6%

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites41.6%

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

Alternative 14: 58.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
      8. lower-/.f6440.7%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{y}, t, z\right)}{b} \]
    7. Applied rewrites40.7%

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

    if -7.4000000000000003e-110 < y < 4.0999999999999999e-116

    1. Initial program 75.7%

      \[\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-+.f6441.6%

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites41.6%

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

Alternative 15: 56.7% accurate, 1.2× speedup?

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

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4000000000000003e-110 or 4.0999999999999999e-116 < y

    1. Initial program 75.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Applied rewrites88.0%

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

      \[\leadsto \color{blue}{\frac{z + \frac{t \cdot x}{y}}{b}} \]
    4. 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-*.f6440.5%

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
    5. Applied rewrites40.5%

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \frac{\frac{t \cdot x}{y} + z}{b} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{x \cdot t}{y} + z}{b} \]
      6. associate-/l*N/A

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

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
      8. lower-/.f6441.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, \frac{t}{y}, z\right)}{b} \]
    7. Applied rewrites41.9%

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

    if -7.4000000000000003e-110 < y < 4.0999999999999999e-116

    1. Initial program 75.7%

      \[\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-+.f6441.6%

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites41.6%

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

Alternative 16: 52.6% accurate, 1.7× speedup?

\[\begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-110}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{1 + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (if (<= y -4.5e-110)
  (/ z b)
  (if (<= y 1.62e-74) (/ x (+ 1.0 a)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -4.5e-110) {
		tmp = z / b;
	} else if (y <= 1.62e-74) {
		tmp = x / (1.0 + 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 <= (-4.5d-110)) then
        tmp = z / b
    else if (y <= 1.62d-74) then
        tmp = x / (1.0d0 + 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 <= -4.5e-110) {
		tmp = z / b;
	} else if (y <= 1.62e-74) {
		tmp = x / (1.0 + a);
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -4.5e-110:
		tmp = z / b
	elif y <= 1.62e-74:
		tmp = x / (1.0 + a)
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -4.5e-110)
		tmp = Float64(z / b);
	elseif (y <= 1.62e-74)
		tmp = Float64(x / Float64(1.0 + 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 <= -4.5e-110)
		tmp = z / b;
	elseif (y <= 1.62e-74)
		tmp = x / (1.0 + a);
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.5e-110], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.62e-74], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 1.62 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5000000000000001e-110 or 1.6200000000000001e-74 < y

    1. Initial program 75.7%

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

        \[\leadsto \frac{z}{\color{blue}{b}} \]
    4. Applied rewrites34.0%

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

    if -4.5000000000000001e-110 < y < 1.6200000000000001e-74

    1. Initial program 75.7%

      \[\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-+.f6441.6%

        \[\leadsto \frac{x}{1 + \color{blue}{a}} \]
    4. Applied rewrites41.6%

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

Alternative 17: 34.0% accurate, 5.5× speedup?

\[\frac{z}{b} \]
(FPCore (x y z t a b)
  :precision binary64
  (/ z b))
double code(double x, double y, double z, double t, double a, double b) {
	return z / b;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = z / b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return z / b;
}
def code(x, y, z, t, a, b):
	return z / b
function code(x, y, z, t, a, b)
	return Float64(z / b)
end
function tmp = code(x, y, z, t, a, b)
	tmp = z / b;
end
code[x_, y_, z_, t_, a_, b_] := N[(z / b), $MachinePrecision]
\frac{z}{b}
Derivation
  1. Initial program 75.7%

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

      \[\leadsto \frac{z}{\color{blue}{b}} \]
  4. Applied rewrites34.0%

    \[\leadsto \color{blue}{\frac{z}{b}} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025212 
(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))))