Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.3% → 94.6%
Time: 9.7s
Alternatives: 14
Speedup: 0.3×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

Alternative 1: 94.6% accurate, 0.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-292 or 5.0000000000000003e-294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-294

    1. Initial program 4.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(t + \left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + \frac{a \cdot \left(-1 \cdot \left(y \cdot \left(t - x\right)\right) - -1 \cdot \left(a \cdot \left(t - x\right)\right)\right)}{{z}^{2}}\right)\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    8. Applied rewrites99.8%

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

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

Alternative 2: 41.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;x + t\\

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\


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

    1. Initial program 84.0%

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

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

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

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

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

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

        \[\leadsto \left(y - z\right) \cdot \frac{t}{\color{blue}{a - z}} \]
      6. lower--.f6447.3

        \[\leadsto \left(y - z\right) \cdot \frac{t}{a - \color{blue}{z}} \]
    5. Applied rewrites47.3%

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

      \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
    7. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto t \cdot \frac{y}{\color{blue}{a}} \]
      3. lower-/.f6442.6

        \[\leadsto t \cdot \frac{y}{a} \]
    8. Applied rewrites42.6%

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58 or 5.0000000000000002e-219 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e280

    1. Initial program 95.4%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6428.0

        \[\leadsto x + \left(t - \color{blue}{x}\right) \]
    5. Applied rewrites28.0%

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

      \[\leadsto x + t \]
    7. Step-by-step derivation
      1. Applied rewrites51.8%

        \[\leadsto x + t \]

      if -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000002e-219

      1. Initial program 33.0%

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

        \[\leadsto \color{blue}{t} \]
      4. Step-by-step derivation
        1. Applied rewrites36.9%

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

        if 1e280 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

        1. Initial program 80.4%

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

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

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

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
          6. distribute-rgt-out--N/A

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

            \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
          8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
          6. div-subN/A

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

            \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
          8. lower--.f6459.2

            \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
        8. Applied rewrites59.2%

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

          \[\leadsto \frac{x \cdot y}{z} \]
        10. Step-by-step derivation
          1. associate-/l*N/A

            \[\leadsto x \cdot \frac{y}{z} \]
          2. lower-*.f64N/A

            \[\leadsto x \cdot \frac{y}{z} \]
          3. lower-/.f6459.0

            \[\leadsto x \cdot \frac{y}{z} \]
        11. Applied rewrites59.0%

          \[\leadsto x \cdot \frac{y}{\color{blue}{z}} \]
      5. Recombined 4 regimes into one program.
      6. Add Preprocessing

      Alternative 3: 39.9% accurate, 0.2× speedup?

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

        1. Initial program 85.2%

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

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

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

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

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

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

            \[\leadsto \left(y - z\right) \cdot \frac{t}{\color{blue}{a - z}} \]
          6. lower--.f6443.1

            \[\leadsto \left(y - z\right) \cdot \frac{t}{a - \color{blue}{z}} \]
        5. Applied rewrites43.1%

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

          \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
        7. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto t \cdot \frac{y}{\color{blue}{a}} \]
          3. lower-/.f6439.8

            \[\leadsto t \cdot \frac{y}{a} \]
        8. Applied rewrites39.8%

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

        if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58 or 5.0000000000000002e-219 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.99999999999999988e237

        1. Initial program 95.1%

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

          \[\leadsto x + \color{blue}{\left(t - x\right)} \]
        4. Step-by-step derivation
          1. lower--.f6429.2

            \[\leadsto x + \left(t - \color{blue}{x}\right) \]
        5. Applied rewrites29.2%

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

          \[\leadsto x + t \]
        7. Step-by-step derivation
          1. Applied rewrites53.3%

            \[\leadsto x + t \]

          if -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000002e-219

          1. Initial program 33.0%

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

            \[\leadsto \color{blue}{t} \]
          4. Step-by-step derivation
            1. Applied rewrites36.9%

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

          Alternative 4: 94.4% accurate, 0.3× speedup?

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

            1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

            if -1.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e-294

            1. Initial program 4.1%

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

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

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

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

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

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

                \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
              6. distribute-rgt-out--N/A

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

                \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
              8. distribute-lft-neg-inN/A

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

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

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

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

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

          Alternative 5: 36.2% accurate, 0.4× speedup?

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

            1. Initial program 92.1%

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

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            4. Step-by-step derivation
              1. lower--.f6422.1

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            5. Applied rewrites22.1%

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

              \[\leadsto x + t \]
            7. Step-by-step derivation
              1. Applied rewrites40.7%

                \[\leadsto x + t \]

              if -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000002e-219

              1. Initial program 33.0%

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

                \[\leadsto \color{blue}{t} \]
              4. Step-by-step derivation
                1. Applied rewrites36.9%

                  \[\leadsto \color{blue}{t} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification39.7%

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

              Alternative 6: 71.5% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{-51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (let* ((t_1 (fma x (/ (- y a) z) t)))
                 (if (<= z -3.6e-51)
                   t_1
                   (if (<= z 4.5e+16)
                     (fma (- t x) (/ (- y z) a) x)
                     (if (<= z 2.9e+197) (fma (/ (- x t) z) y t) t_1)))))
              double code(double x, double y, double z, double t, double a) {
              	double t_1 = fma(x, ((y - a) / z), t);
              	double tmp;
              	if (z <= -3.6e-51) {
              		tmp = t_1;
              	} else if (z <= 4.5e+16) {
              		tmp = fma((t - x), ((y - z) / a), x);
              	} else if (z <= 2.9e+197) {
              		tmp = fma(((x - t) / z), y, t);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	t_1 = fma(x, Float64(Float64(y - a) / z), t)
              	tmp = 0.0
              	if (z <= -3.6e-51)
              		tmp = t_1;
              	elseif (z <= 4.5e+16)
              		tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x);
              	elseif (z <= 2.9e+197)
              		tmp = fma(Float64(Float64(x - t) / z), y, t);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3.6e-51], t$95$1, If[LessEqual[z, 4.5e+16], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.9e+197], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
              \mathbf{if}\;z \leq -3.6 \cdot 10^{-51}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \leq 4.5 \cdot 10^{+16}:\\
              \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
              
              \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -3.6e-51 or 2.90000000000000002e197 < z

                1. Initial program 62.4%

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

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

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

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

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

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

                    \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                  6. distribute-rgt-out--N/A

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

                    \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                  8. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  if -3.6e-51 < z < 4.5e16

                  1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 4.5e16 < z < 2.90000000000000002e197

                    1. Initial program 78.5%

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

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

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

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

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

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

                        \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                      6. distribute-rgt-out--N/A

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

                        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                      8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                      6. div-subN/A

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

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

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

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

                  Alternative 7: 70.5% accurate, 0.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{-51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t a)
                   :precision binary64
                   (let* ((t_1 (fma x (/ (- y a) z) t)))
                     (if (<= z -3.2e-51)
                       t_1
                       (if (<= z 4.5e+16)
                         (fma (- y z) (/ (- t x) a) x)
                         (if (<= z 2.9e+197) (fma (/ (- x t) z) y t) t_1)))))
                  double code(double x, double y, double z, double t, double a) {
                  	double t_1 = fma(x, ((y - a) / z), t);
                  	double tmp;
                  	if (z <= -3.2e-51) {
                  		tmp = t_1;
                  	} else if (z <= 4.5e+16) {
                  		tmp = fma((y - z), ((t - x) / a), x);
                  	} else if (z <= 2.9e+197) {
                  		tmp = fma(((x - t) / z), y, t);
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a)
                  	t_1 = fma(x, Float64(Float64(y - a) / z), t)
                  	tmp = 0.0
                  	if (z <= -3.2e-51)
                  		tmp = t_1;
                  	elseif (z <= 4.5e+16)
                  		tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x);
                  	elseif (z <= 2.9e+197)
                  		tmp = fma(Float64(Float64(x - t) / z), y, t);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3.2e-51], t$95$1, If[LessEqual[z, 4.5e+16], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.9e+197], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
                  \mathbf{if}\;z \leq -3.2 \cdot 10^{-51}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;z \leq 4.5 \cdot 10^{+16}:\\
                  \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
                  
                  \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if z < -3.2e-51 or 2.90000000000000002e197 < z

                    1. Initial program 62.4%

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

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

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

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

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

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

                        \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                      6. distribute-rgt-out--N/A

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

                        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                      8. distribute-lft-neg-inN/A

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

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

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

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

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

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

                      if -3.2e-51 < z < 4.5e16

                      1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

                      if 4.5e16 < z < 2.90000000000000002e197

                      1. Initial program 78.5%

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

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

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

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

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

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

                          \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                        6. distribute-rgt-out--N/A

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

                          \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                        8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                        6. div-subN/A

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

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

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

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

                    Alternative 8: 69.0% accurate, 0.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{-51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+15}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (x y z t a)
                     :precision binary64
                     (let* ((t_1 (fma x (/ (- y a) z) t)))
                       (if (<= z -3.2e-51)
                         t_1
                         (if (<= z 1.7e+15)
                           (fma (/ (- t x) a) y x)
                           (if (<= z 2.9e+197) (fma (/ (- x t) z) y t) t_1)))))
                    double code(double x, double y, double z, double t, double a) {
                    	double t_1 = fma(x, ((y - a) / z), t);
                    	double tmp;
                    	if (z <= -3.2e-51) {
                    		tmp = t_1;
                    	} else if (z <= 1.7e+15) {
                    		tmp = fma(((t - x) / a), y, x);
                    	} else if (z <= 2.9e+197) {
                    		tmp = fma(((x - t) / z), y, t);
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a)
                    	t_1 = fma(x, Float64(Float64(y - a) / z), t)
                    	tmp = 0.0
                    	if (z <= -3.2e-51)
                    		tmp = t_1;
                    	elseif (z <= 1.7e+15)
                    		tmp = fma(Float64(Float64(t - x) / a), y, x);
                    	elseif (z <= 2.9e+197)
                    		tmp = fma(Float64(Float64(x - t) / z), y, t);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3.2e-51], t$95$1, If[LessEqual[z, 1.7e+15], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 2.9e+197], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
                    \mathbf{if}\;z \leq -3.2 \cdot 10^{-51}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;z \leq 1.7 \cdot 10^{+15}:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
                    
                    \mathbf{elif}\;z \leq 2.9 \cdot 10^{+197}:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if z < -3.2e-51 or 2.90000000000000002e197 < z

                      1. Initial program 62.4%

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

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

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

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

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

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

                          \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                        6. distribute-rgt-out--N/A

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

                          \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                        8. distribute-lft-neg-inN/A

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

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

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

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

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

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

                        if -3.2e-51 < z < 1.7e15

                        1. Initial program 91.9%

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{t - x}{a}, y, x\right) \]
                          6. lower--.f6478.1

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

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

                        if 1.7e15 < z < 2.90000000000000002e197

                        1. Initial program 78.5%

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

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

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

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

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

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

                            \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                          6. distribute-rgt-out--N/A

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

                            \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                          8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                          6. div-subN/A

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

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

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

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

                      Alternative 9: 75.7% accurate, 0.8× speedup?

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

                        1. Initial program 67.1%

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

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

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

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

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

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

                            \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                          6. distribute-rgt-out--N/A

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

                            \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                          8. distribute-lft-neg-inN/A

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

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

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

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

                        if -3.2e-51 < z < 4e14

                        1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 10: 61.9% accurate, 0.9× speedup?

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

                          1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(t - x, \frac{\mathsf{neg}\left(z\right)}{a}, x\right) \]
                              2. lower-neg.f6460.4

                                \[\leadsto \mathsf{fma}\left(t - x, \frac{-z}{a}, x\right) \]
                            4. Applied rewrites60.4%

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

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

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

                              if -1.1999999999999999e98 < a < 1.79999999999999995e164

                              1. Initial program 72.2%

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

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

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

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

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

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

                                  \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                                6. distribute-rgt-out--N/A

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

                                  \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                                8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                                6. div-subN/A

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

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
                                8. lower--.f6463.0

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
                              8. Applied rewrites63.0%

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

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

                            Alternative 11: 54.3% accurate, 0.9× speedup?

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

                              1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(t - x, \frac{\mathsf{neg}\left(z\right)}{a}, x\right) \]
                                  2. lower-neg.f6454.6

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{t}, \frac{-z}{a}, x\right) \]
                                6. Step-by-step derivation
                                  1. Applied rewrites54.4%

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

                                  if -8.6e7 < a < 1.79999999999999995e164

                                  1. Initial program 71.1%

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

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

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

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

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

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

                                      \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                                    6. distribute-rgt-out--N/A

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

                                      \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                                    8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                                    6. div-subN/A

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

                                      \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
                                    8. lower--.f6466.5

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{x}{z}, y, t\right) \]
                                  11. Recombined 2 regimes into one program.
                                  12. Final simplification57.5%

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

                                  Alternative 12: 51.5% accurate, 1.0× speedup?

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

                                    1. Initial program 88.8%

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

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

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

                                      if -8.6e7 < a < 2.20000000000000006e164

                                      1. Initial program 71.1%

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

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

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

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

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

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

                                          \[\leadsto \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) + t \]
                                        6. distribute-rgt-out--N/A

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

                                          \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right) \cdot \frac{y - a}{z}\right)\right) + t \]
                                        8. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                                        6. div-subN/A

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

                                          \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, y, t\right) \]
                                        8. lower--.f6466.5

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{x}{z}, y, t\right) \]
                                      11. Recombined 2 regimes into one program.
                                      12. Final simplification54.5%

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

                                      Alternative 13: 38.7% accurate, 2.2× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -29:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a)
                                       :precision binary64
                                       (if (<= z -29.0) t (if (<= z 9e+23) x t)))
                                      double code(double x, double y, double z, double t, double a) {
                                      	double tmp;
                                      	if (z <= -29.0) {
                                      		tmp = t;
                                      	} else if (z <= 9e+23) {
                                      		tmp = x;
                                      	} else {
                                      		tmp = t;
                                      	}
                                      	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)
                                      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) :: tmp
                                          if (z <= (-29.0d0)) then
                                              tmp = t
                                          else if (z <= 9d+23) then
                                              tmp = x
                                          else
                                              tmp = t
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double x, double y, double z, double t, double a) {
                                      	double tmp;
                                      	if (z <= -29.0) {
                                      		tmp = t;
                                      	} else if (z <= 9e+23) {
                                      		tmp = x;
                                      	} else {
                                      		tmp = t;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(x, y, z, t, a):
                                      	tmp = 0
                                      	if z <= -29.0:
                                      		tmp = t
                                      	elif z <= 9e+23:
                                      		tmp = x
                                      	else:
                                      		tmp = t
                                      	return tmp
                                      
                                      function code(x, y, z, t, a)
                                      	tmp = 0.0
                                      	if (z <= -29.0)
                                      		tmp = t;
                                      	elseif (z <= 9e+23)
                                      		tmp = x;
                                      	else
                                      		tmp = t;
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(x, y, z, t, a)
                                      	tmp = 0.0;
                                      	if (z <= -29.0)
                                      		tmp = t;
                                      	elseif (z <= 9e+23)
                                      		tmp = x;
                                      	else
                                      		tmp = t;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -29.0], t, If[LessEqual[z, 9e+23], x, t]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;z \leq -29:\\
                                      \;\;\;\;t\\
                                      
                                      \mathbf{elif}\;z \leq 9 \cdot 10^{+23}:\\
                                      \;\;\;\;x\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if z < -29 or 8.99999999999999958e23 < z

                                        1. Initial program 65.1%

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

                                          \[\leadsto \color{blue}{t} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites44.7%

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

                                          if -29 < z < 8.99999999999999958e23

                                          1. Initial program 91.3%

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

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

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

                                          Alternative 14: 24.9% accurate, 29.0× speedup?

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

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

                                            \[\leadsto \color{blue}{t} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites26.9%

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

                                            Reproduce

                                            ?
                                            herbie shell --seed 2025026 
                                            (FPCore (x y z t a)
                                              :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
                                              :precision binary64
                                              (+ x (* (- y z) (/ (- t x) (- a z)))))