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

Percentage Accurate: 99.5% → 99.7%
Time: 4.4s
Alternatives: 13
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}

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 13 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.5% 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.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x - y, \frac{60}{z - t}, 120 \cdot a\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (fma (- x y) (/ 60.0 (- z t)) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
	return fma((x - y), (60.0 / (z - t)), (120.0 * a));
}
function code(x, y, z, t, a)
	return fma(Float64(x - y), Float64(60.0 / Float64(z - t)), Float64(120.0 * a))
end
code[x_, y_, z_, t_, a_] := N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{z - t}}, 120 \cdot a\right) \]
    13. lift-*.f6499.7

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

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

Alternative 2: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot 60}{z - t}\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (fma a 120.0 (/ (* (- x y) 60.0) (- z t))))
double code(double x, double y, double z, double t, double a) {
	return fma(a, 120.0, (((x - y) * 60.0) / (z - t)));
}
function code(x, y, z, t, a)
	return fma(a, 120.0, Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)))
end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8999999999999999e73 or 5.4999999999999999e135 < y

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if -4.8999999999999999e73 < y < 5.4999999999999999e135

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(60, \frac{x}{z - \color{blue}{t}}, 120 \cdot a\right) \]
      4. lift-*.f6475.2

        \[\leadsto \mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right) \]
    6. Applied rewrites75.2%

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

Alternative 4: 82.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+167}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\

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

\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.4e167

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e167 < y < 1.6000000000000001e131

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(60, \frac{x}{z - \color{blue}{t}}, 120 \cdot a\right) \]
      4. lift-*.f6475.2

        \[\leadsto \mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right) \]
    6. Applied rewrites75.2%

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

    if 1.6000000000000001e131 < y

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{x - y}{\color{blue}{z} - t} \]
      4. lift--.f6450.1

        \[\leadsto 60 \cdot \frac{x - y}{z - \color{blue}{t}} \]
    6. Applied rewrites50.1%

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

Alternative 5: 74.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-8}:\\
\;\;\;\;120 \cdot a\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{+57}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3000000000000001e-8 or 5.8000000000000003e57 < a

    1. Initial program 99.5%

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

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

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

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

    if -1.3000000000000001e-8 < a < 5.8000000000000003e57

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{x - y}{\color{blue}{z} - t} \]
      4. lift--.f6450.1

        \[\leadsto 60 \cdot \frac{x - y}{z - \color{blue}{t}} \]
    6. Applied rewrites50.1%

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

Alternative 6: 63.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\
t_2 := \mathsf{fma}\left(\frac{y}{z}, -60, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+100}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-214}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.21999999999999995e100 or 4.79999999999999977e101 < z

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{z}, -60, 120 \cdot a\right) \]
    6. Step-by-step derivation
      1. lower-/.f6455.1

        \[\leadsto \mathsf{fma}\left(\frac{y}{z}, -60, 120 \cdot a\right) \]
    7. Applied rewrites55.1%

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

    if -1.21999999999999995e100 < z < -3.19999999999999978e-101 or 2.6e-214 < z < 4.79999999999999977e101

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right) \]
      3. lift-*.f6455.3

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

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

    if -3.19999999999999978e-101 < z < 2.6e-214

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

      \[\leadsto \frac{\left(x - y\right) \cdot 60}{-1 \cdot \color{blue}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6428.2

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{-t} \]
    7. Applied rewrites28.2%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{x - y}{t}} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -60 \cdot \frac{x - y}{t} \]
      3. lift--.f6428.3

        \[\leadsto -60 \cdot \frac{x - y}{t} \]
    10. Applied rewrites28.3%

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

