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

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

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.3% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

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

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

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
  2. Applied rewrites99.7%

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

Alternative 2: 87.7% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t} + a \cdot 120\\


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

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

    if -2.40000000000000011e164 < y < 1.65e-22

    1. Initial program 99.3%

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

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

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

    if 1.65e-22 < y

    1. Initial program 99.3%

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

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

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

Alternative 3: 87.7% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t} + a \cdot 120\\


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

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

    if -2.40000000000000011e164 < y < 1.65e-22

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t} + 120 \cdot a} \]
    3. Applied rewrites74.6%

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

    if 1.65e-22 < y

    1. Initial program 99.3%

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

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

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

Alternative 4: 87.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-60, \frac{y}{z - t}, 120 \cdot a\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+164}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-22}:\\ \;\;\;\;\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 -60.0 (/ y (- z t)) (* 120.0 a))))
   (if (<= y -2.4e+164)
     t_1
     (if (<= y 1.65e-22) (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(-60.0, (y / (z - t)), (120.0 * a));
	double tmp;
	if (y <= -2.4e+164) {
		tmp = t_1;
	} else if (y <= 1.65e-22) {
		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(-60.0, Float64(y / Float64(z - t)), Float64(120.0 * a))
	tmp = 0.0
	if (y <= -2.4e+164)
		tmp = t_1;
	elseif (y <= 1.65e-22)
		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[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+164], t$95$1, If[LessEqual[y, 1.65e-22], 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(-60, \frac{y}{z - t}, 120 \cdot a\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-22}:\\
\;\;\;\;\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 < -2.40000000000000011e164 or 1.65e-22 < y

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

    if -2.40000000000000011e164 < y < 1.65e-22

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t} + 120 \cdot a} \]
    3. Applied rewrites74.6%

      \[\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 5: 81.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 2.2 \cdot 10^{-141}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6e-115 or 2.20000000000000009e-141 < a

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

    if -1.6e-115 < a < 2.20000000000000009e-141

    1. Initial program 99.3%

      \[\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. Applied rewrites51.6%

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

Alternative 6: 76.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x}{t}, 120 \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.7999999999999999e58

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

    if -3.7999999999999999e58 < t < 4.4999999999999998e-82

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
    3. Applied rewrites63.2%

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

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

    if 4.4999999999999998e-82 < t

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t} + 120 \cdot a} \]
    3. Applied rewrites74.6%

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

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

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

Alternative 7: 73.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq 2.9 \cdot 10^{-70}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.5000000000000005e-15

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

    if -9.5000000000000005e-15 < a < 2.89999999999999971e-70

    1. Initial program 99.3%

      \[\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. Applied rewrites51.6%

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

    if 2.89999999999999971e-70 < a

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

Alternative 8: 66.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x}{t}, 120 \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.15000000000000001e-11

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

    if -2.15000000000000001e-11 < t < 2e-85

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

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

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

    if 2e-85 < t

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t} + 120 \cdot a} \]
    3. Applied rewrites74.6%

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

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

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

