Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.1% → 95.0%
Time: 6.5s
Alternatives: 12
Speedup: 0.3×

Specification

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

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

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

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

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

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

Initial Program: 80.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 95.0% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{-z}, y - a, 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)))) < -4.99999999999999955e-308 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 89.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    5. 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}} \]
    6. Step-by-step derivation
      1. Applied rewrites99.8%

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

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

    Alternative 2: 83.1% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_3 := \mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-308}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{-z}, y - a, t\right)\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (* (- t x) (/ y (- a z))))
            (t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
            (t_3 (fma t (/ (- y z) (- a z)) x)))
       (if (<= t_2 (- INFINITY))
         t_1
         (if (<= t_2 -5e-308)
           t_3
           (if (<= t_2 0.0)
             (fma (/ (- t x) (- z)) (- y a) t)
             (if (<= t_2 4e+302) t_3 t_1))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (t - x) * (y / (a - z));
    	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
    	double t_3 = fma(t, ((y - z) / (a - z)), x);
    	double tmp;
    	if (t_2 <= -((double) INFINITY)) {
    		tmp = t_1;
    	} else if (t_2 <= -5e-308) {
    		tmp = t_3;
    	} else if (t_2 <= 0.0) {
    		tmp = fma(((t - x) / -z), (y - a), t);
    	} else if (t_2 <= 4e+302) {
    		tmp = t_3;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(t - x) * Float64(y / Float64(a - z)))
    	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
    	t_3 = fma(t, Float64(Float64(y - z) / Float64(a - z)), x)
    	tmp = 0.0
    	if (t_2 <= Float64(-Inf))
    		tmp = t_1;
    	elseif (t_2 <= -5e-308)
    		tmp = t_3;
    	elseif (t_2 <= 0.0)
    		tmp = fma(Float64(Float64(t - x) / Float64(-z)), Float64(y - a), t);
    	elseif (t_2 <= 4e+302)
    		tmp = t_3;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-308], t$95$3, If[LessEqual[t$95$2, 0.0], N[(N[(N[(t - x), $MachinePrecision] / (-z)), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$2, 4e+302], t$95$3, t$95$1]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(t - x\right) \cdot \frac{y}{a - z}\\
    t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
    t_3 := \mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)\\
    \mathbf{if}\;t\_2 \leq -\infty:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-308}:\\
    \;\;\;\;t\_3\\
    
    \mathbf{elif}\;t\_2 \leq 0:\\
    \;\;\;\;\mathsf{fma}\left(\frac{t - x}{-z}, y - a, t\right)\\
    
    \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+302}:\\
    \;\;\;\;t\_3\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 4.0000000000000003e302 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

      1. Initial program 87.2%

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

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

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

        if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999955e-308 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.0000000000000003e302

        1. Initial program 89.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
          5. 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}} \]
          6. Step-by-step derivation
            1. Applied rewrites99.8%

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

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

          Alternative 3: 42.9% accurate, 0.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-151}:\\ \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\ \mathbf{elif}\;t\_2 \leq 10^{-184}:\\ \;\;\;\;t\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+291}:\\ \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (* t (/ y a))) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
             (if (<= t_2 (- INFINITY))
               t_1
               (if (<= t_2 -2e-151)
                 (fma t 1.0 x)
                 (if (<= t_2 1e-184) t (if (<= t_2 4e+291) (fma t 1.0 x) t_1))))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = t * (y / a);
          	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
          	double tmp;
          	if (t_2 <= -((double) INFINITY)) {
          		tmp = t_1;
          	} else if (t_2 <= -2e-151) {
          		tmp = fma(t, 1.0, x);
          	} else if (t_2 <= 1e-184) {
          		tmp = t;
          	} else if (t_2 <= 4e+291) {
          		tmp = fma(t, 1.0, x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a)
          	t_1 = Float64(t * Float64(y / a))
          	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
          	tmp = 0.0
          	if (t_2 <= Float64(-Inf))
          		tmp = t_1;
          	elseif (t_2 <= -2e-151)
          		tmp = fma(t, 1.0, x);
          	elseif (t_2 <= 1e-184)
          		tmp = t;
          	elseif (t_2 <= 4e+291)
          		tmp = fma(t, 1.0, x);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-151], N[(t * 1.0 + x), $MachinePrecision], If[LessEqual[t$95$2, 1e-184], t, If[LessEqual[t$95$2, 4e+291], N[(t * 1.0 + x), $MachinePrecision], t$95$1]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := t \cdot \frac{y}{a}\\
          t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
          \mathbf{if}\;t\_2 \leq -\infty:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-151}:\\
          \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\
          
          \mathbf{elif}\;t\_2 \leq 10^{-184}:\\
          \;\;\;\;t\\
          
          \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+291}:\\
          \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 3.9999999999999998e291 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

            1. Initial program 87.4%

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

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

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

                \[\leadsto \left(t - x\right) \cdot \frac{y}{a} \]
              3. Step-by-step derivation
                1. Applied rewrites76.3%

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

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

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

                  if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.9999999999999999e-151 or 1.0000000000000001e-184 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 3.9999999999999998e291

                  1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(t, \color{blue}{1}, x\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites48.5%

                        \[\leadsto \mathsf{fma}\left(t, \color{blue}{1}, x\right) \]

                      if -1.9999999999999999e-151 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.0000000000000001e-184

                      1. Initial program 22.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 rewrites39.9%

                          \[\leadsto \color{blue}{t} \]
                      5. Recombined 3 regimes into one program.
                      6. Final simplification49.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -\infty:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-151}:\\ \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 10^{-184}:\\ \;\;\;\;t\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 4 \cdot 10^{+291}:\\ \;\;\;\;\mathsf{fma}\left(t, 1, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 4: 59.4% accurate, 0.7× speedup?

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

                        1. Initial program 57.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}{t} \]
                        4. Step-by-step derivation
                          1. Applied rewrites60.1%

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

                          if -7.9999999999999994e112 < z < 2.29999999999999999e-166

                          1. Initial program 90.7%

                            \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                            if 2.29999999999999999e-166 < z < 6.5000000000000006e107

                            1. Initial program 82.7%

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-166}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+107}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 5: 73.3% accurate, 0.8× speedup?

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

                              1. Initial program 83.6%

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

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

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

                                if -1.08000000000000003e151 < y < 8.9999999999999999e69

                                1. Initial program 76.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 6: 61.8% accurate, 0.8× speedup?

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

                                  1. Initial program 56.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}{t} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites61.7%

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

                                    if -2.70000000000000015e144 < z < 4.59999999999999979e86

                                    1. Initial program 88.2%

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+144}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+86}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                    7. Add Preprocessing

                                    Alternative 7: 67.3% accurate, 0.8× speedup?

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

                                      1. Initial program 83.1%

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

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

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

                                        if -1.09999999999999995e54 < y < 1.05e32

                                        1. Initial program 75.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 8: 60.2% accurate, 0.9× speedup?

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

                                            1. Initial program 57.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}{t} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites60.1%

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

                                              if -7.9999999999999994e112 < z < 5.5000000000000003e107

                                              1. Initial program 88.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 9: 59.0% accurate, 0.9× speedup?

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

                                                1. Initial program 57.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 rewrites58.6%

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

                                                  if -7.9999999999999994e112 < z < 8.80000000000000011e80

                                                  1. Initial program 89.4%

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

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

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+80}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 10: 52.5% accurate, 1.0× speedup?

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

                                                    1. Initial program 57.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}{t} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites60.1%

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

                                                      if -7.9999999999999994e112 < z < 5.5000000000000003e107

                                                      1. Initial program 88.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+112}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+107}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 11: 38.3% accurate, 2.2× speedup?

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

                                                          1. Initial program 60.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 rewrites54.1%

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

                                                            if -2.59999999999999992e23 < z < 3.5999999999999999e84

                                                            1. Initial program 91.7%

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

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

                                                                \[\leadsto \color{blue}{x} \]
                                                            5. Recombined 2 regimes into one program.
                                                            6. Final simplification42.2%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+23}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                            7. Add Preprocessing

                                                            Alternative 12: 24.7% 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 78.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 rewrites27.7%

                                                                \[\leadsto \color{blue}{t} \]
                                                              2. Final simplification27.7%

                                                                \[\leadsto t \]
                                                              3. Add Preprocessing

                                                              Reproduce

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