Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.3% → 89.0%
Time: 4.9s
Alternatives: 14
Speedup: 0.3×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.3% 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: 89.0% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\


\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)))) < -3.99999999999999998e-243

    1. Initial program 89.7%

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

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

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}, -1, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (or (<= t_2 -4e-243) (not (<= t_2 0.0)))
     (fma t_1 (- y z) x)
     (fma (/ (* (- t x) (- y a)) z) -1.0 t))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if ((t_2 <= -4e-243) || !(t_2 <= 0.0)) {
		tmp = fma(t_1, (y - z), x);
	} else {
		tmp = fma((((t - x) * (y - a)) / z), -1.0, t);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if ((t_2 <= -4e-243) || !(t_2 <= 0.0))
		tmp = fma(t_1, Float64(y - z), x);
	else
		tmp = fma(Float64(Float64(Float64(t - x) * Float64(y - a)) / z), -1.0, t);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -4e-243], N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * -1.0 + t), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 84.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-180} \lor \neg \left(t\_2 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (or (<= t_2 -2e-180) (not (<= t_2 0.0)))
     (fma t_1 (- y z) x)
     (* (- t) (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if ((t_2 <= -2e-180) || !(t_2 <= 0.0)) {
		tmp = fma(t_1, (y - z), x);
	} else {
		tmp = -t * (z / (a - z));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if ((t_2 <= -2e-180) || !(t_2 <= 0.0))
		tmp = fma(t_1, Float64(y - z), x);
	else
		tmp = Float64(Float64(-t) * Float64(z / Float64(a - z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e-180], N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


\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)))) < -2e-180 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 8.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 55.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.49999999999999992e78 or 3.5000000000000002e104 < y

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.49999999999999992e78 < y < -1.3999999999999999e-50 or 1.8e-260 < y < 3.5000000000000002e104

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

    if -1.3999999999999999e-50 < y < 1.8e-260

    1. Initial program 71.8%

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

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

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

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

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

        \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
      5. lift--.f6446.8

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

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

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

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

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

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

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

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

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

      \[\leadsto -t \cdot \frac{z}{a - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+78}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-50}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-260}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+94}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

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

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8999999999999998e94

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999998e94 < y < 2.40000000000000015e35

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

      if 2.40000000000000015e35 < y

      1. Initial program 82.6%

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

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

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

      Alternative 6: 70.6% accurate, 0.8× speedup?

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

        1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.8999999999999998e94 < y < 1.24999999999999994e36

        1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 63.8% accurate, 0.8× speedup?

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

          1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

          if -3.00000000000000022e-85 < a < 1.28e23

          1. Initial program 71.0%

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

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

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

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

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

              \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
            5. lift--.f6459.6

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 59.9% accurate, 0.8× speedup?

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

          1. Initial program 86.3%

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

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

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

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

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

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

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

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

          if -7.0000000000000004e27 < a < 3.30000000000000029e23

          1. Initial program 69.3%

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

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

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

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

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

              \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
            5. lift--.f6458.2

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 60.6% accurate, 0.8× speedup?

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

          1. Initial program 85.6%

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

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

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

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

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

              if -6.79999999999999984e57 < a < 3.30000000000000029e23

              1. Initial program 69.5%

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

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

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

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

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

                  \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
                5. lift--.f6458.1

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

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

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

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

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

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

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

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

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

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

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

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

              if 3.30000000000000029e23 < a

              1. Initial program 87.5%

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

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

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

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

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

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

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

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

            Alternative 10: 61.9% accurate, 0.9× speedup?

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

              1. Initial program 57.3%

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

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

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

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

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

                  \[\leadsto \frac{\left(y - z\right) \cdot t}{a - z} \]
                5. lift--.f6435.9

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

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

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

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

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

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

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

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

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

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

              if -5.6000000000000001e82 < z < 1.85e84

              1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

            Alternative 11: 59.6% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+82}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+143}:\\ \;\;\;\;\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 -5.6e+82) t (if (<= z 1.05e+143) (fma y (/ (- t x) a) x) t)))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if (z <= -5.6e+82) {
            		tmp = t;
            	} else if (z <= 1.05e+143) {
            		tmp = fma(y, ((t - x) / a), x);
            	} else {
            		tmp = t;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if (z <= -5.6e+82)
            		tmp = t;
            	elseif (z <= 1.05e+143)
            		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, -5.6e+82], t, If[LessEqual[z, 1.05e+143], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -5.6 \cdot 10^{+82}:\\
            \;\;\;\;t\\
            
            \mathbf{elif}\;z \leq 1.05 \cdot 10^{+143}:\\
            \;\;\;\;\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 < -5.6000000000000001e82 or 1.04999999999999994e143 < z

              1. Initial program 54.2%

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

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

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

                if -5.6000000000000001e82 < z < 1.04999999999999994e143

                1. Initial program 91.3%

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

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

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

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

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

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

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

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

              Alternative 12: 52.5% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+95}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+142}:\\ \;\;\;\;\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 -2.05e+95) t (if (<= z 9.2e+142) (fma y (/ t a) x) t)))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (z <= -2.05e+95) {
              		tmp = t;
              	} else if (z <= 9.2e+142) {
              		tmp = fma(y, (t / a), x);
              	} else {
              		tmp = t;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (z <= -2.05e+95)
              		tmp = t;
              	elseif (z <= 9.2e+142)
              		tmp = fma(y, Float64(t / a), x);
              	else
              		tmp = t;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.05e+95], t, If[LessEqual[z, 9.2e+142], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -2.05 \cdot 10^{+95}:\\
              \;\;\;\;t\\
              
              \mathbf{elif}\;z \leq 9.2 \cdot 10^{+142}:\\
              \;\;\;\;\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 < -2.04999999999999993e95 or 9.20000000000000009e142 < z

                1. Initial program 53.1%

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

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

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

                  if -2.04999999999999993e95 < z < 9.20000000000000009e142

                  1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

                  Alternative 13: 39.9% accurate, 2.2× speedup?

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

                    1. Initial program 86.7%

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

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

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

                      if -1.69999999999999996e57 < a < 1.4000000000000001e25

                      1. Initial program 69.5%

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

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

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

                      Alternative 14: 26.2% accurate, 29.0× speedup?

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

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

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

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

                        Reproduce

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