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

Percentage Accurate: 74.7% → 90.0%
Time: 5.5s
Alternatives: 15
Speedup: 0.9×

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 15 alternatives:

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

Initial Program: 74.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: 90.0% accurate, 0.4× speedup?

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

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


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

    1. Initial program 74.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 rewrites85.5%

      \[\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 +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 74.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 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 88.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}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-316}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\mathsf{fma}\left(t, x, z \cdot y\right) \cdot \frac{1}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(b, y, t\right)\right)}\\ \mathbf{elif}\;t\_1 \leq 10^{+298}:\\ \;\;\;\;t\_1\\ \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 -5e-316)
    (/ (fma (/ y t) z x) (fma (/ y t) b (- a -1.0)))
    (if (<= t_1 0.0)
      (* (fma t x (* z y)) (/ 1.0 (fma a t (fma b y t))))
      (if (<= t_1 1e+298) t_1 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double tmp;
	if (t_1 <= -5e-316) {
		tmp = fma((y / t), z, x) / fma((y / t), b, (a - -1.0));
	} else if (t_1 <= 0.0) {
		tmp = fma(t, x, (z * y)) * (1.0 / fma(a, t, fma(b, y, t)));
	} else if (t_1 <= 1e+298) {
		tmp = t_1;
	} else {
		tmp = z / b;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
	tmp = 0.0
	if (t_1 <= -5e-316)
		tmp = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, Float64(a - -1.0)));
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(t, x, Float64(z * y)) * Float64(1.0 / fma(a, t, fma(b, y, t))));
	elseif (t_1 <= 1e+298)
		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[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-316], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * t + N[(b * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], t$95$1, 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 -5 \cdot 10^{-316}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)}\\

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

\mathbf{elif}\;t\_1 \leq 10^{+298}:\\
\;\;\;\;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))) < -5.0000000171117013e-316

    1. Initial program 74.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-/.f6474.9%

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

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

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

      \[\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.0000000171117013e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0

    1. Initial program 74.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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 74.7%

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

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

    1. Initial program 74.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 3: 88.2% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := \mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{+61}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-24}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, x, z \cdot y\right)}{\mathsf{fma}\left(y, b, t + a \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{t\_1}\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (fma (/ y t) b (- a -1.0))))
  (if (<= t -2.3e+61)
    (/ (fma (/ z t) y x) t_1)
    (if (<= t 3e-24)
      (/ (fma t x (* z y)) (fma y b (+ t (* a t))))
      (/ (fma (/ y t) z 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 tmp;
	if (t <= -2.3e+61) {
		tmp = fma((z / t), y, x) / t_1;
	} else if (t <= 3e-24) {
		tmp = fma(t, x, (z * y)) / fma(y, b, (t + (a * t)));
	} else {
		tmp = fma((y / t), z, x) / t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(Float64(y / t), b, Float64(a - -1.0))
	tmp = 0.0
	if (t <= -2.3e+61)
		tmp = Float64(fma(Float64(z / t), y, x) / t_1);
	elseif (t <= 3e-24)
		tmp = Float64(fma(t, x, Float64(z * y)) / fma(y, b, Float64(t + Float64(a * t))));
	else
		tmp = Float64(fma(Float64(y / t), z, 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]}, If[LessEqual[t, -2.3e+61], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 3e-24], N[(N[(t * x + N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(y * b + N[(t + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, b, a - -1\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+61}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{t\_1}\\

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3e61

    1. Initial program 74.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-/.f6474.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3e61 < t < 3e-24

    1. Initial program 74.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 rewrites71.1%

      \[\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)}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    if 3e-24 < t

    1. Initial program 74.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-/.f6474.9%

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

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

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

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

Alternative 4: 85.4% accurate, 0.5× speedup?

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

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


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

    1. Initial program 74.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-/.f6474.9%

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

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

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

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

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

    1. Initial program 74.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 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 82.3% accurate, 0.8× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.0000000000000006e69

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e69 < t < 3.3999999999999999e124

    1. Initial program 74.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 rewrites71.1%

      \[\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)}} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    if 3.3999999999999999e124 < t

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\frac{y}{t}} + x}{1 + a} \]
      12. lower-fma.f6458.0%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1} \]
      17. lift--.f6458.0%

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

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

Alternative 6: 82.3% accurate, 0.9× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.0000000000000006e69

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e69 < t < 3.3999999999999999e124

    1. Initial program 74.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 rewrites71.1%

      \[\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.3999999999999999e124 < t

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\frac{y}{t}} + x}{1 + a} \]
      12. lower-fma.f6458.0%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1} \]
      17. lift--.f6458.0%

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

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

