Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3

Percentage Accurate: 96.9% → 96.9%
Time: 3.3s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

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

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

Alternative 1: 96.9% accurate, 1.0× speedup?

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

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Derivation
  1. Initial program 96.9%

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

Alternative 2: 88.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\ \;\;\;\;x - \frac{y - z}{-z} \cdot a\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\ \;\;\;\;x - a \cdot \frac{y}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - z}{\frac{-z}{a}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.8e+57)
   (- x (* (/ (- y z) (- z)) a))
   (if (<= z 2.1e+14)
     (- x (* a (/ y (+ 1.0 t))))
     (- x (/ (- y z) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.8e+57) {
		tmp = x - (((y - z) / -z) * a);
	} else if (z <= 2.1e+14) {
		tmp = x - (a * (y / (1.0 + t)));
	} 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) :: tmp
    if (z <= (-5.8d+57)) then
        tmp = x - (((y - z) / -z) * a)
    else if (z <= 2.1d+14) then
        tmp = x - (a * (y / (1.0d0 + t)))
    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 tmp;
	if (z <= -5.8e+57) {
		tmp = x - (((y - z) / -z) * a);
	} else if (z <= 2.1e+14) {
		tmp = x - (a * (y / (1.0 + t)));
	} else {
		tmp = x - ((y - z) / (-z / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.8e+57:
		tmp = x - (((y - z) / -z) * a)
	elif z <= 2.1e+14:
		tmp = x - (a * (y / (1.0 + t)))
	else:
		tmp = x - ((y - z) / (-z / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.8e+57)
		tmp = Float64(x - Float64(Float64(Float64(y - z) / Float64(-z)) * a));
	elseif (z <= 2.1e+14)
		tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t))));
	else
		tmp = Float64(x - Float64(Float64(y - z) / Float64(Float64(-z) / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.8e+57)
		tmp = x - (((y - z) / -z) * a);
	elseif (z <= 2.1e+14)
		tmp = x - (a * (y / (1.0 + t)));
	else
		tmp = x - ((y - z) / (-z / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+57], N[(x - N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+14], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\
\;\;\;\;x - \frac{y - z}{-z} \cdot a\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{-z}{a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.8000000000000003e57

    1. Initial program 94.0%

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

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

        \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
      2. lower-neg.f6484.8

        \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
    4. Applied rewrites84.8%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-z}}{a}} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - z}}{\frac{-z}{a}} \]
      2. lift-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - z}{\frac{-z}{a}}} \]
      3. lift-/.f64N/A

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
      4. associate-/r/N/A

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

        \[\leadsto x - \color{blue}{\frac{y - z}{-z} \cdot a} \]
      6. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - z}{-z}} \cdot a \]
      7. lift--.f6489.3

        \[\leadsto x - \frac{\color{blue}{y - z}}{-z} \cdot a \]
    6. Applied rewrites89.3%

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

    if -5.8000000000000003e57 < z < 2.1e14

    1. Initial program 99.0%

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

      \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
    3. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
      4. lower-+.f6489.1

        \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
    4. Applied rewrites89.1%

      \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]

    if 2.1e14 < z

    1. Initial program 94.6%

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

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

        \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
      2. lower-neg.f6483.5

        \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
    4. Applied rewrites83.5%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-z}}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y - z}{-z} \cdot a\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\ \;\;\;\;x - a \cdot \frac{y}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* (/ (- y z) (- z)) a))))
   (if (<= z -5.8e+57)
     t_1
     (if (<= z 2.1e+14) (- x (* a (/ y (+ 1.0 t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (((y - z) / -z) * a);
	double tmp;
	if (z <= -5.8e+57) {
		tmp = t_1;
	} else if (z <= 2.1e+14) {
		tmp = x - (a * (y / (1.0 + t)));
	} 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 = x - (((y - z) / -z) * a)
    if (z <= (-5.8d+57)) then
        tmp = t_1
    else if (z <= 2.1d+14) then
        tmp = x - (a * (y / (1.0d0 + t)))
    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 = x - (((y - z) / -z) * a);
	double tmp;
	if (z <= -5.8e+57) {
		tmp = t_1;
	} else if (z <= 2.1e+14) {
		tmp = x - (a * (y / (1.0 + t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (((y - z) / -z) * a)
	tmp = 0
	if z <= -5.8e+57:
		tmp = t_1
	elif z <= 2.1e+14:
		tmp = x - (a * (y / (1.0 + t)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(Float64(y - z) / Float64(-z)) * a))
	tmp = 0.0
	if (z <= -5.8e+57)
		tmp = t_1;
	elseif (z <= 2.1e+14)
		tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (((y - z) / -z) * a);
	tmp = 0.0;
	if (z <= -5.8e+57)
		tmp = t_1;
	elseif (z <= 2.1e+14)
		tmp = x - (a * (y / (1.0 + t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+57], t$95$1, If[LessEqual[z, 2.1e+14], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \frac{y - z}{-z} \cdot a\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8000000000000003e57 or 2.1e14 < z

    1. Initial program 94.3%

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

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

        \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
      2. lower-neg.f6484.1

        \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
    4. Applied rewrites84.1%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-z}}{a}} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x - \frac{\color{blue}{y - z}}{\frac{-z}{a}} \]
      2. lift-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - z}{\frac{-z}{a}}} \]
      3. lift-/.f64N/A

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
      4. associate-/r/N/A

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

        \[\leadsto x - \color{blue}{\frac{y - z}{-z} \cdot a} \]
      6. lower-/.f64N/A

        \[\leadsto x - \color{blue}{\frac{y - z}{-z}} \cdot a \]
      7. lift--.f6488.3

        \[\leadsto x - \frac{\color{blue}{y - z}}{-z} \cdot a \]
    6. Applied rewrites88.3%

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

    if -5.8000000000000003e57 < z < 2.1e14

    1. Initial program 99.0%

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

      \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
    3. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
      4. lower-+.f6489.1

        \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
    4. Applied rewrites89.1%

      \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 84.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+84}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+15}:\\ \;\;\;\;x - a \cdot \frac{y}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.2e+84)
   (- x a)
   (if (<= z 3.6e+15) (- x (* a (/ y (+ 1.0 t)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.2e+84) {
		tmp = x - a;
	} else if (z <= 3.6e+15) {
		tmp = x - (a * (y / (1.0 + t)));
	} else {
		tmp = x - 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 <= (-1.2d+84)) then
        tmp = x - a
    else if (z <= 3.6d+15) then
        tmp = x - (a * (y / (1.0d0 + t)))
    else
        tmp = x - 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 <= -1.2e+84) {
		tmp = x - a;
	} else if (z <= 3.6e+15) {
		tmp = x - (a * (y / (1.0 + t)));
	} else {
		tmp = x - a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.2e+84:
		tmp = x - a
	elif z <= 3.6e+15:
		tmp = x - (a * (y / (1.0 + t)))
	else:
		tmp = x - a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.2e+84)
		tmp = Float64(x - a);
	elseif (z <= 3.6e+15)
		tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t))));
	else
		tmp = Float64(x - a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.2e+84)
		tmp = x - a;
	elseif (z <= 3.6e+15)
		tmp = x - (a * (y / (1.0 + t)));
	else
		tmp = x - a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+84], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.6e+15], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+84}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\

