Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 81.0% → 89.6%
Time: 6.6s
Alternatives: 15
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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 81.0% 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: 89.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-226}:\\
\;\;\;\;t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;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)))) < -5.00000000000000012e-233 or 4.9999999999999998e-226 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000012e-233 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-226

    1. Initial program 15.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. lift--.f6473.9

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites73.9%

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

Alternative 2: 89.6% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;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)))) < -5.00000000000000012e-233 or 4.9999999999999998e-226 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000012e-233 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-226

    1. Initial program 15.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. 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}} \]
    3. 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. associate-*r/N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 87.8% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;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)))) < -5.00000000000000012e-233 or 4.9999999999999998e-226 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000012e-233 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-226

    1. Initial program 15.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. lift--.f6473.9

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites73.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t}{z} - \frac{x}{z}, a, t\right) \]
      6. sub-divN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{z}, a, t\right) \]
      8. lift--.f6461.4

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

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

Alternative 4: 75.2% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+116}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a - z}\\

\mathbf{else}:\\
\;\;\;\;t - t\_1 \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.7e172

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. lift--.f6464.9

        \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites64.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t}{z} - \frac{x}{z}, a, t\right) \]
      6. sub-divN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{z}, a, t\right) \]
      8. lift--.f6467.1

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

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

    if -5.7e172 < z < -1.9999999999999999e-60

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.9999999999999999e-60 < z < 7.5e116

      1. Initial program 90.4%

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

        \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
      3. Step-by-step derivation
        1. Applied rewrites80.8%

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

        if 7.5e116 < z

        1. Initial program 62.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
          10. lift--.f6463.1

            \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
        6. Applied rewrites63.1%

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

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

            \[\leadsto t - y \cdot \frac{t - x}{\color{blue}{z}} \]
          2. sub-divN/A

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

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

            \[\leadsto t - \left(\frac{t}{z} - \frac{x}{z}\right) \cdot y \]
          5. sub-divN/A

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

            \[\leadsto t - \frac{t - x}{z} \cdot y \]
          7. lift--.f6473.8

            \[\leadsto t - \frac{t - x}{z} \cdot y \]
        9. Applied rewrites73.8%

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

      Alternative 5: 75.0% accurate, 0.8× speedup?

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

        1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -6.5e19 < a < 7.4999999999999999e-99

          1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
            10. lift--.f6474.5

              \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
          6. Applied rewrites74.5%

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

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

              \[\leadsto t - y \cdot \frac{t - x}{\color{blue}{z}} \]
            2. sub-divN/A

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

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

              \[\leadsto t - \left(\frac{t}{z} - \frac{x}{z}\right) \cdot y \]
            5. sub-divN/A

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

              \[\leadsto t - \frac{t - x}{z} \cdot y \]
            7. lift--.f6475.1

              \[\leadsto t - \frac{t - x}{z} \cdot y \]
          9. Applied rewrites75.1%

            \[\leadsto t - \frac{t - x}{z} \cdot \color{blue}{y} \]
        6. Recombined 2 regimes into one program.
        7. Add Preprocessing

        Alternative 6: 73.8% accurate, 0.8× speedup?

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

          1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

          if -9.99999999999999954e36 < a < 2.1999999999999999e27

          1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
            10. lift--.f6469.7

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

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

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

              \[\leadsto t - y \cdot \frac{t - x}{\color{blue}{z}} \]
            2. sub-divN/A

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

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

              \[\leadsto t - \left(\frac{t}{z} - \frac{x}{z}\right) \cdot y \]
            5. sub-divN/A

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

              \[\leadsto t - \frac{t - x}{z} \cdot y \]
            7. lift--.f6470.2

              \[\leadsto t - \frac{t - x}{z} \cdot y \]
          9. Applied rewrites70.2%

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

        Alternative 7: 38.5% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+172}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-232}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-254}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+116}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -1.85e+172)
           t
           (if (<= z -1.8e-232)
             (+ x t)
             (if (<= z 5.5e-254) (/ (* t y) a) (if (<= z 7.5e+116) x t)))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -1.85e+172) {
        		tmp = t;
        	} else if (z <= -1.8e-232) {
        		tmp = x + t;
        	} else if (z <= 5.5e-254) {
        		tmp = (t * y) / a;
        	} else if (z <= 7.5e+116) {
        		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 <= (-1.85d+172)) then
                tmp = t
            else if (z <= (-1.8d-232)) then
                tmp = x + t
            else if (z <= 5.5d-254) then
                tmp = (t * y) / a
            else if (z <= 7.5d+116) 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 <= -1.85e+172) {
        		tmp = t;
        	} else if (z <= -1.8e-232) {
        		tmp = x + t;
        	} else if (z <= 5.5e-254) {
        		tmp = (t * y) / a;
        	} else if (z <= 7.5e+116) {
        		tmp = x;
        	} else {
        		tmp = t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	tmp = 0
        	if z <= -1.85e+172:
        		tmp = t
        	elif z <= -1.8e-232:
        		tmp = x + t
        	elif z <= 5.5e-254:
        		tmp = (t * y) / a
        	elif z <= 7.5e+116:
        		tmp = x
        	else:
        		tmp = t
        	return tmp
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -1.85e+172)
        		tmp = t;
        	elseif (z <= -1.8e-232)
        		tmp = Float64(x + t);
        	elseif (z <= 5.5e-254)
        		tmp = Float64(Float64(t * y) / a);
        	elseif (z <= 7.5e+116)
        		tmp = x;
        	else
        		tmp = t;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	tmp = 0.0;
        	if (z <= -1.85e+172)
        		tmp = t;
        	elseif (z <= -1.8e-232)
        		tmp = x + t;
        	elseif (z <= 5.5e-254)
        		tmp = (t * y) / a;
        	elseif (z <= 7.5e+116)
        		tmp = x;
        	else
        		tmp = t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+172], t, If[LessEqual[z, -1.8e-232], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-254], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 7.5e+116], x, t]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -1.85 \cdot 10^{+172}:\\
        \;\;\;\;t\\
        
        \mathbf{elif}\;z \leq -1.8 \cdot 10^{-232}:\\
        \;\;\;\;x + t\\
        
        \mathbf{elif}\;z \leq 5.5 \cdot 10^{-254}:\\
        \;\;\;\;\frac{t \cdot y}{a}\\
        
        \mathbf{elif}\;z \leq 7.5 \cdot 10^{+116}:\\
        \;\;\;\;x\\
        
        \mathbf{else}:\\
        \;\;\;\;t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if z < -1.84999999999999986e172 or 7.5e116 < z

          1. Initial program 60.5%

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

            \[\leadsto \color{blue}{t} \]
          3. Step-by-step derivation
            1. Applied rewrites56.6%

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

            if -1.84999999999999986e172 < z < -1.80000000000000008e-232

            1. Initial program 86.6%

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

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lift--.f6414.3

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites14.3%

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

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

                \[\leadsto x + t \]

              if -1.80000000000000008e-232 < z < 5.4999999999999999e-254

              1. Initial program 92.8%

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

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

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

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

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

                  \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
                5. lift--.f6437.4

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

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

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

                  \[\leadsto \frac{t \cdot y}{a} \]
                2. lower-*.f6435.2

                  \[\leadsto \frac{t \cdot y}{a} \]
              7. Applied rewrites35.2%

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

              if 5.4999999999999999e-254 < z < 7.5e116

              1. Initial program 88.9%

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

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

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

              Alternative 8: 69.8% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+27}:\\ \;\;\;\;t - \frac{t - x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (if (<= a -1.2e+37)
                 (fma (- t x) (/ y a) x)
                 (if (<= a 2.2e+27) (- t (* (/ (- t x) z) y)) (fma y (/ (- t x) a) x))))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (a <= -1.2e+37) {
              		tmp = fma((t - x), (y / a), x);
              	} else if (a <= 2.2e+27) {
              		tmp = t - (((t - x) / z) * y);
              	} else {
              		tmp = fma(y, ((t - x) / a), x);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (a <= -1.2e+37)
              		tmp = fma(Float64(t - x), Float64(y / a), x);
              	elseif (a <= 2.2e+27)
              		tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * y));
              	else
              		tmp = fma(y, Float64(Float64(t - x) / a), x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.2e+37], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.2e+27], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;a \leq -1.2 \cdot 10^{+37}:\\
              \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
              
              \mathbf{elif}\;a \leq 2.2 \cdot 10^{+27}:\\
              \;\;\;\;t - \frac{t - x}{z} \cdot y\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if a < -1.2e37

                1. Initial program 89.0%

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

                  \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                3. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.2e37 < a < 2.1999999999999999e27

                1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                  10. lift--.f6469.7

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

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

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

                    \[\leadsto t - y \cdot \frac{t - x}{\color{blue}{z}} \]
                  2. sub-divN/A

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

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

                    \[\leadsto t - \left(\frac{t}{z} - \frac{x}{z}\right) \cdot y \]
                  5. sub-divN/A

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

                    \[\leadsto t - \frac{t - x}{z} \cdot y \]
                  7. lift--.f6470.2

                    \[\leadsto t - \frac{t - x}{z} \cdot y \]
                9. Applied rewrites70.2%

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

                if 2.1999999999999999e27 < a

                1. Initial program 88.1%

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

                  \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                3. 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. lower-fma.f64N/A

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

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

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

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

              Alternative 9: 66.2% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-44}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (if (<= z -4.2e+131)
                 (fma (/ (- t x) z) a t)
                 (if (<= z 7.5e-44) (fma (- t x) (/ y a) x) (* t (/ (- y z) (- a z))))))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (z <= -4.2e+131) {
              		tmp = fma(((t - x) / z), a, t);
              	} else if (z <= 7.5e-44) {
              		tmp = fma((t - x), (y / a), x);
              	} else {
              		tmp = t * ((y - z) / (a - z));
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (z <= -4.2e+131)
              		tmp = fma(Float64(Float64(t - x) / z), a, t);
              	elseif (z <= 7.5e-44)
              		tmp = fma(Float64(t - x), Float64(y / a), x);
              	else
              		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+131], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * a + t), $MachinePrecision], If[LessEqual[z, 7.5e-44], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -4.2 \cdot 10^{+131}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a, t\right)\\
              
              \mathbf{elif}\;z \leq 7.5 \cdot 10^{-44}:\\
              \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t \cdot \frac{y - z}{a - z}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -4.19999999999999971e131

                1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                  10. lift--.f6463.1

                    \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                6. Applied rewrites63.1%

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{t}{z} - \frac{x}{z}, a, t\right) \]
                  6. sub-divN/A

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

                    \[\leadsto \mathsf{fma}\left(\frac{t - x}{z}, a, t\right) \]
                  8. lift--.f6462.5

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

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

                if -4.19999999999999971e131 < z < 7.50000000000000008e-44

                1. Initial program 90.2%

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

                  \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                3. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 7.50000000000000008e-44 < z

                1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto t \cdot \frac{y - z}{\color{blue}{a} - z} \]
                  5. lift--.f6461.2

                    \[\leadsto t \cdot \frac{y - z}{a - \color{blue}{z}} \]
                6. Applied rewrites61.2%

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

              Alternative 10: 64.3% accurate, 0.9× speedup?

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

                1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                  10. lift--.f6463.1

                    \[\leadsto t - 1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                6. Applied rewrites63.1%

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{t}{z} - \frac{x}{z}, a, t\right) \]
                  6. sub-divN/A

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

                    \[\leadsto \mathsf{fma}\left(\frac{t - x}{z}, a, t\right) \]
                  8. lift--.f6463.2

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

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

                if -4.19999999999999971e131 < z < 3.99999999999999987e118

                1. Initial program 89.2%

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

                  \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                3. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 11: 61.2% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.75 \cdot 10^{+171}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (if (<= z -3.75e+171) t (if (<= z 4.2e+118) (fma (- t x) (/ y a) x) t)))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (z <= -3.75e+171) {
              		tmp = t;
              	} else if (z <= 4.2e+118) {
              		tmp = fma((t - x), (y / a), x);
              	} else {
              		tmp = t;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (z <= -3.75e+171)
              		tmp = t;
              	elseif (z <= 4.2e+118)
              		tmp = fma(Float64(t - x), Float64(y / a), x);
              	else
              		tmp = t;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.75e+171], t, If[LessEqual[z, 4.2e+118], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -3.75 \cdot 10^{+171}:\\
              \;\;\;\;t\\
              
              \mathbf{elif}\;z \leq 4.2 \cdot 10^{+118}:\\
              \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -3.7499999999999999e171 or 4.2e118 < z

                1. Initial program 60.3%

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

                  \[\leadsto \color{blue}{t} \]
                3. Step-by-step derivation
                  1. Applied rewrites56.6%

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

                  if -3.7499999999999999e171 < z < 4.2e118

                  1. Initial program 88.5%

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

                    \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                  3. 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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 59.9% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.75 \cdot 10^{+171}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                (FPCore (x y z t a)
                 :precision binary64
                 (if (<= z -3.75e+171) t (if (<= z 4e+118) (fma y (/ (- t x) a) x) t)))
                double code(double x, double y, double z, double t, double a) {
                	double tmp;
                	if (z <= -3.75e+171) {
                		tmp = t;
                	} else if (z <= 4e+118) {
                		tmp = fma(y, ((t - x) / a), x);
                	} else {
                		tmp = t;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a)
                	tmp = 0.0
                	if (z <= -3.75e+171)
                		tmp = t;
                	elseif (z <= 4e+118)
                		tmp = fma(y, Float64(Float64(t - x) / a), x);
                	else
                		tmp = t;
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.75e+171], t, If[LessEqual[z, 4e+118], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -3.75 \cdot 10^{+171}:\\
                \;\;\;\;t\\
                
                \mathbf{elif}\;z \leq 4 \cdot 10^{+118}:\\
                \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -3.7499999999999999e171 or 3.99999999999999987e118 < z

                  1. Initial program 60.3%

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

                    \[\leadsto \color{blue}{t} \]
                  3. Step-by-step derivation
                    1. Applied rewrites56.6%

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

                    if -3.7499999999999999e171 < z < 3.99999999999999987e118

                    1. Initial program 88.5%

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

                      \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                    3. 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. lower-fma.f64N/A

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

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

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

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

                  Alternative 13: 52.4% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+171}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+116}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                  (FPCore (x y z t a)
                   :precision binary64
                   (if (<= z -4.8e+171) t (if (<= z 7.5e+116) (fma y (/ t a) x) t)))
                  double code(double x, double y, double z, double t, double a) {
                  	double tmp;
                  	if (z <= -4.8e+171) {
                  		tmp = t;
                  	} else if (z <= 7.5e+116) {
                  		tmp = fma(y, (t / a), x);
                  	} else {
                  		tmp = t;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a)
                  	tmp = 0.0
                  	if (z <= -4.8e+171)
                  		tmp = t;
                  	elseif (z <= 7.5e+116)
                  		tmp = fma(y, Float64(t / a), x);
                  	else
                  		tmp = t;
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+171], t, If[LessEqual[z, 7.5e+116], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -4.8 \cdot 10^{+171}:\\
                  \;\;\;\;t\\
                  
                  \mathbf{elif}\;z \leq 7.5 \cdot 10^{+116}:\\
                  \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -4.79999999999999995e171 or 7.5e116 < z

                    1. Initial program 60.5%

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

                      \[\leadsto \color{blue}{t} \]
                    3. Step-by-step derivation
                      1. Applied rewrites56.6%

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

                      if -4.79999999999999995e171 < z < 7.5e116

                      1. Initial program 88.4%

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

                        \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                      3. 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. lower-fma.f64N/A

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(y, \frac{t}{a}, x\right) \]
                      7. Recombined 2 regimes into one program.
                      8. Add Preprocessing

                      Alternative 14: 38.2% accurate, 2.2× speedup?

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

                        1. Initial program 61.0%

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

                          \[\leadsto \color{blue}{t} \]
                        3. Step-by-step derivation
                          1. Applied rewrites56.5%

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

                          if -3.50000000000000026e160 < z < 7.5e116

                          1. Initial program 88.7%

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

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

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

                          Alternative 15: 25.2% 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 81.0%

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

                            \[\leadsto \color{blue}{t} \]
                          3. Step-by-step derivation
                            1. Applied rewrites25.2%

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

                            Reproduce

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