Data.Colour.RGB:hslsv from colour-2.3.3, B

Percentage Accurate: 99.3% → 99.3%
Time: 7.1s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 99.3% accurate, 1.0× speedup?

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

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

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

Alternative 2: 84.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{y}{z - t} \cdot -60\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000001e93

    1. Initial program 95.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
      4. metadata-evalN/A

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      9. metadata-evalN/A

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
      11. lower--.f6488.0

        \[\leadsto \left(x - y\right) \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Applied rewrites88.0%

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

    if -5.0000000000000001e93 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999996e109

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{\frac{y}{z - t}} \cdot -60\right) \]
      6. lower--.f6486.9

        \[\leadsto \mathsf{fma}\left(120, a, \frac{y}{\color{blue}{z - t}} \cdot -60\right) \]
    5. Applied rewrites86.9%

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

    if 1.99999999999999996e109 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right)} \cdot 60}{z - t} \]
      6. lower--.f6486.8

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\color{blue}{z - t}} \]
    8. Applied rewrites86.8%

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

Alternative 3: 73.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+43} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+109}\right):\\ \;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;120 \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (or (<= t_1 -1e+43) (not (<= t_1 2e+109)))
     (* (- x y) (/ 60.0 (- z t)))
     (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -1e+43) || !(t_1 <= 2e+109)) {
		tmp = (x - y) * (60.0 / (z - t));
	} else {
		tmp = 120.0 * a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if ((t_1 <= (-1d+43)) .or. (.not. (t_1 <= 2d+109))) then
        tmp = (x - y) * (60.0d0 / (z - t))
    else
        tmp = 120.0d0 * a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -1e+43) || !(t_1 <= 2e+109)) {
		tmp = (x - y) * (60.0 / (z - t));
	} else {
		tmp = 120.0 * a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if (t_1 <= -1e+43) or not (t_1 <= 2e+109):
		tmp = (x - y) * (60.0 / (z - t))
	else:
		tmp = 120.0 * a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if ((t_1 <= -1e+43) || !(t_1 <= 2e+109))
		tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t)));
	else
		tmp = Float64(120.0 * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if ((t_1 <= -1e+43) || ~((t_1 <= 2e+109)))
		tmp = (x - y) * (60.0 / (z - t));
	else
		tmp = 120.0 * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+43], N[Not[LessEqual[t$95$1, 2e+109]], $MachinePrecision]], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+43} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+109}\right):\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\

\mathbf{else}:\\
\;\;\;\;120 \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000001e43 or 1.99999999999999996e109 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 97.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
      4. metadata-evalN/A

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      9. metadata-evalN/A

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
      11. lower--.f6484.6

        \[\leadsto \left(x - y\right) \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Applied rewrites84.6%

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

    if -1.00000000000000001e43 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999996e109

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. lower-*.f6475.9

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites75.9%

      \[\leadsto \color{blue}{120 \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.2%

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

Alternative 4: 72.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+43}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+109}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -1e+43)
     (* (- x y) (/ 60.0 (- z t)))
     (if (<= t_1 2e+109) (* 120.0 a) (/ (* (- x y) 60.0) (- z t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -1e+43) {
		tmp = (x - y) * (60.0 / (z - t));
	} else if (t_1 <= 2e+109) {
		tmp = 120.0 * a;
	} else {
		tmp = ((x - y) * 60.0) / (z - t);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-1d+43)) then
        tmp = (x - y) * (60.0d0 / (z - t))
    else if (t_1 <= 2d+109) then
        tmp = 120.0d0 * a
    else
        tmp = ((x - y) * 60.0d0) / (z - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -1e+43) {
		tmp = (x - y) * (60.0 / (z - t));
	} else if (t_1 <= 2e+109) {
		tmp = 120.0 * a;
	} else {
		tmp = ((x - y) * 60.0) / (z - t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -1e+43:
		tmp = (x - y) * (60.0 / (z - t))
	elif t_1 <= 2e+109:
		tmp = 120.0 * a
	else:
		tmp = ((x - y) * 60.0) / (z - t)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_1 <= -1e+43)
		tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t)));
	elseif (t_1 <= 2e+109)
		tmp = Float64(120.0 * a);
	else
		tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_1 <= -1e+43)
		tmp = (x - y) * (60.0 / (z - t));
	elseif (t_1 <= 2e+109)
		tmp = 120.0 * a;
	else
		tmp = ((x - y) * 60.0) / (z - t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+43], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+109], N[(120.0 * a), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+43}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+109}:\\