Alternative 7: 68.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3999999999999999e-138

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e-138 < t < 1.6e25

    1. Initial program 74.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 rewrites85.5%

      \[\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 b around inf

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6440.5%

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

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

    if 1.6e25 < t

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\frac{y}{t}} + x}{1 + a} \]
      12. lower-fma.f6458.0%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1} \]
      17. lift--.f6458.0%

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

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

Alternative 8: 68.3% accurate, 1.1× speedup?

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.8e-138

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{z}{t} \cdot y} + x}{1 + a} \]
      8. lift-fma.f6456.0%

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

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

    if -2.8e-138 < t < 1.6e25

    1. Initial program 74.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 rewrites85.5%

      \[\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 b around inf

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6440.5%

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

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

    if 1.6e25 < t

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\frac{y}{t}} + x}{1 + a} \]
      12. lower-fma.f6458.0%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1} \]
      17. lift--.f6458.0%

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

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

Alternative 9: 68.3% accurate, 1.1× speedup?

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.3999999999999999e-138 or 1.6e25 < t

    1. Initial program 74.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \color{blue}{\frac{y}{t}} + x}{1 + a} \]
      12. lower-fma.f6458.0%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a - -1} \]
      17. lift--.f6458.0%

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

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

    if -2.3999999999999999e-138 < t < 1.6e25

    1. Initial program 74.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 rewrites85.5%

      \[\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 b around inf

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6440.5%

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

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

Alternative 10: 56.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;a + 1 \leq 5 \cdot 10^{+33}:\\
\;\;\;\;\frac{z + \frac{t \cdot x}{y}}{b}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 a #s(literal 1 binary64)) < -2e15 or 4.9999999999999997e33 < (+.f64 a #s(literal 1 binary64))

    1. Initial program 74.7%

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

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
      4. lower-*.f6433.6%

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
    4. Applied rewrites33.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \frac{y}{t} + x}{a} \]
      8. lower-fma.f6434.6%

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a} \]
    6. Applied rewrites34.6%

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

    if -2e15 < (+.f64 a #s(literal 1 binary64)) < 4.9999999999999997e33

    1. Initial program 74.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 rewrites85.5%

      \[\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 b around inf

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

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

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

        \[\leadsto \frac{z + \frac{t \cdot x}{y}}{b} \]
      4. lower-*.f6440.5%

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

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

Alternative 11: 56.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.5e119 or 8.5000000000000004e72 < y

    1. Initial program 74.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 -8.5e119 < y < -3.5999999999999998e-23

    1. Initial program 74.7%

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

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
      4. lower-*.f6433.6%

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
    4. Applied rewrites33.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{\frac{y}{t}}{\color{blue}{a}}, \frac{x}{a}\right) \]
      13. lower-/.f6434.7%

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

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

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

    if -3.5999999999999998e-23 < y < 8.5000000000000004e72

    1. Initial program 74.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 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 55.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.5e119 or 8.5000000000000004e72 < y

    1. Initial program 74.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 -8.5e119 < y < -3.5999999999999998e-23

    1. Initial program 74.7%

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

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
      4. lower-*.f6433.6%

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
    4. Applied rewrites33.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \frac{y}{t} + x}{a} \]
      8. lower-fma.f6434.6%

        \[\leadsto \frac{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}{a} \]
    6. Applied rewrites34.6%

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

    if -3.5999999999999998e-23 < y < 8.5000000000000004e72

    1. Initial program 74.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 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 54.9% accurate, 0.4× 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:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t\_1 \leq 10^{+298}:\\ \;\;\;\;\frac{x}{1 + a}\\ \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 (- INFINITY))
    (/ z b)
    (if (<= t_1 1e+298) (/ 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 <= -((double) INFINITY)) {
		tmp = z / b;
	} else if (t_1 <= 1e+298) {
		tmp = x / (1.0 + a);
	} else {
		tmp = z / b;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = z / b;
	} else if (t_1 <= 1e+298) {
		tmp = x / (1.0 + a);
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = z / b
	elif t_1 <= 1e+298:
		tmp = 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 <= Float64(-Inf))
		tmp = Float64(z / b);
	elseif (t_1 <= 1e+298)
		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)
	t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = z / b;
	elseif (t_1 <= 1e+298)
		tmp = x / (1.0 + a);
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], N[(x / N[(1.0 + a), $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 -\infty:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;t\_1 \leq 10^{+298}:\\
\;\;\;\;\frac{x}{1 + a}\\

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


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

    1. Initial program 74.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 -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 9.9999999999999996e297

    1. Initial program 74.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: 42.7% accurate, 2.1× speedup?

\[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{+66}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (if (<= a -2e+15) (/ x a) (if (<= a 7.8e+66) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -2e+15) {
		tmp = x / a;
	} else if (a <= 7.8e+66) {
		tmp = z / b;
	} else {
		tmp = x / a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-2d+15)) then
        tmp = x / a
    else if (a <= 7.8d+66) then
        tmp = z / b
    else
        tmp = x / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -2e+15) {
		tmp = x / a;
	} else if (a <= 7.8e+66) {
		tmp = z / b;
	} else {
		tmp = x / a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -2e+15:
		tmp = x / a
	elif a <= 7.8e+66:
		tmp = z / b
	else:
		tmp = x / a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -2e+15)
		tmp = Float64(x / a);
	elseif (a <= 7.8e+66)
		tmp = Float64(z / b);
	else
		tmp = Float64(x / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -2e+15)
		tmp = x / a;
	elseif (a <= 7.8e+66)
		tmp = z / b;
	else
		tmp = x / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e+15], N[(x / a), $MachinePrecision], If[LessEqual[a, 7.8e+66], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{a}\\

\mathbf{elif}\;a \leq 7.8 \cdot 10^{+66}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2e15 or 7.8000000000000007e66 < a

    1. Initial program 74.7%

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

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

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

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

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
      4. lower-*.f6433.6%

        \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
    4. Applied rewrites33.6%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{a}} \]
    5. Taylor expanded in x around inf

      \[\leadsto \frac{x}{\color{blue}{a}} \]
    6. Step-by-step derivation
      1. lower-/.f6425.3%

        \[\leadsto \frac{x}{a} \]
    7. Applied rewrites25.3%

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

    if -2e15 < a < 7.8000000000000007e66

    1. Initial program 74.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 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 25.3% accurate, 5.5× speedup?

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

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

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

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

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

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

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

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
    4. lower-*.f6433.6%

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{a} \]
  4. Applied rewrites33.6%

    \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{a}} \]
  5. Taylor expanded in x around inf

    \[\leadsto \frac{x}{\color{blue}{a}} \]
  6. Step-by-step derivation
    1. lower-/.f6425.3%

      \[\leadsto \frac{x}{a} \]
  7. Applied rewrites25.3%

    \[\leadsto \frac{x}{\color{blue}{a}} \]
  8. Add Preprocessing

Reproduce

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