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

Percentage Accurate: 85.7% → 98.2%
Time: 3.0s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

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

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

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

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

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

Alternative 1: 98.2% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
    4. sub-flipN/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
    9. remove-double-negN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
    13. sub-negate-revN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
    17. sub-negate-revN/A

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

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

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

Alternative 2: 95.5% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
    4. sub-flipN/A

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
    8. mult-flip-revN/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot \frac{1}{z - a}, z - t, x\right)} \]
    11. mult-flip-revN/A

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

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

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

Alternative 3: 83.3% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \frac{z - t}{z - a} \cdot y\\ t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_2 \leq -200000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 400000:\\ \;\;\;\;x + \frac{y \cdot z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ (- z t) (- z a)) y)) (t_2 (/ (* y (- z t)) (- z a))))
   (if (<= t_2 -200000.0)
     t_1
     (if (<= t_2 400000.0) (+ x (/ (* y z) (- z a))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) / (z - a)) * y;
	double t_2 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_2 <= -200000.0) {
		tmp = t_1;
	} else if (t_2 <= 400000.0) {
		tmp = x + ((y * z) / (z - a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((z - t) / (z - a)) * y
    t_2 = (y * (z - t)) / (z - a)
    if (t_2 <= (-200000.0d0)) then
        tmp = t_1
    else if (t_2 <= 400000.0d0) then
        tmp = x + ((y * z) / (z - a))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) / (z - a)) * y;
	double t_2 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_2 <= -200000.0) {
		tmp = t_1;
	} else if (t_2 <= 400000.0) {
		tmp = x + ((y * z) / (z - a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) / (z - a)) * y
	t_2 = (y * (z - t)) / (z - a)
	tmp = 0
	if t_2 <= -200000.0:
		tmp = t_1
	elif t_2 <= 400000.0:
		tmp = x + ((y * z) / (z - a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) / Float64(z - a)) * y)
	t_2 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if (t_2 <= -200000.0)
		tmp = t_1;
	elseif (t_2 <= 400000.0)
		tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) / (z - a)) * y;
	t_2 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if (t_2 <= -200000.0)
		tmp = t_1;
	elseif (t_2 <= 400000.0)
		tmp = x + ((y * z) / (z - a));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -200000.0], t$95$1, If[LessEqual[t$95$2, 400000.0], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{z - t}{z - a} \cdot y\\
t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_2 \leq -200000:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 85.7%

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

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

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

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

        \[\leadsto \frac{y \cdot \left(z - t\right)}{z - a} \]
      4. lower--.f6439.5%

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(t - z\right)\right)}{z - a} \cdot y \]
      9. sub-negate-revN/A

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

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

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      13. lower-*.f6449.4%

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      15. frac-2negN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(t - z\right)\right)}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot y \]
      17. sub-negate-revN/A

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

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

        \[\leadsto \frac{z - t}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot y \]
      20. sub-negate-revN/A

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      22. lower-/.f6449.4%

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
    6. Applied rewrites49.4%

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

    if -2e5 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4e5

    1. Initial program 85.7%

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

      \[\leadsto x + \frac{\color{blue}{y \cdot z}}{z - a} \]
    3. Step-by-step derivation
      1. lower-*.f6462.6%

        \[\leadsto x + \frac{y \cdot \color{blue}{z}}{z - a} \]
    4. Applied rewrites62.6%

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

