Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.8% → 90.4%
Time: 10.1s
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: 79.8% 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: 90.4% accurate, 0.2× 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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(-1, \frac{t \cdot \left(y - a\right)}{z}, x \cdot \frac{y - a}{z}\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 -5e-243) (not (<= t_2 5e-277)))
     (fma t_1 (- y z) x)
     (+ t (fma -1.0 (/ (* t (- y a)) z) (* x (/ (- y 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 <= -5e-243) || !(t_2 <= 5e-277)) {
		tmp = fma(t_1, (y - z), x);
	} else {
		tmp = t + fma(-1.0, ((t * (y - a)) / z), (x * ((y - 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 <= -5e-243) || !(t_2 <= 5e-277))
		tmp = fma(t_1, Float64(y - z), x);
	else
		tmp = Float64(t + fma(-1.0, Float64(Float64(t * Float64(y - a)) / z), Float64(x * Float64(Float64(y - 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, -5e-243], N[Not[LessEqual[t$95$2, 5e-277]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(t + N[(-1.0 * N[(N[(t * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\

\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(-1, \frac{t \cdot \left(y - a\right)}{z}, x \cdot \frac{y - a}{z}\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)))) < -5e-243 or 5e-277 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.0%

      \[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--.f6491.0

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

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

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

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \mathsf{fma}\left(-1, \frac{t \cdot \left(y - a\right)}{z}, x \cdot \frac{y - a}{z}\right) \]
      9. lift--.f6495.3

        \[\leadsto t + \mathsf{fma}\left(-1, \frac{t \cdot \left(y - a\right)}{z}, x \cdot \frac{y - a}{z}\right) \]
    8. Applied rewrites95.3%

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

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

Alternative 2: 88.8% 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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\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 -5e-243) (not (<= t_2 5e-277)))
     (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 <= -5e-243) || !(t_2 <= 5e-277)) {
		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 <= -5e-243) || !(t_2 <= 5e-277))
		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, -5e-243], N[Not[LessEqual[t$95$2, 5e-277]], $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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\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)))) < -5e-243 or 5e-277 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.0%

      \[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--.f6491.0

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

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

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

    1. Initial program 3.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-243} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 5 \cdot 10^{-277}\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: 86.2% 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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\right):\\ \;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{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 -5e-243) (not (<= t_2 5e-277)))
     (fma t_1 (- y z) x)
     (fma (/ (* (- t x) y) 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 <= -5e-243) || !(t_2 <= 5e-277)) {
		tmp = fma(t_1, (y - z), x);
	} else {
		tmp = fma((((t - x) * y) / 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 <= -5e-243) || !(t_2 <= 5e-277))
		tmp = fma(t_1, Float64(y - z), x);
	else
		tmp = fma(Float64(Float64(Float64(t - x) * y) / 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, -5e-243], N[Not[LessEqual[t$95$2, 5e-277]], $MachinePrecision]], N[(t$95$1 * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(N[(t - x), $MachinePrecision] * y), $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 -5 \cdot 10^{-243} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-277}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{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)))) < -5e-243 or 5e-277 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.0%

      \[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--.f6491.0

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

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

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

    1. Initial program 3.6%

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{z}, -1, t\right) \]
    8. Recombined 2 regimes into one program.
    9. Final simplification87.2%

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

    Alternative 4: 72.2% accurate, 0.7× speedup?

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

      1. Initial program 46.6%

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

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

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

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

        if -2.39999999999999983e94 < z < 4.1999999999999998e-19

        1. Initial program 90.0%

          \[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--.f6490.0

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

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

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

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

          if 4.1999999999999998e-19 < z < 9.8000000000000003e107

          1. Initial program 86.7%

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

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

          Alternative 5: 72.0% accurate, 0.8× speedup?

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

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

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

            if -1.55e28 < a < 1.06000000000000004e-39

            1. Initial program 65.4%

              \[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 rewrites76.6%

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

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

                \[\leadsto \mathsf{fma}\left(\frac{\left(t - x\right) \cdot y}{z}, -1, t\right) \]
            8. Recombined 2 regimes into one program.
            9. Final simplification74.7%

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

            Alternative 6: 73.1% accurate, 0.8× speedup?

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

              1. Initial program 51.5%

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

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

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

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

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

                  \[\leadsto t \cdot \color{blue}{\frac{y - z}{a - z}} \]
                3. lift-/.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--.f6465.8

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

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

              if -2.39999999999999983e94 < z < 5.50000000000000016e37

              1. Initial program 90.0%

                \[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--.f6490.1

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

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

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

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

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

              Alternative 7: 69.0% accurate, 0.8× speedup?

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

                1. Initial program 52.0%

                  \[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--.f6452.1

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

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

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

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

                    \[\leadsto t \cdot \color{blue}{\frac{y - z}{a - z}} \]
                  3. lift-/.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--.f6465.1

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

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

                if -2.39999999999999983e94 < z < 9.4999999999999999e34

                1. Initial program 89.9%

                  \[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--.f6475.4

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

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

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

              Alternative 8: 65.4% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-87} \lor \neg \left(z \leq 1.5 \cdot 10^{-20}\right):\\ \;\;\;\;t \cdot \frac{y - 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 -3.1e-87) (not (<= z 1.5e-20)))
                 (* t (/ (- y 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 <= -3.1e-87) || !(z <= 1.5e-20)) {
              		tmp = t * ((y - 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 <= -3.1e-87) || !(z <= 1.5e-20))
              		tmp = Float64(t * Float64(Float64(y - 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, -3.1e-87], N[Not[LessEqual[z, 1.5e-20]], $MachinePrecision]], N[(t * N[(N[(y - z), $MachinePrecision] / 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 -3.1 \cdot 10^{-87} \lor \neg \left(z \leq 1.5 \cdot 10^{-20}\right):\\
              \;\;\;\;t \cdot \frac{y - 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 < -3.09999999999999998e-87 or 1.50000000000000014e-20 < z

                1. Initial program 62.8%

                  \[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--.f6463.0

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

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

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

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

                    \[\leadsto t \cdot \color{blue}{\frac{y - z}{a - z}} \]
                  3. lift-/.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.2

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

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

                if -3.09999999999999998e-87 < z < 1.50000000000000014e-20

                1. Initial program 92.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--.f6479.2

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

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

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

              Alternative 9: 38.8% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-265}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-294}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (if (<= z -2.35e+94)
                 t
                 (if (<= z -1.45e-265)
                   x
                   (if (<= z 3.4e-294) (/ (* t y) a) (if (<= z 4.8e-12) x t)))))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (z <= -2.35e+94) {
              		tmp = t;
              	} else if (z <= -1.45e-265) {
              		tmp = x;
              	} else if (z <= 3.4e-294) {
              		tmp = (t * y) / a;
              	} else if (z <= 4.8e-12) {
              		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 <= (-2.35d+94)) then
                      tmp = t
                  else if (z <= (-1.45d-265)) then
                      tmp = x
                  else if (z <= 3.4d-294) then
                      tmp = (t * y) / a
                  else if (z <= 4.8d-12) 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 <= -2.35e+94) {
              		tmp = t;
              	} else if (z <= -1.45e-265) {
              		tmp = x;
              	} else if (z <= 3.4e-294) {
              		tmp = (t * y) / a;
              	} else if (z <= 4.8e-12) {
              		tmp = x;
              	} else {
              		tmp = t;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a):
              	tmp = 0
              	if z <= -2.35e+94:
              		tmp = t
              	elif z <= -1.45e-265:
              		tmp = x
              	elif z <= 3.4e-294:
              		tmp = (t * y) / a
              	elif z <= 4.8e-12:
              		tmp = x
              	else:
              		tmp = t
              	return tmp
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (z <= -2.35e+94)
              		tmp = t;
              	elseif (z <= -1.45e-265)
              		tmp = x;
              	elseif (z <= 3.4e-294)
              		tmp = Float64(Float64(t * y) / a);
              	elseif (z <= 4.8e-12)
              		tmp = x;
              	else
              		tmp = t;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a)
              	tmp = 0.0;
              	if (z <= -2.35e+94)
              		tmp = t;
              	elseif (z <= -1.45e-265)
              		tmp = x;
              	elseif (z <= 3.4e-294)
              		tmp = (t * y) / a;
              	elseif (z <= 4.8e-12)
              		tmp = x;
              	else
              		tmp = t;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.35e+94], t, If[LessEqual[z, -1.45e-265], x, If[LessEqual[z, 3.4e-294], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 4.8e-12], x, t]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -2.35 \cdot 10^{+94}:\\
              \;\;\;\;t\\
              
              \mathbf{elif}\;z \leq -1.45 \cdot 10^{-265}:\\
              \;\;\;\;x\\
              
              \mathbf{elif}\;z \leq 3.4 \cdot 10^{-294}:\\
              \;\;\;\;\frac{t \cdot y}{a}\\
              
              \mathbf{elif}\;z \leq 4.8 \cdot 10^{-12}:\\
              \;\;\;\;x\\
              
              \mathbf{else}:\\
              \;\;\;\;t\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -2.35000000000000008e94 or 4.79999999999999974e-12 < z

                1. Initial program 54.4%

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

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

                  if -2.35000000000000008e94 < z < -1.44999999999999987e-265 or 3.39999999999999981e-294 < z < 4.79999999999999974e-12

                  1. Initial program 89.6%

                    \[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 rewrites34.0%

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

                    if -1.44999999999999987e-265 < z < 3.39999999999999981e-294

                    1. Initial program 94.2%

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

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

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

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

                        \[\leadsto \frac{t \cdot y}{a} \]
                      2. lower-*.f6472.4

                        \[\leadsto \frac{t \cdot y}{a} \]
                    8. Applied rewrites72.4%

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

                  Alternative 10: 60.0% accurate, 0.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\ \;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+35}:\\ \;\;\;\;\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 -2.4e+94)
                     (+ t (/ (* a (- t x)) z))
                     (if (<= z 6.2e+35) (fma y (/ (- t x) a) x) t)))
                  double code(double x, double y, double z, double t, double a) {
                  	double tmp;
                  	if (z <= -2.4e+94) {
                  		tmp = t + ((a * (t - x)) / z);
                  	} else if (z <= 6.2e+35) {
                  		tmp = fma(y, ((t - x) / a), x);
                  	} else {
                  		tmp = t;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a)
                  	tmp = 0.0
                  	if (z <= -2.4e+94)
                  		tmp = Float64(t + Float64(Float64(a * Float64(t - x)) / z));
                  	elseif (z <= 6.2e+35)
                  		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, -2.4e+94], N[(t + N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+35], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\
                  \;\;\;\;t + \frac{a \cdot \left(t - x\right)}{z}\\
                  
                  \mathbf{elif}\;z \leq 6.2 \cdot 10^{+35}:\\
                  \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if z < -2.39999999999999983e94

                    1. Initial program 48.4%

                      \[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 rewrites73.4%

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

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

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

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

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

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

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

                    if -2.39999999999999983e94 < z < 6.19999999999999973e35

                    1. Initial program 89.9%

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

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

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

                    if 6.19999999999999973e35 < z

                    1. Initial program 55.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 rewrites40.9%

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

                    Alternative 11: 59.6% accurate, 0.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+35}:\\ \;\;\;\;\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 -2.4e+94) t (if (<= z 6.2e+35) (fma y (/ (- t x) a) x) t)))
                    double code(double x, double y, double z, double t, double a) {
                    	double tmp;
                    	if (z <= -2.4e+94) {
                    		tmp = t;
                    	} else if (z <= 6.2e+35) {
                    		tmp = fma(y, ((t - x) / a), x);
                    	} else {
                    		tmp = t;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a)
                    	tmp = 0.0
                    	if (z <= -2.4e+94)
                    		tmp = t;
                    	elseif (z <= 6.2e+35)
                    		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, -2.4e+94], t, If[LessEqual[z, 6.2e+35], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\
                    \;\;\;\;t\\
                    
                    \mathbf{elif}\;z \leq 6.2 \cdot 10^{+35}:\\
                    \;\;\;\;\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 < -2.39999999999999983e94 or 6.19999999999999973e35 < z

                      1. Initial program 52.0%

                        \[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 rewrites51.1%

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

                        if -2.39999999999999983e94 < z < 6.19999999999999973e35

                        1. Initial program 89.9%

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

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

                          \[\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: 51.8% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\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.4e+94) t (if (<= z 1.7e-7) (fma y (/ t a) x) t)))
                      double code(double x, double y, double z, double t, double a) {
                      	double tmp;
                      	if (z <= -2.4e+94) {
                      		tmp = t;
                      	} else if (z <= 1.7e-7) {
                      		tmp = fma(y, (t / a), x);
                      	} else {
                      		tmp = t;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a)
                      	tmp = 0.0
                      	if (z <= -2.4e+94)
                      		tmp = t;
                      	elseif (z <= 1.7e-7)
                      		tmp = fma(y, Float64(t / a), x);
                      	else
                      		tmp = t;
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+94], t, If[LessEqual[z, 1.7e-7], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -2.4 \cdot 10^{+94}:\\
                      \;\;\;\;t\\
                      
                      \mathbf{elif}\;z \leq 1.7 \cdot 10^{-7}:\\
                      \;\;\;\;\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.39999999999999983e94 or 1.69999999999999987e-7 < z

                        1. Initial program 54.4%

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

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

                          if -2.39999999999999983e94 < z < 1.69999999999999987e-7

                          1. Initial program 90.1%

                            \[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--.f6469.4

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

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

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

                          Alternative 13: 38.7% accurate, 2.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+94}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (if (<= z -2.35e+94) t (if (<= z 4.8e-12) x t)))
                          double code(double x, double y, double z, double t, double a) {
                          	double tmp;
                          	if (z <= -2.35e+94) {
                          		tmp = t;
                          	} else if (z <= 4.8e-12) {
                          		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 <= (-2.35d+94)) then
                                  tmp = t
                              else if (z <= 4.8d-12) 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 <= -2.35e+94) {
                          		tmp = t;
                          	} else if (z <= 4.8e-12) {
                          		tmp = x;
                          	} else {
                          		tmp = t;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	tmp = 0
                          	if z <= -2.35e+94:
                          		tmp = t
                          	elif z <= 4.8e-12:
                          		tmp = x
                          	else:
                          		tmp = t
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	tmp = 0.0
                          	if (z <= -2.35e+94)
                          		tmp = t;
                          	elseif (z <= 4.8e-12)
                          		tmp = x;
                          	else
                          		tmp = t;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	tmp = 0.0;
                          	if (z <= -2.35e+94)
                          		tmp = t;
                          	elseif (z <= 4.8e-12)
                          		tmp = x;
                          	else
                          		tmp = t;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.35e+94], t, If[LessEqual[z, 4.8e-12], x, t]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -2.35 \cdot 10^{+94}:\\
                          \;\;\;\;t\\
                          
                          \mathbf{elif}\;z \leq 4.8 \cdot 10^{-12}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -2.35000000000000008e94 or 4.79999999999999974e-12 < z

                            1. Initial program 54.4%

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

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

                              if -2.35000000000000008e94 < z < 4.79999999999999974e-12

                              1. Initial program 90.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} \]
                              4. Step-by-step derivation
                                1. Applied rewrites31.2%

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

                              Alternative 14: 24.9% 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 76.3%

                                \[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 2025045 
                                (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)))))