Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.9% → 87.8%
Time: 5.6s
Alternatives: 12
Speedup: 0.3×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

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

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

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

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

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

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

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


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

    1. Initial program 92.0%

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

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

    1. Initial program 23.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 rewrites67.9%

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

Alternative 2: 87.8% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 92.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--.f6492.0

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

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

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

    1. Initial program 23.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 rewrites67.9%

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

Alternative 3: 72.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -31000000000:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.1e10 or 4.99999999999999976e73 < a

    1. Initial program 88.1%

      \[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.3

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

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

    if -3.1e10 < a < 4.99999999999999976e73

    1. Initial program 73.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 rewrites68.9%

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

Alternative 4: 72.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.65 \cdot 10^{-158}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.5999999999999998e24 or 2.5000000000000001e142 < z

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e24 < z < -1.6500000000000001e-158 or 3.59999999999999979e-50 < z < 2.5000000000000001e142

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.6500000000000001e-158 < z < 3.59999999999999979e-50

      1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

    Alternative 5: 72.0% accurate, 0.8× speedup?

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

      1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -8200 < z < 1.49999999999999989e93

      1. Initial program 90.7%

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

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

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

      Alternative 6: 69.6% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -185000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+89}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (* t (/ (- y z) (- a z)))))
         (if (<= z -185000000000.0)
           t_1
           (if (<= z 1.95e+89) (fma (- t x) (/ (- y z) a) x) t_1))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = t * ((y - z) / (a - z));
      	double tmp;
      	if (z <= -185000000000.0) {
      		tmp = t_1;
      	} else if (z <= 1.95e+89) {
      		tmp = fma((t - x), ((y - z) / a), x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a)
      	t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
      	tmp = 0.0
      	if (z <= -185000000000.0)
      		tmp = t_1;
      	elseif (z <= 1.95e+89)
      		tmp = fma(Float64(t - x), Float64(Float64(y - z) / 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] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -185000000000.0], t$95$1, If[LessEqual[z, 1.95e+89], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := t \cdot \frac{y - z}{a - z}\\
      \mathbf{if}\;z \leq -185000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 1.95 \cdot 10^{+89}:\\
      \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.85e11 or 1.95000000000000005e89 < z

        1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.85e11 < z < 1.95000000000000005e89

        1. Initial program 90.6%

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

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

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

      Alternative 7: 67.6% accurate, 0.9× speedup?

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

        1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.00000000000000011e-32 < z < 0.00350000000000000007

        1. Initial program 91.6%

          \[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.8

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

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

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

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

        Alternative 8: 60.8% accurate, 0.9× speedup?

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

          1. Initial program 64.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 rewrites48.8%

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

            if -9.9999999999999994e38 < z < 2.6e99

            1. Initial program 90.1%

              \[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.2

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

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

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

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

            Alternative 9: 59.8% accurate, 0.9× speedup?

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

              1. Initial program 64.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 rewrites48.8%

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

                if -9.9999999999999994e38 < z < 2.6e99

                1. Initial program 90.1%

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

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

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

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

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

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

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

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

              Alternative 10: 51.8% accurate, 1.1× speedup?

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

                1. Initial program 63.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 rewrites48.9%

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

                  if -3.70000000000000012e39 < z < 2.30000000000000019e99

                  1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 38.9% accurate, 2.1× speedup?

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

                    1. Initial program 65.3%

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

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

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

                      if -1.1e15 < z < 9.2000000000000008e78

                      1. Initial program 90.7%

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

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

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

                      Alternative 12: 25.4% 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 79.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 rewrites25.4%

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

                        Reproduce

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