\;\;\;\;120 \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000001e43

    1. Initial program 96.3%

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

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

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

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

        \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
      4. metadata-evalN/A

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      9. metadata-evalN/A

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
      11. lower--.f6483.0

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

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

    if -1.00000000000000001e43 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999996e109

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. lower-*.f6475.9

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites75.9%

      \[\leadsto \color{blue}{120 \cdot a} \]

    if 1.99999999999999996e109 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right)} \cdot 60}{z - t} \]
      6. lower--.f6486.8

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\color{blue}{z - t}} \]
    8. Applied rewrites86.8%

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

Alternative 5: 59.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+88} \lor \neg \left(t\_1 \leq 10^{+169}\right):\\ \;\;\;\;\frac{y}{z - t} \cdot -60\\ \mathbf{else}:\\ \;\;\;\;120 \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (or (<= t_1 -1e+88) (not (<= t_1 1e+169)))
     (* (/ y (- z t)) -60.0)
     (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -1e+88) || !(t_1 <= 1e+169)) {
		tmp = (y / (z - t)) * -60.0;
	} else {
		tmp = 120.0 * a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if ((t_1 <= (-1d+88)) .or. (.not. (t_1 <= 1d+169))) then
        tmp = (y / (z - t)) * (-60.0d0)
    else
        tmp = 120.0d0 * a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -1e+88) || !(t_1 <= 1e+169)) {
		tmp = (y / (z - t)) * -60.0;
	} else {
		tmp = 120.0 * a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if (t_1 <= -1e+88) or not (t_1 <= 1e+169):
		tmp = (y / (z - t)) * -60.0
	else:
		tmp = 120.0 * a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if ((t_1 <= -1e+88) || !(t_1 <= 1e+169))
		tmp = Float64(Float64(y / Float64(z - t)) * -60.0);
	else
		tmp = Float64(120.0 * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if ((t_1 <= -1e+88) || ~((t_1 <= 1e+169)))
		tmp = (y / (z - t)) * -60.0;
	else
		tmp = 120.0 * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+88], N[Not[LessEqual[t$95$1, 1e+169]], $MachinePrecision]], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+88} \lor \neg \left(t\_1 \leq 10^{+169}\right):\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\