Alternative 7: 61.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-119}:\\ \;\;\;\;120 \cdot a\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-242}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq 3500000000000:\\ \;\;\;\;\frac{x}{z - t} \cdot 60\\ \mathbf{else}:\\ \;\;\;\;120 \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -5.2e-119)
   (* 120.0 a)
   (if (<= a 5.5e-242)
     (* -60.0 (/ y (- z t)))
     (if (<= a 3500000000000.0) (* (/ x (- z t)) 60.0) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.2e-119) {
		tmp = 120.0 * a;
	} else if (a <= 5.5e-242) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= 3500000000000.0) {
		tmp = (x / (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) :: tmp
    if (a <= (-5.2d-119)) then
        tmp = 120.0d0 * a
    else if (a <= 5.5d-242) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (a <= 3500000000000.0d0) then
        tmp = (x / (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 tmp;
	if (a <= -5.2e-119) {
		tmp = 120.0 * a;
	} else if (a <= 5.5e-242) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= 3500000000000.0) {
		tmp = (x / (z - t)) * 60.0;
	} else {
		tmp = 120.0 * a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -5.2e-119:
		tmp = 120.0 * a
	elif a <= 5.5e-242:
		tmp = -60.0 * (y / (z - t))
	elif a <= 3500000000000.0:
		tmp = (x / (z - t)) * 60.0
	else:
		tmp = 120.0 * a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -5.2e-119)
		tmp = Float64(120.0 * a);
	elseif (a <= 5.5e-242)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (a <= 3500000000000.0)
		tmp = Float64(Float64(x / Float64(z - t)) * 60.0);
	else
		tmp = Float64(120.0 * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -5.2e-119)
		tmp = 120.0 * a;
	elseif (a <= 5.5e-242)
		tmp = -60.0 * (y / (z - t));
	elseif (a <= 3500000000000.0)
		tmp = (x / (z - t)) * 60.0;
	else
		tmp = 120.0 * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.2e-119], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 5.5e-242], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3500000000000.0], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-119}:\\
\;\;\;\;120 \cdot a\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-242}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

\mathbf{elif}\;a \leq 3500000000000:\\
\;\;\;\;\frac{x}{z - t} \cdot 60\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.20000000000000023e-119 or 3.5e12 < a

    1. Initial program 99.5%

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

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

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

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

    if -5.20000000000000023e-119 < a < 5.4999999999999998e-242

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

      \[\leadsto \frac{\left(x - y\right) \cdot 60}{-1 \cdot \color{blue}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6428.2

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{-t} \]
    7. Applied rewrites28.2%

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

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

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

        \[\leadsto -60 \cdot \frac{y}{z - \color{blue}{t}} \]
      3. lift--.f6426.9

        \[\leadsto -60 \cdot \frac{y}{z - t} \]
    10. Applied rewrites26.9%

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

    if 5.4999999999999998e-242 < a < 3.5e12

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

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

Alternative 8: 60.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+129}:\\
\;\;\;\;\frac{x}{z - t} \cdot 60\\

\mathbf{elif}\;x \leq 2.5 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot x}{z - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4e129

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

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

    if -4e129 < x < 2.50000000000000014e83

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right) \]
      3. lift-*.f6455.3

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

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

    if 2.50000000000000014e83 < x

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

      \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{x}{z - t}} \]
      5. associate-*r/N/A

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

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z} - t} \]
      8. lift--.f6426.0

        \[\leadsto \frac{60 \cdot x}{z - \color{blue}{t}} \]
    6. Applied rewrites26.0%

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

Alternative 9: 57.7% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10000000000000:\\
\;\;\;\;120 \cdot a\\

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


\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 1e13 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

      \[\leadsto \frac{\left(x - y\right) \cdot 60}{-1 \cdot \color{blue}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6428.2

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{-t} \]
    7. Applied rewrites28.2%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{x - y}{t}} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -60 \cdot \frac{x - y}{t} \]
      3. lift--.f6428.3

        \[\leadsto -60 \cdot \frac{x - y}{t} \]
    10. Applied rewrites28.3%

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

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

    1. Initial program 99.5%

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

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

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

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

Alternative 10: 55.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-119}:\\
\;\;\;\;120 \cdot a\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{-240}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

