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

Percentage Accurate: 99.3% → 99.4%
Time: 3.6s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 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.4% 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.3%

    \[\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.4

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

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

Alternative 2: 89.0% accurate, 0.8× speedup?

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

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

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

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


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

    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 \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.5

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

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

    if -3.7000000000000001e74 < y < 1.64999999999999996e171

    1. Initial program 99.3%

      \[\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.4

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

      \[\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.64999999999999996e171 < y

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(60 \cdot \frac{\frac{x}{y} - 1}{z - t}\right) \cdot y + a \cdot 120 \]
      10. lift--.f6487.7

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

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

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

        \[\leadsto \frac{-60}{z - t} \cdot y + a \cdot 120 \]
      2. lift--.f6475.5

        \[\leadsto \frac{-60}{z - t} \cdot y + a \cdot 120 \]
    7. Applied rewrites75.5%

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

Alternative 3: 89.0% 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 -3.7 \cdot 10^{+74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+171}:\\ \;\;\;\;\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 -3.7e+74)
     t_1
     (if (<= y 1.65e+171) (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 <= -3.7e+74) {
		tmp = t_1;
	} else if (y <= 1.65e+171) {
		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 <= -3.7e+74)
		tmp = t_1;
	elseif (y <= 1.65e+171)
		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, -3.7e+74], t$95$1, If[LessEqual[y, 1.65e+171], 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 -3.7 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{+171}:\\
\;\;\;\;\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 < -3.7000000000000001e74 or 1.64999999999999996e171 < 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 \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.5

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

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

    if -3.7000000000000001e74 < y < 1.64999999999999996e171

    1. Initial program 99.3%

      \[\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.4

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

      \[\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.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 -2 \cdot 10^{+183}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \mathbf{elif}\;t\_1 \leq 10^{+124}:\\ \;\;\;\;\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
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -2e+183)
     (/ (* (- x y) 60.0) (- z t))
     (if (<= t_1 1e+124)
       (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 t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -2e+183) {
		tmp = ((x - y) * 60.0) / (z - t);
	} else if (t_1 <= 1e+124) {
		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)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_1 <= -2e+183)
		tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t));
	elseif (t_1 <= 1e+124)
		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_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+183], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+124], 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}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+183}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\

\mathbf{elif}\;t\_1 \leq 10^{+124}:\\
\;\;\;\;\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 (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999989e183

    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. 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.8

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

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

    if -1.99999999999999989e183 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999948e123

    1. Initial program 99.3%

      \[\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.4

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

      \[\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 9.99999999999999948e123 < (/.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. 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.4

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

      \[\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: 75.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4 \cdot 10^{+23}:\\ \;\;\;\;120 \cdot a\\ \mathbf{elif}\;a \leq 0.000225:\\ \;\;\;\;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 -4e+23)
   (* 120.0 a)
   (if (<= a 0.000225) (* 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 <= -4e+23) {
		tmp = 120.0 * a;
	} else if (a <= 0.000225) {
		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 <= (-4d+23)) then
        tmp = 120.0d0 * a
    else if (a <= 0.000225d0) 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 <= -4e+23) {
		tmp = 120.0 * a;
	} else if (a <= 0.000225) {
		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 <= -4e+23:
		tmp = 120.0 * a
	elif a <= 0.000225:
		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 <= -4e+23)
		tmp = Float64(120.0 * a);
	elseif (a <= 0.000225)
		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 <= -4e+23)
		tmp = 120.0 * a;
	elseif (a <= 0.000225)
		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, -4e+23], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 0.000225], 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 -4 \cdot 10^{+23}:\\
\;\;\;\;120 \cdot a\\

\mathbf{elif}\;a \leq 0.000225:\\
\;\;\;\;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 < -3.9999999999999997e23 or 2.2499999999999999e-4 < a

    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. Step-by-step derivation
      1. lower-*.f6450.9

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

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

    if -3.9999999999999997e23 < a < 2.2499999999999999e-4

    1. Initial program 99.3%

      \[\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.4

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

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

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

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

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{z - t} \cdot 60\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e14 or 1.4e26 < z

    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 \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.5

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

      \[\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-/.f6454.5

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

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

    if -1.3e14 < z < 7.5999999999999999e-106

    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 \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.5

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

      \[\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-*.f6454.9

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

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

    if 7.5999999999999999e-106 < z < 1.4e26

    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. 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.4

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

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

Alternative 7: 60.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{z - t} \cdot 60\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5e65 or 8.6e94 < x

    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. 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.4

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

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

    if -4.5e65 < x < 8.6e94

    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 \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.5

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

      \[\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-*.f6454.9

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

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

Alternative 8: 57.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{z - t} \cdot 60\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 8.5 \cdot 10^{+94}:\\
\;\;\;\;120 \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4e97 or 8.50000000000000054e94 < x

    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. 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.4

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

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

    if -2.4e97 < x < 8.50000000000000054e94

    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. Step-by-step derivation
      1. lower-*.f6450.9

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

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

Alternative 9: 54.8% 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^{+250}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+144}:\\ \;\;\;\;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+250) t_1 (if (<= t_2 1e+144) (* 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+250) {
		tmp = t_1;
	} else if (t_2 <= 1e+144) {
		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+250)) then
        tmp = t_1
    else if (t_2 <= 1d+144) 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+250) {
		tmp = t_1;
	} else if (t_2 <= 1e+144) {
		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+250:
		tmp = t_1
	elif t_2 <= 1e+144:
		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+250)
		tmp = t_1;
	elseif (t_2 <= 1e+144)
		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+250)
		tmp = t_1;
	elseif (t_2 <= 1e+144)
		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+250], t$95$1, If[LessEqual[t$95$2, 1e+144], 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^{+250}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+144}:\\
\;\;\;\;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.9999999999999992e249 or 1.00000000000000002e144 < (/.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 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.5

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

      \[\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-*.f6454.9

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

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

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

        \[\leadsto 60 \cdot \frac{y}{t} \]
      2. lift-/.f6415.9

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

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

    if -9.9999999999999992e249 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e144

    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. Step-by-step derivation
      1. lower-*.f6450.9

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

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

Alternative 10: 54.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+161}:\\
\;\;\;\;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)) < -1.00000000000000005e236 or 2.0000000000000001e161 < (/.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. 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.4

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

      \[\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. lower-*.f64N/A

        \[\leadsto -60 \cdot \frac{x}{\color{blue}{t}} \]
      2. lower-/.f6415.5

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

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

    if -1.00000000000000005e236 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e161

    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. Step-by-step derivation
      1. lower-*.f6450.9

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

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

Alternative 11: 50.9% 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. Step-by-step derivation
    1. lower-*.f6450.9

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

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

Reproduce

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