Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A

Percentage Accurate: 98.1% → 98.1%
Time: 3.6s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\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 11 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: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}

Alternative 1: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Derivation
  1. Initial program 98.3%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 82.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+132}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000026e-102 or 1e19 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999998e132

    1. Initial program 98.9%

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

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

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

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

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

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

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

    if 5.00000000000000026e-102 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e19

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if 1.99999999999999998e132 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 88.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 80.9% accurate, 0.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000026e-102 or 1e19 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.9999999999999997e165

    1. Initial program 98.9%

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

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

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

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

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

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

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

    if 5.00000000000000026e-102 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e19

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if 4.9999999999999997e165 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{t \cdot y}{z} \]
      4. lift-*.f6474.3

        \[\leadsto -\frac{t \cdot y}{z} \]
    8. Applied rewrites74.3%

      \[\leadsto -\frac{t \cdot y}{z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.6%

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

Alternative 4: 80.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+19}:\\
\;\;\;\;x + y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999998e-13 or 1e19 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.9999999999999997e165

    1. Initial program 99.0%

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

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

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

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

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

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

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

    if 9.9999999999999998e-13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e19

    1. Initial program 100.0%

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

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

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

      if 4.9999999999999997e165 < (/.f64 (-.f64 z t) (-.f64 z a))

      1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -\frac{t \cdot y}{z} \]
        4. lift-*.f6474.3

          \[\leadsto -\frac{t \cdot y}{z} \]
      8. Applied rewrites74.3%

        \[\leadsto -\frac{t \cdot y}{z} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification86.4%

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

    Alternative 5: 80.5% accurate, 0.3× speedup?

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

      1. Initial program 99.0%

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

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

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

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

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

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

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

      if 9.9999999999999998e-13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e19

      1. Initial program 100.0%

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

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

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

        if 4.9999999999999997e165 < (/.f64 (-.f64 z t) (-.f64 z a))

        1. Initial program 87.0%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y \cdot \left(z - t\right)}{\color{blue}{z}} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

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

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

            \[\leadsto \frac{z - t}{z} \cdot y \]
          4. lift-/.f64N/A

            \[\leadsto \frac{z - t}{z} \cdot y \]
          5. lift--.f6469.9

            \[\leadsto \frac{z - t}{z} \cdot y \]
        8. Applied rewrites69.9%

          \[\leadsto \frac{z - t}{z} \cdot \color{blue}{y} \]
        9. Taylor expanded in z around 0

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

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

            \[\leadsto -\frac{t \cdot y}{z} \]
          3. lift-/.f64N/A

            \[\leadsto -\frac{t \cdot y}{z} \]
          4. *-commutativeN/A

            \[\leadsto -\frac{y \cdot t}{z} \]
          5. lower-*.f6474.3

            \[\leadsto -\frac{y \cdot t}{z} \]
        11. Applied rewrites74.3%

          \[\leadsto -\frac{y \cdot t}{z} \]
        12. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto -\frac{y \cdot t}{z} \]
          2. lift-/.f64N/A

            \[\leadsto -\frac{y \cdot t}{z} \]
          3. *-commutativeN/A

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

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

            \[\leadsto -t \cdot \frac{y}{z} \]
          6. lower-/.f6474.3

            \[\leadsto -t \cdot \frac{y}{z} \]
        13. Applied rewrites74.3%

          \[\leadsto -t \cdot \frac{y}{z} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification86.4%

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

      Alternative 6: 83.7% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq -100000000000 \lor \neg \left(t\_1 \leq 50000\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (/ (- z t) (- z a))))
         (if (or (<= t_1 -100000000000.0) (not (<= t_1 50000.0)))
           (* (- z t) (/ y (- z a)))
           (+ x (* y (/ z (- z a)))))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = (z - t) / (z - a);
      	double tmp;
      	if ((t_1 <= -100000000000.0) || !(t_1 <= 50000.0)) {
      		tmp = (z - t) * (y / (z - a));
      	} else {
      		tmp = x + (y * (z / (z - 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) :: t_1
          real(8) :: tmp
          t_1 = (z - t) / (z - a)
          if ((t_1 <= (-100000000000.0d0)) .or. (.not. (t_1 <= 50000.0d0))) then
              tmp = (z - t) * (y / (z - a))
          else
              tmp = x + (y * (z / (z - a)))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double t_1 = (z - t) / (z - a);
      	double tmp;
      	if ((t_1 <= -100000000000.0) || !(t_1 <= 50000.0)) {
      		tmp = (z - t) * (y / (z - a));
      	} else {
      		tmp = x + (y * (z / (z - a)));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = (z - t) / (z - a)
      	tmp = 0
      	if (t_1 <= -100000000000.0) or not (t_1 <= 50000.0):
      		tmp = (z - t) * (y / (z - a))
      	else:
      		tmp = x + (y * (z / (z - a)))
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(Float64(z - t) / Float64(z - a))
      	tmp = 0.0
      	if ((t_1 <= -100000000000.0) || !(t_1 <= 50000.0))
      		tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a)));
      	else
      		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = (z - t) / (z - a);
      	tmp = 0.0;
      	if ((t_1 <= -100000000000.0) || ~((t_1 <= 50000.0)))
      		tmp = (z - t) * (y / (z - a));
      	else
      		tmp = x + (y * (z / (z - a)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -100000000000.0], N[Not[LessEqual[t$95$1, 50000.0]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{z - t}{z - a}\\
      \mathbf{if}\;t\_1 \leq -100000000000 \lor \neg \left(t\_1 \leq 50000\right):\\
      \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
      
      \mathbf{else}:\\
      \;\;\;\;x + y \cdot \frac{z}{z - a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e11 or 5e4 < (/.f64 (-.f64 z t) (-.f64 z a))

        1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e4

        1. Initial program 99.8%

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

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

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

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

        Alternative 7: 83.7% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq -100000000000 \lor \neg \left(t\_1 \leq 50000\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (/ (- z t) (- z a))))
           (if (or (<= t_1 -100000000000.0) (not (<= t_1 50000.0)))
             (* (- z t) (/ y (- z a)))
             (fma y (/ z (- z a)) x))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = (z - t) / (z - a);
        	double tmp;
        	if ((t_1 <= -100000000000.0) || !(t_1 <= 50000.0)) {
        		tmp = (z - t) * (y / (z - a));
        	} else {
        		tmp = fma(y, (z / (z - a)), x);
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	t_1 = Float64(Float64(z - t) / Float64(z - a))
        	tmp = 0.0
        	if ((t_1 <= -100000000000.0) || !(t_1 <= 50000.0))
        		tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a)));
        	else
        		tmp = fma(y, Float64(z / Float64(z - a)), x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -100000000000.0], N[Not[LessEqual[t$95$1, 50000.0]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{z - t}{z - a}\\
        \mathbf{if}\;t\_1 \leq -100000000000 \lor \neg \left(t\_1 \leq 50000\right):\\
        \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e11 or 5e4 < (/.f64 (-.f64 z t) (-.f64 z a))

          1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1e11 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e4

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        Alternative 8: 81.1% accurate, 0.4× speedup?

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

          1. Initial program 97.4%

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

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

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

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

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

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

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

          if 9.9999999999999998e-13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e19

          1. Initial program 100.0%

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

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

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

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

          Alternative 9: 55.3% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+67}:\\ \;\;\;\;y\\ \mathbf{elif}\;t\_1 \leq 10^{+100}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (* y (/ (- z t) (- z a)))))
             (if (<= t_1 -2e+67) y (if (<= t_1 1e+100) x y))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = y * ((z - t) / (z - a));
          	double tmp;
          	if (t_1 <= -2e+67) {
          		tmp = y;
          	} else if (t_1 <= 1e+100) {
          		tmp = x;
          	} else {
          		tmp = y;
          	}
          	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 = y * ((z - t) / (z - a))
              if (t_1 <= (-2d+67)) then
                  tmp = y
              else if (t_1 <= 1d+100) then
                  tmp = x
              else
                  tmp = y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = y * ((z - t) / (z - a));
          	double tmp;
          	if (t_1 <= -2e+67) {
          		tmp = y;
          	} else if (t_1 <= 1e+100) {
          		tmp = x;
          	} else {
          		tmp = y;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = y * ((z - t) / (z - a))
          	tmp = 0
          	if t_1 <= -2e+67:
          		tmp = y
          	elif t_1 <= 1e+100:
          		tmp = x
          	else:
          		tmp = y
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a)))
          	tmp = 0.0
          	if (t_1 <= -2e+67)
          		tmp = y;
          	elseif (t_1 <= 1e+100)
          		tmp = x;
          	else
          		tmp = y;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = y * ((z - t) / (z - a));
          	tmp = 0.0;
          	if (t_1 <= -2e+67)
          		tmp = y;
          	elseif (t_1 <= 1e+100)
          		tmp = x;
          	else
          		tmp = y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+67], y, If[LessEqual[t$95$1, 1e+100], x, y]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := y \cdot \frac{z - t}{z - a}\\
          \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+67}:\\
          \;\;\;\;y\\
          
          \mathbf{elif}\;t\_1 \leq 10^{+100}:\\
          \;\;\;\;x\\
          
          \mathbf{else}:\\
          \;\;\;\;y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -1.99999999999999997e67 or 1.00000000000000002e100 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a)))

            1. Initial program 95.9%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{y \cdot \left(z - t\right)}{\color{blue}{z}} \]
            7. Step-by-step derivation
              1. associate-*r/N/A

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

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

                \[\leadsto \frac{z - t}{z} \cdot y \]
              4. lift-/.f64N/A

                \[\leadsto \frac{z - t}{z} \cdot y \]
              5. lift--.f6464.0

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

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

              \[\leadsto y \]
            10. Step-by-step derivation
              1. Applied rewrites33.8%

                \[\leadsto y \]

              if -1.99999999999999997e67 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 1.00000000000000002e100

              1. Initial program 99.8%

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

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

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

              Alternative 10: 67.4% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq 6.2 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (if (<= (/ (- z t) (- z a)) 6.2e-36) x (+ x y)))
              double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (((z - t) / (z - a)) <= 6.2e-36) {
              		tmp = x;
              	} else {
              		tmp = x + y;
              	}
              	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 - t) / (z - a)) <= 6.2d-36) then
                      tmp = x
                  else
                      tmp = x + y
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t, double a) {
              	double tmp;
              	if (((z - t) / (z - a)) <= 6.2e-36) {
              		tmp = x;
              	} else {
              		tmp = x + y;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a):
              	tmp = 0
              	if ((z - t) / (z - a)) <= 6.2e-36:
              		tmp = x
              	else:
              		tmp = x + y
              	return tmp
              
              function code(x, y, z, t, a)
              	tmp = 0.0
              	if (Float64(Float64(z - t) / Float64(z - a)) <= 6.2e-36)
              		tmp = x;
              	else
              		tmp = Float64(x + y);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a)
              	tmp = 0.0;
              	if (((z - t) / (z - a)) <= 6.2e-36)
              		tmp = x;
              	else
              		tmp = x + y;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], 6.2e-36], x, N[(x + y), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\frac{z - t}{z - a} \leq 6.2 \cdot 10^{-36}:\\
              \;\;\;\;x\\
              
              \mathbf{else}:\\
              \;\;\;\;x + y\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 6.1999999999999997e-36

                1. Initial program 98.9%

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

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

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

                  if 6.1999999999999997e-36 < (/.f64 (-.f64 z t) (-.f64 z a))

                  1. Initial program 98.0%

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

                    \[\leadsto x + \color{blue}{y} \]
                  4. Step-by-step derivation
                    1. Applied rewrites72.6%

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

                  Alternative 11: 51.5% accurate, 26.0× speedup?

                  \[\begin{array}{l} \\ x \end{array} \]
                  (FPCore (x y z t a) :precision binary64 x)
                  double code(double x, double y, double z, double t, double a) {
                  	return x;
                  }
                  
                  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
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a) {
                  	return x;
                  }
                  
                  def code(x, y, z, t, a):
                  	return x
                  
                  function code(x, y, z, t, a)
                  	return x
                  end
                  
                  function tmp = code(x, y, z, t, a)
                  	tmp = x;
                  end
                  
                  code[x_, y_, z_, t_, a_] := x
                  
                  \begin{array}{l}
                  
                  \\
                  x
                  \end{array}
                  
                  Derivation
                  1. Initial program 98.3%

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

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

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

                    Developer Target 1: 98.3% accurate, 0.8× speedup?

                    \[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - t}} \end{array} \]
                    (FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
                    double code(double x, double y, double z, double t, double a) {
                    	return x + (y / ((z - a) / (z - 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 = x + (y / ((z - a) / (z - t)))
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a) {
                    	return x + (y / ((z - a) / (z - t)));
                    }
                    
                    def code(x, y, z, t, a):
                    	return x + (y / ((z - a) / (z - t)))
                    
                    function code(x, y, z, t, a)
                    	return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))))
                    end
                    
                    function tmp = code(x, y, z, t, a)
                    	tmp = x + (y / ((z - a) / (z - t)));
                    end
                    
                    code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    x + \frac{y}{\frac{z - a}{z - t}}
                    \end{array}
                    

                    Reproduce

                    ?
                    herbie shell --seed 2025061 
                    (FPCore (x y z t a)
                      :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
                      :precision binary64
                    
                      :alt
                      (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
                    
                      (+ x (* y (/ (- z t) (- z a)))))