\mathbf{else}:\\
\;\;\;\;120 \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87 or 9.99999999999999934e168 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 97.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
      4. metadata-evalN/A

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      9. metadata-evalN/A

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
      11. lower--.f6489.7

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

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

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

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

      if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999934e168

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{120 \cdot a} \]
      4. Step-by-step derivation
        1. lower-*.f6471.4

          \[\leadsto \color{blue}{120 \cdot a} \]
      5. Applied rewrites71.4%

        \[\leadsto \color{blue}{120 \cdot a} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification63.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq -1 \cdot 10^{+88} \lor \neg \left(\frac{60 \cdot \left(x - y\right)}{z - t} \leq 10^{+169}\right):\\ \;\;\;\;\frac{y}{z - t} \cdot -60\\ \mathbf{else}:\\ \;\;\;\;120 \cdot a\\ \end{array} \]
    10. Add Preprocessing

    Alternative 6: 60.9% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+93}:\\ \;\;\;\;\frac{60}{z - t} \cdot x\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+109}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
       (if (<= t_1 -5e+93)
         (* (/ 60.0 (- z t)) x)
         (if (<= t_1 2e+109) (* 120.0 a) (* (- x y) (/ 60.0 z))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (60.0 * (x - y)) / (z - t);
    	double tmp;
    	if (t_1 <= -5e+93) {
    		tmp = (60.0 / (z - t)) * x;
    	} else if (t_1 <= 2e+109) {
    		tmp = 120.0 * a;
    	} else {
    		tmp = (x - y) * (60.0 / z);
    	}
    	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 = (60.0d0 * (x - y)) / (z - t)
        if (t_1 <= (-5d+93)) then
            tmp = (60.0d0 / (z - t)) * x
        else if (t_1 <= 2d+109) then
            tmp = 120.0d0 * a
        else
            tmp = (x - y) * (60.0d0 / z)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = (60.0 * (x - y)) / (z - t);
    	double tmp;
    	if (t_1 <= -5e+93) {
    		tmp = (60.0 / (z - t)) * x;
    	} else if (t_1 <= 2e+109) {
    		tmp = 120.0 * a;
    	} else {
    		tmp = (x - y) * (60.0 / z);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = (60.0 * (x - y)) / (z - t)
    	tmp = 0
    	if t_1 <= -5e+93:
    		tmp = (60.0 / (z - t)) * x
    	elif t_1 <= 2e+109:
    		tmp = 120.0 * a
    	else:
    		tmp = (x - y) * (60.0 / z)
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
    	tmp = 0.0
    	if (t_1 <= -5e+93)
    		tmp = Float64(Float64(60.0 / Float64(z - t)) * x);
    	elseif (t_1 <= 2e+109)
    		tmp = Float64(120.0 * a);
    	else
    		tmp = Float64(Float64(x - y) * Float64(60.0 / z));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = (60.0 * (x - y)) / (z - t);
    	tmp = 0.0;
    	if (t_1 <= -5e+93)
    		tmp = (60.0 / (z - t)) * x;
    	elseif (t_1 <= 2e+109)
    		tmp = 120.0 * a;
    	else
    		tmp = (x - y) * (60.0 / z);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+93], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 2e+109], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+93}:\\
    \;\;\;\;\frac{60}{z - t} \cdot x\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+109}:\\
    \;\;\;\;120 \cdot a\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000001e93

      1. Initial program 95.5%

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

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

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

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

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

        \[\leadsto \frac{60}{z - t} \cdot x \]
      7. Step-by-step derivation
        1. Applied rewrites52.4%

          \[\leadsto \frac{60}{z - t} \cdot x \]

        if -5.0000000000000001e93 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999996e109

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{120 \cdot a} \]
        4. Step-by-step derivation
          1. lower-*.f6473.5

            \[\leadsto \color{blue}{120 \cdot a} \]
        5. Applied rewrites73.5%

          \[\leadsto \color{blue}{120 \cdot a} \]

        if 1.99999999999999996e109 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
          4. metadata-evalN/A

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

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

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

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

            \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
          9. metadata-evalN/A

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

            \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
          11. lower--.f6486.7

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

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

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

            \[\leadsto \left(x - y\right) \cdot \frac{60}{\color{blue}{z}} \]
        8. Recombined 3 regimes into one program.
        9. Add Preprocessing

        Alternative 7: 59.8% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+93}:\\ \;\;\;\;\frac{60}{z - t} \cdot x\\ \mathbf{elif}\;t\_1 \leq 10^{+169}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z - t} \cdot -60\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
           (if (<= t_1 -5e+93)
             (* (/ 60.0 (- z t)) x)
             (if (<= t_1 1e+169) (* 120.0 a) (* (/ y (- z t)) -60.0)))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = (60.0 * (x - y)) / (z - t);
        	double tmp;
        	if (t_1 <= -5e+93) {
        		tmp = (60.0 / (z - t)) * x;
        	} else if (t_1 <= 1e+169) {
        		tmp = 120.0 * a;
        	} else {
        		tmp = (y / (z - t)) * -60.0;
        	}
        	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 = (60.0d0 * (x - y)) / (z - t)
            if (t_1 <= (-5d+93)) then
                tmp = (60.0d0 / (z - t)) * x
            else if (t_1 <= 1d+169) then
                tmp = 120.0d0 * a
            else
                tmp = (y / (z - t)) * (-60.0d0)
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a) {
        	double t_1 = (60.0 * (x - y)) / (z - t);
        	double tmp;
        	if (t_1 <= -5e+93) {
        		tmp = (60.0 / (z - t)) * x;
        	} else if (t_1 <= 1e+169) {
        		tmp = 120.0 * a;
        	} else {
        		tmp = (y / (z - t)) * -60.0;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	t_1 = (60.0 * (x - y)) / (z - t)
        	tmp = 0
        	if t_1 <= -5e+93:
        		tmp = (60.0 / (z - t)) * x
        	elif t_1 <= 1e+169:
        		tmp = 120.0 * a
        	else:
        		tmp = (y / (z - t)) * -60.0
        	return tmp
        
        function code(x, y, z, t, a)
        	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
        	tmp = 0.0
        	if (t_1 <= -5e+93)
        		tmp = Float64(Float64(60.0 / Float64(z - t)) * x);
        	elseif (t_1 <= 1e+169)
        		tmp = Float64(120.0 * a);
        	else
        		tmp = Float64(Float64(y / Float64(z - t)) * -60.0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	t_1 = (60.0 * (x - y)) / (z - t);
        	tmp = 0.0;
        	if (t_1 <= -5e+93)
        		tmp = (60.0 / (z - t)) * x;
        	elseif (t_1 <= 1e+169)
        		tmp = 120.0 * a;
        	else
        		tmp = (y / (z - t)) * -60.0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+93], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1e+169], N[(120.0 * a), $MachinePrecision], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+93}:\\
        \;\;\;\;\frac{60}{z - t} \cdot x\\
        
        \mathbf{elif}\;t\_1 \leq 10^{+169}:\\
        \;\;\;\;120 \cdot a\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{y}{z - t} \cdot -60\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000001e93

          1. Initial program 95.5%

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

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

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

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

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

            \[\leadsto \frac{60}{z - t} \cdot x \]
          7. Step-by-step derivation
            1. Applied rewrites52.4%

              \[\leadsto \frac{60}{z - t} \cdot x \]

            if -5.0000000000000001e93 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999934e168

            1. Initial program 99.8%

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

              \[\leadsto \color{blue}{120 \cdot a} \]
            4. Step-by-step derivation
              1. lower-*.f6471.0

                \[\leadsto \color{blue}{120 \cdot a} \]
            5. Applied rewrites71.0%

              \[\leadsto \color{blue}{120 \cdot a} \]

            if 9.99999999999999934e168 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

            1. Initial program 99.9%

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

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

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

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

                \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
              4. metadata-evalN/A

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

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

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

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

                \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
              9. metadata-evalN/A

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

                \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
              11. lower--.f6491.5

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

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

              \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
            7. Step-by-step derivation
              1. Applied rewrites55.2%

                \[\leadsto \frac{y}{z - t} \cdot \color{blue}{-60} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 8: 59.8% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+88}:\\ \;\;\;\;\frac{-60 \cdot y}{z - t}\\ \mathbf{elif}\;t\_1 \leq 10^{+169}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z - t} \cdot -60\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
               (if (<= t_1 -1e+88)
                 (/ (* -60.0 y) (- z t))
                 (if (<= t_1 1e+169) (* 120.0 a) (* (/ y (- z t)) -60.0)))))
            double code(double x, double y, double z, double t, double a) {
            	double t_1 = (60.0 * (x - y)) / (z - t);
            	double tmp;
            	if (t_1 <= -1e+88) {
            		tmp = (-60.0 * y) / (z - t);
            	} else if (t_1 <= 1e+169) {
            		tmp = 120.0 * a;
            	} else {
            		tmp = (y / (z - t)) * -60.0;
            	}
            	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 = (60.0d0 * (x - y)) / (z - t)
                if (t_1 <= (-1d+88)) then
                    tmp = ((-60.0d0) * y) / (z - t)
                else if (t_1 <= 1d+169) then
                    tmp = 120.0d0 * a
                else
                    tmp = (y / (z - t)) * (-60.0d0)
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a) {
            	double t_1 = (60.0 * (x - y)) / (z - t);
            	double tmp;
            	if (t_1 <= -1e+88) {
            		tmp = (-60.0 * y) / (z - t);
            	} else if (t_1 <= 1e+169) {
            		tmp = 120.0 * a;
            	} else {
            		tmp = (y / (z - t)) * -60.0;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a):
            	t_1 = (60.0 * (x - y)) / (z - t)
            	tmp = 0
            	if t_1 <= -1e+88:
            		tmp = (-60.0 * y) / (z - t)
            	elif t_1 <= 1e+169:
            		tmp = 120.0 * a
            	else:
            		tmp = (y / (z - t)) * -60.0
            	return tmp
            
            function code(x, y, z, t, a)
            	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
            	tmp = 0.0
            	if (t_1 <= -1e+88)
            		tmp = Float64(Float64(-60.0 * y) / Float64(z - t));
            	elseif (t_1 <= 1e+169)
            		tmp = Float64(120.0 * a);
            	else
            		tmp = Float64(Float64(y / Float64(z - t)) * -60.0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a)
            	t_1 = (60.0 * (x - y)) / (z - t);
            	tmp = 0.0;
            	if (t_1 <= -1e+88)
            		tmp = (-60.0 * y) / (z - t);
            	elseif (t_1 <= 1e+169)
            		tmp = 120.0 * a;
            	else
            		tmp = (y / (z - t)) * -60.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+88], N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+169], N[(120.0 * a), $MachinePrecision], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
            \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+88}:\\
            \;\;\;\;\frac{-60 \cdot y}{z - t}\\
            
            \mathbf{elif}\;t\_1 \leq 10^{+169}:\\
            \;\;\;\;120 \cdot a\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{y}{z - t} \cdot -60\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87

              1. Initial program 95.6%

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

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

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

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

                  \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
                4. metadata-evalN/A

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

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

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

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

                  \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
                9. metadata-evalN/A

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

                  \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
                11. lower--.f6488.3

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

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

                \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
              7. Step-by-step derivation
                1. Applied rewrites36.3%

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

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

                  if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999934e168

                  1. Initial program 99.8%

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

                    \[\leadsto \color{blue}{120 \cdot a} \]
                  4. Step-by-step derivation
                    1. lower-*.f6471.4

                      \[\leadsto \color{blue}{120 \cdot a} \]
                  5. Applied rewrites71.4%

                    \[\leadsto \color{blue}{120 \cdot a} \]

                  if 9.99999999999999934e168 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

                  1. Initial program 99.9%

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

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

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

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

                      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
                    4. metadata-evalN/A

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

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

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

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

                      \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
                    9. metadata-evalN/A

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

                      \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60}{z - t}} \]
                    11. lower--.f6491.5

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

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

                    \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
                  7. Step-by-step derivation
                    1. Applied rewrites55.2%

                      \[\leadsto \frac{y}{z - t} \cdot \color{blue}{-60} \]
                  8. Recombined 3 regimes into one program.
                  9. Add Preprocessing

                  Alternative 9: 55.9% accurate, 0.4× speedup?

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

                    1. Initial program 96.3%

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{z}, 60, 120 \cdot a\right) \]
                      5. lower-*.f6464.8

                        \[\leadsto \mathsf{fma}\left(\frac{x - y}{z}, 60, \color{blue}{120 \cdot a}\right) \]
                    5. Applied rewrites64.8%

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

                      \[\leadsto 60 \cdot \color{blue}{\frac{x}{z}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites38.9%

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

                      if -5.00000000000000008e204 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999998e202

                      1. Initial program 99.8%

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

                        \[\leadsto \color{blue}{120 \cdot a} \]
                      4. Step-by-step derivation
                        1. lower-*.f6466.1

                          \[\leadsto \color{blue}{120 \cdot a} \]
                      5. Applied rewrites66.1%

                        \[\leadsto \color{blue}{120 \cdot a} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification60.7%

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

                    Alternative 10: 55.7% accurate, 0.4× speedup?

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

                      1. Initial program 96.7%

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{t}, -60, 120 \cdot a\right) \]
                        5. lower-*.f6456.3

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

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

                        \[\leadsto 60 \cdot \color{blue}{\frac{y}{t}} \]
                      7. Step-by-step derivation
                        1. Applied rewrites32.3%

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

                        if -1.00000000000000002e184 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999934e168

                        1. Initial program 99.8%

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

                          \[\leadsto \color{blue}{120 \cdot a} \]
                        4. Step-by-step derivation
                          1. lower-*.f6467.4

                            \[\leadsto \color{blue}{120 \cdot a} \]
                        5. Applied rewrites67.4%

                          \[\leadsto \color{blue}{120 \cdot a} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification59.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq -1 \cdot 10^{+184} \lor \neg \left(\frac{60 \cdot \left(x - y\right)}{z - t} \leq 10^{+169}\right):\\ \;\;\;\;\frac{y}{t} \cdot 60\\ \mathbf{else}:\\ \;\;\;\;120 \cdot a\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 56.0% accurate, 0.4× speedup?

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

                        1. Initial program 95.8%

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{t}, -60, 120 \cdot a\right) \]
                          5. lower-*.f6455.9

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

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

                          \[\leadsto -60 \cdot \color{blue}{\frac{x}{t}} \]
                        7. Step-by-step derivation
                          1. Applied rewrites30.0%

                            \[\leadsto \frac{x}{t} \cdot \color{blue}{-60} \]
                          2. Step-by-step derivation
                            1. Applied rewrites32.1%

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

                            if -5.00000000000000008e204 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000009e248

                            1. Initial program 99.8%

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

                              \[\leadsto \color{blue}{120 \cdot a} \]
                            4. Step-by-step derivation
                              1. lower-*.f6464.8

                                \[\leadsto \color{blue}{120 \cdot a} \]
                            5. Applied rewrites64.8%

                              \[\leadsto \color{blue}{120 \cdot a} \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification59.1%

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

                          Alternative 12: 56.2% accurate, 0.4× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+204}:\\ \;\;\;\;\frac{x}{z} \cdot 60\\ \mathbf{elif}\;t\_1 \leq 10^{+168}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -60\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
                             (if (<= t_1 -5e+204)
                               (* (/ x z) 60.0)
                               (if (<= t_1 1e+168) (* 120.0 a) (* (/ y z) -60.0)))))
                          double code(double x, double y, double z, double t, double a) {
                          	double t_1 = (60.0 * (x - y)) / (z - t);
                          	double tmp;
                          	if (t_1 <= -5e+204) {
                          		tmp = (x / z) * 60.0;
                          	} else if (t_1 <= 1e+168) {
                          		tmp = 120.0 * a;
                          	} else {
                          		tmp = (y / z) * -60.0;
                          	}
                          	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 = (60.0d0 * (x - y)) / (z - t)
                              if (t_1 <= (-5d+204)) then
                                  tmp = (x / z) * 60.0d0
                              else if (t_1 <= 1d+168) then
                                  tmp = 120.0d0 * a
                              else
                                  tmp = (y / z) * (-60.0d0)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double t_1 = (60.0 * (x - y)) / (z - t);
                          	double tmp;
                          	if (t_1 <= -5e+204) {
                          		tmp = (x / z) * 60.0;
                          	} else if (t_1 <= 1e+168) {
                          		tmp = 120.0 * a;
                          	} else {
                          		tmp = (y / z) * -60.0;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	t_1 = (60.0 * (x - y)) / (z - t)
                          	tmp = 0
                          	if t_1 <= -5e+204:
                          		tmp = (x / z) * 60.0
                          	elif t_1 <= 1e+168:
                          		tmp = 120.0 * a
                          	else:
                          		tmp = (y / z) * -60.0
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
                          	tmp = 0.0
                          	if (t_1 <= -5e+204)
                          		tmp = Float64(Float64(x / z) * 60.0);
                          	elseif (t_1 <= 1e+168)
                          		tmp = Float64(120.0 * a);
                          	else
                          		tmp = Float64(Float64(y / z) * -60.0);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	t_1 = (60.0 * (x - y)) / (z - t);
                          	tmp = 0.0;
                          	if (t_1 <= -5e+204)
                          		tmp = (x / z) * 60.0;
                          	elseif (t_1 <= 1e+168)
                          		tmp = 120.0 * a;
                          	else
                          		tmp = (y / z) * -60.0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+204], N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+168], N[(120.0 * a), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
                          \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+204}:\\
                          \;\;\;\;\frac{x}{z} \cdot 60\\
                          
                          \mathbf{elif}\;t\_1 \leq 10^{+168}:\\
                          \;\;\;\;120 \cdot a\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{y}{z} \cdot -60\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000008e204

                            1. Initial program 91.6%

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{z}, 60, 120 \cdot a\right) \]
                              5. lower-*.f6460.3

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

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

                              \[\leadsto 60 \cdot \color{blue}{\frac{x}{z}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites43.3%

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

                              if -5.00000000000000008e204 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999993e167

                              1. Initial program 99.8%

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

                                \[\leadsto \color{blue}{120 \cdot a} \]
                              4. Step-by-step derivation
                                1. lower-*.f6467.2

                                  \[\leadsto \color{blue}{120 \cdot a} \]
                              5. Applied rewrites67.2%

                                \[\leadsto \color{blue}{120 \cdot a} \]

                              if 9.9999999999999993e167 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

                              1. Initial program 99.9%

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{z}, 60, 120 \cdot a\right) \]
                                5. lower-*.f6467.0

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

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

                                \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
                              7. Step-by-step derivation
                                1. Applied rewrites38.7%

                                  \[\leadsto \frac{y}{z} \cdot \color{blue}{-60} \]
                              8. Recombined 3 regimes into one program.
                              9. Add Preprocessing

                              Alternative 13: 89.8% accurate, 0.8× speedup?

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

                                1. Initial program 99.8%

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

                                  \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} + a \cdot 120 \]
                                4. Step-by-step derivation
                                  1. lower-*.f6485.2

                                    \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} + a \cdot 120 \]
                                5. Applied rewrites85.2%

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

                                    \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t} + a \cdot 120} \]
                                  2. +-commutativeN/A

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

                                    \[\leadsto \color{blue}{a \cdot 120} + \frac{-60 \cdot y}{z - t} \]
                                  4. lower-fma.f6485.3

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)} \]
                                7. Applied rewrites85.3%

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

                                if -1.40000000000000008e54 < y < 9.4999999999999995e69

                                1. Initial program 99.3%

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

                                  \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
                                4. Step-by-step derivation
                                  1. lower-*.f6492.0

                                    \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
                                5. Applied rewrites92.0%

                                  \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]

                                if 9.4999999999999995e69 < y

                                1. Initial program 97.8%

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{\frac{y}{z - t}} \cdot -60\right) \]
                                  6. lower--.f6488.2

                                    \[\leadsto \mathsf{fma}\left(120, a, \frac{y}{\color{blue}{z - t}} \cdot -60\right) \]
                                5. Applied rewrites88.2%

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

                              Alternative 14: 84.5% accurate, 0.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - y}{t}\\ \mathbf{if}\;t \leq -1.9 \cdot 10^{-28}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, -60, 120 \cdot a\right)\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{+14}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, t\_1 \cdot -60\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t a)
                               :precision binary64
                               (let* ((t_1 (/ (- x y) t)))
                                 (if (<= t -1.9e-28)
                                   (fma t_1 -60.0 (* 120.0 a))
                                   (if (<= t 7.6e+14)
                                     (fma (/ (- x y) z) 60.0 (* 120.0 a))
                                     (fma a 120.0 (* t_1 -60.0))))))
                              double code(double x, double y, double z, double t, double a) {
                              	double t_1 = (x - y) / t;
                              	double tmp;
                              	if (t <= -1.9e-28) {
                              		tmp = fma(t_1, -60.0, (120.0 * a));
                              	} else if (t <= 7.6e+14) {
                              		tmp = fma(((x - y) / z), 60.0, (120.0 * a));
                              	} else {
                              		tmp = fma(a, 120.0, (t_1 * -60.0));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a)
                              	t_1 = Float64(Float64(x - y) / t)
                              	tmp = 0.0
                              	if (t <= -1.9e-28)
                              		tmp = fma(t_1, -60.0, Float64(120.0 * a));
                              	elseif (t <= 7.6e+14)
                              		tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a));
                              	else
                              		tmp = fma(a, 120.0, Float64(t_1 * -60.0));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -1.9e-28], N[(t$95$1 * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e+14], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(t$95$1 * -60.0), $MachinePrecision]), $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \frac{x - y}{t}\\
                              \mathbf{if}\;t \leq -1.9 \cdot 10^{-28}:\\
                              \;\;\;\;\mathsf{fma}\left(t\_1, -60, 120 \cdot a\right)\\
                              
                              \mathbf{elif}\;t \leq 7.6 \cdot 10^{+14}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(a, 120, t\_1 \cdot -60\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if t < -1.90000000000000005e-28

                                1. Initial program 99.9%

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{t}, -60, 120 \cdot a\right) \]
                                  5. lower-*.f6493.1

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

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

                                if -1.90000000000000005e-28 < t < 7.6e14

                                1. Initial program 99.3%

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{z}, 60, 120 \cdot a\right) \]
                                  5. lower-*.f6483.7

                                    \[\leadsto \mathsf{fma}\left(\frac{x - y}{z}, 60, \color{blue}{120 \cdot a}\right) \]
                                5. Applied rewrites83.7%

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

                                if 7.6e14 < t

                                1. Initial program 98.0%

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{t}, -60, 120 \cdot a\right) \]
                                  5. lower-*.f6492.4

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

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

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

                                Alternative 15: 67.5% accurate, 0.9× speedup?

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

                                  1. Initial program 99.9%

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{x - y}}{z}, 60, 120 \cdot a\right) \]
                                    5. lower-*.f6489.0

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

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

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

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

                                    if -4.79999999999999985e-124 < z < 8.5e10

                                    1. Initial program 98.2%

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

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

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

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

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

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

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

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

                                      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites62.0%

                                        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{60}, 120 \cdot a\right) \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification70.4%

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

                                    Alternative 16: 52.0% accurate, 5.2× speedup?

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

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

                                      \[\leadsto \color{blue}{120 \cdot a} \]
                                    4. Step-by-step derivation
                                      1. lower-*.f6453.9

                                        \[\leadsto \color{blue}{120 \cdot a} \]
                                    5. Applied rewrites53.9%

                                      \[\leadsto \color{blue}{120 \cdot a} \]
                                    6. Add Preprocessing

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

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

                                    Reproduce

                                    ?
                                    herbie shell --seed 2025017 
                                    (FPCore (x y z t a)
                                      :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
                                      :precision binary64
                                    
                                      :alt
                                      (! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
                                    
                                      (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))