Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.6% → 95.3%
Time: 23.4s
Alternatives: 15
Speedup: 0.3×

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

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

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

\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\ \;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(x - t\right) \cdot \left(\frac{-1}{a - z} \cdot \left(y - z\right)\right)\\ \end{array} \]
(FPCore (x y z t a)
  :precision binary64
  (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
  (if (<=
       t_1
       -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
    (+ x (* (- x t) (/ (- z y) (- a z))))
    (if (<= t_1 0)
      (+ t (/ (- a y) (/ z (- t x))))
      (+ x (* (- x t) (* (/ -1 (- a z)) (- y z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -4e-301) {
		tmp = x + ((x - t) * ((z - y) / (a - z)));
	} else if (t_1 <= 0.0) {
		tmp = t + ((a - y) / (z / (t - x)));
	} else {
		tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if (t_1 <= (-4d-301)) then
        tmp = x + ((x - t) * ((z - y) / (a - z)))
    else if (t_1 <= 0.0d0) then
        tmp = t + ((a - y) / (z / (t - x)))
    else
        tmp = x + ((x - t) * (((-1.0d0) / (a - z)) * (y - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -4e-301) {
		tmp = x + ((x - t) * ((z - y) / (a - z)));
	} else if (t_1 <= 0.0) {
		tmp = t + ((a - y) / (z / (t - x)));
	} else {
		tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -4e-301:
		tmp = x + ((x - t) * ((z - y) / (a - z)))
	elif t_1 <= 0.0:
		tmp = t + ((a - y) / (z / (t - x)))
	else:
		tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= -4e-301)
		tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(z - y) / Float64(a - z))));
	elseif (t_1 <= 0.0)
		tmp = Float64(t + Float64(Float64(a - y) / Float64(z / Float64(t - x))));
	else
		tmp = Float64(x + Float64(Float64(x - t) * Float64(Float64(-1.0 / Float64(a - z)) * Float64(y - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_1 <= -4e-301)
		tmp = x + ((x - t) * ((z - y) / (a - z)));
	elseif (t_1 <= 0.0)
		tmp = t + ((a - y) / (z / (t - x)));
	else
		tmp = x + ((x - t) * ((-1.0 / (a - z)) * (y - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0], N[(t + N[(N[(a - y), $MachinePrecision] / N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x - t), $MachinePrecision] * N[(N[(-1 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a - z}\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\

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


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

    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--.f6483.6%

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

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

    if -4.0000000000000003e-301 < (+.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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
    3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \frac{\left(a - y\right) \cdot \left(t - x\right)}{z} \]
      14. div-flip-revN/A

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

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

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

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

        \[\leadsto t + \frac{1}{\frac{\frac{z}{t - x}}{\color{blue}{a - y}}} \]
      19. div-flip-revN/A

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

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

        \[\leadsto t + \frac{a - y}{\frac{z}{\color{blue}{t - x}}} \]
      22. lift--.f6452.8%

        \[\leadsto t + \frac{a - y}{\frac{z}{t - \color{blue}{x}}} \]
    8. Applied rewrites52.8%

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

    if 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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.3% 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 \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\ \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
       -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
    t_1
    (if (<= t_2 0) (+ t (/ (- a y) (/ z (- t x)))) 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-301) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t + ((a - y) / (z / (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) :: 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-301)) then
        tmp = t_1
    else if (t_2 <= 0.0d0) then
        tmp = t + ((a - y) / (z / (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 + ((x - t) * ((z - y) / (a - z)));
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -4e-301) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t + ((a - y) / (z / (t - x)));
	} 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-301:
		tmp = t_1
	elif t_2 <= 0.0:
		tmp = t + ((a - y) / (z / (t - x)))
	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-301)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = Float64(t + Float64(Float64(a - y) / Float64(z / Float64(t - x))));
	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-301)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = t + ((a - y) / (z / (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[(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, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], t$95$1, If[LessEqual[t$95$2, 0], N[(t + N[(N[(a - y), $MachinePrecision] / N[(z / N[(t - x), $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 \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t + \frac{a - y}{\frac{z}{t - x}}\\

\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)))) < -4.0000000000000003e-301 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--.f6483.6%

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

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

    if -4.0000000000000003e-301 < (+.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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
    3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \frac{\left(a - y\right) \cdot \left(t - x\right)}{z} \]
      14. div-flip-revN/A

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

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

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

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

        \[\leadsto t + \frac{1}{\frac{\frac{z}{t - x}}{\color{blue}{a - y}}} \]
      19. div-flip-revN/A

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

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

        \[\leadsto t + \frac{a - y}{\frac{z}{\color{blue}{t - x}}} \]
      22. lift--.f6452.8%

        \[\leadsto t + \frac{a - y}{\frac{z}{t - \color{blue}{x}}} \]
    8. Applied rewrites52.8%

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

Alternative 3: 95.2% 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 \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\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
       -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624)
    t_1
    (if (<= t_2 0) (- t (* (/ (- t x) z) (- y a))) 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-301) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t - (((t - x) / z) * (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) :: 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-301)) then
        tmp = t_1
    else if (t_2 <= 0.0d0) then
        tmp = t - (((t - x) / z) * (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 + ((x - t) * ((z - y) / (a - z)));
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -4e-301) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t - (((t - x) / z) * (y - a));
	} 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-301:
		tmp = t_1
	elif t_2 <= 0.0:
		tmp = t - (((t - x) / z) * (y - a))
	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-301)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a)));
	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-301)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = t - (((t - x) / z) * (y - a));
	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, -4825645764048353/12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624], t$95$1, If[LessEqual[t$95$2, 0], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $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 \frac{-4825645764048353}{12064114410120881697684249086315471354100504503497011563593230129923244688987454586741947156276531487416450850028801674329627080999958126358211839195533902044386710183415792069701368078118158360793576698212191168580174892152827542937880954483101341506291035205862448784848059094859987648259778470316291228729945882624}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\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)))) < -4.0000000000000003e-301 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--.f6483.6%

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

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

    if -4.0000000000000003e-301 < (+.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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
    3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 78.5% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq -8999999999999999844710088704:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2050000000000:\\
\;\;\;\;t\_1\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.38e134 or 2.05e12 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
    3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.38e134 < z < -8.9999999999999998e27 or 9.0000000000000005e-126 < z < 2.05e12

    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 rewrites64.3%

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

      if -8.9999999999999998e27 < z < 9.0000000000000005e-126

      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.7%

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

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

    Alternative 5: 78.4% accurate, 0.7× speedup?

    \[\begin{array}{l} t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\ \mathbf{if}\;z \leq -30000000000000000948382466048:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq \frac{520997997575091}{2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976}:\\ \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;z \leq 2050000000000:\\ \;\;\;\;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 t) (/ (- y a) z)))))
      (if (<= z -30000000000000000948382466048)
        t_1
        (if (<=
             z
             520997997575091/2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976)
          (+ x (/ (* y (- t x)) (- a z)))
          (if (<= z 2050000000000) (+ 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 - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -3e+28) {
    		tmp = t_1;
    	} else if (z <= 1.75e-124) {
    		tmp = x + ((y * (t - x)) / (a - z));
    	} else if (z <= 2050000000000.0) {
    		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 - t) * ((y - a) / z))
        if (z <= (-3d+28)) then
            tmp = t_1
        else if (z <= 1.75d-124) then
            tmp = x + ((y * (t - x)) / (a - z))
        else if (z <= 2050000000000.0d0) 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 - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -3e+28) {
    		tmp = t_1;
    	} else if (z <= 1.75e-124) {
    		tmp = x + ((y * (t - x)) / (a - z));
    	} else if (z <= 2050000000000.0) {
    		tmp = x + ((t * (y - z)) / (a - z));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = t + ((x - t) * ((y - a) / z))
    	tmp = 0
    	if z <= -3e+28:
    		tmp = t_1
    	elif z <= 1.75e-124:
    		tmp = x + ((y * (t - x)) / (a - z))
    	elif z <= 2050000000000.0:
    		tmp = x + ((t * (y - z)) / (a - z))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z)))
    	tmp = 0.0
    	if (z <= -3e+28)
    		tmp = t_1;
    	elseif (z <= 1.75e-124)
    		tmp = Float64(x + Float64(Float64(y * Float64(t - x)) / Float64(a - z)));
    	elseif (z <= 2050000000000.0)
    		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 - t) * ((y - a) / z));
    	tmp = 0.0;
    	if (z <= -3e+28)
    		tmp = t_1;
    	elseif (z <= 1.75e-124)
    		tmp = x + ((y * (t - x)) / (a - z));
    	elseif (z <= 2050000000000.0)
    		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[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -30000000000000000948382466048], t$95$1, If[LessEqual[z, 520997997575091/2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976], N[(x + N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000000], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
    \mathbf{if}\;z \leq -30000000000000000948382466048:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq \frac{520997997575091}{2977131414714805823690030317109266572712515013375254774912983855843898524112477893944078543723575564536883288499266264815757728270805630976}:\\
    \;\;\;\;x + \frac{y \cdot \left(t - x\right)}{a - z}\\
    
    \mathbf{elif}\;z \leq 2050000000000:\\
    \;\;\;\;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 z < -3.0000000000000001e28 or 2.05e12 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.0000000000000001e28 < z < 1.7499999999999999e-124

      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.7%

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

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

      if 1.7499999999999999e-124 < z < 2.05e12

      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--.f6455.5%

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

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

    Alternative 6: 75.8% accurate, 0.6× speedup?

    \[\begin{array}{l} t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\ t_2 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\ \mathbf{if}\;z \leq -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq \frac{-6902436815285787}{3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq \frac{6787859625549757}{23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 2050000000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ x (/ (* t (- y z)) (- a z))))
           (t_2 (+ t (* (- x t) (/ (- y a) z)))))
      (if (<=
           z
           -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064)
        t_2
        (if (<=
             z
             -6902436815285787/3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112)
          t_1
          (if (<=
               z
               6787859625549757/23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808)
            (+ x (* (- t x) (/ y a)))
            (if (<= z 2050000000000) t_1 t_2))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = x + ((t * (y - z)) / (a - z));
    	double t_2 = t + ((x - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -8.6e+133) {
    		tmp = t_2;
    	} else if (z <= -2.12e-222) {
    		tmp = t_1;
    	} else if (z <= 2.85e-124) {
    		tmp = x + ((t - x) * (y / a));
    	} else if (z <= 2050000000000.0) {
    		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 + ((t * (y - z)) / (a - z))
        t_2 = t + ((x - t) * ((y - a) / z))
        if (z <= (-8.6d+133)) then
            tmp = t_2
        else if (z <= (-2.12d-222)) then
            tmp = t_1
        else if (z <= 2.85d-124) then
            tmp = x + ((t - x) * (y / a))
        else if (z <= 2050000000000.0d0) 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 + ((t * (y - z)) / (a - z));
    	double t_2 = t + ((x - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -8.6e+133) {
    		tmp = t_2;
    	} else if (z <= -2.12e-222) {
    		tmp = t_1;
    	} else if (z <= 2.85e-124) {
    		tmp = x + ((t - x) * (y / a));
    	} else if (z <= 2050000000000.0) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = x + ((t * (y - z)) / (a - z))
    	t_2 = t + ((x - t) * ((y - a) / z))
    	tmp = 0
    	if z <= -8.6e+133:
    		tmp = t_2
    	elif z <= -2.12e-222:
    		tmp = t_1
    	elif z <= 2.85e-124:
    		tmp = x + ((t - x) * (y / a))
    	elif z <= 2050000000000.0:
    		tmp = t_1
    	else:
    		tmp = t_2
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z)))
    	t_2 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z)))
    	tmp = 0.0
    	if (z <= -8.6e+133)
    		tmp = t_2;
    	elseif (z <= -2.12e-222)
    		tmp = t_1;
    	elseif (z <= 2.85e-124)
    		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
    	elseif (z <= 2050000000000.0)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = x + ((t * (y - z)) / (a - z));
    	t_2 = t + ((x - t) * ((y - a) / z));
    	tmp = 0.0;
    	if (z <= -8.6e+133)
    		tmp = t_2;
    	elseif (z <= -2.12e-222)
    		tmp = t_1;
    	elseif (z <= 2.85e-124)
    		tmp = x + ((t - x) * (y / a));
    	elseif (z <= 2050000000000.0)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	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]}, Block[{t$95$2 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064], t$95$2, If[LessEqual[z, -6902436815285787/3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112], t$95$1, If[LessEqual[z, 6787859625549757/23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000000], t$95$1, t$95$2]]]]]]
    
    \begin{array}{l}
    t_1 := x + \frac{t \cdot \left(y - z\right)}{a - z}\\
    t_2 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
    \mathbf{if}\;z \leq -85999999999999998896126747031913950778816040297344791989994017316795973699655221479323918150864890160471663734042053387896069831000064:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq \frac{-6902436815285787}{3255866422304616344765552632188114158762089024568314531443485259650408807528140659922574316831813618526821245406949824436469141432675471230646169947427163108444901161872077421124549944292877941762189949285100879873872435565174053364826112}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq \frac{6787859625549757}{23817051317718446589520242536874132581700120107002038199303870846751188192899823151552628349788604516295066307994130118526061826166445047808}:\\
    \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
    
    \mathbf{elif}\;z \leq 2050000000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -8.5999999999999999e133 or 2.05e12 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -8.5999999999999999e133 < z < -2.1200000000000001e-222 or 2.8499999999999999e-124 < z < 2.05e12

      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--.f6455.5%

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

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

      if -2.1200000000000001e-222 < z < 2.8499999999999999e-124

      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.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x + \left(t - x\right) \cdot \frac{y}{\color{blue}{a}} \]
        10. lower-/.f6447.8%

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

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

    Alternative 7: 74.3% accurate, 0.8× speedup?

    \[\begin{array}{l} t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\ \mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ t (* (- x t) (/ (- y a) z)))))
      (if (<=
           z
           -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
        t_1
        (if (<=
             z
             3266710722441009/340282366920938463463374607431768211456)
          (+ x (* (- t x) (/ y a)))
          t_1))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = t + ((x - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -4.2e-68) {
    		tmp = t_1;
    	} else if (z <= 9.6e-24) {
    		tmp = x + ((t - x) * (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 = t + ((x - t) * ((y - a) / z))
        if (z <= (-4.2d-68)) then
            tmp = t_1
        else if (z <= 9.6d-24) then
            tmp = x + ((t - x) * (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 = t + ((x - t) * ((y - a) / z));
    	double tmp;
    	if (z <= -4.2e-68) {
    		tmp = t_1;
    	} else if (z <= 9.6e-24) {
    		tmp = x + ((t - x) * (y / a));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = t + ((x - t) * ((y - a) / z))
    	tmp = 0
    	if z <= -4.2e-68:
    		tmp = t_1
    	elif z <= 9.6e-24:
    		tmp = x + ((t - x) * (y / a))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(t + Float64(Float64(x - t) * Float64(Float64(y - a) / z)))
    	tmp = 0.0
    	if (z <= -4.2e-68)
    		tmp = t_1;
    	elseif (z <= 9.6e-24)
    		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = t + ((x - t) * ((y - a) / z));
    	tmp = 0.0;
    	if (z <= -4.2e-68)
    		tmp = t_1;
    	elseif (z <= 9.6e-24)
    		tmp = x + ((t - x) * (y / a));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 3266710722441009/340282366920938463463374607431768211456], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    t_1 := t + \left(x - t\right) \cdot \frac{y - a}{z}\\
    \mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\
    \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.2000000000000002e-68 or 9.5999999999999993e-24 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.2000000000000002e-68 < z < 9.5999999999999993e-24

      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.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x + \left(t - x\right) \cdot \frac{y}{\color{blue}{a}} \]
        10. lower-/.f6447.8%

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

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

    Alternative 8: 70.2% accurate, 0.7× speedup?

    \[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t}{a}\\ \mathbf{if}\;a \leq -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq \frac{-2676089423823675}{5575186299632655785383929568162090376495104}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352:\\ \;\;\;\;t + \left(x - t\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ x (* (- y z) (/ t a)))))
      (if (<=
           a
           -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608)
        t_1
        (if (<=
             a
             -2676089423823675/5575186299632655785383929568162090376495104)
          (+ x (* (- t x) (/ y a)))
          (if (<=
               a
               3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352)
            (+ t (* (- x t) (/ 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 <= -6.2e+173) {
    		tmp = t_1;
    	} else if (a <= -4.8e-28) {
    		tmp = x + ((t - x) * (y / a));
    	} else if (a <= 3.3e+120) {
    		tmp = t + ((x - t) * (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 <= (-6.2d+173)) then
            tmp = t_1
        else if (a <= (-4.8d-28)) then
            tmp = x + ((t - x) * (y / a))
        else if (a <= 3.3d+120) then
            tmp = t + ((x - t) * (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 <= -6.2e+173) {
    		tmp = t_1;
    	} else if (a <= -4.8e-28) {
    		tmp = x + ((t - x) * (y / a));
    	} else if (a <= 3.3e+120) {
    		tmp = t + ((x - t) * (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 <= -6.2e+173:
    		tmp = t_1
    	elif a <= -4.8e-28:
    		tmp = x + ((t - x) * (y / a))
    	elif a <= 3.3e+120:
    		tmp = t + ((x - t) * (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 <= -6.2e+173)
    		tmp = t_1;
    	elseif (a <= -4.8e-28)
    		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
    	elseif (a <= 3.3e+120)
    		tmp = Float64(t + Float64(Float64(x - t) * 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 <= -6.2e+173)
    		tmp = t_1;
    	elseif (a <= -4.8e-28)
    		tmp = x + ((t - x) * (y / a));
    	elseif (a <= 3.3e+120)
    		tmp = t + ((x - t) * (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, -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608], t$95$1, If[LessEqual[a, -2676089423823675/5575186299632655785383929568162090376495104], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352], N[(t + N[(N[(x - t), $MachinePrecision] * 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 -620000000000000003212457350491329463065743578269686069966198026144487760686059902922307079391982416738548459206260587836559484403366779647513569787150099426184693122343108608:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;a \leq \frac{-2676089423823675}{5575186299632655785383929568162090376495104}:\\
    \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
    
    \mathbf{elif}\;a \leq 3299999999999999905342712846524970004371795945284041350065477064438034921550654301697269184162914950315529134220983140352:\\
    \;\;\;\;t + \left(x - t\right) \cdot \frac{y}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if a < -6.2e173 or 3.2999999999999999e120 < 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 rewrites64.3%

          \[\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 rewrites43.5%

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

          if -6.2e173 < a < -4.8000000000000004e-28

          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.6%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \left(t - x\right) \cdot \frac{y}{\color{blue}{a}} \]
            10. lower-/.f6447.8%

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

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

          if -4.8000000000000004e-28 < a < 3.2999999999999999e120

          1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(x - t\right) \cdot \frac{y}{z} \]
          9. Applied rewrites49.5%

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

        Alternative 9: 69.1% accurate, 0.8× speedup?

        \[\begin{array}{l} t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t a)
          :precision binary64
          (let* ((t_1 (+ t (* (- x t) (/ y z)))))
          (if (<=
               z
               -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
            t_1
            (if (<=
                 z
                 3266710722441009/340282366920938463463374607431768211456)
              (+ x (* (- t x) (/ y a)))
              t_1))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = t + ((x - t) * (y / z));
        	double tmp;
        	if (z <= -4.2e-68) {
        		tmp = t_1;
        	} else if (z <= 9.6e-24) {
        		tmp = x + ((t - x) * (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 = t + ((x - t) * (y / z))
            if (z <= (-4.2d-68)) then
                tmp = t_1
            else if (z <= 9.6d-24) then
                tmp = x + ((t - x) * (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 = t + ((x - t) * (y / z));
        	double tmp;
        	if (z <= -4.2e-68) {
        		tmp = t_1;
        	} else if (z <= 9.6e-24) {
        		tmp = x + ((t - x) * (y / a));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	t_1 = t + ((x - t) * (y / z))
        	tmp = 0
        	if z <= -4.2e-68:
        		tmp = t_1
        	elif z <= 9.6e-24:
        		tmp = x + ((t - x) * (y / a))
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t, a)
        	t_1 = Float64(t + Float64(Float64(x - t) * Float64(y / z)))
        	tmp = 0.0
        	if (z <= -4.2e-68)
        		tmp = t_1;
        	elseif (z <= 9.6e-24)
        		tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	t_1 = t + ((x - t) * (y / z));
        	tmp = 0.0;
        	if (z <= -4.2e-68)
        		tmp = t_1;
        	elseif (z <= 9.6e-24)
        		tmp = x + ((t - x) * (y / a));
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5099505842092539/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], t$95$1, If[LessEqual[z, 3266710722441009/340282366920938463463374607431768211456], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\
        \mathbf{if}\;z \leq \frac{-5099505842092539}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq \frac{3266710722441009}{340282366920938463463374607431768211456}:\\
        \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -4.2000000000000002e-68 or 9.5999999999999993e-24 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
          3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(x - t\right) \cdot \frac{y}{z} \]
          9. Applied rewrites49.5%

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

          if -4.2000000000000002e-68 < z < 9.5999999999999993e-24

          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.6%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \left(t - x\right) \cdot \frac{y}{\color{blue}{a}} \]
            10. lower-/.f6447.8%

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

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

        Alternative 10: 63.3% accurate, 0.8× speedup?

        \[\begin{array}{l} t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq \frac{-8742010015015781}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq \frac{1725436586697641}{53919893334301279589334030174039261347274288845081144962207220498432}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t a)
          :precision binary64
          (let* ((t_1 (+ t (* (- x t) (/ y z)))))
          (if (<=
               z
               -8742010015015781/971334446112864535459730953411759453321203419526069760625906204869452142602604249088)
            t_1
            (if (<=
                 z
                 1725436586697641/53919893334301279589334030174039261347274288845081144962207220498432)
              (+ x (/ (* t y) a))
              t_1))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = t + ((x - t) * (y / z));
        	double tmp;
        	if (z <= -9e-69) {
        		tmp = t_1;
        	} else if (z <= 3.2e-53) {
        		tmp = x + ((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 = t + ((x - t) * (y / z))
            if (z <= (-9d-69)) then
                tmp = t_1
            else if (z <= 3.2d-53) then
                tmp = x + ((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 = t + ((x - t) * (y / z));
        	double tmp;
        	if (z <= -9e-69) {
        		tmp = t_1;
        	} else if (z <= 3.2e-53) {
        		tmp = x + ((t * y) / a);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	t_1 = t + ((x - t) * (y / z))
        	tmp = 0
        	if z <= -9e-69:
        		tmp = t_1
        	elif z <= 3.2e-53:
        		tmp = x + ((t * y) / a)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t, a)
        	t_1 = Float64(t + Float64(Float64(x - t) * Float64(y / z)))
        	tmp = 0.0
        	if (z <= -9e-69)
        		tmp = t_1;
        	elseif (z <= 3.2e-53)
        		tmp = Float64(x + Float64(Float64(t * y) / a));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	t_1 = t + ((x - t) * (y / z));
        	tmp = 0.0;
        	if (z <= -9e-69)
        		tmp = t_1;
        	elseif (z <= 3.2e-53)
        		tmp = x + ((t * y) / a);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8742010015015781/971334446112864535459730953411759453321203419526069760625906204869452142602604249088], t$95$1, If[LessEqual[z, 1725436586697641/53919893334301279589334030174039261347274288845081144962207220498432], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := t + \left(x - t\right) \cdot \frac{y}{z}\\
        \mathbf{if}\;z \leq \frac{-8742010015015781}{971334446112864535459730953411759453321203419526069760625906204869452142602604249088}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq \frac{1725436586697641}{53919893334301279589334030174039261347274288845081144962207220498432}:\\
        \;\;\;\;x + \frac{t \cdot y}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -9.0000000000000002e-69 or 3.2000000000000001e-53 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
          3. 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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(x - t\right) \cdot \frac{y}{z} \]
          9. Applied rewrites49.5%

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

          if -9.0000000000000002e-69 < z < 3.2000000000000001e-53

          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.6%

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

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

            \[\leadsto x + \frac{t \cdot y}{a} \]
          6. Step-by-step derivation
            1. lower-*.f6437.8%

              \[\leadsto x + \frac{t \cdot y}{a} \]
          7. Applied rewrites37.8%

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

        Alternative 11: 58.9% accurate, 0.8× speedup?

        \[\begin{array}{l} \mathbf{if}\;a \leq -1480000000000000000:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{elif}\;a \leq \frac{6877123763982683}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\ \;\;\;\;t + \frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]
        (FPCore (x y z t a)
          :precision binary64
          (if (<= a -1480000000000000000)
          (+ x (/ (* t y) a))
          (if (<=
               a
               6877123763982683/237142198758023568227473377297792835283496928595231875152809132048206089502588928)
            (+ t (/ (* y (- x t)) z))
            (+ x t))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (a <= -1.48e+18) {
        		tmp = x + ((t * y) / a);
        	} else if (a <= 2.9e-65) {
        		tmp = t + ((y * (x - t)) / z);
        	} else {
        		tmp = x + t;
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8) :: tmp
            if (a <= (-1.48d+18)) then
                tmp = x + ((t * y) / a)
            else if (a <= 2.9d-65) then
                tmp = t + ((y * (x - t)) / z)
            else
                tmp = x + t
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (a <= -1.48e+18) {
        		tmp = x + ((t * y) / a);
        	} else if (a <= 2.9e-65) {
        		tmp = t + ((y * (x - t)) / z);
        	} else {
        		tmp = x + t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	tmp = 0
        	if a <= -1.48e+18:
        		tmp = x + ((t * y) / a)
        	elif a <= 2.9e-65:
        		tmp = t + ((y * (x - t)) / z)
        	else:
        		tmp = x + t
        	return tmp
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (a <= -1.48e+18)
        		tmp = Float64(x + Float64(Float64(t * y) / a));
        	elseif (a <= 2.9e-65)
        		tmp = Float64(t + Float64(Float64(y * Float64(x - t)) / z));
        	else
        		tmp = Float64(x + t);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	tmp = 0.0;
        	if (a <= -1.48e+18)
        		tmp = x + ((t * y) / a);
        	elseif (a <= 2.9e-65)
        		tmp = t + ((y * (x - t)) / z);
        	else
        		tmp = x + t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1480000000000000000], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6877123763982683/237142198758023568227473377297792835283496928595231875152809132048206089502588928], N[(t + N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
        
        \begin{array}{l}
        \mathbf{if}\;a \leq -1480000000000000000:\\
        \;\;\;\;x + \frac{t \cdot y}{a}\\
        
        \mathbf{elif}\;a \leq \frac{6877123763982683}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\
        \;\;\;\;t + \frac{y \cdot \left(x - t\right)}{z}\\
        
        \mathbf{else}:\\
        \;\;\;\;x + t\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if a < -1.48e18

          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.6%

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

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

            \[\leadsto x + \frac{t \cdot y}{a} \]
          6. Step-by-step derivation
            1. lower-*.f6437.8%

              \[\leadsto x + \frac{t \cdot y}{a} \]
          7. Applied rewrites37.8%

            \[\leadsto x + \frac{t \cdot y}{a} \]

          if -1.48e18 < a < 2.8999999999999998e-65

          1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.8999999999999998e-65 < a

          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--.f6420.0%

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

            \[\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 x around 0

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

              \[\leadsto x + t \]
          10. Recombined 3 regimes into one program.
          11. Add Preprocessing

          Alternative 12: 57.0% accurate, 0.8× speedup?

          \[\begin{array}{l} t_1 := t + \frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{if}\;z \leq -28000000000000001471563169792:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2320000000000000000000:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (let* ((t_1 (+ t (/ (* x (- y a)) z))))
            (if (<= z -28000000000000001471563169792)
              t_1
              (if (<= z 2320000000000000000000) (+ x (/ (* t y) 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 (z <= -2.8e+28) {
          		tmp = t_1;
          	} else if (z <= 2.32e+21) {
          		tmp = x + ((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 = t + ((x * (y - a)) / z)
              if (z <= (-2.8d+28)) then
                  tmp = t_1
              else if (z <= 2.32d+21) then
                  tmp = x + ((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 = t + ((x * (y - a)) / z);
          	double tmp;
          	if (z <= -2.8e+28) {
          		tmp = t_1;
          	} else if (z <= 2.32e+21) {
          		tmp = x + ((t * y) / a);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = t + ((x * (y - a)) / z)
          	tmp = 0
          	if z <= -2.8e+28:
          		tmp = t_1
          	elif z <= 2.32e+21:
          		tmp = x + ((t * y) / a)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(t + Float64(Float64(x * Float64(y - a)) / z))
          	tmp = 0.0
          	if (z <= -2.8e+28)
          		tmp = t_1;
          	elseif (z <= 2.32e+21)
          		tmp = Float64(x + Float64(Float64(t * y) / 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 (z <= -2.8e+28)
          		tmp = t_1;
          	elseif (z <= 2.32e+21)
          		tmp = x + ((t * y) / a);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -28000000000000001471563169792], t$95$1, If[LessEqual[z, 2320000000000000000000], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          t_1 := t + \frac{x \cdot \left(y - a\right)}{z}\\
          \mathbf{if}\;z \leq -28000000000000001471563169792:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 2320000000000000000000:\\
          \;\;\;\;x + \frac{t \cdot y}{a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -2.8000000000000001e28 or 2.32e21 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
            3. 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.4%

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

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

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

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

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

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

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

            if -2.8000000000000001e28 < z < 2.32e21

            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.6%

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

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

              \[\leadsto x + \frac{t \cdot y}{a} \]
            6. Step-by-step derivation
              1. lower-*.f6437.8%

                \[\leadsto x + \frac{t \cdot y}{a} \]
            7. Applied rewrites37.8%

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

          Alternative 13: 51.2% accurate, 0.8× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -8600000000000000169248555008:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 1499999999999999918362846480564224:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\ \end{array} \]
          (FPCore (x y z t a)
            :precision binary64
            (if (<= z -8600000000000000169248555008)
            (+ x t)
            (if (<= z 1499999999999999918362846480564224)
              (+ x (/ (* t y) a))
              (+ t (/ (* a (- t x)) z)))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -8.6e+27) {
          		tmp = x + t;
          	} else if (z <= 1.5e+33) {
          		tmp = x + ((t * y) / a);
          	} else {
          		tmp = t + ((a * (t - x)) / z);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8), intent (in) :: a
              real(8) :: tmp
              if (z <= (-8.6d+27)) then
                  tmp = x + t
              else if (z <= 1.5d+33) then
                  tmp = x + ((t * y) / a)
              else
                  tmp = t + ((a * (t - x)) / z)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -8.6e+27) {
          		tmp = x + t;
          	} else if (z <= 1.5e+33) {
          		tmp = x + ((t * y) / a);
          	} else {
          		tmp = t + ((a * (t - x)) / z);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if z <= -8.6e+27:
          		tmp = x + t
          	elif z <= 1.5e+33:
          		tmp = x + ((t * y) / a)
          	else:
          		tmp = t + ((a * (t - x)) / z)
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -8.6e+27)
          		tmp = Float64(x + t);
          	elseif (z <= 1.5e+33)
          		tmp = Float64(x + Float64(Float64(t * y) / a));
          	else
          		tmp = Float64(t + Float64(Float64(a * Float64(t - x)) / z));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (z <= -8.6e+27)
          		tmp = x + t;
          	elseif (z <= 1.5e+33)
          		tmp = x + ((t * y) / a);
          	else
          		tmp = t + ((a * (t - x)) / z);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8600000000000000169248555008], N[(x + t), $MachinePrecision], If[LessEqual[z, 1499999999999999918362846480564224], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -8600000000000000169248555008:\\
          \;\;\;\;x + t\\
          
          \mathbf{elif}\;z \leq 1499999999999999918362846480564224:\\
          \;\;\;\;x + \frac{t \cdot y}{a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -8.6000000000000002e27

            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--.f6420.0%

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

              \[\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 x around 0

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

                \[\leadsto x + t \]

              if -8.6000000000000002e27 < z < 1.4999999999999999e33

              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.6%

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

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

                \[\leadsto x + \frac{t \cdot y}{a} \]
              6. Step-by-step derivation
                1. lower-*.f6437.8%

                  \[\leadsto x + \frac{t \cdot y}{a} \]
              7. Applied rewrites37.8%

                \[\leadsto x + \frac{t \cdot y}{a} \]

              if 1.4999999999999999e33 < 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 \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
              3. 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.4%

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

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

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

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

                  \[\leadsto t + \frac{a \cdot \left(t - x\right)}{z} \]
                3. lower--.f6429.5%

                  \[\leadsto t + \frac{a \cdot \left(t - x\right)}{z} \]
              7. Applied rewrites29.5%

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

            Alternative 14: 49.1% accurate, 0.9× speedup?

            \[\begin{array}{l} \mathbf{if}\;z \leq -8600000000000000169248555008:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 77999999999999999862150877151232:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{x}{t}\right) \cdot t\\ \end{array} \]
            (FPCore (x y z t a)
              :precision binary64
              (if (<= z -8600000000000000169248555008)
              (+ x t)
              (if (<= z 77999999999999999862150877151232)
                (+ x (/ (* t y) a))
                (* (+ 1 (/ x t)) t))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if (z <= -8.6e+27) {
            		tmp = x + t;
            	} else if (z <= 7.8e+31) {
            		tmp = x + ((t * y) / a);
            	} else {
            		tmp = (1.0 + (x / t)) * t;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z, t, a)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8), intent (in) :: a
                real(8) :: tmp
                if (z <= (-8.6d+27)) then
                    tmp = x + t
                else if (z <= 7.8d+31) then
                    tmp = x + ((t * y) / a)
                else
                    tmp = (1.0d0 + (x / t)) * t
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if (z <= -8.6e+27) {
            		tmp = x + t;
            	} else if (z <= 7.8e+31) {
            		tmp = x + ((t * y) / a);
            	} else {
            		tmp = (1.0 + (x / t)) * t;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a):
            	tmp = 0
            	if z <= -8.6e+27:
            		tmp = x + t
            	elif z <= 7.8e+31:
            		tmp = x + ((t * y) / a)
            	else:
            		tmp = (1.0 + (x / t)) * t
            	return tmp
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if (z <= -8.6e+27)
            		tmp = Float64(x + t);
            	elseif (z <= 7.8e+31)
            		tmp = Float64(x + Float64(Float64(t * y) / a));
            	else
            		tmp = Float64(Float64(1.0 + Float64(x / t)) * t);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a)
            	tmp = 0.0;
            	if (z <= -8.6e+27)
            		tmp = x + t;
            	elseif (z <= 7.8e+31)
            		tmp = x + ((t * y) / a);
            	else
            		tmp = (1.0 + (x / t)) * t;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8600000000000000169248555008], N[(x + t), $MachinePrecision], If[LessEqual[z, 77999999999999999862150877151232], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(1 + N[(x / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
            
            \begin{array}{l}
            \mathbf{if}\;z \leq -8600000000000000169248555008:\\
            \;\;\;\;x + t\\
            
            \mathbf{elif}\;z \leq 77999999999999999862150877151232:\\
            \;\;\;\;x + \frac{t \cdot y}{a}\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(1 + \frac{x}{t}\right) \cdot t\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if z < -8.6000000000000002e27

              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--.f6420.0%

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

                \[\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 x around 0

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

                  \[\leadsto x + t \]

                if -8.6000000000000002e27 < z < 7.8e31

                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.6%

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

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

                  \[\leadsto x + \frac{t \cdot y}{a} \]
                6. Step-by-step derivation
                  1. lower-*.f6437.8%

                    \[\leadsto x + \frac{t \cdot y}{a} \]
                7. Applied rewrites37.8%

                  \[\leadsto x + \frac{t \cdot y}{a} \]

                if 7.8e31 < 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--.f6420.0%

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

                  \[\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 x around 0

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

                    \[\leadsto x + t \]
                  2. Step-by-step derivation
                    1. lift-+.f64N/A

                      \[\leadsto \color{blue}{x + t} \]
                    2. +-commutativeN/A

                      \[\leadsto \color{blue}{t + x} \]
                    3. sum-to-multN/A

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

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

                      \[\leadsto \color{blue}{\left(1 + \frac{x}{t}\right)} \cdot t \]
                    6. lower-unsound-/.f6431.5%

                      \[\leadsto \left(1 + \color{blue}{\frac{x}{t}}\right) \cdot t \]
                  3. Applied rewrites31.5%

                    \[\leadsto \color{blue}{\left(1 + \frac{x}{t}\right) \cdot t} \]
                10. Recombined 3 regimes into one program.
                11. Add Preprocessing

                Alternative 15: 34.3% accurate, 7.3× speedup?

                \[x + t \]
                (FPCore (x y z t a)
                  :precision binary64
                  (+ x t))
                double code(double x, double y, double z, double t, double a) {
                	return x + t;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t, a)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8), intent (in) :: a
                    code = x + t
                end function
                
                public static double code(double x, double y, double z, double t, double a) {
                	return x + t;
                }
                
                def code(x, y, z, t, a):
                	return x + t
                
                function code(x, y, z, t, a)
                	return Float64(x + t)
                end
                
                function tmp = code(x, y, z, t, a)
                	tmp = x + t;
                end
                
                code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
                
                x + t
                
                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--.f6420.0%

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

                  \[\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 x around 0

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

                    \[\leadsto x + t \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025271 -o generate:evaluate
                  (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)))))