Alternative 4: 83.1% accurate, 0.4× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2e12 or 9.9999999999999992e124 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 85.7%

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

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

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

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

        \[\leadsto \frac{y \cdot \left(z - t\right)}{z - a} \]
      4. lower--.f6439.5%

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(t - z\right)\right)}{z - a} \cdot y \]
      9. sub-negate-revN/A

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

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

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      13. lower-*.f6449.4%

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      15. frac-2negN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(t - z\right)\right)}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot y \]
      17. sub-negate-revN/A

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

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

        \[\leadsto \frac{z - t}{\mathsf{neg}\left(\left(a - z\right)\right)} \cdot y \]
      20. sub-negate-revN/A

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      22. lower-/.f6449.4%

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
    6. Applied rewrites49.4%

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

    if -2e12 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999992e124

    1. Initial program 85.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
      4. sub-flipN/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
      9. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
      17. sub-negate-revN/A

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

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

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

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

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

    Alternative 5: 82.4% accurate, 0.4× speedup?

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

      1. Initial program 85.7%

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

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

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

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

          \[\leadsto \frac{y \cdot \left(z - t\right)}{z - a} \]
        4. lower--.f6439.5%

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

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

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

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

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

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

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

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

          \[\leadsto \left(y \cdot \frac{1}{z - a}\right) \cdot \color{blue}{\left(z - t\right)} \]
        8. mult-flip-revN/A

          \[\leadsto \frac{y}{z - a} \cdot \left(\color{blue}{z} - t\right) \]
        9. lower-/.f6446.9%

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

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

      if -2e12 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999992e124

      1. Initial program 85.7%

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

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

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

          \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
        4. sub-flipN/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
        9. remove-double-negN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
        13. sub-negate-revN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
        17. sub-negate-revN/A

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

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

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

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

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

      Alternative 6: 82.2% accurate, 0.8× speedup?

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

        1. Initial program 85.7%

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

          \[\leadsto \color{blue}{x + y} \]
        3. Step-by-step derivation
          1. lower-+.f6460.7%

            \[\leadsto x + \color{blue}{y} \]
        4. Applied rewrites60.7%

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

        if -1.14999999999999998e159 < z < 6.7999999999999998e217

        1. Initial program 85.7%

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

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

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

            \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
          4. sub-flipN/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
          9. remove-double-negN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
          13. sub-negate-revN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
          17. sub-negate-revN/A

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

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

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

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

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

        Alternative 7: 77.6% accurate, 0.8× speedup?

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

          1. Initial program 85.7%

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

            \[\leadsto \color{blue}{x + y} \]
          3. Step-by-step derivation
            1. lower-+.f6460.7%

              \[\leadsto x + \color{blue}{y} \]
          4. Applied rewrites60.7%

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

          if -2.2999999999999999e156 < z < 3.7000000000000002e55

          1. Initial program 85.7%

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

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

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

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
            4. sub-flipN/A

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

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

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

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

              \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
            9. remove-double-negN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
            13. sub-negate-revN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
            17. sub-negate-revN/A

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{t - z}{a}} \cdot y + x \]
              4. mult-flipN/A

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \frac{1}{a}}, t - z, x\right) \]
              9. mult-flipN/A

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

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

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

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

          Alternative 8: 75.7% accurate, 0.9× speedup?

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

            1. Initial program 85.7%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.7%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.7%

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

            if -2.00000000000000001e160 < z < 1.40000000000000004e56

            1. Initial program 85.7%

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

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

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

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. sub-flipN/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
              9. remove-double-negN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
              13. sub-negate-revN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
              17. sub-negate-revN/A

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

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

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

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

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

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

          Alternative 9: 62.6% accurate, 1.0× speedup?

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

            1. Initial program 85.7%

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

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

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

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. sub-flipN/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
              9. remove-double-negN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
              13. sub-negate-revN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
              17. sub-negate-revN/A

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

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

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

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

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

                \[\leadsto \frac{t \cdot y}{\color{blue}{a} - z} \]
              3. lower--.f6426.1%

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

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

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot y}{a} \]
              2. lower-*.f6418.4%

                \[\leadsto \frac{t \cdot y}{a} \]
            9. Applied rewrites18.4%

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

                \[\leadsto \frac{t \cdot y}{a} \]
              2. mult-flipN/A

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

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

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

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

                \[\leadsto y \cdot \left(t \cdot \color{blue}{\frac{1}{a}}\right) \]
              7. mult-flip-revN/A

                \[\leadsto y \cdot \frac{t}{a} \]
              8. lower-/.f6420.2%

                \[\leadsto y \cdot \frac{t}{a} \]
            11. Applied rewrites20.2%

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

            if -1.6499999999999999e178 < t < 1.02e248

            1. Initial program 85.7%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.7%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.7%

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

          Alternative 10: 61.1% accurate, 0.4× speedup?

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

            1. Initial program 85.7%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.7%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.7%

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

            if -4.9999999999999996e-78 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1e-82

            1. Initial program 85.7%

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

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

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

                \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} - \left(\mathsf{neg}\left(x\right)\right)} \]
              4. sub-flipN/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{z - t}{z - a} \cdot y} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
              9. remove-double-negN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(z - t\right)}\right)}{\mathsf{neg}\left(\left(z - a\right)\right)}, y, x\right) \]
              13. sub-negate-revN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{t - z}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y, x\right) \]
              17. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \left(1 + \frac{y \cdot \left(t - z\right)}{x \cdot \color{blue}{\left(a - z\right)}}\right) \]
              7. lower--.f6479.0%

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

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

              \[\leadsto x \cdot 1 \]
            8. Step-by-step derivation
              1. Applied rewrites50.7%

                \[\leadsto x \cdot 1 \]
            9. Recombined 2 regimes into one program.
            10. Add Preprocessing

            Alternative 11: 60.7% accurate, 4.1× speedup?

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

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.7%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.7%

              \[\leadsto \color{blue}{x + y} \]
            5. Add Preprocessing

            Alternative 12: 19.1% accurate, 15.3× speedup?

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

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.7%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.7%

              \[\leadsto \color{blue}{x + y} \]
            5. Taylor expanded in x around 0

              \[\leadsto y \]
            6. Step-by-step derivation
              1. Applied rewrites19.1%

                \[\leadsto y \]
              2. Add Preprocessing

              Reproduce

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