Alternative 9: 64.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\ \mathbf{if}\;t \leq -2.15 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-170}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 120 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma 60.0 (/ y t) (* 120.0 a))))
   (if (<= t -2.15e-11)
     t_1
     (if (<= t 6.5e-170) (fma -60.0 (/ y z) (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(60.0, (y / t), (120.0 * a));
	double tmp;
	if (t <= -2.15e-11) {
		tmp = t_1;
	} else if (t <= 6.5e-170) {
		tmp = fma(-60.0, (y / z), (120.0 * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(60.0, Float64(y / t), Float64(120.0 * a))
	tmp = 0.0
	if (t <= -2.15e-11)
		tmp = t_1;
	elseif (t <= 6.5e-170)
		tmp = fma(-60.0, Float64(y / z), Float64(120.0 * a));
	else
		tmp = t_1;
	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]}, If[LessEqual[t, -2.15e-11], t$95$1, If[LessEqual[t, 6.5e-170], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.15000000000000001e-11 or 6.50000000000000035e-170 < t

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

    if -2.15000000000000001e-11 < t < 6.50000000000000035e-170

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

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

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

Alternative 10: 61.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(60, \frac{y}{t}, 120 \cdot a\right)\\ \mathbf{if}\;t \leq -4 \cdot 10^{-77}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-149}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma 60.0 (/ y t) (* 120.0 a))))
   (if (<= t -4e-77) t_1 (if (<= t 4.6e-149) (* 60.0 (/ (- x y) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(60.0, (y / t), (120.0 * a));
	double tmp;
	if (t <= -4e-77) {
		tmp = t_1;
	} else if (t <= 4.6e-149) {
		tmp = 60.0 * ((x - y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(60.0, Float64(y / t), Float64(120.0 * a))
	tmp = 0.0
	if (t <= -4e-77)
		tmp = t_1;
	elseif (t <= 4.6e-149)
		tmp = Float64(60.0 * Float64(Float64(x - y) / z));
	else
		tmp = t_1;
	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]}, If[LessEqual[t, -4e-77], t$95$1, If[LessEqual[t, 4.6e-149], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9999999999999997e-77 or 4.5999999999999999e-149 < t

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

    if -3.9999999999999997e-77 < t < 4.5999999999999999e-149

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
    3. Applied rewrites63.2%

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

      \[\leadsto 60 \cdot \color{blue}{\frac{x - y}{z}} \]
    5. Applied rewrites28.5%

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

Alternative 11: 59.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot x}{z - t}\\ t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+288}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+135}:\\ \;\;\;\;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) (- z t))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_2 -1e+288)
     (* 60.0 (/ y t))
     (if (<= t_2 -2e+114) t_1 (if (<= t_2 5e+135) (* 120.0 a) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * x) / (z - t);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -1e+288) {
		tmp = 60.0 * (y / t);
	} else if (t_2 <= -2e+114) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		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) / (z - t)
    t_2 = (60.0d0 * (x - y)) / (z - t)
    if (t_2 <= (-1d+288)) then
        tmp = 60.0d0 * (y / t)
    else if (t_2 <= (-2d+114)) then
        tmp = t_1
    else if (t_2 <= 5d+135) 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) / (z - t);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -1e+288) {
		tmp = 60.0 * (y / t);
	} else if (t_2 <= -2e+114) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		tmp = 120.0 * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * x) / (z - t)
	t_2 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_2 <= -1e+288:
		tmp = 60.0 * (y / t)
	elif t_2 <= -2e+114:
		tmp = t_1
	elif t_2 <= 5e+135:
		tmp = 120.0 * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * x) / Float64(z - t))
	t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_2 <= -1e+288)
		tmp = Float64(60.0 * Float64(y / t));
	elseif (t_2 <= -2e+114)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		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) / (z - t);
	t_2 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_2 <= -1e+288)
		tmp = 60.0 * (y / t);
	elseif (t_2 <= -2e+114)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		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[(60.0 * x), $MachinePrecision] / N[(z - 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, -1e+288], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e+114], t$95$1, If[LessEqual[t$95$2, 5e+135], N[(120.0 * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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

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


\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)) < -1e288

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

      \[\leadsto 60 \cdot \frac{y}{\color{blue}{t}} \]
    8. Applied rewrites16.1%

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

    if -1e288 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e114 or 5.00000000000000029e135 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.3%

      \[\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. Applied rewrites27.2%

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

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

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

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

Alternative 12: 59.5% accurate, 0.4× speedup?

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

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-4d+51)) then
        tmp = 60.0d0 * ((x - y) / z)
    else if (t_1 <= 5d+128) then
        tmp = 120.0d0 * a
    else
        tmp = 60.0d0 * (x / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -4e+51) {
		tmp = 60.0 * ((x - y) / z);
	} else if (t_1 <= 5e+128) {
		tmp = 120.0 * a;
	} else {
		tmp = 60.0 * (x / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -4e+51:
		tmp = 60.0 * ((x - y) / z)
	elif t_1 <= 5e+128:
		tmp = 120.0 * a
	else:
		tmp = 60.0 * (x / (z - t))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_1 <= -4e+51)
		tmp = Float64(60.0 * Float64(Float64(x - y) / z));
	elseif (t_1 <= 5e+128)
		tmp = Float64(120.0 * a);
	else
		tmp = Float64(60.0 * Float64(x / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_1 <= -4e+51)
		tmp = 60.0 * ((x - y) / z);
	elseif (t_1 <= 5e+128)
		tmp = 120.0 * a;
	else
		tmp = 60.0 * (x / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+51], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+128], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $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^{+51}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

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

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


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

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
    3. Applied rewrites63.2%

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

      \[\leadsto 60 \cdot \color{blue}{\frac{x - y}{z}} \]
    5. Applied rewrites28.5%

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

    if -4e51 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e128

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

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

    1. Initial program 99.3%

      \[\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. Applied rewrites27.2%

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

Alternative 13: 58.3% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
    3. Applied rewrites63.2%

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

      \[\leadsto 60 \cdot \color{blue}{\frac{x - y}{z}} \]
    5. Applied rewrites28.5%

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

    if -4e51 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000029e135

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

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

    1. Initial program 99.3%

      \[\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. Applied rewrites27.2%

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

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

Alternative 14: 54.4% 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 -1 \cdot 10^{+163}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+135}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -1e+163)
     (* 60.0 (/ y t))
     (if (<= t_1 5e+135) (* 120.0 a) (* -60.0 (/ x t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -1e+163) {
		tmp = 60.0 * (y / t);
	} else if (t_1 <= 5e+135) {
		tmp = 120.0 * a;
	} else {
		tmp = -60.0 * (x / t);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

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


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

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

      \[\leadsto 60 \cdot \frac{y}{\color{blue}{t}} \]
    8. Applied rewrites16.1%

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

    if -9.9999999999999994e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000029e135

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

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

    1. Initial program 99.3%

      \[\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. Applied rewrites27.2%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{x}{t}} \]
    5. Applied rewrites16.6%

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

Alternative 15: 54.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{y}{t}\\ t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+163}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+135}:\\ \;\;\;\;120 \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* 60.0 (/ y t))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_2 -1e+163) t_1 (if (<= t_2 5e+135) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * (y / t);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -1e+163) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		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 * (y / t)
    t_2 = (60.0d0 * (x - y)) / (z - t)
    if (t_2 <= (-1d+163)) then
        tmp = t_1
    else if (t_2 <= 5d+135) 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 * (y / t);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -1e+163) {
		tmp = t_1;
	} else if (t_2 <= 5e+135) {
		tmp = 120.0 * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * (y / t)
	t_2 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_2 <= -1e+163:
		tmp = t_1
	elif t_2 <= 5e+135:
		tmp = 120.0 * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(60.0 * Float64(y / t))
	t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_2 <= -1e+163)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		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 * (y / t);
	t_2 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_2 <= -1e+163)
		tmp = t_1;
	elseif (t_2 <= 5e+135)
		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[(y / 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, -1e+163], t$95$1, If[LessEqual[t$95$2, 5e+135], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+135}:\\
\;\;\;\;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)) < -9.9999999999999994e162 or 5.00000000000000029e135 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Applied rewrites99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t} + 120 \cdot a} \]
    4. Applied rewrites74.7%

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

      \[\leadsto 60 \cdot \frac{y}{t} + \color{blue}{120 \cdot a} \]
    6. Applied rewrites54.0%

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

      \[\leadsto 60 \cdot \frac{y}{\color{blue}{t}} \]
    8. Applied rewrites16.1%

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

    if -9.9999999999999994e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000029e135

    1. Initial program 99.3%

      \[\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. Applied rewrites49.7%

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

Alternative 16: 49.7% 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.3%

    \[\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. Applied rewrites49.7%

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

Reproduce

?
herbie shell --seed 2025159 
(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)))