\mathbf{elif}\;a \leq 6.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{t} \cdot -60\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.20000000000000023e-119 or 6.2e17 < a

    1. Initial program 99.5%

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

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

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

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

    if -5.20000000000000023e-119 < a < 1.2e-240

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

      \[\leadsto \frac{\left(x - y\right) \cdot 60}{-1 \cdot \color{blue}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6428.2

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{-t} \]
    7. Applied rewrites28.2%

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

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

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

        \[\leadsto -60 \cdot \frac{y}{z - \color{blue}{t}} \]
      3. lift--.f6426.9

        \[\leadsto -60 \cdot \frac{y}{z - t} \]
    10. Applied rewrites26.9%

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

    if 1.2e-240 < a < 6.2e17

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

      \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
    5. Taylor expanded in z around 0

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

        \[\leadsto \frac{x}{t} \cdot -60 \]
      2. lower-*.f64N/A

        \[\leadsto \frac{x}{t} \cdot -60 \]
      3. lower-/.f6415.6

        \[\leadsto \frac{x}{t} \cdot -60 \]
    7. Applied rewrites15.6%

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

Alternative 11: 55.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+233}:\\ \;\;\;\;\frac{-60 \cdot y}{-t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+177}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{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 -4e+233)
     (/ (* -60.0 y) (- t))
     (if (<= t_1 2e+177) (* 120.0 a) (* (/ x 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 <= -4e+233) {
		tmp = (-60.0 * y) / -t;
	} else if (t_1 <= 2e+177) {
		tmp = 120.0 * a;
	} else {
		tmp = (x / 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 <= (-4d+233)) then
        tmp = ((-60.0d0) * y) / -t
    else if (t_1 <= 2d+177) then
        tmp = 120.0d0 * a
    else
        tmp = (x / 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 <= -4e+233) {
		tmp = (-60.0 * y) / -t;
	} else if (t_1 <= 2e+177) {
		tmp = 120.0 * a;
	} else {
		tmp = (x / 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 <= -4e+233:
		tmp = (-60.0 * y) / -t
	elif t_1 <= 2e+177:
		tmp = 120.0 * a
	else:
		tmp = (x / 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 <= -4e+233)
		tmp = Float64(Float64(-60.0 * y) / Float64(-t));
	elseif (t_1 <= 2e+177)
		tmp = Float64(120.0 * a);
	else
		tmp = Float64(Float64(x / 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 <= -4e+233)
		tmp = (-60.0 * y) / -t;
	elseif (t_1 <= 2e+177)
		tmp = 120.0 * a;
	else
		tmp = (x / 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, -4e+233], N[(N[(-60.0 * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[t$95$1, 2e+177], N[(120.0 * a), $MachinePrecision], N[(N[(x / t), $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 -4 \cdot 10^{+233}:\\
\;\;\;\;\frac{-60 \cdot y}{-t}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{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)) < -3.99999999999999989e233

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{z - t} \]
      6. lift--.f6449.9

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

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

      \[\leadsto \frac{\left(x - y\right) \cdot 60}{-1 \cdot \color{blue}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6428.2

        \[\leadsto \frac{\left(x - y\right) \cdot 60}{-t} \]
    7. Applied rewrites28.2%

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

      \[\leadsto \frac{-60 \cdot y}{-\color{blue}{t}} \]
    9. Step-by-step derivation
      1. lower-*.f6416.2

        \[\leadsto \frac{-60 \cdot y}{-t} \]
    10. Applied rewrites16.2%

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

    if -3.99999999999999989e233 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e177

    1. Initial program 99.5%

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

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

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

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

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

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

      \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
    5. Taylor expanded in z around 0

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

        \[\leadsto \frac{x}{t} \cdot -60 \]
      2. lower-*.f64N/A

        \[\leadsto \frac{x}{t} \cdot -60 \]
      3. lower-/.f6415.6

        \[\leadsto \frac{x}{t} \cdot -60 \]
    7. Applied rewrites15.6%

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

Alternative 12: 54.3% accurate, 0.5× speedup?

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

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

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

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

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

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


\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 2e177 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{60} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
      4. lift--.f6426.1

        \[\leadsto \frac{x}{z - t} \cdot 60 \]
    4. Applied rewrites26.1%

      \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
    5. Taylor expanded in z around 0

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

        \[\leadsto \frac{x}{t} \cdot -60 \]
      2. lower-*.f64N/A

        \[\leadsto \frac{x}{t} \cdot -60 \]
      3. lower-/.f6415.6

        \[\leadsto \frac{x}{t} \cdot -60 \]
    7. Applied rewrites15.6%

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

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

    1. Initial program 99.5%

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

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

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

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

Alternative 13: 51.4% accurate, 4.6× 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.5%

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

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

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

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

Reproduce

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