Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3

Percentage Accurate: 68.7% → 86.8%
Time: 9.0s
Alternatives: 17
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 17 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: 68.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.8% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-288}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 32.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
      9. distribute-rgt-out--N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
      10. distribute-lft-neg-inN/A

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

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

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

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

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

      if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000006e-288 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5e287

      1. Initial program 98.1%

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

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

      1. Initial program 43.1%

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

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

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

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

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

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

    Alternative 2: 86.7% accurate, 0.2× speedup?

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

      1. Initial program 32.8%

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
        9. distribute-rgt-out--N/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
        10. distribute-lft-neg-inN/A

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

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

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

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

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

        if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1.00000000000000006e-288 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 2.0000000000000001e300

        1. Initial program 98.1%

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

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

        1. Initial program 40.2%

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
          9. distribute-rgt-out--N/A

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
          10. distribute-lft-neg-inN/A

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

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

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

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

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

        Alternative 3: 50.5% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+157}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -88000000:\\ \;\;\;\;\frac{y - a}{z} \cdot x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+164}:\\ \;\;\;\;\frac{\left(x - t\right) \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -2.9e+157)
           t
           (if (<= z -88000000.0)
             (* (/ (- y a) z) x)
             (if (<= z 3e-30)
               (fma (/ t a) y x)
               (if (<= z 1.85e+164) (/ (* (- x t) y) z) t)))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -2.9e+157) {
        		tmp = t;
        	} else if (z <= -88000000.0) {
        		tmp = ((y - a) / z) * x;
        	} else if (z <= 3e-30) {
        		tmp = fma((t / a), y, x);
        	} else if (z <= 1.85e+164) {
        		tmp = ((x - t) * y) / z;
        	} else {
        		tmp = t;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -2.9e+157)
        		tmp = t;
        	elseif (z <= -88000000.0)
        		tmp = Float64(Float64(Float64(y - a) / z) * x);
        	elseif (z <= 3e-30)
        		tmp = fma(Float64(t / a), y, x);
        	elseif (z <= 1.85e+164)
        		tmp = Float64(Float64(Float64(x - t) * y) / z);
        	else
        		tmp = t;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+157], t, If[LessEqual[z, -88000000.0], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e-30], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 1.85e+164], N[(N[(N[(x - t), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], t]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -2.9 \cdot 10^{+157}:\\
        \;\;\;\;t\\
        
        \mathbf{elif}\;z \leq -88000000:\\
        \;\;\;\;\frac{y - a}{z} \cdot x\\
        
        \mathbf{elif}\;z \leq 3 \cdot 10^{-30}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
        
        \mathbf{elif}\;z \leq 1.85 \cdot 10^{+164}:\\
        \;\;\;\;\frac{\left(x - t\right) \cdot y}{z}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if z < -2.89999999999999988e157 or 1.85e164 < z

          1. Initial program 41.4%

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

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

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
            5. distribute-lft-neg-inN/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
            6. mul-1-negN/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
            8. mul-1-negN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(-\left(t - x\right), \color{blue}{\frac{z}{a - z}}, x\right) \]
            12. lower--.f6464.4

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

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

            \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
          7. Step-by-step derivation
            1. Applied rewrites74.2%

              \[\leadsto \mathsf{fma}\left(0, \color{blue}{x}, 1 \cdot t\right) \]
            2. Step-by-step derivation
              1. Applied rewrites74.2%

                \[\leadsto t \]

              if -2.89999999999999988e157 < z < -8.8e7

              1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                9. distribute-rgt-out--N/A

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  if -8.8e7 < z < 2.9999999999999999e-30

                  1. Initial program 91.4%

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

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

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

                      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                    3. *-commutativeN/A

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

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

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

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

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

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

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

                    if 2.9999999999999999e-30 < z < 1.85e164

                    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                      9. distribute-rgt-out--N/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                      10. distribute-lft-neg-inN/A

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

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

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

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

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

                          \[\leadsto \frac{\left(x - t\right) \cdot y}{z} \]
                      3. Recombined 4 regimes into one program.
                      4. Final simplification63.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+157}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -88000000:\\ \;\;\;\;\frac{y - a}{z} \cdot x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+164}:\\ \;\;\;\;\frac{\left(x - t\right) \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 4: 52.1% accurate, 0.8× speedup?

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

                        1. Initial program 39.0%

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

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

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

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

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

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                          5. distribute-lft-neg-inN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                          6. mul-1-negN/A

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                          8. mul-1-negN/A

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

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

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

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

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

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

                          \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                        7. Step-by-step derivation
                          1. Applied rewrites69.9%

                            \[\leadsto \mathsf{fma}\left(0, \color{blue}{x}, 1 \cdot t\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites69.9%

                              \[\leadsto t \]

                            if -2.70000000000000006e106 < z < 2.9999999999999999e-30

                            1. Initial program 85.8%

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

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

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

                                \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                              3. *-commutativeN/A

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

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

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

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

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

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

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

                              if 2.9999999999999999e-30 < z < 1.85e164

                              1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                9. distribute-rgt-out--N/A

                                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+106}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+164}:\\ \;\;\;\;\frac{\left(x - t\right) \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                5. Add Preprocessing

                                Alternative 5: 52.7% accurate, 0.8× speedup?

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

                                  1. Initial program 39.0%

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

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

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

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

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

                                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                    5. distribute-lft-neg-inN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                    6. mul-1-negN/A

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

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                    8. mul-1-negN/A

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

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

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

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

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

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

                                    \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites69.9%

                                      \[\leadsto \mathsf{fma}\left(0, \color{blue}{x}, 1 \cdot t\right) \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites69.9%

                                        \[\leadsto t \]

                                      if -2.70000000000000006e106 < z < 3.2e-30

                                      1. Initial program 85.8%

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

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

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

                                          \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                        3. *-commutativeN/A

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

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

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

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

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

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

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

                                        if 3.2e-30 < z < 1.90000000000000011e164

                                        1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                          9. distribute-rgt-out--N/A

                                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                          10. distribute-lft-neg-inN/A

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

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

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

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

                                            \[\leadsto \frac{x - t}{z} \cdot \color{blue}{y} \]
                                        8. Recombined 3 regimes into one program.
                                        9. Final simplification61.1%

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

                                        Alternative 6: 77.2% accurate, 0.8× speedup?

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

                                          1. Initial program 42.6%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                            9. distribute-rgt-out--N/A

                                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                            10. distribute-lft-neg-inN/A

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

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

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

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

                                            if -5.1e6 < z < 6.8e12

                                            1. Initial program 91.3%

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

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

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

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

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

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

                                            if 6.8e12 < z

                                            1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                              9. distribute-rgt-out--N/A

                                                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                              10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                                            Alternative 7: 75.3% accurate, 0.8× speedup?

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

                                              1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                9. distribute-rgt-out--N/A

                                                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                10. distribute-lft-neg-inN/A

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

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

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

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

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

                                                if -650 < z < 3.09999999999999991e-30

                                                1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 8: 73.5% accurate, 0.8× speedup?

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

                                                1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                  9. distribute-rgt-out--N/A

                                                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                  10. distribute-lft-neg-inN/A

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

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

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

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

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

                                                  if -0.0210000000000000013 < z < 2.9999999999999999e-30

                                                  1. Initial program 91.4%

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

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

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

                                                      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                                    3. *-commutativeN/A

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

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

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

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

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

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

                                                Alternative 9: 75.0% accurate, 0.8× speedup?

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

                                                  1. Initial program 42.6%

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                    9. distribute-rgt-out--N/A

                                                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                    10. distribute-lft-neg-inN/A

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

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

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

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

                                                    if -650 < z < 3.09999999999999991e-30

                                                    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

                                                    if 3.09999999999999991e-30 < z

                                                    1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                      9. distribute-rgt-out--N/A

                                                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                      10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                                                    Alternative 10: 34.6% accurate, 0.8× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                                                    (FPCore (x y z t a)
                                                     :precision binary64
                                                     (if (<= z -4.5e+57)
                                                       t
                                                       (if (<= z -2.5e-43) (* (/ x z) y) (if (<= z 175000.0) (/ (* t y) a) t))))
                                                    double code(double x, double y, double z, double t, double a) {
                                                    	double tmp;
                                                    	if (z <= -4.5e+57) {
                                                    		tmp = t;
                                                    	} else if (z <= -2.5e-43) {
                                                    		tmp = (x / z) * y;
                                                    	} else if (z <= 175000.0) {
                                                    		tmp = (t * y) / a;
                                                    	} 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 <= (-4.5d+57)) then
                                                            tmp = t
                                                        else if (z <= (-2.5d-43)) then
                                                            tmp = (x / z) * y
                                                        else if (z <= 175000.0d0) then
                                                            tmp = (t * y) / a
                                                        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 <= -4.5e+57) {
                                                    		tmp = t;
                                                    	} else if (z <= -2.5e-43) {
                                                    		tmp = (x / z) * y;
                                                    	} else if (z <= 175000.0) {
                                                    		tmp = (t * y) / a;
                                                    	} else {
                                                    		tmp = t;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(x, y, z, t, a):
                                                    	tmp = 0
                                                    	if z <= -4.5e+57:
                                                    		tmp = t
                                                    	elif z <= -2.5e-43:
                                                    		tmp = (x / z) * y
                                                    	elif z <= 175000.0:
                                                    		tmp = (t * y) / a
                                                    	else:
                                                    		tmp = t
                                                    	return tmp
                                                    
                                                    function code(x, y, z, t, a)
                                                    	tmp = 0.0
                                                    	if (z <= -4.5e+57)
                                                    		tmp = t;
                                                    	elseif (z <= -2.5e-43)
                                                    		tmp = Float64(Float64(x / z) * y);
                                                    	elseif (z <= 175000.0)
                                                    		tmp = Float64(Float64(t * y) / a);
                                                    	else
                                                    		tmp = t;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(x, y, z, t, a)
                                                    	tmp = 0.0;
                                                    	if (z <= -4.5e+57)
                                                    		tmp = t;
                                                    	elseif (z <= -2.5e-43)
                                                    		tmp = (x / z) * y;
                                                    	elseif (z <= 175000.0)
                                                    		tmp = (t * y) / a;
                                                    	else
                                                    		tmp = t;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+57], t, If[LessEqual[z, -2.5e-43], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 175000.0], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], t]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\
                                                    \;\;\;\;t\\
                                                    
                                                    \mathbf{elif}\;z \leq -2.5 \cdot 10^{-43}:\\
                                                    \;\;\;\;\frac{x}{z} \cdot y\\
                                                    
                                                    \mathbf{elif}\;z \leq 175000:\\
                                                    \;\;\;\;\frac{t \cdot y}{a}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;t\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if z < -4.49999999999999996e57 or 175000 < z

                                                      1. Initial program 48.3%

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

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

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

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

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

                                                          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                        5. distribute-lft-neg-inN/A

                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                        6. mul-1-negN/A

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

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                        8. mul-1-negN/A

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(-\left(t - x\right), \color{blue}{\frac{z}{a - z}}, x\right) \]
                                                        12. lower--.f6458.4

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

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

                                                        \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites54.3%

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

                                                            \[\leadsto t \]

                                                          if -4.49999999999999996e57 < z < -2.50000000000000009e-43

                                                          1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                            9. distribute-rgt-out--N/A

                                                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                            10. distribute-lft-neg-inN/A

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

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

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

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

                                                              \[\leadsto \frac{x - t}{z} \cdot \color{blue}{y} \]
                                                            2. Taylor expanded in x around inf

                                                              \[\leadsto \frac{x}{z} \cdot y \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites50.6%

                                                                \[\leadsto \frac{x}{z} \cdot y \]

                                                              if -2.50000000000000009e-43 < z < 175000

                                                              1. Initial program 91.4%

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

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

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

                                                                  \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                                                3. *-commutativeN/A

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

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

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

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

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

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

                                                                  \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
                                                              8. Recombined 3 regimes into one program.
                                                              9. Final simplification44.2%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                              10. Add Preprocessing

                                                              Alternative 11: 36.3% accurate, 0.8× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                                                              (FPCore (x y z t a)
                                                               :precision binary64
                                                               (if (<= z -4.5e+57)
                                                                 t
                                                                 (if (<= z -2.7e-43) (* (/ x z) y) (if (<= z 175000.0) (* t (/ y a)) t))))
                                                              double code(double x, double y, double z, double t, double a) {
                                                              	double tmp;
                                                              	if (z <= -4.5e+57) {
                                                              		tmp = t;
                                                              	} else if (z <= -2.7e-43) {
                                                              		tmp = (x / z) * y;
                                                              	} else if (z <= 175000.0) {
                                                              		tmp = t * (y / a);
                                                              	} 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 <= (-4.5d+57)) then
                                                                      tmp = t
                                                                  else if (z <= (-2.7d-43)) then
                                                                      tmp = (x / z) * y
                                                                  else if (z <= 175000.0d0) then
                                                                      tmp = t * (y / a)
                                                                  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 <= -4.5e+57) {
                                                              		tmp = t;
                                                              	} else if (z <= -2.7e-43) {
                                                              		tmp = (x / z) * y;
                                                              	} else if (z <= 175000.0) {
                                                              		tmp = t * (y / a);
                                                              	} else {
                                                              		tmp = t;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              def code(x, y, z, t, a):
                                                              	tmp = 0
                                                              	if z <= -4.5e+57:
                                                              		tmp = t
                                                              	elif z <= -2.7e-43:
                                                              		tmp = (x / z) * y
                                                              	elif z <= 175000.0:
                                                              		tmp = t * (y / a)
                                                              	else:
                                                              		tmp = t
                                                              	return tmp
                                                              
                                                              function code(x, y, z, t, a)
                                                              	tmp = 0.0
                                                              	if (z <= -4.5e+57)
                                                              		tmp = t;
                                                              	elseif (z <= -2.7e-43)
                                                              		tmp = Float64(Float64(x / z) * y);
                                                              	elseif (z <= 175000.0)
                                                              		tmp = Float64(t * Float64(y / a));
                                                              	else
                                                              		tmp = t;
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              function tmp_2 = code(x, y, z, t, a)
                                                              	tmp = 0.0;
                                                              	if (z <= -4.5e+57)
                                                              		tmp = t;
                                                              	elseif (z <= -2.7e-43)
                                                              		tmp = (x / z) * y;
                                                              	elseif (z <= 175000.0)
                                                              		tmp = t * (y / a);
                                                              	else
                                                              		tmp = t;
                                                              	end
                                                              	tmp_2 = tmp;
                                                              end
                                                              
                                                              code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+57], t, If[LessEqual[z, -2.7e-43], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 175000.0], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], t]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\
                                                              \;\;\;\;t\\
                                                              
                                                              \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\
                                                              \;\;\;\;\frac{x}{z} \cdot y\\
                                                              
                                                              \mathbf{elif}\;z \leq 175000:\\
                                                              \;\;\;\;t \cdot \frac{y}{a}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;t\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if z < -4.49999999999999996e57 or 175000 < z

                                                                1. Initial program 48.3%

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

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

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

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

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

                                                                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                                  5. distribute-lft-neg-inN/A

                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                                  6. mul-1-negN/A

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

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                                  8. mul-1-negN/A

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

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

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

                                                                    \[\leadsto \mathsf{fma}\left(-\left(t - x\right), \color{blue}{\frac{z}{a - z}}, x\right) \]
                                                                  12. lower--.f6458.4

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

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

                                                                  \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites54.3%

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

                                                                      \[\leadsto t \]

                                                                    if -4.49999999999999996e57 < z < -2.69999999999999991e-43

                                                                    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                                      9. distribute-rgt-out--N/A

                                                                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                                      10. distribute-lft-neg-inN/A

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

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

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

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

                                                                        \[\leadsto \frac{x - t}{z} \cdot \color{blue}{y} \]
                                                                      2. Taylor expanded in x around inf

                                                                        \[\leadsto \frac{x}{z} \cdot y \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites50.6%

                                                                          \[\leadsto \frac{x}{z} \cdot y \]

                                                                        if -2.69999999999999991e-43 < z < 175000

                                                                        1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

                                                                            \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
                                                                        8. Recombined 3 regimes into one program.
                                                                        9. Final simplification43.8%

                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                                        10. Add Preprocessing

                                                                        Alternative 12: 36.3% accurate, 0.8× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
                                                                        (FPCore (x y z t a)
                                                                         :precision binary64
                                                                         (if (<= z -4.5e+57)
                                                                           t
                                                                           (if (<= z -2.7e-43) (* x (/ y z)) (if (<= z 175000.0) (* t (/ y a)) t))))
                                                                        double code(double x, double y, double z, double t, double a) {
                                                                        	double tmp;
                                                                        	if (z <= -4.5e+57) {
                                                                        		tmp = t;
                                                                        	} else if (z <= -2.7e-43) {
                                                                        		tmp = x * (y / z);
                                                                        	} else if (z <= 175000.0) {
                                                                        		tmp = t * (y / a);
                                                                        	} 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 <= (-4.5d+57)) then
                                                                                tmp = t
                                                                            else if (z <= (-2.7d-43)) then
                                                                                tmp = x * (y / z)
                                                                            else if (z <= 175000.0d0) then
                                                                                tmp = t * (y / a)
                                                                            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 <= -4.5e+57) {
                                                                        		tmp = t;
                                                                        	} else if (z <= -2.7e-43) {
                                                                        		tmp = x * (y / z);
                                                                        	} else if (z <= 175000.0) {
                                                                        		tmp = t * (y / a);
                                                                        	} else {
                                                                        		tmp = t;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x, y, z, t, a):
                                                                        	tmp = 0
                                                                        	if z <= -4.5e+57:
                                                                        		tmp = t
                                                                        	elif z <= -2.7e-43:
                                                                        		tmp = x * (y / z)
                                                                        	elif z <= 175000.0:
                                                                        		tmp = t * (y / a)
                                                                        	else:
                                                                        		tmp = t
                                                                        	return tmp
                                                                        
                                                                        function code(x, y, z, t, a)
                                                                        	tmp = 0.0
                                                                        	if (z <= -4.5e+57)
                                                                        		tmp = t;
                                                                        	elseif (z <= -2.7e-43)
                                                                        		tmp = Float64(x * Float64(y / z));
                                                                        	elseif (z <= 175000.0)
                                                                        		tmp = Float64(t * Float64(y / a));
                                                                        	else
                                                                        		tmp = t;
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x, y, z, t, a)
                                                                        	tmp = 0.0;
                                                                        	if (z <= -4.5e+57)
                                                                        		tmp = t;
                                                                        	elseif (z <= -2.7e-43)
                                                                        		tmp = x * (y / z);
                                                                        	elseif (z <= 175000.0)
                                                                        		tmp = t * (y / a);
                                                                        	else
                                                                        		tmp = t;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+57], t, If[LessEqual[z, -2.7e-43], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 175000.0], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], t]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\
                                                                        \;\;\;\;t\\
                                                                        
                                                                        \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\
                                                                        \;\;\;\;x \cdot \frac{y}{z}\\
                                                                        
                                                                        \mathbf{elif}\;z \leq 175000:\\
                                                                        \;\;\;\;t \cdot \frac{y}{a}\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 3 regimes
                                                                        2. if z < -4.49999999999999996e57 or 175000 < z

                                                                          1. Initial program 48.3%

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

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

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

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

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

                                                                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                                            5. distribute-lft-neg-inN/A

                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                                            6. mul-1-negN/A

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

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                                            8. mul-1-negN/A

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

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

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

                                                                              \[\leadsto \mathsf{fma}\left(-\left(t - x\right), \color{blue}{\frac{z}{a - z}}, x\right) \]
                                                                            12. lower--.f6458.4

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

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

                                                                            \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites54.3%

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

                                                                                \[\leadsto t \]

                                                                              if -4.49999999999999996e57 < z < -2.69999999999999991e-43

                                                                              1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                                                9. distribute-rgt-out--N/A

                                                                                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                                                10. distribute-lft-neg-inN/A

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

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

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

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

                                                                                  \[\leadsto \frac{x - t}{z} \cdot \color{blue}{y} \]
                                                                                2. Taylor expanded in x around inf

                                                                                  \[\leadsto \frac{x \cdot y}{z} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites50.6%

                                                                                    \[\leadsto x \cdot \frac{y}{\color{blue}{z}} \]

                                                                                  if -2.69999999999999991e-43 < z < 175000

                                                                                  1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
                                                                                  8. Recombined 3 regimes into one program.
                                                                                  9. Final simplification43.8%

                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-43}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 175000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                                                                                  10. Add Preprocessing

                                                                                  Alternative 13: 63.8% accurate, 0.9× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{+19} \lor \neg \left(a \leq 1.26 \cdot 10^{+150}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{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 -1.45e+19) (not (<= a 1.26e+150)))
                                                                                     (fma (/ t 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 <= -1.45e+19) || !(a <= 1.26e+150)) {
                                                                                  		tmp = fma((t / 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 <= -1.45e+19) || !(a <= 1.26e+150))
                                                                                  		tmp = fma(Float64(t / 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, -1.45e+19], N[Not[LessEqual[a, 1.26e+150]], $MachinePrecision]], N[(N[(t / 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 -1.45 \cdot 10^{+19} \lor \neg \left(a \leq 1.26 \cdot 10^{+150}\right):\\
                                                                                  \;\;\;\;\mathsf{fma}\left(\frac{t}{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 < -1.45e19 or 1.26e150 < a

                                                                                    1. Initial program 73.7%

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

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

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

                                                                                        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                                                                      3. *-commutativeN/A

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

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

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

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

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

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

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

                                                                                      if -1.45e19 < a < 1.26e150

                                                                                      1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

                                                                                          \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                                                        9. distribute-rgt-out--N/A

                                                                                          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                                                        10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                                                                                      Alternative 14: 68.7% accurate, 0.9× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -650:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y - a, t\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-30}:\\ \;\;\;\;\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 (<= z -650.0)
                                                                                         (fma (/ x z) (- y a) t)
                                                                                         (if (<= z 3.2e-30) (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 (z <= -650.0) {
                                                                                      		tmp = fma((x / z), (y - a), t);
                                                                                      	} else if (z <= 3.2e-30) {
                                                                                      		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 (z <= -650.0)
                                                                                      		tmp = fma(Float64(x / z), Float64(y - a), t);
                                                                                      	elseif (z <= 3.2e-30)
                                                                                      		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[LessEqual[z, -650.0], N[(N[(x / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 3.2e-30], 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}\;z \leq -650:\\
                                                                                      \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y - a, t\right)\\
                                                                                      
                                                                                      \mathbf{elif}\;z \leq 3.2 \cdot 10^{-30}:\\
                                                                                      \;\;\;\;\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 3 regimes
                                                                                      2. if z < -650

                                                                                        1. Initial program 42.6%

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

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

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

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

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

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

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

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

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

                                                                                            \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                                                          9. distribute-rgt-out--N/A

                                                                                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                                                          10. distribute-lft-neg-inN/A

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

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

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

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

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

                                                                                          if -650 < z < 3.2e-30

                                                                                          1. Initial program 91.4%

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

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

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

                                                                                              \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                                                                            3. *-commutativeN/A

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

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

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

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

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

                                                                                          if 3.2e-30 < z

                                                                                          1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot \frac{t - x}{z} - \color{blue}{a \cdot \frac{t - x}{z}}\right)\right)\right) + t \]
                                                                                            9. distribute-rgt-out--N/A

                                                                                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{t - x}{z} \cdot \left(y - a\right)}\right)\right) + t \]
                                                                                            10. distribute-lft-neg-inN/A

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

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

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

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

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

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

                                                                                          Alternative 15: 52.2% accurate, 1.0× speedup?

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

                                                                                            1. Initial program 39.0%

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

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

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

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

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

                                                                                                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                                                              5. distribute-lft-neg-inN/A

                                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                                                              6. mul-1-negN/A

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

                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                                                              8. mul-1-negN/A

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

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

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

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

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

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

                                                                                              \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites69.9%

                                                                                                \[\leadsto \mathsf{fma}\left(0, \color{blue}{x}, 1 \cdot t\right) \]
                                                                                              2. Step-by-step derivation
                                                                                                1. Applied rewrites69.9%

                                                                                                  \[\leadsto t \]

                                                                                                if -2.70000000000000006e106 < z < 3.3e163

                                                                                                1. Initial program 83.6%

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

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

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

                                                                                                    \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
                                                                                                  3. *-commutativeN/A

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

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

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

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

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

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

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

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

                                                                                                Alternative 16: 36.3% accurate, 1.0× speedup?

                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3600000000000 \lor \neg \left(z \leq 175000\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \end{array} \]
                                                                                                (FPCore (x y z t a)
                                                                                                 :precision binary64
                                                                                                 (if (or (<= z -3600000000000.0) (not (<= z 175000.0))) t (* t (/ y a))))
                                                                                                double code(double x, double y, double z, double t, double a) {
                                                                                                	double tmp;
                                                                                                	if ((z <= -3600000000000.0) || !(z <= 175000.0)) {
                                                                                                		tmp = t;
                                                                                                	} else {
                                                                                                		tmp = t * (y / a);
                                                                                                	}
                                                                                                	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 <= (-3600000000000.0d0)) .or. (.not. (z <= 175000.0d0))) then
                                                                                                        tmp = t
                                                                                                    else
                                                                                                        tmp = t * (y / a)
                                                                                                    end if
                                                                                                    code = tmp
                                                                                                end function
                                                                                                
                                                                                                public static double code(double x, double y, double z, double t, double a) {
                                                                                                	double tmp;
                                                                                                	if ((z <= -3600000000000.0) || !(z <= 175000.0)) {
                                                                                                		tmp = t;
                                                                                                	} else {
                                                                                                		tmp = t * (y / a);
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                def code(x, y, z, t, a):
                                                                                                	tmp = 0
                                                                                                	if (z <= -3600000000000.0) or not (z <= 175000.0):
                                                                                                		tmp = t
                                                                                                	else:
                                                                                                		tmp = t * (y / a)
                                                                                                	return tmp
                                                                                                
                                                                                                function code(x, y, z, t, a)
                                                                                                	tmp = 0.0
                                                                                                	if ((z <= -3600000000000.0) || !(z <= 175000.0))
                                                                                                		tmp = t;
                                                                                                	else
                                                                                                		tmp = Float64(t * Float64(y / a));
                                                                                                	end
                                                                                                	return tmp
                                                                                                end
                                                                                                
                                                                                                function tmp_2 = code(x, y, z, t, a)
                                                                                                	tmp = 0.0;
                                                                                                	if ((z <= -3600000000000.0) || ~((z <= 175000.0)))
                                                                                                		tmp = t;
                                                                                                	else
                                                                                                		tmp = t * (y / a);
                                                                                                	end
                                                                                                	tmp_2 = tmp;
                                                                                                end
                                                                                                
                                                                                                code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3600000000000.0], N[Not[LessEqual[z, 175000.0]], $MachinePrecision]], t, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \begin{array}{l}
                                                                                                \mathbf{if}\;z \leq -3600000000000 \lor \neg \left(z \leq 175000\right):\\
                                                                                                \;\;\;\;t\\
                                                                                                
                                                                                                \mathbf{else}:\\
                                                                                                \;\;\;\;t \cdot \frac{y}{a}\\
                                                                                                
                                                                                                
                                                                                                \end{array}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Split input into 2 regimes
                                                                                                2. if z < -3.6e12 or 175000 < z

                                                                                                  1. Initial program 49.1%

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

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

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

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

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

                                                                                                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                                                                    5. distribute-lft-neg-inN/A

                                                                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                                                                    6. mul-1-negN/A

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

                                                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                                                                    8. mul-1-negN/A

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

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

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

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

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

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

                                                                                                    \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites52.0%

                                                                                                      \[\leadsto \mathsf{fma}\left(0, \color{blue}{x}, 1 \cdot t\right) \]
                                                                                                    2. Step-by-step derivation
                                                                                                      1. Applied rewrites52.0%

                                                                                                        \[\leadsto t \]

                                                                                                      if -3.6e12 < z < 175000

                                                                                                      1. Initial program 90.2%

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

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

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

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

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

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

                                                                                                          \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{t}{a - z}} \]
                                                                                                        6. lower--.f6442.3

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

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

                                                                                                        \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
                                                                                                      7. Step-by-step derivation
                                                                                                        1. Applied rewrites31.8%

                                                                                                          \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
                                                                                                      8. Recombined 2 regimes into one program.
                                                                                                      9. Final simplification40.9%

                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3600000000000 \lor \neg \left(z \leq 175000\right):\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
                                                                                                      10. Add Preprocessing

                                                                                                      Alternative 17: 25.0% 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 71.7%

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

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

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

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

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

                                                                                                          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t - x\right) \cdot \frac{z}{a - z}}\right)\right) + x \]
                                                                                                        5. distribute-lft-neg-inN/A

                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \frac{z}{a - z}} + x \]
                                                                                                        6. mul-1-negN/A

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

                                                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \left(t - x\right), \frac{z}{a - z}, x\right)} \]
                                                                                                        8. mul-1-negN/A

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

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

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

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

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

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

                                                                                                        \[\leadsto \left(x + -1 \cdot x\right) - \color{blue}{-1 \cdot t} \]
                                                                                                      7. Step-by-step derivation
                                                                                                        1. Applied rewrites27.5%

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

                                                                                                            \[\leadsto t \]
                                                                                                          2. Add Preprocessing

                                                                                                          Developer Target 1: 84.5% accurate, 0.6× speedup?

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

                                                                                                          Reproduce

                                                                                                          ?
                                                                                                          herbie shell --seed 2024364 
                                                                                                          (FPCore (x y z t a)
                                                                                                            :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
                                                                                                            :precision binary64
                                                                                                          
                                                                                                            :alt
                                                                                                            (! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
                                                                                                          
                                                                                                            (+ x (/ (* (- y z) (- t x)) (- a z))))