Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.1% → 91.9%
Time: 4.4s
Alternatives: 15
Speedup: 0.7×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 80.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 91.9% accurate, 0.2× speedup?

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

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

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

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

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


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

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-48 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -5.0000000000000003e-291

    1. Initial program 77.2%

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

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

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

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

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

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

    1. Initial program 4.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e176

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

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

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

    if -5e176 < z < 1.35e95

    1. Initial program 88.0%

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

    if 1.35e95 < z

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e176

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

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

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

    if -5e176 < z < 1.35e95

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e95 < z

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+35}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.39999999999999965e35

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y - z}{a - z} \cdot t \]
      4. lift--.f6461.3

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

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

    if -6.39999999999999965e35 < z < 9.4999999999999991e93

    1. Initial program 90.0%

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

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

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

      if 9.4999999999999991e93 < z

      1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 73.0% accurate, 0.6× speedup?

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

      1. Initial program 64.0%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y - z}{a - z} \cdot t \]
        4. lift--.f6463.8

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

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

      if -1.6000000000000001e162 < z < -3.69999999999999977e-140

      1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -3.69999999999999977e-140 < z < 5.6000000000000003e-24

        1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

        if 5.6000000000000003e-24 < z < 2.3e19

        1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 70.9% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+93}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z} + t\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -6.4e+35)
         (* (/ (- y z) (- a z)) t)
         (if (<= z 9.5e+93)
           (+ x (* y (/ (- t x) (- a z))))
           (+ (/ (* x (- y a)) z) t))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -6.4e+35) {
      		tmp = ((y - z) / (a - z)) * t;
      	} else if (z <= 9.5e+93) {
      		tmp = x + (y * ((t - x) / (a - z)));
      	} else {
      		tmp = ((x * (y - a)) / z) + 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 <= (-6.4d+35)) then
              tmp = ((y - z) / (a - z)) * t
          else if (z <= 9.5d+93) then
              tmp = x + (y * ((t - x) / (a - z)))
          else
              tmp = ((x * (y - a)) / z) + 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 <= -6.4e+35) {
      		tmp = ((y - z) / (a - z)) * t;
      	} else if (z <= 9.5e+93) {
      		tmp = x + (y * ((t - x) / (a - z)));
      	} else {
      		tmp = ((x * (y - a)) / z) + t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -6.4e+35:
      		tmp = ((y - z) / (a - z)) * t
      	elif z <= 9.5e+93:
      		tmp = x + (y * ((t - x) / (a - z)))
      	else:
      		tmp = ((x * (y - a)) / z) + t
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -6.4e+35)
      		tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t);
      	elseif (z <= 9.5e+93)
      		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / Float64(a - z))));
      	else
      		tmp = Float64(Float64(Float64(x * Float64(y - a)) / z) + t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -6.4e+35)
      		tmp = ((y - z) / (a - z)) * t;
      	elseif (z <= 9.5e+93)
      		tmp = x + (y * ((t - x) / (a - z)));
      	else
      		tmp = ((x * (y - a)) / z) + t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e+35], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 9.5e+93], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -6.4 \cdot 10^{+35}:\\
      \;\;\;\;\frac{y - z}{a - z} \cdot t\\
      
      \mathbf{elif}\;z \leq 9.5 \cdot 10^{+93}:\\
      \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x \cdot \left(y - a\right)}{z} + t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -6.39999999999999965e35

        1. Initial program 67.5%

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

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

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

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

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

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

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

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

            \[\leadsto \frac{y - z}{a - z} \cdot t \]
          4. lift--.f6461.3

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

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

        if -6.39999999999999965e35 < z < 9.4999999999999991e93

        1. Initial program 90.0%

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

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

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

          if 9.4999999999999991e93 < z

          1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{x \cdot \left(y - a\right)}{z} + t \]
            3. lift--.f6465.5

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

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

        Alternative 7: 69.5% accurate, 0.7× speedup?

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

          1. Initial program 67.6%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{y - z}{a - z} \cdot t \]
            4. lift--.f6461.7

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

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

          if -7.40000000000000017e34 < z < 5.6000000000000003e-24

          1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

          if 5.6000000000000003e-24 < z < 2.3e19

          1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 68.1% accurate, 0.7× speedup?

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

          1. Initial program 67.6%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{y - z}{a - z} \cdot t \]
            4. lift--.f6461.7

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

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

          if -7.40000000000000017e34 < z < 9.0000000000000001e-77

          1. Initial program 91.2%

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

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

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

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

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

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

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

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

          if 9.0000000000000001e-77 < z < 2.3e19

          1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 66.0% accurate, 0.8× speedup?

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

          1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

            if -1.02e51 < a < 2.1500000000000001e-35

            1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 2.1500000000000001e-35 < a < 2.2499999999999999e194

            1. Initial program 84.2%

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

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

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

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

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

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

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

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

          Alternative 10: 57.6% accurate, 0.8× speedup?

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

            1. Initial program 64.9%

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

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

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

              if -2.05000000000000006e36 < z < 9.0000000000000001e-77

              1. Initial program 91.3%

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

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

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

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

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

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

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

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

              if 9.0000000000000001e-77 < z < 7.8000000000000005e93

              1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto y \cdot \frac{x - t}{z} \]
                4. lower--.f6432.0

                  \[\leadsto y \cdot \frac{x - t}{z} \]
              7. Applied rewrites32.0%

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

            Alternative 11: 53.6% accurate, 0.8× speedup?

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

              1. Initial program 64.9%

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

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

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

                if -2.10000000000000004e36 < z < 9.0000000000000001e-77

                1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 9.0000000000000001e-77 < z < 7.8000000000000005e93

                    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto y \cdot \frac{x - t}{z} \]
                      4. lower--.f6432.0

                        \[\leadsto y \cdot \frac{x - t}{z} \]
                    7. Applied rewrites32.0%

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

                  Alternative 12: 52.6% accurate, 1.1× speedup?

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

                    1. Initial program 65.2%

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

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

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

                      if -2.10000000000000004e36 < z < 1.2999999999999999e82

                      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 13: 38.6% accurate, 1.0× speedup?

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

                          1. Initial program 68.0%

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

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

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

                            if -9.9999999999999997e34 < z < 2e-132

                            1. Initial program 91.3%

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

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

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

                              if 2e-132 < z < 3.5e9

                              1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{y - z}{a - z} \cdot t \]
                              8. Taylor expanded in z around 0

                                \[\leadsto \frac{y}{a} \cdot t \]
                              9. Step-by-step derivation
                                1. lower-/.f6424.3

                                  \[\leadsto \frac{y}{a} \cdot t \]
                              10. Applied rewrites24.3%

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

                            Alternative 14: 38.0% accurate, 2.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+35}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 950000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (if (<= z -1e+35) t (if (<= z 950000000000.0) x t)))
                            double code(double x, double y, double z, double t, double a) {
                            	double tmp;
                            	if (z <= -1e+35) {
                            		tmp = t;
                            	} else if (z <= 950000000000.0) {
                            		tmp = x;
                            	} else {
                            		tmp = t;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t, a)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8), intent (in) :: a
                                real(8) :: tmp
                                if (z <= (-1d+35)) then
                                    tmp = t
                                else if (z <= 950000000000.0d0) then
                                    tmp = x
                                else
                                    tmp = t
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	double tmp;
                            	if (z <= -1e+35) {
                            		tmp = t;
                            	} else if (z <= 950000000000.0) {
                            		tmp = x;
                            	} else {
                            		tmp = t;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a):
                            	tmp = 0
                            	if z <= -1e+35:
                            		tmp = t
                            	elif z <= 950000000000.0:
                            		tmp = x
                            	else:
                            		tmp = t
                            	return tmp
                            
                            function code(x, y, z, t, a)
                            	tmp = 0.0
                            	if (z <= -1e+35)
                            		tmp = t;
                            	elseif (z <= 950000000000.0)
                            		tmp = x;
                            	else
                            		tmp = t;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a)
                            	tmp = 0.0;
                            	if (z <= -1e+35)
                            		tmp = t;
                            	elseif (z <= 950000000000.0)
                            		tmp = x;
                            	else
                            		tmp = t;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+35], t, If[LessEqual[z, 950000000000.0], x, t]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -1 \cdot 10^{+35}:\\
                            \;\;\;\;t\\
                            
                            \mathbf{elif}\;z \leq 950000000000:\\
                            \;\;\;\;x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -9.9999999999999997e34 or 9.5e11 < z

                              1. Initial program 67.9%

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

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

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

                                if -9.9999999999999997e34 < z < 9.5e11

                                1. Initial program 90.8%

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

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

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

                                Alternative 15: 25.1% accurate, 17.9× speedup?

                                \[\begin{array}{l} \\ t \end{array} \]
                                (FPCore (x y z t a) :precision binary64 t)
                                double code(double x, double y, double z, double t, double a) {
                                	return t;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y, z, t, a)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8), intent (in) :: a
                                    code = t
                                end function
                                
                                public static double code(double x, double y, double z, double t, double a) {
                                	return t;
                                }
                                
                                def code(x, y, z, t, a):
                                	return t
                                
                                function code(x, y, z, t, a)
                                	return t
                                end
                                
                                function tmp = code(x, y, z, t, a)
                                	tmp = t;
                                end
                                
                                code[x_, y_, z_, t_, a_] := t
                                
                                \begin{array}{l}
                                
                                \\
                                t
                                \end{array}
                                
                                Derivation
                                1. Initial program 80.1%

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

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

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

                                  Reproduce

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