Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E

Percentage Accurate: 93.7% → 99.6%
Time: 5.2s
Alternatives: 11
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 93.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 3 \cdot 10^{+259}:\\
\;\;\;\;x + \frac{t\_1}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 y (-.f64 z t)) < -4.0000000000000002e270

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000002e270 < (*.f64 y (-.f64 z t)) < 3.00000000000000013e259

    1. Initial program 99.4%

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

    if 3.00000000000000013e259 < (*.f64 y (-.f64 z t))

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ t_2 := y \cdot \frac{z - t}{a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+269}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -0.02:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t\_1 \leq 500:\\ \;\;\;\;x - \frac{t}{a} \cdot y\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+296}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* y (/ (- z t) a))))
   (if (<= t_1 -5e+269)
     t_2
     (if (<= t_1 -0.02)
       (+ x (/ (* y z) a))
       (if (<= t_1 500.0)
         (- x (* (/ t a) y))
         (if (<= t_1 5e+296) (/ (* (- z t) y) a) t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / a;
	double t_2 = y * ((z - t) / a);
	double tmp;
	if (t_1 <= -5e+269) {
		tmp = t_2;
	} else if (t_1 <= -0.02) {
		tmp = x + ((y * z) / a);
	} else if (t_1 <= 500.0) {
		tmp = x - ((t / a) * y);
	} else if (t_1 <= 5e+296) {
		tmp = ((z - t) * y) / a;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (y * (z - t)) / a
    t_2 = y * ((z - t) / a)
    if (t_1 <= (-5d+269)) then
        tmp = t_2
    else if (t_1 <= (-0.02d0)) then
        tmp = x + ((y * z) / a)
    else if (t_1 <= 500.0d0) then
        tmp = x - ((t / a) * y)
    else if (t_1 <= 5d+296) then
        tmp = ((z - t) * y) / a
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / a;
	double t_2 = y * ((z - t) / a);
	double tmp;
	if (t_1 <= -5e+269) {
		tmp = t_2;
	} else if (t_1 <= -0.02) {
		tmp = x + ((y * z) / a);
	} else if (t_1 <= 500.0) {
		tmp = x - ((t / a) * y);
	} else if (t_1 <= 5e+296) {
		tmp = ((z - t) * y) / a;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / a
	t_2 = y * ((z - t) / a)
	tmp = 0
	if t_1 <= -5e+269:
		tmp = t_2
	elif t_1 <= -0.02:
		tmp = x + ((y * z) / a)
	elif t_1 <= 500.0:
		tmp = x - ((t / a) * y)
	elif t_1 <= 5e+296:
		tmp = ((z - t) * y) / a
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / a)
	t_2 = Float64(y * Float64(Float64(z - t) / a))
	tmp = 0.0
	if (t_1 <= -5e+269)
		tmp = t_2;
	elseif (t_1 <= -0.02)
		tmp = Float64(x + Float64(Float64(y * z) / a));
	elseif (t_1 <= 500.0)
		tmp = Float64(x - Float64(Float64(t / a) * y));
	elseif (t_1 <= 5e+296)
		tmp = Float64(Float64(Float64(z - t) * y) / a);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / a;
	t_2 = y * ((z - t) / a);
	tmp = 0.0;
	if (t_1 <= -5e+269)
		tmp = t_2;
	elseif (t_1 <= -0.02)
		tmp = x + ((y * z) / a);
	elseif (t_1 <= 500.0)
		tmp = x - ((t / a) * y);
	elseif (t_1 <= 5e+296)
		tmp = ((z - t) * y) / a;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+269], t$95$2, If[LessEqual[t$95$1, -0.02], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 500.0], N[(x - N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+296], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -0.02:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\

\mathbf{elif}\;t\_1 \leq 500:\\
\;\;\;\;x - \frac{t}{a} \cdot y\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.0000000000000002e269 or 5.0000000000000001e296 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -5.0000000000000002e269 < (/.f64 (*.f64 y (-.f64 z t)) a) < -0.0200000000000000004

        1. Initial program 99.6%

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

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

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

          if -0.0200000000000000004 < (/.f64 (*.f64 y (-.f64 z t)) a) < 500

          1. Initial program 99.1%

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

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

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

            if 500 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000001e296

            1. Initial program 99.7%

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \leq -5 \cdot 10^{+269}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \leq -0.02:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \leq 500:\\ \;\;\;\;x - \frac{t}{a} \cdot y\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \leq 5 \cdot 10^{+296}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \end{array} \]
            7. Add Preprocessing

            Alternative 3: 84.7% accurate, 0.2× speedup?

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

              1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -5.0000000000000002e269 < (/.f64 (*.f64 y (-.f64 z t)) a) < -0.0200000000000000004

                  1. Initial program 99.6%

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

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

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

                    if -0.0200000000000000004 < (/.f64 (*.f64 y (-.f64 z t)) a) < 500

                    1. Initial program 99.1%

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

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

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

                      if 500 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000001e296

                      1. Initial program 99.7%

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

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

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

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

                      Alternative 4: 60.8% accurate, 0.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+107} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+183}\right):\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                      (FPCore (x y z t a)
                       :precision binary64
                       (let* ((t_1 (/ (* y (- z t)) a)))
                         (if (or (<= t_1 -5e+107) (not (<= t_1 2e+183))) (* z (/ y a)) x)))
                      double code(double x, double y, double z, double t, double a) {
                      	double t_1 = (y * (z - t)) / a;
                      	double tmp;
                      	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183)) {
                      		tmp = z * (y / a);
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t, a)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8) :: t_1
                          real(8) :: tmp
                          t_1 = (y * (z - t)) / a
                          if ((t_1 <= (-5d+107)) .or. (.not. (t_1 <= 2d+183))) then
                              tmp = z * (y / a)
                          else
                              tmp = x
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a) {
                      	double t_1 = (y * (z - t)) / a;
                      	double tmp;
                      	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183)) {
                      		tmp = z * (y / a);
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a):
                      	t_1 = (y * (z - t)) / a
                      	tmp = 0
                      	if (t_1 <= -5e+107) or not (t_1 <= 2e+183):
                      		tmp = z * (y / a)
                      	else:
                      		tmp = x
                      	return tmp
                      
                      function code(x, y, z, t, a)
                      	t_1 = Float64(Float64(y * Float64(z - t)) / a)
                      	tmp = 0.0
                      	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183))
                      		tmp = Float64(z * Float64(y / a));
                      	else
                      		tmp = x;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a)
                      	t_1 = (y * (z - t)) / a;
                      	tmp = 0.0;
                      	if ((t_1 <= -5e+107) || ~((t_1 <= 2e+183)))
                      		tmp = z * (y / a);
                      	else
                      		tmp = x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+107], N[Not[LessEqual[t$95$1, 2e+183]], $MachinePrecision]], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
                      \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+107} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+183}\right):\\
                      \;\;\;\;z \cdot \frac{y}{a}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.0000000000000002e107 or 1.99999999999999989e183 < (/.f64 (*.f64 y (-.f64 z t)) a)

                        1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{z}{a} \cdot y} \]
                          2. Step-by-step derivation
                            1. Applied rewrites58.8%

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

                            if -5.0000000000000002e107 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e183

                            1. Initial program 99.2%

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

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

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

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

                            Alternative 5: 58.2% accurate, 0.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+107} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+183}\right):\\ \;\;\;\;\frac{z}{a} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (let* ((t_1 (/ (* y (- z t)) a)))
                               (if (or (<= t_1 -5e+107) (not (<= t_1 2e+183))) (* (/ z a) y) x)))
                            double code(double x, double y, double z, double t, double a) {
                            	double t_1 = (y * (z - t)) / a;
                            	double tmp;
                            	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183)) {
                            		tmp = (z / a) * y;
                            	} else {
                            		tmp = x;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t, a)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8), intent (in) :: a
                                real(8) :: t_1
                                real(8) :: tmp
                                t_1 = (y * (z - t)) / a
                                if ((t_1 <= (-5d+107)) .or. (.not. (t_1 <= 2d+183))) then
                                    tmp = (z / a) * y
                                else
                                    tmp = x
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	double t_1 = (y * (z - t)) / a;
                            	double tmp;
                            	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183)) {
                            		tmp = (z / a) * y;
                            	} else {
                            		tmp = x;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a):
                            	t_1 = (y * (z - t)) / a
                            	tmp = 0
                            	if (t_1 <= -5e+107) or not (t_1 <= 2e+183):
                            		tmp = (z / a) * y
                            	else:
                            		tmp = x
                            	return tmp
                            
                            function code(x, y, z, t, a)
                            	t_1 = Float64(Float64(y * Float64(z - t)) / a)
                            	tmp = 0.0
                            	if ((t_1 <= -5e+107) || !(t_1 <= 2e+183))
                            		tmp = Float64(Float64(z / a) * y);
                            	else
                            		tmp = x;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a)
                            	t_1 = (y * (z - t)) / a;
                            	tmp = 0.0;
                            	if ((t_1 <= -5e+107) || ~((t_1 <= 2e+183)))
                            		tmp = (z / a) * y;
                            	else
                            		tmp = x;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+107], N[Not[LessEqual[t$95$1, 2e+183]], $MachinePrecision]], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], x]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
                            \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+107} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+183}\right):\\
                            \;\;\;\;\frac{z}{a} \cdot y\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.0000000000000002e107 or 1.99999999999999989e183 < (/.f64 (*.f64 y (-.f64 z t)) a)

                              1. Initial program 83.6%

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

                                \[\leadsto \color{blue}{\frac{y \cdot z}{a}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites51.3%

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

                                if -5.0000000000000002e107 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e183

                                1. Initial program 99.2%

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

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

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

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

                                Alternative 6: 84.7% accurate, 0.7× speedup?

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

                                  1. Initial program 85.1%

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

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

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

                                    if -5.1999999999999996e68 < z < 9.49999999999999974e36

                                    1. Initial program 97.2%

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

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

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

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

                                    Alternative 7: 75.1% accurate, 0.7× speedup?

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

                                      1. Initial program 85.2%

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

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

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

                                        if -9.39999999999999982e226 < t < 3.89999999999999986e259

                                        1. Initial program 92.8%

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

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

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

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

                                        Alternative 8: 75.4% accurate, 0.7× speedup?

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

                                          1. Initial program 84.7%

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

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

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

                                            if -9.39999999999999982e226 < t < 3.89999999999999986e259

                                            1. Initial program 92.8%

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

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

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

                                              if 3.89999999999999986e259 < t

                                              1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \color{blue}{\frac{-y}{a} \cdot t} \]
                                              7. Recombined 3 regimes into one program.
                                              8. Final simplification77.5%

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

                                              Alternative 9: 97.2% accurate, 1.1× speedup?

                                              \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{a}, z - t, x\right) \end{array} \]
                                              (FPCore (x y z t a) :precision binary64 (fma (/ y a) (- z t) x))
                                              double code(double x, double y, double z, double t, double a) {
                                              	return fma((y / a), (z - t), x);
                                              }
                                              
                                              function code(x, y, z, t, a)
                                              	return fma(Float64(y / a), Float64(z - t), x)
                                              end
                                              
                                              code[x_, y_, z_, t_, a_] := N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \mathsf{fma}\left(\frac{y}{a}, z - t, x\right)
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 10: 71.6% accurate, 1.3× speedup?

                                              \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{a}, z, x\right) \end{array} \]
                                              (FPCore (x y z t a) :precision binary64 (fma (/ y a) z x))
                                              double code(double x, double y, double z, double t, double a) {
                                              	return fma((y / a), z, x);
                                              }
                                              
                                              function code(x, y, z, t, a)
                                              	return fma(Float64(y / a), z, x)
                                              end
                                              
                                              code[x_, y_, z_, t_, a_] := N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \mathsf{fma}\left(\frac{y}{a}, z, x\right)
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 91.8%

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

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

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z, x\right)} \]
                                                2. Final simplification71.8%

                                                  \[\leadsto \mathsf{fma}\left(\frac{y}{a}, z, x\right) \]
                                                3. Add Preprocessing

                                                Alternative 11: 40.4% accurate, 23.0× speedup?

                                                \[\begin{array}{l} \\ x \end{array} \]
                                                (FPCore (x y z t a) :precision binary64 x)
                                                double code(double x, double y, double z, double t, double a) {
                                                	return x;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(x, y, z, t, a)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    real(8), intent (in) :: z
                                                    real(8), intent (in) :: t
                                                    real(8), intent (in) :: a
                                                    code = x
                                                end function
                                                
                                                public static double code(double x, double y, double z, double t, double a) {
                                                	return x;
                                                }
                                                
                                                def code(x, y, z, t, a):
                                                	return x
                                                
                                                function code(x, y, z, t, a)
                                                	return x
                                                end
                                                
                                                function tmp = code(x, y, z, t, a)
                                                	tmp = x;
                                                end
                                                
                                                code[x_, y_, z_, t_, a_] := x
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                x
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 91.8%

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

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

                                                    \[\leadsto \color{blue}{x} \]
                                                  2. Final simplification37.5%

                                                    \[\leadsto x \]
                                                  3. Add Preprocessing

                                                  Developer Target 1: 99.3% accurate, 0.5× speedup?

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

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2025019 
                                                  (FPCore (x y z t a)
                                                    :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
                                                    :precision binary64
                                                  
                                                    :alt
                                                    (! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
                                                  
                                                    (+ x (/ (* y (- z t)) a)))