Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 81.1% → 92.3%
Time: 11.9s
Alternatives: 18
Speedup: 0.3×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 81.1% 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: 92.3% accurate, 0.2× speedup?

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

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

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

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

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


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

    1. Initial program 96.2%

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

        \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. 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--.f6496.3

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

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

    if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 3.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999997e-37

    1. Initial program 64.7%

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

        \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. 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--.f6464.7

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{a - z}, \left(\frac{y}{z} - 1\right) \cdot z, x\right) \]
      4. lower-/.f6458.6

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

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

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

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

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

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

    if 4.9999999999999997e-37 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.2%

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

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

Alternative 2: 46.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(t - x\right)}{a}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+305}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-63}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_2 \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+279}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- t x)) a)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_2 -5e+305)
     t_1
     (if (<= t_2 -2000000.0)
       (+ x t)
       (if (<= t_2 -2e-63)
         (/ (* (- y z) t) a)
         (if (<= t_2 -2e-306)
           x
           (if (<= t_2 1e-167) t (if (<= t_2 2e+279) (+ x t) t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (t - x)) / a;
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -5e+305) {
		tmp = t_1;
	} else if (t_2 <= -2000000.0) {
		tmp = x + t;
	} else if (t_2 <= -2e-63) {
		tmp = ((y - z) * t) / a;
	} else if (t_2 <= -2e-306) {
		tmp = x;
	} else if (t_2 <= 1e-167) {
		tmp = t;
	} else if (t_2 <= 2e+279) {
		tmp = x + t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y * (t - x)) / a
    t_2 = x + ((y - z) * ((t - x) / (a - z)))
    if (t_2 <= (-5d+305)) then
        tmp = t_1
    else if (t_2 <= (-2000000.0d0)) then
        tmp = x + t
    else if (t_2 <= (-2d-63)) then
        tmp = ((y - z) * t) / a
    else if (t_2 <= (-2d-306)) then
        tmp = x
    else if (t_2 <= 1d-167) then
        tmp = t
    else if (t_2 <= 2d+279) then
        tmp = x + t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (t - x)) / a;
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -5e+305) {
		tmp = t_1;
	} else if (t_2 <= -2000000.0) {
		tmp = x + t;
	} else if (t_2 <= -2e-63) {
		tmp = ((y - z) * t) / a;
	} else if (t_2 <= -2e-306) {
		tmp = x;
	} else if (t_2 <= 1e-167) {
		tmp = t;
	} else if (t_2 <= 2e+279) {
		tmp = x + t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (t - x)) / a
	t_2 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_2 <= -5e+305:
		tmp = t_1
	elif t_2 <= -2000000.0:
		tmp = x + t
	elif t_2 <= -2e-63:
		tmp = ((y - z) * t) / a
	elif t_2 <= -2e-306:
		tmp = x
	elif t_2 <= 1e-167:
		tmp = t
	elif t_2 <= 2e+279:
		tmp = x + t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(t - x)) / a)
	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_2 <= -5e+305)
		tmp = t_1;
	elseif (t_2 <= -2000000.0)
		tmp = Float64(x + t);
	elseif (t_2 <= -2e-63)
		tmp = Float64(Float64(Float64(y - z) * t) / a);
	elseif (t_2 <= -2e-306)
		tmp = x;
	elseif (t_2 <= 1e-167)
		tmp = t;
	elseif (t_2 <= 2e+279)
		tmp = Float64(x + t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (t - x)) / a;
	t_2 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_2 <= -5e+305)
		tmp = t_1;
	elseif (t_2 <= -2000000.0)
		tmp = x + t;
	elseif (t_2 <= -2e-63)
		tmp = ((y - z) * t) / a;
	elseif (t_2 <= -2e-306)
		tmp = x;
	elseif (t_2 <= 1e-167)
		tmp = t;
	elseif (t_2 <= 2e+279)
		tmp = x + t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+305], t$95$1, If[LessEqual[t$95$2, -2000000.0], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -2e-63], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, -2e-306], x, If[LessEqual[t$95$2, 1e-167], t, If[LessEqual[t$95$2, 2e+279], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -2000000:\\
\;\;\;\;x + t\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-63}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+279}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.00000000000000009e305 or 2.00000000000000012e279 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.4%

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

        \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. 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--.f6491.4

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{a - z}, \left(\frac{y}{z} - 1\right) \cdot z, x\right) \]
      4. lower-/.f6489.6

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000009e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e6 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.00000000000000012e279

    1. Initial program 97.5%

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

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

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

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

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

        \[\leadsto x + t \]

      if -2e6 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000013e-63

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
      4. Step-by-step derivation
        1. 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--.f6468.8

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

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

        \[\leadsto \frac{\left(y - z\right) \cdot t}{a} \]
      7. Step-by-step derivation
        1. Applied rewrites55.6%

          \[\leadsto \frac{\left(y - z\right) \cdot t}{a} \]

        if -2.00000000000000013e-63 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

        1. Initial program 84.3%

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

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

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

          if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

          1. Initial program 5.5%

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

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

              \[\leadsto \color{blue}{t} \]
          5. Recombined 5 regimes into one program.
          6. Final simplification53.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-63}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 2 \cdot 10^{+279}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(t - x\right)}{a}\\ \end{array} \]
          7. Add Preprocessing

          Alternative 3: 45.1% accurate, 0.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;t\_1 \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-63}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_1 \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
             (if (<= t_1 -5e+305)
               (/ (* y t) (- a z))
               (if (<= t_1 -2000000.0)
                 (+ x t)
                 (if (<= t_1 -2e-63)
                   (/ (* (- y z) t) a)
                   (if (<= t_1 -2e-306)
                     x
                     (if (<= t_1 1e-167)
                       t
                       (if (<= t_1 1e+294) (+ x t) (* t (/ y (- a z)))))))))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
          	double tmp;
          	if (t_1 <= -5e+305) {
          		tmp = (y * t) / (a - z);
          	} else if (t_1 <= -2000000.0) {
          		tmp = x + t;
          	} else if (t_1 <= -2e-63) {
          		tmp = ((y - z) * t) / a;
          	} else if (t_1 <= -2e-306) {
          		tmp = x;
          	} else if (t_1 <= 1e-167) {
          		tmp = t;
          	} else if (t_1 <= 1e+294) {
          		tmp = x + t;
          	} else {
          		tmp = t * (y / (a - z));
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8), intent (in) :: a
              real(8) :: t_1
              real(8) :: tmp
              t_1 = x + ((y - z) * ((t - x) / (a - z)))
              if (t_1 <= (-5d+305)) then
                  tmp = (y * t) / (a - z)
              else if (t_1 <= (-2000000.0d0)) then
                  tmp = x + t
              else if (t_1 <= (-2d-63)) then
                  tmp = ((y - z) * t) / a
              else if (t_1 <= (-2d-306)) then
                  tmp = x
              else if (t_1 <= 1d-167) then
                  tmp = t
              else if (t_1 <= 1d+294) then
                  tmp = x + t
              else
                  tmp = t * (y / (a - z))
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
          	double tmp;
          	if (t_1 <= -5e+305) {
          		tmp = (y * t) / (a - z);
          	} else if (t_1 <= -2000000.0) {
          		tmp = x + t;
          	} else if (t_1 <= -2e-63) {
          		tmp = ((y - z) * t) / a;
          	} else if (t_1 <= -2e-306) {
          		tmp = x;
          	} else if (t_1 <= 1e-167) {
          		tmp = t;
          	} else if (t_1 <= 1e+294) {
          		tmp = x + t;
          	} else {
          		tmp = t * (y / (a - z));
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = x + ((y - z) * ((t - x) / (a - z)))
          	tmp = 0
          	if t_1 <= -5e+305:
          		tmp = (y * t) / (a - z)
          	elif t_1 <= -2000000.0:
          		tmp = x + t
          	elif t_1 <= -2e-63:
          		tmp = ((y - z) * t) / a
          	elif t_1 <= -2e-306:
          		tmp = x
          	elif t_1 <= 1e-167:
          		tmp = t
          	elif t_1 <= 1e+294:
          		tmp = x + t
          	else:
          		tmp = t * (y / (a - z))
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
          	tmp = 0.0
          	if (t_1 <= -5e+305)
          		tmp = Float64(Float64(y * t) / Float64(a - z));
          	elseif (t_1 <= -2000000.0)
          		tmp = Float64(x + t);
          	elseif (t_1 <= -2e-63)
          		tmp = Float64(Float64(Float64(y - z) * t) / a);
          	elseif (t_1 <= -2e-306)
          		tmp = x;
          	elseif (t_1 <= 1e-167)
          		tmp = t;
          	elseif (t_1 <= 1e+294)
          		tmp = Float64(x + t);
          	else
          		tmp = Float64(t * Float64(y / Float64(a - z)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = x + ((y - z) * ((t - x) / (a - z)));
          	tmp = 0.0;
          	if (t_1 <= -5e+305)
          		tmp = (y * t) / (a - z);
          	elseif (t_1 <= -2000000.0)
          		tmp = x + t;
          	elseif (t_1 <= -2e-63)
          		tmp = ((y - z) * t) / a;
          	elseif (t_1 <= -2e-306)
          		tmp = x;
          	elseif (t_1 <= 1e-167)
          		tmp = t;
          	elseif (t_1 <= 1e+294)
          		tmp = x + t;
          	else
          		tmp = t * (y / (a - z));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+305], N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000000.0], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, -2e-63], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, -2e-306], x, If[LessEqual[t$95$1, 1e-167], t, If[LessEqual[t$95$1, 1e+294], N[(x + t), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
          \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+305}:\\
          \;\;\;\;\frac{y \cdot t}{a - z}\\
          
          \mathbf{elif}\;t\_1 \leq -2000000:\\
          \;\;\;\;x + t\\
          
          \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-63}:\\
          \;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\
          
          \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-306}:\\
          \;\;\;\;x\\
          
          \mathbf{elif}\;t\_1 \leq 10^{-167}:\\
          \;\;\;\;t\\
          
          \mathbf{elif}\;t\_1 \leq 10^{+294}:\\
          \;\;\;\;x + t\\
          
          \mathbf{else}:\\
          \;\;\;\;t \cdot \frac{y}{a - z}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 6 regimes
          2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.00000000000000009e305

            1. Initial program 95.2%

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

              \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
            4. Step-by-step derivation
              1. 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--.f6448.9

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

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

              \[\leadsto \frac{y \cdot t}{a - z} \]
            7. Step-by-step derivation
              1. Applied rewrites48.6%

                \[\leadsto \frac{y \cdot t}{a - z} \]

              if -5.00000000000000009e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e6 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e294

              1. Initial program 97.6%

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

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

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

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

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

                  \[\leadsto x + t \]

                if -2e6 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000013e-63

                1. Initial program 99.8%

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

                  \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                4. Step-by-step derivation
                  1. 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--.f6468.8

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

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

                  \[\leadsto \frac{\left(y - z\right) \cdot t}{a} \]
                7. Step-by-step derivation
                  1. Applied rewrites55.6%

                    \[\leadsto \frac{\left(y - z\right) \cdot t}{a} \]

                  if -2.00000000000000013e-63 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

                  1. Initial program 84.3%

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

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

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

                    if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                    1. Initial program 5.5%

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

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

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

                      if 1.00000000000000007e294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                      1. Initial program 87.0%

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

                        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                      4. Step-by-step derivation
                        1. 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--.f6456.1

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

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

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

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

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

                          \[\leadsto t \cdot \frac{y}{a - \color{blue}{z}} \]
                        4. lift--.f6459.0

                          \[\leadsto t \cdot \frac{y}{a - z} \]
                      8. Applied rewrites59.0%

                        \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
                    5. Recombined 6 regimes into one program.
                    6. Final simplification51.3%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-63}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 4: 44.9% accurate, 0.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_2 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;t\_1 \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-66}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_1 \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                    (FPCore (x y z t a)
                     :precision binary64
                     (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))) (t_2 (* t (/ y (- a z)))))
                       (if (<= t_1 -5e+305)
                         (/ (* y t) (- a z))
                         (if (<= t_1 -2000000.0)
                           (+ x t)
                           (if (<= t_1 -2e-66)
                             t_2
                             (if (<= t_1 -2e-306)
                               x
                               (if (<= t_1 1e-167) t (if (<= t_1 1e+294) (+ x t) t_2))))))))
                    double code(double x, double y, double z, double t, double a) {
                    	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                    	double t_2 = t * (y / (a - z));
                    	double tmp;
                    	if (t_1 <= -5e+305) {
                    		tmp = (y * t) / (a - z);
                    	} else if (t_1 <= -2000000.0) {
                    		tmp = x + t;
                    	} else if (t_1 <= -2e-66) {
                    		tmp = t_2;
                    	} else if (t_1 <= -2e-306) {
                    		tmp = x;
                    	} else if (t_1 <= 1e-167) {
                    		tmp = t;
                    	} else if (t_1 <= 1e+294) {
                    		tmp = x + t;
                    	} else {
                    		tmp = t_2;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t, a)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8) :: t_1
                        real(8) :: t_2
                        real(8) :: tmp
                        t_1 = x + ((y - z) * ((t - x) / (a - z)))
                        t_2 = t * (y / (a - z))
                        if (t_1 <= (-5d+305)) then
                            tmp = (y * t) / (a - z)
                        else if (t_1 <= (-2000000.0d0)) then
                            tmp = x + t
                        else if (t_1 <= (-2d-66)) then
                            tmp = t_2
                        else if (t_1 <= (-2d-306)) then
                            tmp = x
                        else if (t_1 <= 1d-167) then
                            tmp = t
                        else if (t_1 <= 1d+294) then
                            tmp = x + t
                        else
                            tmp = t_2
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a) {
                    	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                    	double t_2 = t * (y / (a - z));
                    	double tmp;
                    	if (t_1 <= -5e+305) {
                    		tmp = (y * t) / (a - z);
                    	} else if (t_1 <= -2000000.0) {
                    		tmp = x + t;
                    	} else if (t_1 <= -2e-66) {
                    		tmp = t_2;
                    	} else if (t_1 <= -2e-306) {
                    		tmp = x;
                    	} else if (t_1 <= 1e-167) {
                    		tmp = t;
                    	} else if (t_1 <= 1e+294) {
                    		tmp = x + t;
                    	} else {
                    		tmp = t_2;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a):
                    	t_1 = x + ((y - z) * ((t - x) / (a - z)))
                    	t_2 = t * (y / (a - z))
                    	tmp = 0
                    	if t_1 <= -5e+305:
                    		tmp = (y * t) / (a - z)
                    	elif t_1 <= -2000000.0:
                    		tmp = x + t
                    	elif t_1 <= -2e-66:
                    		tmp = t_2
                    	elif t_1 <= -2e-306:
                    		tmp = x
                    	elif t_1 <= 1e-167:
                    		tmp = t
                    	elif t_1 <= 1e+294:
                    		tmp = x + t
                    	else:
                    		tmp = t_2
                    	return tmp
                    
                    function code(x, y, z, t, a)
                    	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                    	t_2 = Float64(t * Float64(y / Float64(a - z)))
                    	tmp = 0.0
                    	if (t_1 <= -5e+305)
                    		tmp = Float64(Float64(y * t) / Float64(a - z));
                    	elseif (t_1 <= -2000000.0)
                    		tmp = Float64(x + t);
                    	elseif (t_1 <= -2e-66)
                    		tmp = t_2;
                    	elseif (t_1 <= -2e-306)
                    		tmp = x;
                    	elseif (t_1 <= 1e-167)
                    		tmp = t;
                    	elseif (t_1 <= 1e+294)
                    		tmp = Float64(x + t);
                    	else
                    		tmp = t_2;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a)
                    	t_1 = x + ((y - z) * ((t - x) / (a - z)));
                    	t_2 = t * (y / (a - z));
                    	tmp = 0.0;
                    	if (t_1 <= -5e+305)
                    		tmp = (y * t) / (a - z);
                    	elseif (t_1 <= -2000000.0)
                    		tmp = x + t;
                    	elseif (t_1 <= -2e-66)
                    		tmp = t_2;
                    	elseif (t_1 <= -2e-306)
                    		tmp = x;
                    	elseif (t_1 <= 1e-167)
                    		tmp = t;
                    	elseif (t_1 <= 1e+294)
                    		tmp = x + t;
                    	else
                    		tmp = t_2;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+305], N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000000.0], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, -2e-66], t$95$2, If[LessEqual[t$95$1, -2e-306], x, If[LessEqual[t$95$1, 1e-167], t, If[LessEqual[t$95$1, 1e+294], N[(x + t), $MachinePrecision], t$95$2]]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                    t_2 := t \cdot \frac{y}{a - z}\\
                    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+305}:\\
                    \;\;\;\;\frac{y \cdot t}{a - z}\\
                    
                    \mathbf{elif}\;t\_1 \leq -2000000:\\
                    \;\;\;\;x + t\\
                    
                    \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-66}:\\
                    \;\;\;\;t\_2\\
                    
                    \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-306}:\\
                    \;\;\;\;x\\
                    
                    \mathbf{elif}\;t\_1 \leq 10^{-167}:\\
                    \;\;\;\;t\\
                    
                    \mathbf{elif}\;t\_1 \leq 10^{+294}:\\
                    \;\;\;\;x + t\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_2\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 5 regimes
                    2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.00000000000000009e305

                      1. Initial program 95.2%

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

                        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                      4. Step-by-step derivation
                        1. 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--.f6448.9

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

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

                        \[\leadsto \frac{y \cdot t}{a - z} \]
                      7. Step-by-step derivation
                        1. Applied rewrites48.6%

                          \[\leadsto \frac{y \cdot t}{a - z} \]

                        if -5.00000000000000009e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e6 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e294

                        1. Initial program 97.6%

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

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

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

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

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

                            \[\leadsto x + t \]

                          if -2e6 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e-66 or 1.00000000000000007e294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                          1. Initial program 92.1%

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

                            \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                          4. 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--.f6461.9

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

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

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

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

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

                              \[\leadsto t \cdot \frac{y}{a - \color{blue}{z}} \]
                            4. lift--.f6452.6

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

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

                          if -2e-66 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

                          1. Initial program 83.4%

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

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

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

                            if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                            1. Initial program 5.5%

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot t}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-66}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 5: 44.6% accurate, 0.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+291}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_2 \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_2 \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (let* ((t_1 (* t (/ y (- a z)))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
                               (if (<= t_2 -5e+291)
                                 t_1
                                 (if (<= t_2 -2000000.0)
                                   (+ x t)
                                   (if (<= t_2 -2e-66)
                                     t_1
                                     (if (<= t_2 -2e-306)
                                       x
                                       (if (<= t_2 1e-167) t (if (<= t_2 1e+294) (+ x t) t_1))))))))
                            double code(double x, double y, double z, double t, double a) {
                            	double t_1 = t * (y / (a - z));
                            	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                            	double tmp;
                            	if (t_2 <= -5e+291) {
                            		tmp = t_1;
                            	} else if (t_2 <= -2000000.0) {
                            		tmp = x + t;
                            	} else if (t_2 <= -2e-66) {
                            		tmp = t_1;
                            	} else if (t_2 <= -2e-306) {
                            		tmp = x;
                            	} else if (t_2 <= 1e-167) {
                            		tmp = t;
                            	} else if (t_2 <= 1e+294) {
                            		tmp = x + t;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t, a)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8), intent (in) :: a
                                real(8) :: t_1
                                real(8) :: t_2
                                real(8) :: tmp
                                t_1 = t * (y / (a - z))
                                t_2 = x + ((y - z) * ((t - x) / (a - z)))
                                if (t_2 <= (-5d+291)) then
                                    tmp = t_1
                                else if (t_2 <= (-2000000.0d0)) then
                                    tmp = x + t
                                else if (t_2 <= (-2d-66)) then
                                    tmp = t_1
                                else if (t_2 <= (-2d-306)) then
                                    tmp = x
                                else if (t_2 <= 1d-167) then
                                    tmp = t
                                else if (t_2 <= 1d+294) then
                                    tmp = x + t
                                else
                                    tmp = t_1
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	double t_1 = t * (y / (a - z));
                            	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                            	double tmp;
                            	if (t_2 <= -5e+291) {
                            		tmp = t_1;
                            	} else if (t_2 <= -2000000.0) {
                            		tmp = x + t;
                            	} else if (t_2 <= -2e-66) {
                            		tmp = t_1;
                            	} else if (t_2 <= -2e-306) {
                            		tmp = x;
                            	} else if (t_2 <= 1e-167) {
                            		tmp = t;
                            	} else if (t_2 <= 1e+294) {
                            		tmp = x + t;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a):
                            	t_1 = t * (y / (a - z))
                            	t_2 = x + ((y - z) * ((t - x) / (a - z)))
                            	tmp = 0
                            	if t_2 <= -5e+291:
                            		tmp = t_1
                            	elif t_2 <= -2000000.0:
                            		tmp = x + t
                            	elif t_2 <= -2e-66:
                            		tmp = t_1
                            	elif t_2 <= -2e-306:
                            		tmp = x
                            	elif t_2 <= 1e-167:
                            		tmp = t
                            	elif t_2 <= 1e+294:
                            		tmp = x + t
                            	else:
                            		tmp = t_1
                            	return tmp
                            
                            function code(x, y, z, t, a)
                            	t_1 = Float64(t * Float64(y / Float64(a - z)))
                            	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                            	tmp = 0.0
                            	if (t_2 <= -5e+291)
                            		tmp = t_1;
                            	elseif (t_2 <= -2000000.0)
                            		tmp = Float64(x + t);
                            	elseif (t_2 <= -2e-66)
                            		tmp = t_1;
                            	elseif (t_2 <= -2e-306)
                            		tmp = x;
                            	elseif (t_2 <= 1e-167)
                            		tmp = t;
                            	elseif (t_2 <= 1e+294)
                            		tmp = Float64(x + t);
                            	else
                            		tmp = t_1;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a)
                            	t_1 = t * (y / (a - z));
                            	t_2 = x + ((y - z) * ((t - x) / (a - z)));
                            	tmp = 0.0;
                            	if (t_2 <= -5e+291)
                            		tmp = t_1;
                            	elseif (t_2 <= -2000000.0)
                            		tmp = x + t;
                            	elseif (t_2 <= -2e-66)
                            		tmp = t_1;
                            	elseif (t_2 <= -2e-306)
                            		tmp = x;
                            	elseif (t_2 <= 1e-167)
                            		tmp = t;
                            	elseif (t_2 <= 1e+294)
                            		tmp = x + t;
                            	else
                            		tmp = t_1;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+291], t$95$1, If[LessEqual[t$95$2, -2000000.0], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -2e-66], t$95$1, If[LessEqual[t$95$2, -2e-306], x, If[LessEqual[t$95$2, 1e-167], t, If[LessEqual[t$95$2, 1e+294], N[(x + t), $MachinePrecision], t$95$1]]]]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := t \cdot \frac{y}{a - z}\\
                            t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                            \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+291}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;t\_2 \leq -2000000:\\
                            \;\;\;\;x + t\\
                            
                            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-66}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\
                            \;\;\;\;x\\
                            
                            \mathbf{elif}\;t\_2 \leq 10^{-167}:\\
                            \;\;\;\;t\\
                            
                            \mathbf{elif}\;t\_2 \leq 10^{+294}:\\
                            \;\;\;\;x + t\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000001e291 or -2e6 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e-66 or 1.00000000000000007e294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                              1. Initial program 93.5%

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

                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                              4. Step-by-step derivation
                                1. 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--.f6455.2

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

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

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

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

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

                                  \[\leadsto t \cdot \frac{y}{a - \color{blue}{z}} \]
                                4. lift--.f6450.6

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

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

                              if -5.0000000000000001e291 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e6 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e294

                              1. Initial program 97.5%

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

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

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

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

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

                                  \[\leadsto x + t \]

                                if -2e-66 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

                                1. Initial program 83.4%

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

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

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

                                  if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                                  1. Initial program 5.5%

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{+291}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-66}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 6: 43.7% accurate, 0.2× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot t}{a}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+305}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-7}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_2 \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_2 \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a)
                                   :precision binary64
                                   (let* ((t_1 (/ (* y t) a)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
                                     (if (<= t_2 -5e+305)
                                       t_1
                                       (if (<= t_2 -5e-7)
                                         (+ x t)
                                         (if (<= t_2 -2e-306)
                                           x
                                           (if (<= t_2 1e-167) t (if (<= t_2 1e+294) (+ x t) t_1)))))))
                                  double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = (y * t) / a;
                                  	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                                  	double tmp;
                                  	if (t_2 <= -5e+305) {
                                  		tmp = t_1;
                                  	} else if (t_2 <= -5e-7) {
                                  		tmp = x + t;
                                  	} else if (t_2 <= -2e-306) {
                                  		tmp = x;
                                  	} else if (t_2 <= 1e-167) {
                                  		tmp = t;
                                  	} else if (t_2 <= 1e+294) {
                                  		tmp = x + t;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t, a)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      real(8), intent (in) :: a
                                      real(8) :: t_1
                                      real(8) :: t_2
                                      real(8) :: tmp
                                      t_1 = (y * t) / a
                                      t_2 = x + ((y - z) * ((t - x) / (a - z)))
                                      if (t_2 <= (-5d+305)) then
                                          tmp = t_1
                                      else if (t_2 <= (-5d-7)) then
                                          tmp = x + t
                                      else if (t_2 <= (-2d-306)) then
                                          tmp = x
                                      else if (t_2 <= 1d-167) then
                                          tmp = t
                                      else if (t_2 <= 1d+294) then
                                          tmp = x + t
                                      else
                                          tmp = t_1
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = (y * t) / a;
                                  	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                                  	double tmp;
                                  	if (t_2 <= -5e+305) {
                                  		tmp = t_1;
                                  	} else if (t_2 <= -5e-7) {
                                  		tmp = x + t;
                                  	} else if (t_2 <= -2e-306) {
                                  		tmp = x;
                                  	} else if (t_2 <= 1e-167) {
                                  		tmp = t;
                                  	} else if (t_2 <= 1e+294) {
                                  		tmp = x + t;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a):
                                  	t_1 = (y * t) / a
                                  	t_2 = x + ((y - z) * ((t - x) / (a - z)))
                                  	tmp = 0
                                  	if t_2 <= -5e+305:
                                  		tmp = t_1
                                  	elif t_2 <= -5e-7:
                                  		tmp = x + t
                                  	elif t_2 <= -2e-306:
                                  		tmp = x
                                  	elif t_2 <= 1e-167:
                                  		tmp = t
                                  	elif t_2 <= 1e+294:
                                  		tmp = x + t
                                  	else:
                                  		tmp = t_1
                                  	return tmp
                                  
                                  function code(x, y, z, t, a)
                                  	t_1 = Float64(Float64(y * t) / a)
                                  	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                                  	tmp = 0.0
                                  	if (t_2 <= -5e+305)
                                  		tmp = t_1;
                                  	elseif (t_2 <= -5e-7)
                                  		tmp = Float64(x + t);
                                  	elseif (t_2 <= -2e-306)
                                  		tmp = x;
                                  	elseif (t_2 <= 1e-167)
                                  		tmp = t;
                                  	elseif (t_2 <= 1e+294)
                                  		tmp = Float64(x + t);
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t, a)
                                  	t_1 = (y * t) / a;
                                  	t_2 = x + ((y - z) * ((t - x) / (a - z)));
                                  	tmp = 0.0;
                                  	if (t_2 <= -5e+305)
                                  		tmp = t_1;
                                  	elseif (t_2 <= -5e-7)
                                  		tmp = x + t;
                                  	elseif (t_2 <= -2e-306)
                                  		tmp = x;
                                  	elseif (t_2 <= 1e-167)
                                  		tmp = t;
                                  	elseif (t_2 <= 1e+294)
                                  		tmp = x + t;
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+305], t$95$1, If[LessEqual[t$95$2, -5e-7], N[(x + t), $MachinePrecision], If[LessEqual[t$95$2, -2e-306], x, If[LessEqual[t$95$2, 1e-167], t, If[LessEqual[t$95$2, 1e+294], N[(x + t), $MachinePrecision], t$95$1]]]]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := \frac{y \cdot t}{a}\\
                                  t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                                  \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+305}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-7}:\\
                                  \;\;\;\;x + t\\
                                  
                                  \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-306}:\\
                                  \;\;\;\;x\\
                                  
                                  \mathbf{elif}\;t\_2 \leq 10^{-167}:\\
                                  \;\;\;\;t\\
                                  
                                  \mathbf{elif}\;t\_2 \leq 10^{+294}:\\
                                  \;\;\;\;x + t\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 4 regimes
                                  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.00000000000000009e305 or 1.00000000000000007e294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                                    1. Initial program 90.8%

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

                                      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                    4. Step-by-step derivation
                                      1. 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--.f6452.7

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

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

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

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

                                        \[\leadsto \frac{y \cdot t}{a} \]
                                      3. lower-*.f6439.0

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

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

                                    if -5.00000000000000009e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999977e-7 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e294

                                    1. Initial program 97.6%

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

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

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

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

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

                                        \[\leadsto x + t \]

                                      if -4.99999999999999977e-7 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

                                      1. Initial program 90.9%

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

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

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

                                        if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                                        1. Initial program 5.5%

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

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

                                            \[\leadsto \color{blue}{t} \]
                                        5. Recombined 4 regimes into one program.
                                        6. Final simplification46.4%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{+305}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-7}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-167}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{+294}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \]
                                        7. Add Preprocessing

                                        Alternative 7: 89.1% accurate, 0.3× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306} \lor \neg \left(t\_2 \leq 10^{-167}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\ \end{array} \end{array} \]
                                        (FPCore (x y z t a)
                                         :precision binary64
                                         (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
                                           (if (or (<= t_2 -2e-306) (not (<= t_2 1e-167)))
                                             (fma t_1 (- y z) x)
                                             (fma (/ (* (- t x) (- y a)) z) -1.0 t))))
                                        double code(double x, double y, double z, double t, double a) {
                                        	double t_1 = (t - x) / (a - z);
                                        	double t_2 = x + ((y - z) * t_1);
                                        	double tmp;
                                        	if ((t_2 <= -2e-306) || !(t_2 <= 1e-167)) {
                                        		tmp = fma(t_1, (y - z), x);
                                        	} else {
                                        		tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(x, y, z, t, a)
                                        	t_1 = Float64(Float64(t - x) / Float64(a - z))
                                        	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
                                        	tmp = 0.0
                                        	if ((t_2 <= -2e-306) || !(t_2 <= 1e-167))
                                        		tmp = fma(t_1, Float64(y - z), x);
                                        	else
                                        		tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t);
                                        	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[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e-306], N[Not[LessEqual[t$95$2, 1e-167]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_1 := \frac{t - x}{a - z}\\
                                        t_2 := x + \left(y - z\right) \cdot t\_1\\
                                        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306} \lor \neg \left(t\_2 \leq 10^{-167}\right):\\
                                        \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                                          1. Initial program 95.1%

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

                                              \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                            2. 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--.f6495.1

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

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

                                          if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                                          1. Initial program 5.5%

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

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

                                              \[\leadsto t + \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\right)} \]
                                            2. 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) \]
                                          5. Applied rewrites72.4%

                                            \[\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. Final simplification91.1%

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

                                        Alternative 8: 89.1% accurate, 0.3× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{elif}\;t\_2 \leq 10^{-167}:\\ \;\;\;\;\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 (+ x (* (- y z) t_1))))
                                           (if (<= t_2 -2e-306)
                                             (fma t_1 (- y z) x)
                                             (if (<= t_2 1e-167) (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 = x + ((y - z) * t_1);
                                        	double tmp;
                                        	if (t_2 <= -2e-306) {
                                        		tmp = fma(t_1, (y - z), x);
                                        	} else if (t_2 <= 1e-167) {
                                        		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 = Float64(x + Float64(Float64(y - z) * t_1))
                                        	tmp = 0.0
                                        	if (t_2 <= -2e-306)
                                        		tmp = fma(t_1, Float64(y - z), x);
                                        	elseif (t_2 <= 1e-167)
                                        		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[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-306], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 1e-167], 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 := x + \left(y - z\right) \cdot t\_1\\
                                        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306}:\\
                                        \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
                                        
                                        \mathbf{elif}\;t\_2 \leq 10^{-167}:\\
                                        \;\;\;\;\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 3 regimes
                                        2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306

                                          1. Initial program 96.2%

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

                                              \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                            2. 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--.f6496.3

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

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

                                          if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                                          1. Initial program 5.5%

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

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

                                              \[\leadsto t + \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\right)} \]
                                            2. 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) \]
                                          5. Applied rewrites72.4%

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

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

                                          1. Initial program 93.9%

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

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

                                        Alternative 9: 84.9% accurate, 0.3× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306} \lor \neg \left(t\_2 \leq 10^{-167}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t\\ \end{array} \end{array} \]
                                        (FPCore (x y z t a)
                                         :precision binary64
                                         (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
                                           (if (or (<= t_2 -2e-306) (not (<= t_2 1e-167)))
                                             (fma t_1 (- y z) x)
                                             (* (/ (- y z) (- a z)) t))))
                                        double code(double x, double y, double z, double t, double a) {
                                        	double t_1 = (t - x) / (a - z);
                                        	double t_2 = x + ((y - z) * t_1);
                                        	double tmp;
                                        	if ((t_2 <= -2e-306) || !(t_2 <= 1e-167)) {
                                        		tmp = fma(t_1, (y - z), x);
                                        	} else {
                                        		tmp = ((y - z) / (a - z)) * t;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(x, y, z, t, a)
                                        	t_1 = Float64(Float64(t - x) / Float64(a - z))
                                        	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
                                        	tmp = 0.0
                                        	if ((t_2 <= -2e-306) || !(t_2 <= 1e-167))
                                        		tmp = fma(t_1, Float64(y - z), x);
                                        	else
                                        		tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t);
                                        	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[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e-306], N[Not[LessEqual[t$95$2, 1e-167]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_1 := \frac{t - x}{a - z}\\
                                        t_2 := x + \left(y - z\right) \cdot t\_1\\
                                        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-306} \lor \neg \left(t\_2 \leq 10^{-167}\right):\\
                                        \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{y - z}{a - z} \cdot t\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000006e-306 or 1e-167 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                                          1. Initial program 95.1%

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

                                              \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                            2. 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--.f6495.1

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

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

                                          if -2.00000000000000006e-306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-167

                                          1. Initial program 5.5%

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

                                            \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                          4. Step-by-step derivation
                                            1. 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--.f6433.9

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                            13. lift--.f6442.5

                                              \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                          7. Applied rewrites42.5%

                                            \[\leadsto \frac{y - z}{a - z} \cdot \color{blue}{t} \]
                                        3. Recombined 2 regimes into one program.
                                        4. Final simplification85.9%

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

                                        Alternative 10: 73.0% accurate, 0.8× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+184} \lor \neg \left(z \leq 5.4 \cdot 10^{+87}\right):\\ \;\;\;\;\frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\ \end{array} \end{array} \]
                                        (FPCore (x y z t a)
                                         :precision binary64
                                         (if (or (<= z -6.1e+184) (not (<= z 5.4e+87)))
                                           (* (/ (- y z) (- a z)) t)
                                           (+ x (* y (/ (- t x) (- a z))))))
                                        double code(double x, double y, double z, double t, double a) {
                                        	double tmp;
                                        	if ((z <= -6.1e+184) || !(z <= 5.4e+87)) {
                                        		tmp = ((y - z) / (a - z)) * t;
                                        	} else {
                                        		tmp = x + (y * ((t - x) / (a - z)));
                                        	}
                                        	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 <= (-6.1d+184)) .or. (.not. (z <= 5.4d+87))) then
                                                tmp = ((y - z) / (a - z)) * t
                                            else
                                                tmp = x + (y * ((t - x) / (a - z)))
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double x, double y, double z, double t, double a) {
                                        	double tmp;
                                        	if ((z <= -6.1e+184) || !(z <= 5.4e+87)) {
                                        		tmp = ((y - z) / (a - z)) * t;
                                        	} else {
                                        		tmp = x + (y * ((t - x) / (a - z)));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, y, z, t, a):
                                        	tmp = 0
                                        	if (z <= -6.1e+184) or not (z <= 5.4e+87):
                                        		tmp = ((y - z) / (a - z)) * t
                                        	else:
                                        		tmp = x + (y * ((t - x) / (a - z)))
                                        	return tmp
                                        
                                        function code(x, y, z, t, a)
                                        	tmp = 0.0
                                        	if ((z <= -6.1e+184) || !(z <= 5.4e+87))
                                        		tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t);
                                        	else
                                        		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / Float64(a - z))));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(x, y, z, t, a)
                                        	tmp = 0.0;
                                        	if ((z <= -6.1e+184) || ~((z <= 5.4e+87)))
                                        		tmp = ((y - z) / (a - z)) * t;
                                        	else
                                        		tmp = x + (y * ((t - x) / (a - z)));
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.1e+184], N[Not[LessEqual[z, 5.4e+87]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;z \leq -6.1 \cdot 10^{+184} \lor \neg \left(z \leq 5.4 \cdot 10^{+87}\right):\\
                                        \;\;\;\;\frac{y - z}{a - z} \cdot t\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if z < -6.10000000000000009e184 or 5.40000000000000013e87 < z

                                          1. Initial program 58.4%

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

                                            \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                          4. Step-by-step derivation
                                            1. 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--.f6432.0

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                            13. lift--.f6464.5

                                              \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                          7. Applied rewrites64.5%

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

                                          if -6.10000000000000009e184 < z < 5.40000000000000013e87

                                          1. Initial program 89.0%

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

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

                                              \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
                                          5. Recombined 2 regimes into one program.
                                          6. Final simplification75.5%

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

                                          Alternative 11: 73.0% accurate, 0.8× speedup?

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

                                            1. Initial program 58.4%

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

                                              \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                            4. Step-by-step derivation
                                              1. 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--.f6432.0

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                              13. lift--.f6464.5

                                                \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                            7. Applied rewrites64.5%

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

                                            if -6.10000000000000009e184 < z < 5.40000000000000013e87

                                            1. Initial program 89.0%

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

                                                \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                              2. 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--.f6489.2

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

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

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

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

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

                                            Alternative 12: 69.0% accurate, 0.8× speedup?

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

                                              1. Initial program 88.3%

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

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

                                                  \[\leadsto \frac{\left(t - x\right) \cdot \left(y - z\right)}{a} + \color{blue}{x} \]
                                                2. 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--.f6474.9

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

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

                                              if -1.6e15 < a < 2.95e-12

                                              1. Initial program 68.7%

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

                                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                              4. Step-by-step derivation
                                                1. 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--.f6453.2

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                                13. lift--.f6469.2

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

                                                \[\leadsto \frac{y - z}{a - z} \cdot \color{blue}{t} \]
                                            3. Recombined 2 regimes into one program.
                                            4. Final simplification72.3%

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

                                            Alternative 13: 64.6% accurate, 0.8× speedup?

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

                                              1. Initial program 88.3%

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

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

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

                                                  \[\leadsto y \cdot \frac{t - x}{a} + x \]
                                                3. 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--.f6471.2

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

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

                                              if -2.29999999999999994e40 < a < 2.95e-12

                                              1. Initial program 70.3%

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

                                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                              4. Step-by-step derivation
                                                1. 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--.f6451.6

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                                13. lift--.f6467.1

                                                  \[\leadsto \frac{y - z}{a - z} \cdot t \]
                                              7. Applied rewrites67.1%

                                                \[\leadsto \frac{y - z}{a - z} \cdot \color{blue}{t} \]
                                            3. Recombined 2 regimes into one program.
                                            4. Final simplification69.2%

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

                                            Alternative 14: 61.3% accurate, 0.8× speedup?

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

                                              1. Initial program 53.1%

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

                                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                              4. Step-by-step derivation
                                                1. 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--.f6422.5

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

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

                                                \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot z}{a - z}} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

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

                                                  \[\leadsto -\frac{t \cdot z}{a - z} \]
                                                3. associate-/l*N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                5. lower-/.f64N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                6. lift--.f6468.5

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                              8. Applied rewrites68.5%

                                                \[\leadsto -t \cdot \frac{z}{a - z} \]

                                              if -6.10000000000000009e184 < z < 1.3500000000000001e-17

                                              1. Initial program 90.1%

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

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

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

                                                  \[\leadsto y \cdot \frac{t - x}{a} + x \]
                                                3. 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--.f6473.3

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

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

                                              if 1.3500000000000001e-17 < z

                                              1. Initial program 66.4%

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

                                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                              4. Step-by-step derivation
                                                1. 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--.f6439.6

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \left(y - z\right) \cdot \frac{t}{\color{blue}{a - z}} \]
                                                9. lift--.f6452.2

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

                                                \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} \]
                                            3. Recombined 3 regimes into one program.
                                            4. Final simplification66.7%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+184}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array} \]
                                            5. Add Preprocessing

                                            Alternative 15: 60.7% accurate, 0.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+184} \lor \neg \left(z \leq 130000000\right):\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\ \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 (or (<= z -6.1e+184) (not (<= z 130000000.0)))
                                               (* (- t) (/ z (- a z)))
                                               (fma y (/ (- t x) a) x)))
                                            double code(double x, double y, double z, double t, double a) {
                                            	double tmp;
                                            	if ((z <= -6.1e+184) || !(z <= 130000000.0)) {
                                            		tmp = -t * (z / (a - z));
                                            	} else {
                                            		tmp = fma(y, ((t - x) / a), x);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a)
                                            	tmp = 0.0
                                            	if ((z <= -6.1e+184) || !(z <= 130000000.0))
                                            		tmp = Float64(Float64(-t) * Float64(z / Float64(a - z)));
                                            	else
                                            		tmp = fma(y, Float64(Float64(t - x) / a), x);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.1e+184], N[Not[LessEqual[z, 130000000.0]], $MachinePrecision]], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;z \leq -6.1 \cdot 10^{+184} \lor \neg \left(z \leq 130000000\right):\\
                                            \;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if z < -6.10000000000000009e184 or 1.3e8 < z

                                              1. Initial program 61.3%

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

                                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
                                              4. Step-by-step derivation
                                                1. 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--.f6434.3

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

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

                                                \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot z}{a - z}} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

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

                                                  \[\leadsto -\frac{t \cdot z}{a - z} \]
                                                3. associate-/l*N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                5. lower-/.f64N/A

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                                6. lift--.f6455.6

                                                  \[\leadsto -t \cdot \frac{z}{a - z} \]
                                              8. Applied rewrites55.6%

                                                \[\leadsto -t \cdot \frac{z}{a - z} \]

                                              if -6.10000000000000009e184 < z < 1.3e8

                                              1. Initial program 90.4%

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

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

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

                                                  \[\leadsto y \cdot \frac{t - x}{a} + x \]
                                                3. 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--.f6472.2

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

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

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

                                            Alternative 16: 59.0% accurate, 0.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{+184}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 150000000:\\ \;\;\;\;\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 -9.6e+184) t (if (<= z 150000000.0) (fma y (/ (- t x) a) x) t)))
                                            double code(double x, double y, double z, double t, double a) {
                                            	double tmp;
                                            	if (z <= -9.6e+184) {
                                            		tmp = t;
                                            	} else if (z <= 150000000.0) {
                                            		tmp = fma(y, ((t - x) / a), x);
                                            	} else {
                                            		tmp = t;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a)
                                            	tmp = 0.0
                                            	if (z <= -9.6e+184)
                                            		tmp = t;
                                            	elseif (z <= 150000000.0)
                                            		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, -9.6e+184], t, If[LessEqual[z, 150000000.0], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;z \leq -9.6 \cdot 10^{+184}:\\
                                            \;\;\;\;t\\
                                            
                                            \mathbf{elif}\;z \leq 150000000:\\
                                            \;\;\;\;\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 < -9.59999999999999986e184 or 1.5e8 < z

                                              1. Initial program 61.3%

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

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

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

                                                if -9.59999999999999986e184 < z < 1.5e8

                                                1. Initial program 90.4%

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

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

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

                                                    \[\leadsto y \cdot \frac{t - x}{a} + x \]
                                                  3. 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--.f6472.2

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

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

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{+184}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 150000000:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                              7. Add Preprocessing

                                              Alternative 17: 39.6% accurate, 2.2× speedup?

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

                                                1. Initial program 89.3%

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

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

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

                                                  if -3.35e106 < a < 6e17

                                                  1. Initial program 72.6%

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

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

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

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.35 \cdot 10^{+106}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+17}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 18: 25.5% 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 79.4%

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

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

                                                      \[\leadsto \color{blue}{t} \]
                                                    2. Final simplification24.3%

                                                      \[\leadsto t \]
                                                    3. Add Preprocessing

                                                    Reproduce

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