Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.5% → 92.8%
Time: 6.8s
Alternatives: 14
Speedup: 0.3×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 79.5% 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: 92.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_2 := \sqrt[3]{a - z}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{{t\_2}^{2}}, \frac{t - x}{t\_2}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))) (t_2 (cbrt (- a z))))
   (if (or (<= t_1 -1e-267) (not (<= t_1 0.0)))
     (fma (/ (- y z) (pow t_2 2.0)) (/ (- t x) t_2) x)
     (fma x (/ (- y a) z) t))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double t_2 = cbrt((a - z));
	double tmp;
	if ((t_1 <= -1e-267) || !(t_1 <= 0.0)) {
		tmp = fma(((y - z) / pow(t_2, 2.0)), ((t - x) / t_2), x);
	} else {
		tmp = fma(x, ((y - a) / z), 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))))
	t_2 = cbrt(Float64(a - z))
	tmp = 0.0
	if ((t_1 <= -1e-267) || !(t_1 <= 0.0))
		tmp = fma(Float64(Float64(y - z) / (t_2 ^ 2.0)), Float64(Float64(t - x) / t_2), x);
	else
		tmp = fma(x, Float64(Float64(y - a) / z), 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]}, Block[{t$95$2 = N[Power[N[(a - z), $MachinePrecision], 1/3], $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-267], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / t$95$2), $MachinePrecision] + x), $MachinePrecision], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}

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

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

    1. Initial program 91.9%

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

        \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. +-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. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
      11. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
      12. lower-cbrt.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
      14. lower-cbrt.f6494.5

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

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

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

    1. Initial program 3.2%

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

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

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

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

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

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

      Alternative 2: 89.9% 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 -1 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, 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 -1e-267) (not (<= t_1 0.0)))
           (+ x (* (- y z) (- (/ t (- a z)) (/ x (- a z)))))
           (fma x (/ (- y a) z) 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 <= -1e-267) || !(t_1 <= 0.0)) {
      		tmp = x + ((y - z) * ((t / (a - z)) - (x / (a - z))));
      	} else {
      		tmp = fma(x, ((y - a) / z), 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 <= -1e-267) || !(t_1 <= 0.0))
      		tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t / Float64(a - z)) - Float64(x / Float64(a - z)))));
      	else
      		tmp = fma(x, Float64(Float64(y - a) / z), 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, -1e-267], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - a), $MachinePrecision] / z), $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 -1 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0\right):\\
      \;\;\;\;x + \left(y - z\right) \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, 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)))) < -9.9999999999999998e-268 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

        1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

        1. Initial program 3.2%

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

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

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

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

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

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

          Alternative 3: 90.3% 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 -1 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, 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 -1e-267) (not (<= t_1 0.0))) t_1 (fma x (/ (- y a) z) 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 <= -1e-267) || !(t_1 <= 0.0)) {
          		tmp = t_1;
          	} else {
          		tmp = fma(x, ((y - a) / z), 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 <= -1e-267) || !(t_1 <= 0.0))
          		tmp = t_1;
          	else
          		tmp = fma(x, Float64(Float64(y - a) / z), 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, -1e-267], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(x * N[(N[(y - a), $MachinePrecision] / z), $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 -1 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0\right):\\
          \;\;\;\;t\_1\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, 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)))) < -9.9999999999999998e-268 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

            1. Initial program 91.9%

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

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

            1. Initial program 3.2%

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

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

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

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

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

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

              Alternative 4: 78.8% accurate, 0.8× speedup?

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

                1. Initial program 67.1%

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

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

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

                  if -6.5e12 < z < 1.62e81

                  1. Initial program 92.2%

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

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

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

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

                  Alternative 5: 75.9% accurate, 0.8× speedup?

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

                    1. Initial program 88.3%

                      \[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. lift-/.f64N/A

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                      11. lower-pow.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                      12. lower-cbrt.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                      14. lower-cbrt.f6490.5

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

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

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

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

                      if -0.0115 < a < 1.3e7

                      1. Initial program 75.4%

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.0115 \lor \neg \left(a \leq 13000000\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 6: 75.9% accurate, 0.8× speedup?

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

                        1. Initial program 90.8%

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

                            \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                          2. +-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. lift-/.f64N/A

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                          11. lower-pow.f64N/A

                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                          12. lower-cbrt.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                          14. lower-cbrt.f6490.5

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

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

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

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

                          if -0.0115 < a < 1.3e7

                          1. Initial program 75.4%

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

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

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

                            if 1.3e7 < a

                            1. Initial program 85.4%

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

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

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

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

                            Alternative 7: 73.1% accurate, 0.8× speedup?

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

                              1. Initial program 87.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. lift-/.f64N/A

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                11. lower-pow.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                12. lower-cbrt.f64N/A

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

                                  \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                                14. lower-cbrt.f6489.9

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

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

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

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

                                if -0.0115 < a < 1.65000000000000008e-6

                                1. Initial program 75.8%

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

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

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

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

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

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

                                  Alternative 8: 72.4% accurate, 0.8× speedup?

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

                                    1. Initial program 87.7%

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

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

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

                                      if -0.0115 < a < 1.65000000000000008e-6

                                      1. Initial program 75.8%

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

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

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

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

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

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

                                        Alternative 9: 69.0% accurate, 0.9× speedup?

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

                                          1. Initial program 87.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. lift-/.f64N/A

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                            11. lower-pow.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                            12. lower-cbrt.f64N/A

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

                                              \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                                            14. lower-cbrt.f6489.9

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

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

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

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

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

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

                                              if -0.0115 < a < 1.65000000000000008e-6

                                              1. Initial program 75.8%

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

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

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

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

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

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

                                                Alternative 10: 68.5% accurate, 0.9× speedup?

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

                                                  1. Initial program 87.7%

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

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

                                                    if -0.0115 < a < 1.65000000000000008e-6

                                                    1. Initial program 75.8%

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

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

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

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

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

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

                                                      Alternative 11: 64.9% accurate, 0.9× speedup?

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

                                                        1. Initial program 87.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. lift-/.f64N/A

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

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

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

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

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

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

                                                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                                          11. lower-pow.f64N/A

                                                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                                          12. lower-cbrt.f64N/A

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

                                                            \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                                                          14. lower-cbrt.f6489.9

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

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

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

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

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

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

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

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

                                                              if -0.0115 < a < 3.1e-6

                                                              1. Initial program 75.8%

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

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

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

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

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

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

                                                                Alternative 12: 53.0% accurate, 1.0× speedup?

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

                                                                  1. Initial program 68.0%

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

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

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

                                                                    if -8.1e21 < z < 2.80000000000000015e87

                                                                    1. Initial program 91.1%

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

                                                                        \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                                                      2. +-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. lift-/.f64N/A

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

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

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

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

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

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

                                                                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                                                      11. lower-pow.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^{2}}}, \frac{t - x}{\sqrt[3]{a - z}}, x\right) \]
                                                                      12. lower-cbrt.f64N/A

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

                                                                        \[\leadsto \mathsf{fma}\left(\frac{y - z}{{\left(\sqrt[3]{a - z}\right)}^{2}}, \color{blue}{\frac{t - x}{\sqrt[3]{a - z}}}, x\right) \]
                                                                      14. lower-cbrt.f6492.9

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

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

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

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

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

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

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

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

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

                                                                        Alternative 13: 38.8% accurate, 2.2× speedup?

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

                                                                          1. Initial program 68.0%

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

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

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

                                                                            if -8.1e21 < z < 9.5000000000000002e83

                                                                            1. Initial program 91.1%

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

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

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

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.1 \cdot 10^{+21}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+83}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                                            7. Add Preprocessing

                                                                            Alternative 14: 25.5% 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 81.5%

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

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

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

                                                                                \[\leadsto t \]
                                                                              3. Add Preprocessing

                                                                              Reproduce

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