Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.6% → 93.2%
Time: 10.5s
Alternatives: 25
Speedup: 0.4×

Specification

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

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 25 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: 79.6% accurate, 1.0× speedup?

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

Alternative 1: 93.2% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{+96}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-11}:\\ \;\;\;\;-1 \cdot \frac{t \cdot \left(z - y\right)}{a - z} + x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a)
  :precision binary64
  (let* ((t_1 (+ x (* (- x t) (/ (- z y) (- a z))))))
  (if (<= t -4.2e+96)
    t_1
    (if (<= t 7.5e-11)
      (+
       (* -1.0 (/ (* t (- z y)) (- a z)))
       (* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z)))))
      t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((x - t) * ((z - y) / (a - z)));
	double tmp;
	if (t <= -4.2e+96) {
		tmp = t_1;
	} else if (t <= 7.5e-11) {
		tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z))));
	} 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) :: tmp
    t_1 = x + ((x - t) * ((z - y) / (a - z)))
    if (t <= (-4.2d+96)) then
        tmp = t_1
    else if (t <= 7.5d-11) then
        tmp = ((-1.0d0) * ((t * (z - y)) / (a - z))) + (x * ((1.0d0 + (z / (a - z))) - (y / (a - z))))
    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 = x + ((x - t) * ((z - y) / (a - z)));
	double tmp;
	if (t <= -4.2e+96) {
		tmp = t_1;
	} else if (t <= 7.5e-11) {
		tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((x - t) * ((z - y) / (a - z)))
	tmp = 0
	if t <= -4.2e+96:
		tmp = t_1
	elif t <= 7.5e-11:
		tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z))))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z))))
	tmp = 0.0
	if (t <= -4.2e+96)
		tmp = t_1;
	elseif (t <= 7.5e-11)
		tmp = Float64(Float64(-1.0 * Float64(Float64(t * Float64(z - y)) / Float64(a - z))) + Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z)))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((x - t) * ((z - y) / (a - z)));
	tmp = 0.0;
	if (t <= -4.2e+96)
		tmp = t_1;
	elseif (t <= 7.5e-11)
		tmp = (-1.0 * ((t * (z - y)) / (a - z))) + (x * ((1.0 + (z / (a - z))) - (y / (a - z))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+96], t$95$1, If[LessEqual[t, 7.5e-11], N[(N[(-1.0 * N[(N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-11}:\\
\;\;\;\;-1 \cdot \frac{t \cdot \left(z - y\right)}{a - z} + x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.2000000000000002e96 or 7.5e-11 < t

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      9. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      12. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
      15. lower--.f6484.1%

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

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

    if -4.2000000000000002e96 < t < 7.5e-11

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      9. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      12. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
      15. lower--.f6484.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{t \cdot \left(z - y\right)}{a - z} + x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{\color{blue}{a - z}}\right) \]
      13. lower--.f6478.8%

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

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

Alternative 2: 90.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      9. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      12. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
      15. lower--.f6484.1%

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

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

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

    1. Initial program 79.6%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    3. Step-by-step derivation
      1. lower--.f6419.7%

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

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

      \[\leadsto x + -1 \cdot \color{blue}{x} \]
    6. Step-by-step derivation
      1. lower-*.f642.8%

        \[\leadsto x + -1 \cdot x \]
    7. Applied rewrites2.8%

      \[\leadsto x + -1 \cdot \color{blue}{x} \]
    8. Taylor expanded in z around -inf

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

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

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      8. lower--.f6446.9%

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

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

Alternative 3: 88.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      9. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      12. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
      15. lower--.f6484.1%

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

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

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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
      11. sub-negate-revN/A

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

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

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

        \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
      16. distribute-rgt-neg-outN/A

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

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

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

        \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
      20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
      2. lower-/.f6436.6%

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

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

Alternative 4: 87.9% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      9. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      12. sub-negate-revN/A

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

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

        \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
      15. lower--.f6484.1%

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

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

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

    1. Initial program 79.6%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    3. Step-by-step derivation
      1. lower--.f6419.7%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.6% accurate, 0.2× speedup?

\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-303}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{-246}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - t\right) \cdot y}{z - a}\\ \end{array} \]
(FPCore (x y z t a)
  :precision binary64
  (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
       (t_2 (+ x (* (- y z) (/ t (- a z))))))
  (if (<= t_1 (- INFINITY))
    (+ x (/ (* y (- t x)) (- a z)))
    (if (<= t_1 -4e-303)
      t_2
      (if (<= t_1 1e-246)
        (* t (/ z (- z a)))
        (if (<= t_1 5e+305) t_2 (/ (* (- x t) y) (- z a))))))))
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 = x + ((y - z) * (t / (a - z)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + ((y * (t - x)) / (a - z));
	} else if (t_1 <= -4e-303) {
		tmp = t_2;
	} else if (t_1 <= 1e-246) {
		tmp = t * (z / (z - a));
	} else if (t_1 <= 5e+305) {
		tmp = t_2;
	} else {
		tmp = ((x - t) * y) / (z - a);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double t_2 = x + ((y - z) * (t / (a - z)));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((y * (t - x)) / (a - z));
	} else if (t_1 <= -4e-303) {
		tmp = t_2;
	} else if (t_1 <= 1e-246) {
		tmp = t * (z / (z - a));
	} else if (t_1 <= 5e+305) {
		tmp = t_2;
	} else {
		tmp = ((x - t) * y) / (z - a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	t_2 = x + ((y - z) * (t / (a - z)))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + ((y * (t - x)) / (a - z))
	elif t_1 <= -4e-303:
		tmp = t_2
	elif t_1 <= 1e-246:
		tmp = t * (z / (z - a))
	elif t_1 <= 5e+305:
		tmp = t_2
	else:
		tmp = ((x - t) * y) / (z - a)
	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(x + Float64(Float64(y - z) * Float64(t / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z)));
	elseif (t_1 <= -4e-303)
		tmp = t_2;
	elseif (t_1 <= 1e-246)
		tmp = Float64(t * Float64(z / Float64(z - a)));
	elseif (t_1 <= 5e+305)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(x - t) * y) / Float64(z - a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	t_2 = x + ((y - z) * (t / (a - z)));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + ((y * (t - x)) / (a - z));
	elseif (t_1 <= -4e-303)
		tmp = t_2;
	elseif (t_1 <= 1e-246)
		tmp = t * (z / (z - a));
	elseif (t_1 <= 5e+305)
		tmp = t_2;
	else
		tmp = ((x - t) * y) / (z - a);
	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[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-303], t$95$2, If[LessEqual[t$95$1, 1e-246], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+305], t$95$2, N[(N[(N[(x - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{-246}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x - t\right) \cdot y}{z - a}\\


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

    1. Initial program 79.6%

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

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

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

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

        \[\leadsto x + \frac{y \cdot \left(t - x\right)}{a - z} \]
      4. lower--.f6454.8%

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999997e-303 or 9.9999999999999996e-247 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000001e305

    1. Initial program 79.6%

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

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

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

      if -3.9999999999999997e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999996e-247

      1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
        11. sub-negate-revN/A

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

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

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

          \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
        15. distribute-lft-neg-outN/A

          \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
        16. distribute-rgt-neg-outN/A

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

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

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

          \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
        20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
        2. lower--.f6429.9%

          \[\leadsto t \cdot \frac{z}{z - a} \]
      9. Applied rewrites29.9%

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

      if 5.0000000000000001e305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

      1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{neg}\left(\left(t - x\right)\right)}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot y \]
        8. sub-negate-revN/A

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

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

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

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

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

          \[\leadsto \frac{\left(x - t\right) \cdot y}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
        14. sub-negate-revN/A

          \[\leadsto \frac{\left(x - t\right) \cdot y}{z - \color{blue}{a}} \]
        15. lower--.f6437.4%

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

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

    Alternative 6: 68.0% accurate, 0.6× speedup?

    \[\begin{array}{l} t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-113}:\\ \;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ x (/ (* t (- y z)) (- a z)))))
      (if (<= z -2.1e+93)
        (* t (- 1.0 (/ y z)))
        (if (<= z -3.6e-29)
          t_1
          (if (<= z 4.4e-113)
            (+ x (* (- x t) (/ (- z y) a)))
            (if (<= z 5.4e+81) t_1 (* t (/ z (- z a)))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = x + ((t * (y - z)) / (a - z));
    	double tmp;
    	if (z <= -2.1e+93) {
    		tmp = t * (1.0 - (y / z));
    	} else if (z <= -3.6e-29) {
    		tmp = t_1;
    	} else if (z <= 4.4e-113) {
    		tmp = x + ((x - t) * ((z - y) / a));
    	} else if (z <= 5.4e+81) {
    		tmp = t_1;
    	} else {
    		tmp = t * (z / (z - a));
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    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 + ((t * (y - z)) / (a - z))
        if (z <= (-2.1d+93)) then
            tmp = t * (1.0d0 - (y / z))
        else if (z <= (-3.6d-29)) then
            tmp = t_1
        else if (z <= 4.4d-113) then
            tmp = x + ((x - t) * ((z - y) / a))
        else if (z <= 5.4d+81) then
            tmp = t_1
        else
            tmp = t * (z / (z - a))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = x + ((t * (y - z)) / (a - z));
    	double tmp;
    	if (z <= -2.1e+93) {
    		tmp = t * (1.0 - (y / z));
    	} else if (z <= -3.6e-29) {
    		tmp = t_1;
    	} else if (z <= 4.4e-113) {
    		tmp = x + ((x - t) * ((z - y) / a));
    	} else if (z <= 5.4e+81) {
    		tmp = t_1;
    	} else {
    		tmp = t * (z / (z - a));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = x + ((t * (y - z)) / (a - z))
    	tmp = 0
    	if z <= -2.1e+93:
    		tmp = t * (1.0 - (y / z))
    	elif z <= -3.6e-29:
    		tmp = t_1
    	elif z <= 4.4e-113:
    		tmp = x + ((x - t) * ((z - y) / a))
    	elif z <= 5.4e+81:
    		tmp = t_1
    	else:
    		tmp = t * (z / (z - a))
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z)))
    	tmp = 0.0
    	if (z <= -2.1e+93)
    		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
    	elseif (z <= -3.6e-29)
    		tmp = t_1;
    	elseif (z <= 4.4e-113)
    		tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / a)));
    	elseif (z <= 5.4e+81)
    		tmp = t_1;
    	else
    		tmp = Float64(t * Float64(z / Float64(z - a)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = x + ((t * (y - z)) / (a - z));
    	tmp = 0.0;
    	if (z <= -2.1e+93)
    		tmp = t * (1.0 - (y / z));
    	elseif (z <= -3.6e-29)
    		tmp = t_1;
    	elseif (z <= 4.4e-113)
    		tmp = x + ((x - t) * ((z - y) / a));
    	elseif (z <= 5.4e+81)
    		tmp = t_1;
    	else
    		tmp = t * (z / (z - a));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+93], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-29], t$95$1, If[LessEqual[z, 4.4e-113], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+81], t$95$1, N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\
    \mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\
    \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
    
    \mathbf{elif}\;z \leq -3.6 \cdot 10^{-29}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 4.4 \cdot 10^{-113}:\\
    \;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a}\\
    
    \mathbf{elif}\;z \leq 5.4 \cdot 10^{+81}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t \cdot \frac{z}{z - a}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -2.0999999999999998e93

      1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
        11. sub-negate-revN/A

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

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

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

          \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
        15. distribute-lft-neg-outN/A

          \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
        16. distribute-rgt-neg-outN/A

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

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

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

          \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
        20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
        2. lower-/.f6436.6%

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

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

      if -2.0999999999999998e93 < z < -3.5999999999999997e-29 or 4.4000000000000001e-113 < z < 5.3999999999999999e81

      1. Initial program 79.6%

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

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

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

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

          \[\leadsto x + \frac{t \cdot \left(y - z\right)}{a - z} \]
        4. lower--.f6456.1%

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

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

      if -3.5999999999999997e-29 < z < 4.4000000000000001e-113

      1. Initial program 79.6%

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

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

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

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

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

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

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

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

          \[\leadsto x + \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right) \cdot \frac{y - z}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
        9. sub-negate-revN/A

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

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

          \[\leadsto x + \left(x - t\right) \cdot \frac{\color{blue}{y - z}}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
        12. sub-negate-revN/A

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

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

          \[\leadsto x + \left(x - t\right) \cdot \color{blue}{\frac{z - y}{a - z}} \]
        15. lower--.f6484.1%

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

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

        \[\leadsto x + \left(x - t\right) \cdot \frac{z - y}{\color{blue}{a}} \]
      5. Step-by-step derivation
        1. Applied rewrites52.6%

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

        if 5.3999999999999999e81 < z

        1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
          11. sub-negate-revN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
          16. distribute-rgt-neg-outN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
          20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
          2. lower--.f6429.9%

            \[\leadsto t \cdot \frac{z}{z - a} \]
        9. Applied rewrites29.9%

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

      Alternative 7: 67.8% accurate, 0.7× speedup?

      \[\begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-117}:\\ \;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+81}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
      (FPCore (x y z t a)
        :precision binary64
        (if (<= z -2.1e+93)
        (* t (- 1.0 (/ y z)))
        (if (<= z -7.2e-117)
          (+ x (/ (* t (- y z)) (- a z)))
          (if (<= z 4.6e+81)
            (+ x (/ (* y (- t x)) (- a z)))
            (* t (/ z (- z a)))))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -2.1e+93) {
      		tmp = t * (1.0 - (y / z));
      	} else if (z <= -7.2e-117) {
      		tmp = x + ((t * (y - z)) / (a - z));
      	} else if (z <= 4.6e+81) {
      		tmp = x + ((y * (t - x)) / (a - z));
      	} else {
      		tmp = t * (z / (z - a));
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a)
      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 <= (-2.1d+93)) then
              tmp = t * (1.0d0 - (y / z))
          else if (z <= (-7.2d-117)) then
              tmp = x + ((t * (y - z)) / (a - z))
          else if (z <= 4.6d+81) then
              tmp = x + ((y * (t - x)) / (a - z))
          else
              tmp = t * (z / (z - a))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -2.1e+93) {
      		tmp = t * (1.0 - (y / z));
      	} else if (z <= -7.2e-117) {
      		tmp = x + ((t * (y - z)) / (a - z));
      	} else if (z <= 4.6e+81) {
      		tmp = x + ((y * (t - x)) / (a - z));
      	} else {
      		tmp = t * (z / (z - a));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -2.1e+93:
      		tmp = t * (1.0 - (y / z))
      	elif z <= -7.2e-117:
      		tmp = x + ((t * (y - z)) / (a - z))
      	elif z <= 4.6e+81:
      		tmp = x + ((y * (t - x)) / (a - z))
      	else:
      		tmp = t * (z / (z - a))
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -2.1e+93)
      		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
      	elseif (z <= -7.2e-117)
      		tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z)));
      	elseif (z <= 4.6e+81)
      		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z)));
      	else
      		tmp = Float64(t * Float64(z / Float64(z - a)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -2.1e+93)
      		tmp = t * (1.0 - (y / z));
      	elseif (z <= -7.2e-117)
      		tmp = x + ((t * (y - z)) / (a - z));
      	elseif (z <= 4.6e+81)
      		tmp = x + ((y * (t - x)) / (a - z));
      	else
      		tmp = t * (z / (z - a));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+93], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-117], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+81], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      \mathbf{if}\;z \leq -2.1 \cdot 10^{+93}:\\
      \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
      
      \mathbf{elif}\;z \leq -7.2 \cdot 10^{-117}:\\
      \;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
      
      \mathbf{elif}\;z \leq 4.6 \cdot 10^{+81}:\\
      \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t \cdot \frac{z}{z - a}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -2.0999999999999998e93

        1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
          11. sub-negate-revN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
          16. distribute-rgt-neg-outN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
          20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
          2. lower-/.f6436.6%

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

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

        if -2.0999999999999998e93 < z < -7.2000000000000001e-117

        1. Initial program 79.6%

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

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

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

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

            \[\leadsto x + \frac{t \cdot \left(y - z\right)}{a - z} \]
          4. lower--.f6456.1%

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

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

        if -7.2000000000000001e-117 < z < 4.5999999999999998e81

        1. Initial program 79.6%

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

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

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

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

            \[\leadsto x + \frac{y \cdot \left(t - x\right)}{a - z} \]
          4. lower--.f6454.8%

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

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

        if 4.5999999999999998e81 < z

        1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
          11. sub-negate-revN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
          16. distribute-rgt-neg-outN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
          20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
          2. lower--.f6429.9%

            \[\leadsto t \cdot \frac{z}{z - a} \]
        9. Applied rewrites29.9%

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

      Alternative 8: 63.5% accurate, 0.7× speedup?

      \[\begin{array}{l} t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{if}\;y \leq -3.1 \cdot 10^{-61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.52 \cdot 10^{-139}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+23}:\\ \;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a)
        :precision binary64
        (let* ((t_1 (* (- t x) (/ y (- a z)))))
        (if (<= y -3.1e-61)
          t_1
          (if (<= y -1.52e-139)
            (* t (/ z (- z a)))
            (if (<= y 2.8e+23) (+ x (/ (* t (- y z)) (- a z))) t_1)))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = (t - x) * (y / (a - z));
      	double tmp;
      	if (y <= -3.1e-61) {
      		tmp = t_1;
      	} else if (y <= -1.52e-139) {
      		tmp = t * (z / (z - a));
      	} else if (y <= 2.8e+23) {
      		tmp = x + ((t * (y - z)) / (a - z));
      	} 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) :: tmp
          t_1 = (t - x) * (y / (a - z))
          if (y <= (-3.1d-61)) then
              tmp = t_1
          else if (y <= (-1.52d-139)) then
              tmp = t * (z / (z - a))
          else if (y <= 2.8d+23) then
              tmp = x + ((t * (y - z)) / (a - z))
          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 - x) * (y / (a - z));
      	double tmp;
      	if (y <= -3.1e-61) {
      		tmp = t_1;
      	} else if (y <= -1.52e-139) {
      		tmp = t * (z / (z - a));
      	} else if (y <= 2.8e+23) {
      		tmp = x + ((t * (y - z)) / (a - z));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = (t - x) * (y / (a - z))
      	tmp = 0
      	if y <= -3.1e-61:
      		tmp = t_1
      	elif y <= -1.52e-139:
      		tmp = t * (z / (z - a))
      	elif y <= 2.8e+23:
      		tmp = x + ((t * (y - z)) / (a - z))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(Float64(t - x) * Float64(y / Float64(a - z)))
      	tmp = 0.0
      	if (y <= -3.1e-61)
      		tmp = t_1;
      	elseif (y <= -1.52e-139)
      		tmp = Float64(t * Float64(z / Float64(z - a)));
      	elseif (y <= 2.8e+23)
      		tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = (t - x) * (y / (a - z));
      	tmp = 0.0;
      	if (y <= -3.1e-61)
      		tmp = t_1;
      	elseif (y <= -1.52e-139)
      		tmp = t * (z / (z - a));
      	elseif (y <= 2.8e+23)
      		tmp = x + ((t * (y - z)) / (a - z));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-61], t$95$1, If[LessEqual[y, -1.52e-139], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+23], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
      \mathbf{if}\;y \leq -3.1 \cdot 10^{-61}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq -1.52 \cdot 10^{-139}:\\
      \;\;\;\;t \cdot \frac{z}{z - a}\\
      
      \mathbf{elif}\;y \leq 2.8 \cdot 10^{+23}:\\
      \;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -3.0999999999999999e-61 or 2.8000000000000002e23 < y

        1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
          3. lower-*.f6441.5%

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

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

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

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

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

            \[\leadsto \frac{t - x}{a - z} \cdot y \]
          9. lift--.f6441.8%

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

          \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
        7. Step-by-step derivation
          1. associate-*r/41.8%

            \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
          2. sub-negate-rev41.8%

            \[\leadsto \frac{t - x}{a - z} \cdot y \]
          3. distribute-rgt-neg-out41.8%

            \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
          4. distribute-lft-neg-out41.8%

            \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
          5. sub-negate-rev41.8%

            \[\leadsto \frac{t - x}{a - z} \cdot y \]
          6. frac-2neg-rev41.8%

            \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
          7. mul-1-neg41.8%

            \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
          8. sub-negate-rev41.8%

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

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

            \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
          11. lift--.f6441.8%

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

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

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

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

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

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

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

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

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

        if -3.0999999999999999e-61 < y < -1.52e-139

        1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
          11. sub-negate-revN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
          15. distribute-lft-neg-outN/A

            \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
          16. distribute-rgt-neg-outN/A

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

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

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

            \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
          20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
          2. lower--.f6429.9%

            \[\leadsto t \cdot \frac{z}{z - a} \]
        9. Applied rewrites29.9%

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

        if -1.52e-139 < y < 2.8000000000000002e23

        1. Initial program 79.6%

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

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

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

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

            \[\leadsto x + \frac{t \cdot \left(y - z\right)}{a - z} \]
          4. lower--.f6456.1%

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

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

      Alternative 9: 60.0% accurate, 0.7× speedup?

      \[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -9.2 \cdot 10^{+198}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-81}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;a \leq 16000000000:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t a)
        :precision binary64
        (let* ((t_1 (+ x (* (- y z) (/ t a)))))
        (if (<= a -9.2e+198)
          t_1
          (if (<= a -1e-81)
            (+ x (/ (* y (- t x)) a))
            (if (<= a 16000000000.0) (* t (- 1.0 (/ y z))) t_1)))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = x + ((y - z) * (t / a));
      	double tmp;
      	if (a <= -9.2e+198) {
      		tmp = t_1;
      	} else if (a <= -1e-81) {
      		tmp = x + ((y * (t - x)) / a);
      	} else if (a <= 16000000000.0) {
      		tmp = t * (1.0 - (y / z));
      	} 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) :: tmp
          t_1 = x + ((y - z) * (t / a))
          if (a <= (-9.2d+198)) then
              tmp = t_1
          else if (a <= (-1d-81)) then
              tmp = x + ((y * (t - x)) / a)
          else if (a <= 16000000000.0d0) then
              tmp = t * (1.0d0 - (y / z))
          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 = x + ((y - z) * (t / a));
      	double tmp;
      	if (a <= -9.2e+198) {
      		tmp = t_1;
      	} else if (a <= -1e-81) {
      		tmp = x + ((y * (t - x)) / a);
      	} else if (a <= 16000000000.0) {
      		tmp = t * (1.0 - (y / z));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = x + ((y - z) * (t / a))
      	tmp = 0
      	if a <= -9.2e+198:
      		tmp = t_1
      	elif a <= -1e-81:
      		tmp = x + ((y * (t - x)) / a)
      	elif a <= 16000000000.0:
      		tmp = t * (1.0 - (y / z))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / a)))
      	tmp = 0.0
      	if (a <= -9.2e+198)
      		tmp = t_1;
      	elseif (a <= -1e-81)
      		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a));
      	elseif (a <= 16000000000.0)
      		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = x + ((y - z) * (t / a));
      	tmp = 0.0;
      	if (a <= -9.2e+198)
      		tmp = t_1;
      	elseif (a <= -1e-81)
      		tmp = x + ((y * (t - x)) / a);
      	elseif (a <= 16000000000.0)
      		tmp = t * (1.0 - (y / z));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.2e+198], t$95$1, If[LessEqual[a, -1e-81], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 16000000000.0], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\
      \mathbf{if}\;a \leq -9.2 \cdot 10^{+198}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq -1 \cdot 10^{-81}:\\
      \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\
      
      \mathbf{elif}\;a \leq 16000000000:\\
      \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if a < -9.2000000000000002e198 or 1.6e10 < a

        1. Initial program 79.6%

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

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

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

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

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

            if -9.2000000000000002e198 < a < -9.9999999999999996e-82

            1. Initial program 79.6%

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

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

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

                \[\leadsto x + \frac{y \cdot \left(t - x\right)}{a} \]
              3. lower--.f6443.9%

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

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

            if -9.9999999999999996e-82 < a < 1.6e10

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
              2. lower-/.f6436.6%

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

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

          Alternative 10: 59.8% accurate, 0.7× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+102}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (if (<= z -6.5e-14)
            (* t (- 1.0 (/ y z)))
            (if (<= z 1.05e-110)
              (+ x (/ (* y (- t x)) a))
              (if (<= z 2.2e+102)
                (* (- t x) (/ y (- a z)))
                (* t (/ z (- z a)))))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -6.5e-14) {
          		tmp = t * (1.0 - (y / z));
          	} else if (z <= 1.05e-110) {
          		tmp = x + ((y * (t - x)) / a);
          	} else if (z <= 2.2e+102) {
          		tmp = (t - x) * (y / (a - z));
          	} else {
          		tmp = t * (z / (z - a));
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          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.5d-14)) then
                  tmp = t * (1.0d0 - (y / z))
              else if (z <= 1.05d-110) then
                  tmp = x + ((y * (t - x)) / a)
              else if (z <= 2.2d+102) then
                  tmp = (t - x) * (y / (a - z))
              else
                  tmp = t * (z / (z - a))
              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.5e-14) {
          		tmp = t * (1.0 - (y / z));
          	} else if (z <= 1.05e-110) {
          		tmp = x + ((y * (t - x)) / a);
          	} else if (z <= 2.2e+102) {
          		tmp = (t - x) * (y / (a - z));
          	} else {
          		tmp = t * (z / (z - a));
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if z <= -6.5e-14:
          		tmp = t * (1.0 - (y / z))
          	elif z <= 1.05e-110:
          		tmp = x + ((y * (t - x)) / a)
          	elif z <= 2.2e+102:
          		tmp = (t - x) * (y / (a - z))
          	else:
          		tmp = t * (z / (z - a))
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -6.5e-14)
          		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
          	elseif (z <= 1.05e-110)
          		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / a));
          	elseif (z <= 2.2e+102)
          		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
          	else
          		tmp = Float64(t * Float64(z / Float64(z - a)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (z <= -6.5e-14)
          		tmp = t * (1.0 - (y / z));
          	elseif (z <= 1.05e-110)
          		tmp = x + ((y * (t - x)) / a);
          	elseif (z <= 2.2e+102)
          		tmp = (t - x) * (y / (a - z));
          	else
          		tmp = t * (z / (z - a));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e-14], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-110], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+102], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
          \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
          
          \mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\
          \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a}\\
          
          \mathbf{elif}\;z \leq 2.2 \cdot 10^{+102}:\\
          \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
          
          \mathbf{else}:\\
          \;\;\;\;t \cdot \frac{z}{z - a}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if z < -6.5000000000000001e-14

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
              2. lower-/.f6436.6%

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

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

            if -6.5000000000000001e-14 < z < 1.05e-110

            1. Initial program 79.6%

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

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

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

                \[\leadsto x + \frac{y \cdot \left(t - x\right)}{a} \]
              3. lower--.f6443.9%

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

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

            if 1.05e-110 < z < 2.2000000000000001e102

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

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

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

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

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

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

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

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

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Step-by-step derivation
              1. associate-*r/41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              2. sub-negate-rev41.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              3. distribute-rgt-neg-out41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              4. distribute-lft-neg-out41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              5. sub-negate-rev41.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              6. frac-2neg-rev41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              7. mul-1-neg41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              8. sub-negate-rev41.8%

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

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

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              11. lift--.f6441.8%

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

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

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

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

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

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

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

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

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

            if 2.2000000000000001e102 < z

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
              2. lower--.f6429.9%

                \[\leadsto t \cdot \frac{z}{z - a} \]
            9. Applied rewrites29.9%

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

          Alternative 11: 55.9% accurate, 0.8× speedup?

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

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

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

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

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

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

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

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

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

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Step-by-step derivation
              1. associate-*r/41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              2. sub-negate-rev41.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              3. distribute-rgt-neg-out41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              4. distribute-lft-neg-out41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              5. sub-negate-rev41.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              6. frac-2neg-rev41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              7. mul-1-neg41.8%

                \[\leadsto \frac{t - x}{\color{blue}{a} - z} \cdot y \]
              8. sub-negate-rev41.8%

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

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

                \[\leadsto \frac{t - x}{\color{blue}{a - z}} \cdot y \]
              11. lift--.f6441.8%

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

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

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

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

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

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

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

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

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

            if -3.0999999999999999e-61 < y < 4.8e18

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
              2. lower--.f6429.9%

                \[\leadsto t \cdot \frac{z}{z - a} \]
            9. Applied rewrites29.9%

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

          Alternative 12: 55.3% accurate, 0.8× speedup?

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

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

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

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

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

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

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

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

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

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

            if -4.0000000000000001e-54 < y < 4.8e18

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
              2. lower--.f6429.9%

                \[\leadsto t \cdot \frac{z}{z - a} \]
            9. Applied rewrites29.9%

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

          Alternative 13: 49.1% accurate, 0.9× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\ \;\;\;\;\left(\frac{-y}{a} - -1\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (if (<= z -6.5e-14)
            (* t (- 1.0 (/ y z)))
            (if (<= z 1.05e-110)
              (* (- (/ (- y) a) -1.0) x)
              (* t (/ z (- z a))))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -6.5e-14) {
          		tmp = t * (1.0 - (y / z));
          	} else if (z <= 1.05e-110) {
          		tmp = ((-y / a) - -1.0) * x;
          	} else {
          		tmp = t * (z / (z - a));
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          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.5d-14)) then
                  tmp = t * (1.0d0 - (y / z))
              else if (z <= 1.05d-110) then
                  tmp = ((-y / a) - (-1.0d0)) * x
              else
                  tmp = t * (z / (z - a))
              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.5e-14) {
          		tmp = t * (1.0 - (y / z));
          	} else if (z <= 1.05e-110) {
          		tmp = ((-y / a) - -1.0) * x;
          	} else {
          		tmp = t * (z / (z - a));
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if z <= -6.5e-14:
          		tmp = t * (1.0 - (y / z))
          	elif z <= 1.05e-110:
          		tmp = ((-y / a) - -1.0) * x
          	else:
          		tmp = t * (z / (z - a))
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -6.5e-14)
          		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
          	elseif (z <= 1.05e-110)
          		tmp = Float64(Float64(Float64(Float64(-y) / a) - -1.0) * x);
          	else
          		tmp = Float64(t * Float64(z / Float64(z - a)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (z <= -6.5e-14)
          		tmp = t * (1.0 - (y / z));
          	elseif (z <= 1.05e-110)
          		tmp = ((-y / a) - -1.0) * x;
          	else
          		tmp = t * (z / (z - a));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e-14], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-110], N[(N[(N[((-y) / a), $MachinePrecision] - -1.0), $MachinePrecision] * x), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
          \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
          
          \mathbf{elif}\;z \leq 1.05 \cdot 10^{-110}:\\
          \;\;\;\;\left(\frac{-y}{a} - -1\right) \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;t \cdot \frac{z}{z - a}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -6.5000000000000001e-14

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
              2. lower-/.f6436.6%

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

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

            if -6.5000000000000001e-14 < z < 1.05e-110

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{\color{blue}{a}}\right) \]
              2. lower-/.f6436.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
            7. Applied rewrites36.0%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            8. Step-by-step derivation
              1. associate-*r/36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              2. sub-negate-rev36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              3. distribute-rgt-neg-out36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              4. distribute-lft-neg-out36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              5. sub-negate-rev36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              6. frac-2neg-rev36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              7. mul-1-neg36.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              8. sub-negate-rev36.0%

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

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

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
              11. lift--.f6436.0%

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

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

                \[\leadsto \left(1 + -1 \cdot \frac{y}{a}\right) \cdot \color{blue}{x} \]
              14. lower-*.f6436.0%

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

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

            if 1.05e-110 < z

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
              2. lower--.f6429.9%

                \[\leadsto t \cdot \frac{z}{z - a} \]
            9. Applied rewrites29.9%

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

          Alternative 14: 45.0% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := \frac{t - x}{a} \cdot y\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{+225}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-61}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (* (/ (- t x) a) y)))
            (if (<= y -8.5e+225)
              t_1
              (if (<= y -1.8e-61)
                (* t (- 1.0 (/ y z)))
                (if (<= y 4e+31) (* t (/ z (- z a))) t_1)))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((t - x) / a) * y;
          	double tmp;
          	if (y <= -8.5e+225) {
          		tmp = t_1;
          	} else if (y <= -1.8e-61) {
          		tmp = t * (1.0 - (y / z));
          	} else if (y <= 4e+31) {
          		tmp = t * (z / (z - a));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          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 = ((t - x) / a) * y
              if (y <= (-8.5d+225)) then
                  tmp = t_1
              else if (y <= (-1.8d-61)) then
                  tmp = t * (1.0d0 - (y / z))
              else if (y <= 4d+31) then
                  tmp = t * (z / (z - a))
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((t - x) / a) * y;
          	double tmp;
          	if (y <= -8.5e+225) {
          		tmp = t_1;
          	} else if (y <= -1.8e-61) {
          		tmp = t * (1.0 - (y / z));
          	} else if (y <= 4e+31) {
          		tmp = t * (z / (z - a));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = ((t - x) / a) * y
          	tmp = 0
          	if y <= -8.5e+225:
          		tmp = t_1
          	elif y <= -1.8e-61:
          		tmp = t * (1.0 - (y / z))
          	elif y <= 4e+31:
          		tmp = t * (z / (z - a))
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(Float64(t - x) / a) * y)
          	tmp = 0.0
          	if (y <= -8.5e+225)
          		tmp = t_1;
          	elseif (y <= -1.8e-61)
          		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
          	elseif (y <= 4e+31)
          		tmp = Float64(t * Float64(z / Float64(z - a)));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = ((t - x) / a) * y;
          	tmp = 0.0;
          	if (y <= -8.5e+225)
          		tmp = t_1;
          	elseif (y <= -1.8e-61)
          		tmp = t * (1.0 - (y / z));
          	elseif (y <= 4e+31)
          		tmp = t * (z / (z - a));
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8.5e+225], t$95$1, If[LessEqual[y, -1.8e-61], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+31], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          t_1 := \frac{t - x}{a} \cdot y\\
          \mathbf{if}\;y \leq -8.5 \cdot 10^{+225}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq -1.8 \cdot 10^{-61}:\\
          \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
          
          \mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\
          \;\;\;\;t \cdot \frac{z}{z - a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -8.4999999999999995e225 or 3.9999999999999999e31 < y

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

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

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

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

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

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

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

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

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

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

                \[\leadsto \frac{t - x}{a} \cdot y \]
              2. lower--.f6424.9%

                \[\leadsto \frac{t - x}{a} \cdot y \]
            9. Applied rewrites24.9%

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

            if -8.4999999999999995e225 < y < -1.8000000000000001e-61

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

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

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
              2. lower-/.f6436.6%

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

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

            if -1.8000000000000001e-61 < y < 3.9999999999999999e31

            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

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

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

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(y - z\right)} \cdot \left(t - x\right)\right) \]
              14. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              17. lower-*.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              18. lower--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(z - y\right)} \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              19. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
              21. lower--.f6468.2%

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
            3. Applied rewrites68.2%

              \[\leadsto x + \color{blue}{\frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(x - t\right)\right)} \]
            4. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto t \cdot \color{blue}{\left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \color{blue}{\frac{y}{z - a}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{\color{blue}{y}}{z - a}\right) \]
              4. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right) \]
              5. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{\color{blue}{z - a}}\right) \]
              6. lower--.f6451.7%

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - \color{blue}{a}}\right) \]
            6. Applied rewrites51.7%

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            7. Taylor expanded in y around 0

              \[\leadsto t \cdot \frac{z}{\color{blue}{z - a}} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto t \cdot \frac{z}{z - \color{blue}{a}} \]
              2. lower--.f6429.9%

                \[\leadsto t \cdot \frac{z}{z - a} \]
            9. Applied rewrites29.9%

              \[\leadsto t \cdot \frac{z}{\color{blue}{z - a}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 15: 41.8% accurate, 0.9× speedup?

          \[\begin{array}{l} t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-144}:\\ \;\;\;\;\frac{t - x}{a} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (* t (- 1.0 (/ y z)))))
            (if (<= z -3.2e-28)
              t_1
              (if (<= z 5.5e-144) (* (/ (- t x) a) y) t_1))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = t * (1.0 - (y / z));
          	double tmp;
          	if (z <= -3.2e-28) {
          		tmp = t_1;
          	} else if (z <= 5.5e-144) {
          		tmp = ((t - x) / a) * y;
          	} 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) :: tmp
              t_1 = t * (1.0d0 - (y / z))
              if (z <= (-3.2d-28)) then
                  tmp = t_1
              else if (z <= 5.5d-144) then
                  tmp = ((t - x) / a) * y
              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 * (1.0 - (y / z));
          	double tmp;
          	if (z <= -3.2e-28) {
          		tmp = t_1;
          	} else if (z <= 5.5e-144) {
          		tmp = ((t - x) / a) * y;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = t * (1.0 - (y / z))
          	tmp = 0
          	if z <= -3.2e-28:
          		tmp = t_1
          	elif z <= 5.5e-144:
          		tmp = ((t - x) / a) * y
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(t * Float64(1.0 - Float64(y / z)))
          	tmp = 0.0
          	if (z <= -3.2e-28)
          		tmp = t_1;
          	elseif (z <= 5.5e-144)
          		tmp = Float64(Float64(Float64(t - x) / a) * y);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = t * (1.0 - (y / z));
          	tmp = 0.0;
          	if (z <= -3.2e-28)
          		tmp = t_1;
          	elseif (z <= 5.5e-144)
          		tmp = ((t - x) / a) * y;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-28], t$95$1, If[LessEqual[z, 5.5e-144], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\
          \mathbf{if}\;z \leq -3.2 \cdot 10^{-28}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 5.5 \cdot 10^{-144}:\\
          \;\;\;\;\frac{t - x}{a} \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -3.1999999999999998e-28 or 5.4999999999999997e-144 < z

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
              2. lift-/.f64N/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
              3. mult-flipN/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} \]
              4. associate-*r*N/A

                \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}} \]
              5. *-commutativeN/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              7. frac-2negN/A

                \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto x + \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \color{blue}{\frac{-1}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              10. lift--.f64N/A

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              12. lower--.f64N/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              13. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(y - z\right)} \cdot \left(t - x\right)\right) \]
              14. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              17. lower-*.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              18. lower--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(z - y\right)} \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              19. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
              21. lower--.f6468.2%

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
            3. Applied rewrites68.2%

              \[\leadsto x + \color{blue}{\frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(x - t\right)\right)} \]
            4. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto t \cdot \color{blue}{\left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \color{blue}{\frac{y}{z - a}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{\color{blue}{y}}{z - a}\right) \]
              4. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right) \]
              5. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{\color{blue}{z - a}}\right) \]
              6. lower--.f6451.7%

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - \color{blue}{a}}\right) \]
            6. Applied rewrites51.7%

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            7. Taylor expanded in a around 0

              \[\leadsto t \cdot \left(1 - \color{blue}{\frac{y}{z}}\right) \]
            8. Step-by-step derivation
              1. lower--.f64N/A

                \[\leadsto t \cdot \left(1 - \frac{y}{\color{blue}{z}}\right) \]
              2. lower-/.f6436.6%

                \[\leadsto t \cdot \left(1 - \frac{y}{z}\right) \]
            9. Applied rewrites36.6%

              \[\leadsto t \cdot \left(1 - \color{blue}{\frac{y}{z}}\right) \]

            if -3.1999999999999998e-28 < z < 5.4999999999999997e-144

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
              4. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
              5. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
              6. lower--.f6441.5%

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites41.5%

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              4. lift--.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              6. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              7. sub-divN/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              8. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
            6. Applied rewrites41.8%

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Taylor expanded in z around 0

              \[\leadsto \frac{t - x}{a} \cdot y \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a} \cdot y \]
              2. lower--.f6424.9%

                \[\leadsto \frac{t - x}{a} \cdot y \]
            9. Applied rewrites24.9%

              \[\leadsto \frac{t - x}{a} \cdot y \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 16: 36.0% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := \frac{t - x}{a} \cdot y\\ \mathbf{if}\;y \leq -2.5 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-182}:\\ \;\;\;\;x + \left(t - x\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\ \;\;\;\;\frac{t \cdot z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (* (/ (- t x) a) y)))
            (if (<= y -2.5e-53)
              t_1
              (if (<= y -2e-182)
                (+ x (- t x))
                (if (<= y 4e+31) (/ (* t z) (- z a)) t_1)))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((t - x) / a) * y;
          	double tmp;
          	if (y <= -2.5e-53) {
          		tmp = t_1;
          	} else if (y <= -2e-182) {
          		tmp = x + (t - x);
          	} else if (y <= 4e+31) {
          		tmp = (t * z) / (z - a);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          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 = ((t - x) / a) * y
              if (y <= (-2.5d-53)) then
                  tmp = t_1
              else if (y <= (-2d-182)) then
                  tmp = x + (t - x)
              else if (y <= 4d+31) then
                  tmp = (t * z) / (z - a)
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((t - x) / a) * y;
          	double tmp;
          	if (y <= -2.5e-53) {
          		tmp = t_1;
          	} else if (y <= -2e-182) {
          		tmp = x + (t - x);
          	} else if (y <= 4e+31) {
          		tmp = (t * z) / (z - a);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = ((t - x) / a) * y
          	tmp = 0
          	if y <= -2.5e-53:
          		tmp = t_1
          	elif y <= -2e-182:
          		tmp = x + (t - x)
          	elif y <= 4e+31:
          		tmp = (t * z) / (z - a)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(Float64(t - x) / a) * y)
          	tmp = 0.0
          	if (y <= -2.5e-53)
          		tmp = t_1;
          	elseif (y <= -2e-182)
          		tmp = Float64(x + Float64(t - x));
          	elseif (y <= 4e+31)
          		tmp = Float64(Float64(t * z) / Float64(z - a));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = ((t - x) / a) * y;
          	tmp = 0.0;
          	if (y <= -2.5e-53)
          		tmp = t_1;
          	elseif (y <= -2e-182)
          		tmp = x + (t - x);
          	elseif (y <= 4e+31)
          		tmp = (t * z) / (z - a);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.5e-53], t$95$1, If[LessEqual[y, -2e-182], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+31], N[(N[(t * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          t_1 := \frac{t - x}{a} \cdot y\\
          \mathbf{if}\;y \leq -2.5 \cdot 10^{-53}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq -2 \cdot 10^{-182}:\\
          \;\;\;\;x + \left(t - x\right)\\
          
          \mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\
          \;\;\;\;\frac{t \cdot z}{z - a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -2.5e-53 or 3.9999999999999999e31 < y

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
              4. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
              5. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
              6. lower--.f6441.5%

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites41.5%

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              4. lift--.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              6. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              7. sub-divN/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              8. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
            6. Applied rewrites41.8%

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Taylor expanded in z around 0

              \[\leadsto \frac{t - x}{a} \cdot y \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a} \cdot y \]
              2. lower--.f6424.9%

                \[\leadsto \frac{t - x}{a} \cdot y \]
            9. Applied rewrites24.9%

              \[\leadsto \frac{t - x}{a} \cdot y \]

            if -2.5e-53 < y < -2.0000000000000001e-182

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]

            if -2.0000000000000001e-182 < y < 3.9999999999999999e31

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
              2. lift-/.f64N/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
              3. mult-flipN/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} \]
              4. associate-*r*N/A

                \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}} \]
              5. *-commutativeN/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              7. frac-2negN/A

                \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto x + \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \color{blue}{\frac{-1}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              10. lift--.f64N/A

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              12. lower--.f64N/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              13. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(y - z\right)} \cdot \left(t - x\right)\right) \]
              14. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              17. lower-*.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              18. lower--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(z - y\right)} \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              19. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
              21. lower--.f6468.2%

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
            3. Applied rewrites68.2%

              \[\leadsto x + \color{blue}{\frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(x - t\right)\right)} \]
            4. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto t \cdot \color{blue}{\left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \color{blue}{\frac{y}{z - a}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{\color{blue}{y}}{z - a}\right) \]
              4. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right) \]
              5. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{\color{blue}{z - a}}\right) \]
              6. lower--.f6451.7%

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - \color{blue}{a}}\right) \]
            6. Applied rewrites51.7%

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            7. Taylor expanded in y around 0

              \[\leadsto \frac{t \cdot z}{\color{blue}{z - a}} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot z}{z - \color{blue}{a}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{t \cdot z}{z - a} \]
              3. lower--.f6421.8%

                \[\leadsto \frac{t \cdot z}{z - a} \]
            9. Applied rewrites21.8%

              \[\leadsto \frac{t \cdot z}{\color{blue}{z - a}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 17: 35.6% accurate, 0.9× speedup?

          \[\begin{array}{l} t_1 := x + \left(t - x\right)\\ \mathbf{if}\;z \leq -3500000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 110000000:\\ \;\;\;\;\frac{t - x}{a} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (+ x (- t x))))
            (if (<= z -3500000000000.0)
              t_1
              (if (<= z 110000000.0) (* (/ (- t x) a) y) t_1))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + (t - x);
          	double tmp;
          	if (z <= -3500000000000.0) {
          		tmp = t_1;
          	} else if (z <= 110000000.0) {
          		tmp = ((t - x) / a) * y;
          	} 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) :: tmp
              t_1 = x + (t - x)
              if (z <= (-3500000000000.0d0)) then
                  tmp = t_1
              else if (z <= 110000000.0d0) then
                  tmp = ((t - x) / a) * y
              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 = x + (t - x);
          	double tmp;
          	if (z <= -3500000000000.0) {
          		tmp = t_1;
          	} else if (z <= 110000000.0) {
          		tmp = ((t - x) / a) * y;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = x + (t - x)
          	tmp = 0
          	if z <= -3500000000000.0:
          		tmp = t_1
          	elif z <= 110000000.0:
          		tmp = ((t - x) / a) * y
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(x + Float64(t - x))
          	tmp = 0.0
          	if (z <= -3500000000000.0)
          		tmp = t_1;
          	elseif (z <= 110000000.0)
          		tmp = Float64(Float64(Float64(t - x) / a) * y);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = x + (t - x);
          	tmp = 0.0;
          	if (z <= -3500000000000.0)
          		tmp = t_1;
          	elseif (z <= 110000000.0)
          		tmp = ((t - x) / a) * y;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3500000000000.0], t$95$1, If[LessEqual[z, 110000000.0], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          t_1 := x + \left(t - x\right)\\
          \mathbf{if}\;z \leq -3500000000000:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 110000000:\\
          \;\;\;\;\frac{t - x}{a} \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -3.5e12 or 1.1e8 < z

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]

            if -3.5e12 < z < 1.1e8

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
              4. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
              5. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
              6. lower--.f6441.5%

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites41.5%

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              4. lift--.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              6. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              7. sub-divN/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              8. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
            6. Applied rewrites41.8%

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Taylor expanded in z around 0

              \[\leadsto \frac{t - x}{a} \cdot y \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a} \cdot y \]
              2. lower--.f6424.9%

                \[\leadsto \frac{t - x}{a} \cdot y \]
            9. Applied rewrites24.9%

              \[\leadsto \frac{t - x}{a} \cdot y \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 18: 32.1% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := \frac{t}{a - z} \cdot y\\ \mathbf{if}\;y \leq -1.62 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+50}:\\ \;\;\;\;x + \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (* (/ t (- a z)) y)))
            (if (<= y -1.62e+131)
              t_1
              (if (<= y -5.2e-11)
                (* x (/ (- y a) z))
                (if (<= y 1.45e+50) (+ x (- t x)) t_1)))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = (t / (a - z)) * y;
          	double tmp;
          	if (y <= -1.62e+131) {
          		tmp = t_1;
          	} else if (y <= -5.2e-11) {
          		tmp = x * ((y - a) / z);
          	} else if (y <= 1.45e+50) {
          		tmp = x + (t - x);
          	} 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) :: tmp
              t_1 = (t / (a - z)) * y
              if (y <= (-1.62d+131)) then
                  tmp = t_1
              else if (y <= (-5.2d-11)) then
                  tmp = x * ((y - a) / z)
              else if (y <= 1.45d+50) then
                  tmp = x + (t - x)
              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 / (a - z)) * y;
          	double tmp;
          	if (y <= -1.62e+131) {
          		tmp = t_1;
          	} else if (y <= -5.2e-11) {
          		tmp = x * ((y - a) / z);
          	} else if (y <= 1.45e+50) {
          		tmp = x + (t - x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = (t / (a - z)) * y
          	tmp = 0
          	if y <= -1.62e+131:
          		tmp = t_1
          	elif y <= -5.2e-11:
          		tmp = x * ((y - a) / z)
          	elif y <= 1.45e+50:
          		tmp = x + (t - x)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(t / Float64(a - z)) * y)
          	tmp = 0.0
          	if (y <= -1.62e+131)
          		tmp = t_1;
          	elseif (y <= -5.2e-11)
          		tmp = Float64(x * Float64(Float64(y - a) / z));
          	elseif (y <= 1.45e+50)
          		tmp = Float64(x + Float64(t - x));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = (t / (a - z)) * y;
          	tmp = 0.0;
          	if (y <= -1.62e+131)
          		tmp = t_1;
          	elseif (y <= -5.2e-11)
          		tmp = x * ((y - a) / z);
          	elseif (y <= 1.45e+50)
          		tmp = x + (t - x);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.62e+131], t$95$1, If[LessEqual[y, -5.2e-11], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+50], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          t_1 := \frac{t}{a - z} \cdot y\\
          \mathbf{if}\;y \leq -1.62 \cdot 10^{+131}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq -5.2 \cdot 10^{-11}:\\
          \;\;\;\;x \cdot \frac{y - a}{z}\\
          
          \mathbf{elif}\;y \leq 1.45 \cdot 10^{+50}:\\
          \;\;\;\;x + \left(t - x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -1.6199999999999999e131 or 1.45e50 < y

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
              4. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
              5. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
              6. lower--.f6441.5%

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites41.5%

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              3. lower-*.f6441.5%

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
              4. lift--.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              6. lift-/.f64N/A

                \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
              7. sub-divN/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              8. lower-/.f64N/A

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
              9. lift--.f6441.8%

                \[\leadsto \frac{t - x}{a - z} \cdot y \]
            6. Applied rewrites41.8%

              \[\leadsto \frac{t - x}{a - z} \cdot \color{blue}{y} \]
            7. Taylor expanded in x around 0

              \[\leadsto \frac{t}{a - z} \cdot y \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t}{a - z} \cdot y \]
              2. lower--.f6423.1%

                \[\leadsto \frac{t}{a - z} \cdot y \]
            9. Applied rewrites23.1%

              \[\leadsto \frac{t}{a - z} \cdot y \]

            if -1.6199999999999999e131 < y < -5.2000000000000001e-11

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around 0

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{\color{blue}{a}}\right) \]
              2. lower-/.f6436.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
            7. Applied rewrites36.0%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            8. Taylor expanded in z around -inf

              \[\leadsto x \cdot \frac{y - a}{\color{blue}{z}} \]
            9. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto x \cdot \frac{y - a}{z} \]
              2. lower--.f6423.6%

                \[\leadsto x \cdot \frac{y - a}{z} \]
            10. Applied rewrites23.6%

              \[\leadsto x \cdot \frac{y - a}{\color{blue}{z}} \]

            if -5.2000000000000001e-11 < y < 1.45e50

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 19: 30.7% accurate, 0.7× speedup?

          \[\begin{array}{l} t_1 := \frac{x \cdot \left(y - a\right)}{z}\\ t_2 := x + \left(t - x\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-142}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (/ (* x (- y a)) z)) (t_2 (+ x (- t x))))
            (if (<= z -6.8e-15)
              t_2
              (if (<= z -6e-169)
                t_1
                (if (<= z 5e-142) (/ (* t y) a) (if (<= z 1.85e+81) t_1 t_2))))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = (x * (y - a)) / z;
          	double t_2 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_2;
          	} else if (z <= -6e-169) {
          		tmp = t_1;
          	} else if (z <= 5e-142) {
          		tmp = (t * y) / a;
          	} else if (z <= 1.85e+81) {
          		tmp = t_1;
          	} 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 - a)) / z
              t_2 = x + (t - x)
              if (z <= (-6.8d-15)) then
                  tmp = t_2
              else if (z <= (-6d-169)) then
                  tmp = t_1
              else if (z <= 5d-142) then
                  tmp = (t * y) / a
              else if (z <= 1.85d+81) then
                  tmp = t_1
              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 - a)) / z;
          	double t_2 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_2;
          	} else if (z <= -6e-169) {
          		tmp = t_1;
          	} else if (z <= 5e-142) {
          		tmp = (t * y) / a;
          	} else if (z <= 1.85e+81) {
          		tmp = t_1;
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = (x * (y - a)) / z
          	t_2 = x + (t - x)
          	tmp = 0
          	if z <= -6.8e-15:
          		tmp = t_2
          	elif z <= -6e-169:
          		tmp = t_1
          	elif z <= 5e-142:
          		tmp = (t * y) / a
          	elif z <= 1.85e+81:
          		tmp = t_1
          	else:
          		tmp = t_2
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(x * Float64(y - a)) / z)
          	t_2 = Float64(x + Float64(t - x))
          	tmp = 0.0
          	if (z <= -6.8e-15)
          		tmp = t_2;
          	elseif (z <= -6e-169)
          		tmp = t_1;
          	elseif (z <= 5e-142)
          		tmp = Float64(Float64(t * y) / a);
          	elseif (z <= 1.85e+81)
          		tmp = t_1;
          	else
          		tmp = t_2;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = (x * (y - a)) / z;
          	t_2 = x + (t - x);
          	tmp = 0.0;
          	if (z <= -6.8e-15)
          		tmp = t_2;
          	elseif (z <= -6e-169)
          		tmp = t_1;
          	elseif (z <= 5e-142)
          		tmp = (t * y) / a;
          	elseif (z <= 1.85e+81)
          		tmp = t_1;
          	else
          		tmp = t_2;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$2, If[LessEqual[z, -6e-169], t$95$1, If[LessEqual[z, 5e-142], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.85e+81], t$95$1, t$95$2]]]]]]
          
          \begin{array}{l}
          t_1 := \frac{x \cdot \left(y - a\right)}{z}\\
          t_2 := x + \left(t - x\right)\\
          \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 5 \cdot 10^{-142}:\\
          \;\;\;\;\frac{t \cdot y}{a}\\
          
          \mathbf{elif}\;z \leq 1.85 \cdot 10^{+81}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_2\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -6.8000000000000001e-15 or 1.85e81 < z

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]

            if -6.8000000000000001e-15 < z < -5.9999999999999998e-169 or 5.0000000000000002e-142 < z < 1.85e81

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around -inf

              \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
              3. lower--.f6420.0%

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
            7. Applied rewrites20.0%

              \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]

            if -5.9999999999999998e-169 < z < 5.0000000000000002e-142

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
              2. lift-/.f64N/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
              3. mult-flipN/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} \]
              4. associate-*r*N/A

                \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}} \]
              5. *-commutativeN/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              7. frac-2negN/A

                \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto x + \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \color{blue}{\frac{-1}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              10. lift--.f64N/A

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              12. lower--.f64N/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              13. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(y - z\right)} \cdot \left(t - x\right)\right) \]
              14. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              17. lower-*.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              18. lower--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(z - y\right)} \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              19. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
              21. lower--.f6468.2%

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
            3. Applied rewrites68.2%

              \[\leadsto x + \color{blue}{\frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(x - t\right)\right)} \]
            4. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto t \cdot \color{blue}{\left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \color{blue}{\frac{y}{z - a}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{\color{blue}{y}}{z - a}\right) \]
              4. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right) \]
              5. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{\color{blue}{z - a}}\right) \]
              6. lower--.f6451.7%

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - \color{blue}{a}}\right) \]
            6. Applied rewrites51.7%

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            7. Taylor expanded in z around 0

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot y}{a} \]
              2. lower-*.f6416.5%

                \[\leadsto \frac{t \cdot y}{a} \]
            9. Applied rewrites16.5%

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 20: 30.6% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := x + \left(t - x\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;z \leq 0.0024:\\ \;\;\;\;\frac{t \cdot y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (+ x (- t x))))
            (if (<= z -6.8e-15)
              t_1
              (if (<= z -6e-169)
                (/ (* x (- y a)) z)
                (if (<= z 0.0024) (/ (* t y) (- a z)) t_1)))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_1;
          	} else if (z <= -6e-169) {
          		tmp = (x * (y - a)) / z;
          	} else if (z <= 0.0024) {
          		tmp = (t * y) / (a - z);
          	} 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) :: tmp
              t_1 = x + (t - x)
              if (z <= (-6.8d-15)) then
                  tmp = t_1
              else if (z <= (-6d-169)) then
                  tmp = (x * (y - a)) / z
              else if (z <= 0.0024d0) then
                  tmp = (t * y) / (a - z)
              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 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_1;
          	} else if (z <= -6e-169) {
          		tmp = (x * (y - a)) / z;
          	} else if (z <= 0.0024) {
          		tmp = (t * y) / (a - z);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = x + (t - x)
          	tmp = 0
          	if z <= -6.8e-15:
          		tmp = t_1
          	elif z <= -6e-169:
          		tmp = (x * (y - a)) / z
          	elif z <= 0.0024:
          		tmp = (t * y) / (a - z)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(x + Float64(t - x))
          	tmp = 0.0
          	if (z <= -6.8e-15)
          		tmp = t_1;
          	elseif (z <= -6e-169)
          		tmp = Float64(Float64(x * Float64(y - a)) / z);
          	elseif (z <= 0.0024)
          		tmp = Float64(Float64(t * y) / Float64(a - z));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = x + (t - x);
          	tmp = 0.0;
          	if (z <= -6.8e-15)
          		tmp = t_1;
          	elseif (z <= -6e-169)
          		tmp = (x * (y - a)) / z;
          	elseif (z <= 0.0024)
          		tmp = (t * y) / (a - z);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$1, If[LessEqual[z, -6e-169], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.0024], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          t_1 := x + \left(t - x\right)\\
          \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq -6 \cdot 10^{-169}:\\
          \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
          
          \mathbf{elif}\;z \leq 0.0024:\\
          \;\;\;\;\frac{t \cdot y}{a - z}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -6.8000000000000001e-15 or 0.0023999999999999998 < z

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]

            if -6.8000000000000001e-15 < z < -5.9999999999999998e-169

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around -inf

              \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
              3. lower--.f6420.0%

                \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
            7. Applied rewrites20.0%

              \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]

            if -5.9999999999999998e-169 < z < 0.0023999999999999998

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in y around inf

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
              2. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
              4. lower--.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
              5. lower-/.f64N/A

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
              6. lower--.f6441.5%

                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites41.5%

              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
            5. Taylor expanded in x around 0

              \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot y}{a - \color{blue}{z}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{t \cdot y}{a - z} \]
              3. lower--.f6421.3%

                \[\leadsto \frac{t \cdot y}{a - z} \]
            7. Applied rewrites21.3%

              \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 21: 29.7% accurate, 0.9× speedup?

          \[\begin{array}{l} t_1 := x \cdot \frac{y - a}{z}\\ \mathbf{if}\;x \leq -6 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\ \;\;\;\;x + \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (* x (/ (- y a) z))))
            (if (<= x -6e+20) t_1 (if (<= x 2.8e+30) (+ x (- t x)) t_1))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = x * ((y - a) / z);
          	double tmp;
          	if (x <= -6e+20) {
          		tmp = t_1;
          	} else if (x <= 2.8e+30) {
          		tmp = x + (t - x);
          	} 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) :: tmp
              t_1 = x * ((y - a) / z)
              if (x <= (-6d+20)) then
                  tmp = t_1
              else if (x <= 2.8d+30) then
                  tmp = x + (t - x)
              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 = x * ((y - a) / z);
          	double tmp;
          	if (x <= -6e+20) {
          		tmp = t_1;
          	} else if (x <= 2.8e+30) {
          		tmp = x + (t - x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = x * ((y - a) / z)
          	tmp = 0
          	if x <= -6e+20:
          		tmp = t_1
          	elif x <= 2.8e+30:
          		tmp = x + (t - x)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(x * Float64(Float64(y - a) / z))
          	tmp = 0.0
          	if (x <= -6e+20)
          		tmp = t_1;
          	elseif (x <= 2.8e+30)
          		tmp = Float64(x + Float64(t - x));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = x * ((y - a) / z);
          	tmp = 0.0;
          	if (x <= -6e+20)
          		tmp = t_1;
          	elseif (x <= 2.8e+30)
          		tmp = x + (t - x);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+20], t$95$1, If[LessEqual[x, 2.8e+30], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          t_1 := x \cdot \frac{y - a}{z}\\
          \mathbf{if}\;x \leq -6 \cdot 10^{+20}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\
          \;\;\;\;x + \left(t - x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -6e20 or 2.7999999999999998e30 < x

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around 0

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{\color{blue}{a}}\right) \]
              2. lower-/.f6436.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
            7. Applied rewrites36.0%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            8. Taylor expanded in z around -inf

              \[\leadsto x \cdot \frac{y - a}{\color{blue}{z}} \]
            9. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto x \cdot \frac{y - a}{z} \]
              2. lower--.f6423.6%

                \[\leadsto x \cdot \frac{y - a}{z} \]
            10. Applied rewrites23.6%

              \[\leadsto x \cdot \frac{y - a}{\color{blue}{z}} \]

            if -6e20 < x < 2.7999999999999998e30

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 22: 28.6% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := x + \left(t - x\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-170}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \leq 0.0024:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (+ x (- t x))))
            (if (<= z -6.8e-15)
              t_1
              (if (<= z -9e-170)
                (/ (* x y) z)
                (if (<= z 0.0024) (/ (* t y) a) t_1)))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_1;
          	} else if (z <= -9e-170) {
          		tmp = (x * y) / z;
          	} else if (z <= 0.0024) {
          		tmp = (t * y) / a;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          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 + (t - x)
              if (z <= (-6.8d-15)) then
                  tmp = t_1
              else if (z <= (-9d-170)) then
                  tmp = (x * y) / z
              else if (z <= 0.0024d0) then
                  tmp = (t * y) / a
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = x + (t - x);
          	double tmp;
          	if (z <= -6.8e-15) {
          		tmp = t_1;
          	} else if (z <= -9e-170) {
          		tmp = (x * y) / z;
          	} else if (z <= 0.0024) {
          		tmp = (t * y) / a;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = x + (t - x)
          	tmp = 0
          	if z <= -6.8e-15:
          		tmp = t_1
          	elif z <= -9e-170:
          		tmp = (x * y) / z
          	elif z <= 0.0024:
          		tmp = (t * y) / a
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(x + Float64(t - x))
          	tmp = 0.0
          	if (z <= -6.8e-15)
          		tmp = t_1;
          	elseif (z <= -9e-170)
          		tmp = Float64(Float64(x * y) / z);
          	elseif (z <= 0.0024)
          		tmp = Float64(Float64(t * y) / a);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = x + (t - x);
          	tmp = 0.0;
          	if (z <= -6.8e-15)
          		tmp = t_1;
          	elseif (z <= -9e-170)
          		tmp = (x * y) / z;
          	elseif (z <= 0.0024)
          		tmp = (t * y) / a;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-15], t$95$1, If[LessEqual[z, -9e-170], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.0024], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          t_1 := x + \left(t - x\right)\\
          \mathbf{if}\;z \leq -6.8 \cdot 10^{-15}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq -9 \cdot 10^{-170}:\\
          \;\;\;\;\frac{x \cdot y}{z}\\
          
          \mathbf{elif}\;z \leq 0.0024:\\
          \;\;\;\;\frac{t \cdot y}{a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -6.8000000000000001e-15 or 0.0023999999999999998 < z

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]

            if -6.8000000000000001e-15 < z < -9e-170

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around 0

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{\color{blue}{a}}\right) \]
              2. lower-/.f6436.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
            7. Applied rewrites36.0%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            8. Taylor expanded in a around 0

              \[\leadsto \frac{x \cdot y}{\color{blue}{z}} \]
            9. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{x \cdot y}{z} \]
              2. lower-*.f6416.7%

                \[\leadsto \frac{x \cdot y}{z} \]
            10. Applied rewrites16.7%

              \[\leadsto \frac{x \cdot y}{\color{blue}{z}} \]

            if -9e-170 < z < 0.0023999999999999998

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
              2. lift-/.f64N/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
              3. mult-flipN/A

                \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\left(t - x\right) \cdot \frac{1}{a - z}\right)} \]
              4. associate-*r*N/A

                \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right) \cdot \frac{1}{a - z}} \]
              5. *-commutativeN/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto x + \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} \]
              7. frac-2negN/A

                \[\leadsto x + \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto x + \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \color{blue}{\frac{-1}{\mathsf{neg}\left(\left(a - z\right)\right)}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              10. lift--.f64N/A

                \[\leadsto x + \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              11. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              12. lower--.f64N/A

                \[\leadsto x + \frac{-1}{\color{blue}{z - a}} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right) \]
              13. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(y - z\right)} \cdot \left(t - x\right)\right) \]
              14. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(z - y\right)\right)\right)} \cdot \left(t - x\right)\right) \]
              15. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - y\right) \cdot \left(t - x\right)\right)\right)} \]
              16. distribute-rgt-neg-outN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              17. lower-*.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \color{blue}{\left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right)} \]
              18. lower--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\color{blue}{\left(z - y\right)} \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              19. lift--.f64N/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)\right)\right) \]
              20. sub-negate-revN/A

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
              21. lower--.f6468.2%

                \[\leadsto x + \frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \color{blue}{\left(x - t\right)}\right) \]
            3. Applied rewrites68.2%

              \[\leadsto x + \color{blue}{\frac{-1}{z - a} \cdot \left(\left(z - y\right) \cdot \left(x - t\right)\right)} \]
            4. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto t \cdot \color{blue}{\left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \color{blue}{\frac{y}{z - a}}\right) \]
              3. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{\color{blue}{y}}{z - a}\right) \]
              4. lower--.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right) \]
              5. lower-/.f64N/A

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{\color{blue}{z - a}}\right) \]
              6. lower--.f6451.7%

                \[\leadsto t \cdot \left(\frac{z}{z - a} - \frac{y}{z - \color{blue}{a}}\right) \]
            6. Applied rewrites51.7%

              \[\leadsto \color{blue}{t \cdot \left(\frac{z}{z - a} - \frac{y}{z - a}\right)} \]
            7. Taylor expanded in z around 0

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot y}{a} \]
              2. lower-*.f6416.5%

                \[\leadsto \frac{t \cdot y}{a} \]
            9. Applied rewrites16.5%

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 23: 26.3% accurate, 1.0× speedup?

          \[\begin{array}{l} t_1 := \frac{x \cdot y}{z}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\ \;\;\;\;x + \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (/ (* x y) z)))
            (if (<= x -1.05e+83) t_1 (if (<= x 2.8e+30) (+ x (- t x)) t_1))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = (x * y) / z;
          	double tmp;
          	if (x <= -1.05e+83) {
          		tmp = t_1;
          	} else if (x <= 2.8e+30) {
          		tmp = x + (t - x);
          	} 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) :: tmp
              t_1 = (x * y) / z
              if (x <= (-1.05d+83)) then
                  tmp = t_1
              else if (x <= 2.8d+30) then
                  tmp = x + (t - x)
              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 = (x * y) / z;
          	double tmp;
          	if (x <= -1.05e+83) {
          		tmp = t_1;
          	} else if (x <= 2.8e+30) {
          		tmp = x + (t - x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = (x * y) / z
          	tmp = 0
          	if x <= -1.05e+83:
          		tmp = t_1
          	elif x <= 2.8e+30:
          		tmp = x + (t - x)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(x * y) / z)
          	tmp = 0.0
          	if (x <= -1.05e+83)
          		tmp = t_1;
          	elseif (x <= 2.8e+30)
          		tmp = Float64(x + Float64(t - x));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = (x * y) / z;
          	tmp = 0.0;
          	if (x <= -1.05e+83)
          		tmp = t_1;
          	elseif (x <= 2.8e+30)
          		tmp = x + (t - x);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[x, -1.05e+83], t$95$1, If[LessEqual[x, 2.8e+30], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          t_1 := \frac{x \cdot y}{z}\\
          \mathbf{if}\;x \leq -1.05 \cdot 10^{+83}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 2.8 \cdot 10^{+30}:\\
          \;\;\;\;x + \left(t - x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -1.05e83 or 2.7999999999999998e30 < x

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
              2. lower-+.f64N/A

                \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \frac{y - z}{a - z}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y - z}{a - z}}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a - z}}\right) \]
              5. lower--.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{\color{blue}{a} - z}\right) \]
              6. lower--.f6443.2%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y - z}{a - \color{blue}{z}}\right) \]
            4. Applied rewrites43.2%

              \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y - z}{a - z}\right)} \]
            5. Taylor expanded in z around 0

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{\color{blue}{a}}\right) \]
              2. lower-/.f6436.0%

                \[\leadsto x \cdot \left(1 + -1 \cdot \frac{y}{a}\right) \]
            7. Applied rewrites36.0%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{\frac{y}{a}}\right) \]
            8. Taylor expanded in a around 0

              \[\leadsto \frac{x \cdot y}{\color{blue}{z}} \]
            9. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{x \cdot y}{z} \]
              2. lower-*.f6416.7%

                \[\leadsto \frac{x \cdot y}{z} \]
            10. Applied rewrites16.7%

              \[\leadsto \frac{x \cdot y}{\color{blue}{z}} \]

            if -1.05e83 < x < 2.7999999999999998e30

            1. Initial program 79.6%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Taylor expanded in z around inf

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
            3. Step-by-step derivation
              1. lower--.f6419.7%

                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
            4. Applied rewrites19.7%

              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 24: 19.7% accurate, 4.1× speedup?

          \[x + \left(t - x\right) \]
          (FPCore (x y z t a)
            :precision binary64
            (+ x (- t x)))
          double code(double x, double y, double z, double t, double a) {
          	return x + (t - x);
          }
          
          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 + (t - x)
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return x + (t - x);
          }
          
          def code(x, y, z, t, a):
          	return x + (t - x)
          
          function code(x, y, z, t, a)
          	return Float64(x + Float64(t - x))
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = x + (t - x);
          end
          
          code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
          
          x + \left(t - x\right)
          
          Derivation
          1. Initial program 79.6%

            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
          2. Taylor expanded in z around inf

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Step-by-step derivation
            1. lower--.f6419.7%

              \[\leadsto x + \left(t - \color{blue}{x}\right) \]
          4. Applied rewrites19.7%

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          5. Add Preprocessing

          Alternative 25: 2.8% accurate, 4.8× speedup?

          \[\left(-x\right) + x \]
          (FPCore (x y z t a)
            :precision binary64
            (+ (- x) x))
          double code(double x, double y, double z, double t, double a) {
          	return -x + x;
          }
          
          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 + x
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return -x + x;
          }
          
          def code(x, y, z, t, a):
          	return -x + x
          
          function code(x, y, z, t, a)
          	return Float64(Float64(-x) + x)
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = -x + x;
          end
          
          code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
          
          \left(-x\right) + x
          
          Derivation
          1. Initial program 79.6%

            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
          2. Taylor expanded in z around inf

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Step-by-step derivation
            1. lower--.f6419.7%

              \[\leadsto x + \left(t - \color{blue}{x}\right) \]
          4. Applied rewrites19.7%

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          5. Taylor expanded in x around inf

            \[\leadsto x + -1 \cdot \color{blue}{x} \]
          6. Step-by-step derivation
            1. lower-*.f642.8%

              \[\leadsto x + -1 \cdot x \]
          7. Applied rewrites2.8%

            \[\leadsto x + -1 \cdot \color{blue}{x} \]
          8. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{x + -1 \cdot x} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{-1 \cdot x + x} \]
            3. lower-+.f642.8%

              \[\leadsto \color{blue}{-1 \cdot x + x} \]
            4. lift-*.f64N/A

              \[\leadsto -1 \cdot x + x \]
            5. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(x\right)\right) + x \]
            6. lower-neg.f642.8%

              \[\leadsto \left(-x\right) + x \]
          9. Applied rewrites2.8%

            \[\leadsto \color{blue}{\left(-x\right) + x} \]
          10. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025258 
          (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)))))