\mathbf{else}:\\
\;\;\;\;x - a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e84 or 3.6e15 < z

    1. Initial program 94.0%

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

      \[\leadsto x - \color{blue}{a} \]
    3. Step-by-step derivation
      1. Applied rewrites79.5%

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

      if -1.2e84 < z < 3.6e15

      1. Initial program 99.0%

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

        \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
      3. Step-by-step derivation
        1. associate-/l*N/A

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

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

          \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
        4. lower-+.f6487.8

          \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
      4. Applied rewrites87.8%

        \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 5: 79.1% accurate, 0.9× speedup?

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

      1. Initial program 96.3%

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

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

          \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
        2. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto x - \frac{\color{blue}{y - z}}{\frac{t}{a}} \]
          2. lift-/.f64N/A

            \[\leadsto x - \color{blue}{\frac{y - z}{\frac{t}{a}}} \]
          3. lift-/.f64N/A

            \[\leadsto x - \frac{y - z}{\color{blue}{\frac{t}{a}}} \]
          4. associate-/r/N/A

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

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

            \[\leadsto x - \color{blue}{\frac{y - z}{t}} \cdot a \]
          7. lift--.f6483.4

            \[\leadsto x - \frac{\color{blue}{y - z}}{t} \cdot a \]
        3. Applied rewrites83.4%

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

        if -2e15 < t < 7.49999999999999941e26

        1. Initial program 97.4%

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

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

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

            \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
          3. Step-by-step derivation
            1. Applied rewrites37.0%

              \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
            2. Taylor expanded in t around 0

              \[\leadsto x - \frac{y}{\frac{\color{blue}{1 - z}}{a}} \]
            3. Step-by-step derivation
              1. lower--.f6475.1

                \[\leadsto x - \frac{y}{\frac{1 - \color{blue}{z}}{a}} \]
            4. Applied rewrites75.1%

              \[\leadsto x - \frac{y}{\frac{\color{blue}{1 - z}}{a}} \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto x - \color{blue}{\frac{y}{\frac{1 - z}{a}}} \]
              2. lift-/.f64N/A

                \[\leadsto x - \frac{y}{\color{blue}{\frac{1 - z}{a}}} \]
              3. associate-/r/N/A

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

                \[\leadsto x - \color{blue}{\frac{y}{1 - z} \cdot a} \]
              5. lower-/.f6475.6

                \[\leadsto x - \color{blue}{\frac{y}{1 - z}} \cdot a \]
            6. Applied rewrites75.6%

              \[\leadsto x - \color{blue}{\frac{y}{1 - z} \cdot a} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 6: 76.4% accurate, 0.9× speedup?

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

            1. Initial program 96.0%

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

              \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
            3. Step-by-step derivation
              1. Applied rewrites81.0%

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

                \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
              3. Step-by-step derivation
                1. Applied rewrites74.9%

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

                if -0.00320000000000000015 < t < 7.49999999999999941e26

                1. Initial program 97.4%

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

                  \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
                3. Step-by-step derivation
                  1. Applied rewrites27.9%

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

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

                      \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                    2. Taylor expanded in t around 0

                      \[\leadsto x - \frac{y}{\frac{\color{blue}{1 - z}}{a}} \]
                    3. Step-by-step derivation
                      1. lower--.f6475.7

                        \[\leadsto x - \frac{y}{\frac{1 - \color{blue}{z}}{a}} \]
                    4. Applied rewrites75.7%

                      \[\leadsto x - \frac{y}{\frac{\color{blue}{1 - z}}{a}} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto x - \color{blue}{\frac{y}{\frac{1 - z}{a}}} \]
                      2. lift-/.f64N/A

                        \[\leadsto x - \frac{y}{\color{blue}{\frac{1 - z}{a}}} \]
                      3. associate-/r/N/A

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

                        \[\leadsto x - \color{blue}{\frac{y}{1 - z} \cdot a} \]
                      5. lower-/.f6476.3

                        \[\leadsto x - \color{blue}{\frac{y}{1 - z}} \cdot a \]
                    6. Applied rewrites76.3%

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

                    if 7.49999999999999941e26 < t

                    1. Initial program 96.8%

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

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

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

                        \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites77.9%

                          \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                        2. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{a}}} \]
                          2. lift-/.f64N/A

                            \[\leadsto x - \frac{y}{\color{blue}{\frac{t}{a}}} \]
                          3. associate-/r/N/A

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

                            \[\leadsto x - \color{blue}{\frac{y}{t} \cdot a} \]
                          5. lower-/.f6478.5

                            \[\leadsto x - \color{blue}{\frac{y}{t}} \cdot a \]
                        3. Applied rewrites78.5%

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

                      Alternative 7: 72.1% accurate, 1.0× speedup?

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

                        1. Initial program 96.0%

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

                          \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites81.0%

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

                            \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                          3. Step-by-step derivation
                            1. Applied rewrites74.9%

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

                            if -0.00320000000000000015 < t < 1

                            1. Initial program 97.4%

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

                              \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
                            3. Step-by-step derivation
                              1. associate-/l*N/A

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

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

                                \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
                              4. lower-+.f6467.3

                                \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                            4. Applied rewrites67.3%

                              \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
                            5. Taylor expanded in t around 0

                              \[\leadsto x - a \cdot y \]
                            6. Step-by-step derivation
                              1. Applied rewrites67.2%

                                \[\leadsto x - a \cdot y \]

                              if 1 < t

                              1. Initial program 96.7%

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

                                \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites80.9%

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

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

                                    \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                                  2. Step-by-step derivation
                                    1. lift-/.f64N/A

                                      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{a}}} \]
                                    2. lift-/.f64N/A

                                      \[\leadsto x - \frac{y}{\color{blue}{\frac{t}{a}}} \]
                                    3. associate-/r/N/A

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

                                      \[\leadsto x - \color{blue}{\frac{y}{t} \cdot a} \]
                                    5. lower-/.f6476.8

                                      \[\leadsto x - \color{blue}{\frac{y}{t}} \cdot a \]
                                  3. Applied rewrites76.8%

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

                                Alternative 8: 71.7% accurate, 1.0× speedup?

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

                                  1. Initial program 96.4%

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

                                    \[\leadsto x - \frac{y - z}{\frac{\color{blue}{t}}{a}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites81.0%

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

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

                                        \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
                                      2. Step-by-step derivation
                                        1. lift-/.f64N/A

                                          \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{a}}} \]
                                        2. lift-/.f64N/A

                                          \[\leadsto x - \frac{y}{\color{blue}{\frac{t}{a}}} \]
                                        3. associate-/r/N/A

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

                                          \[\leadsto x - \color{blue}{\frac{y}{t} \cdot a} \]
                                        5. lower-/.f6476.5

                                          \[\leadsto x - \color{blue}{\frac{y}{t}} \cdot a \]
                                      3. Applied rewrites76.5%

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

                                      if -0.00320000000000000015 < t < 1

                                      1. Initial program 97.4%

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

                                        \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
                                      3. Step-by-step derivation
                                        1. associate-/l*N/A

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

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

                                          \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
                                        4. lower-+.f6467.3

                                          \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                                      4. Applied rewrites67.3%

                                        \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
                                      5. Taylor expanded in t around 0

                                        \[\leadsto x - a \cdot y \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites67.2%

                                          \[\leadsto x - a \cdot y \]
                                      7. Recombined 2 regimes into one program.
                                      8. Add Preprocessing

                                      Alternative 9: 71.4% accurate, 1.2× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+83}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-100}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+49}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a)
                                       :precision binary64
                                       (if (<= z -4.3e+83)
                                         (- x a)
                                         (if (<= z 1.02e-100) (- x (* a y)) (if (<= z 4.2e+49) x (- x a)))))
                                      double code(double x, double y, double z, double t, double a) {
                                      	double tmp;
                                      	if (z <= -4.3e+83) {
                                      		tmp = x - a;
                                      	} else if (z <= 1.02e-100) {
                                      		tmp = x - (a * y);
                                      	} else if (z <= 4.2e+49) {
                                      		tmp = x;
                                      	} else {
                                      		tmp = x - 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 <= (-4.3d+83)) then
                                              tmp = x - a
                                          else if (z <= 1.02d-100) then
                                              tmp = x - (a * y)
                                          else if (z <= 4.2d+49) then
                                              tmp = x
                                          else
                                              tmp = x - 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 <= -4.3e+83) {
                                      		tmp = x - a;
                                      	} else if (z <= 1.02e-100) {
                                      		tmp = x - (a * y);
                                      	} else if (z <= 4.2e+49) {
                                      		tmp = x;
                                      	} else {
                                      		tmp = x - a;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(x, y, z, t, a):
                                      	tmp = 0
                                      	if z <= -4.3e+83:
                                      		tmp = x - a
                                      	elif z <= 1.02e-100:
                                      		tmp = x - (a * y)
                                      	elif z <= 4.2e+49:
                                      		tmp = x
                                      	else:
                                      		tmp = x - a
                                      	return tmp
                                      
                                      function code(x, y, z, t, a)
                                      	tmp = 0.0
                                      	if (z <= -4.3e+83)
                                      		tmp = Float64(x - a);
                                      	elseif (z <= 1.02e-100)
                                      		tmp = Float64(x - Float64(a * y));
                                      	elseif (z <= 4.2e+49)
                                      		tmp = x;
                                      	else
                                      		tmp = Float64(x - a);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(x, y, z, t, a)
                                      	tmp = 0.0;
                                      	if (z <= -4.3e+83)
                                      		tmp = x - a;
                                      	elseif (z <= 1.02e-100)
                                      		tmp = x - (a * y);
                                      	elseif (z <= 4.2e+49)
                                      		tmp = x;
                                      	else
                                      		tmp = x - a;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e+83], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.02e-100], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+49], x, N[(x - a), $MachinePrecision]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;z \leq -4.3 \cdot 10^{+83}:\\
                                      \;\;\;\;x - a\\
                                      
                                      \mathbf{elif}\;z \leq 1.02 \cdot 10^{-100}:\\
                                      \;\;\;\;x - a \cdot y\\
                                      
                                      \mathbf{elif}\;z \leq 4.2 \cdot 10^{+49}:\\
                                      \;\;\;\;x\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;x - a\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if z < -4.3e83 or 4.20000000000000022e49 < z

                                        1. Initial program 93.8%

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

                                          \[\leadsto x - \color{blue}{a} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites80.8%

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

                                          if -4.3e83 < z < 1.02e-100

                                          1. Initial program 98.9%

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

                                            \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 + t}} \]
                                          3. Step-by-step derivation
                                            1. associate-/l*N/A

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

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

                                              \[\leadsto x - a \cdot \frac{y}{\color{blue}{1 + t}} \]
                                            4. lower-+.f6488.8

                                              \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                                          4. Applied rewrites88.8%

                                            \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
                                          5. Taylor expanded in t around 0

                                            \[\leadsto x - a \cdot y \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites69.2%

                                              \[\leadsto x - a \cdot y \]

                                            if 1.02e-100 < z < 4.20000000000000022e49

                                            1. Initial program 99.2%

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

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

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

                                            Alternative 10: 66.9% accurate, 1.6× speedup?

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

                                              1. Initial program 94.5%

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

                                                \[\leadsto x - \color{blue}{a} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites78.0%

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

                                                if -4.5e8 < z < 4.20000000000000022e49

                                                1. Initial program 99.0%

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

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

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

                                                Alternative 11: 54.1% accurate, 18.3× 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 96.9%

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

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

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

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2025112 
                                                  (FPCore (x y z t a)
                                                    :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
                                                    :precision binary64
                                                    (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))