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

Percentage Accurate: 99.3% → 99.8%
Time: 12.6s
Alternatives: 15
Speedup: 1.1×

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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);
}
real(8) function code(x, y, z, t, a)
    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.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 59.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - y\right) \cdot 60\\ t_2 := \frac{t\_1}{z}\\ t_3 := \frac{t\_1}{z - t}\\ \mathbf{if}\;t\_3 \leq -3 \cdot 10^{+26}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+28}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+251}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- x y) 60.0)) (t_2 (/ t_1 z)) (t_3 (/ t_1 (- z t))))
   (if (<= t_3 -3e+26)
     t_2
     (if (<= t_3 2e+28)
       (* a 120.0)
       (if (<= t_3 4e+251) t_2 (/ (* (- x y) -60.0) t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - y) * 60.0;
	double t_2 = t_1 / z;
	double t_3 = t_1 / (z - t);
	double tmp;
	if (t_3 <= -3e+26) {
		tmp = t_2;
	} else if (t_3 <= 2e+28) {
		tmp = a * 120.0;
	} else if (t_3 <= 4e+251) {
		tmp = t_2;
	} else {
		tmp = ((x - y) * -60.0) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_3
    real(8) :: tmp
    t_1 = (x - y) * 60.0d0
    t_2 = t_1 / z
    t_3 = t_1 / (z - t)
    if (t_3 <= (-3d+26)) then
        tmp = t_2
    else if (t_3 <= 2d+28) then
        tmp = a * 120.0d0
    else if (t_3 <= 4d+251) then
        tmp = t_2
    else
        tmp = ((x - y) * (-60.0d0)) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - y) * 60.0;
	double t_2 = t_1 / z;
	double t_3 = t_1 / (z - t);
	double tmp;
	if (t_3 <= -3e+26) {
		tmp = t_2;
	} else if (t_3 <= 2e+28) {
		tmp = a * 120.0;
	} else if (t_3 <= 4e+251) {
		tmp = t_2;
	} else {
		tmp = ((x - y) * -60.0) / t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x - y) * 60.0
	t_2 = t_1 / z
	t_3 = t_1 / (z - t)
	tmp = 0
	if t_3 <= -3e+26:
		tmp = t_2
	elif t_3 <= 2e+28:
		tmp = a * 120.0
	elif t_3 <= 4e+251:
		tmp = t_2
	else:
		tmp = ((x - y) * -60.0) / t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - y) * 60.0)
	t_2 = Float64(t_1 / z)
	t_3 = Float64(t_1 / Float64(z - t))
	tmp = 0.0
	if (t_3 <= -3e+26)
		tmp = t_2;
	elseif (t_3 <= 2e+28)
		tmp = Float64(a * 120.0);
	elseif (t_3 <= 4e+251)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(x - y) * -60.0) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x - y) * 60.0;
	t_2 = t_1 / z;
	t_3 = t_1 / (z - t);
	tmp = 0.0;
	if (t_3 <= -3e+26)
		tmp = t_2;
	elseif (t_3 <= 2e+28)
		tmp = a * 120.0;
	elseif (t_3 <= 4e+251)
		tmp = t_2;
	else
		tmp = ((x - y) * -60.0) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -3e+26], t$95$2, If[LessEqual[t$95$3, 2e+28], N[(a * 120.0), $MachinePrecision], If[LessEqual[t$95$3, 4e+251], t$95$2, N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+251}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot -60}{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)) < -2.99999999999999997e26 or 1.99999999999999992e28 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.0000000000000002e251

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999997e26 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999992e28

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-60 \cdot \left(x - y\right)}}{t} \]
      4. lower--.f6481.9

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

      \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - y\right) \cdot 60}{z - t} \leq -3 \cdot 10^{+26}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z}\\ \mathbf{elif}\;\frac{\left(x - y\right) \cdot 60}{z - t} \leq 2 \cdot 10^{+28}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;\frac{\left(x - y\right) \cdot 60}{z - t} \leq 4 \cdot 10^{+251}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 57.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\ t_2 := 60 \cdot \frac{x}{z - t}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+202}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+28}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+28}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- x y) 60.0) (- z t))) (t_2 (* 60.0 (/ x (- z t)))))
   (if (<= t_1 -2e+202)
     (* -60.0 (/ y (- z t)))
     (if (<= t_1 -1e+28) t_2 (if (<= t_1 2e+28) (* a 120.0) t_2)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((x - y) * 60.0) / (z - t);
	double t_2 = 60.0 * (x / (z - t));
	double tmp;
	if (t_1 <= -2e+202) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= -1e+28) {
		tmp = t_2;
	} else if (t_1 <= 2e+28) {
		tmp = a * 120.0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x - y) * 60.0d0) / (z - t)
    t_2 = 60.0d0 * (x / (z - t))
    if (t_1 <= (-2d+202)) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (t_1 <= (-1d+28)) then
        tmp = t_2
    else if (t_1 <= 2d+28) then
        tmp = a * 120.0d0
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((x - y) * 60.0) / (z - t);
	double t_2 = 60.0 * (x / (z - t));
	double tmp;
	if (t_1 <= -2e+202) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= -1e+28) {
		tmp = t_2;
	} else if (t_1 <= 2e+28) {
		tmp = a * 120.0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((x - y) * 60.0) / (z - t)
	t_2 = 60.0 * (x / (z - t))
	tmp = 0
	if t_1 <= -2e+202:
		tmp = -60.0 * (y / (z - t))
	elif t_1 <= -1e+28:
		tmp = t_2
	elif t_1 <= 2e+28:
		tmp = a * 120.0
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t))
	t_2 = Float64(60.0 * Float64(x / Float64(z - t)))
	tmp = 0.0
	if (t_1 <= -2e+202)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (t_1 <= -1e+28)
		tmp = t_2;
	elseif (t_1 <= 2e+28)
		tmp = Float64(a * 120.0);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((x - y) * 60.0) / (z - t);
	t_2 = 60.0 * (x / (z - t));
	tmp = 0.0;
	if (t_1 <= -2e+202)
		tmp = -60.0 * (y / (z - t));
	elseif (t_1 <= -1e+28)
		tmp = t_2;
	elseif (t_1 <= 2e+28)
		tmp = a * 120.0;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+202], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+28], t$95$2, If[LessEqual[t$95$1, 2e+28], N[(a * 120.0), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

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

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

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


\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.9999999999999998e202

    1. Initial program 95.1%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6465.8

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Applied rewrites65.8%

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

    if -1.9999999999999998e202 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999958e27 or 1.99999999999999992e28 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6451.3

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
    5. Applied rewrites51.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
      5. lower-/.f6452.4

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

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

    if -9.99999999999999958e27 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999992e28

    1. Initial program 99.8%

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

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

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

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

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

Alternative 4: 72.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-77}:\\
\;\;\;\;a \cdot 120\\

\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)) < -2.99999999999999997e26 or 3.9999999999999997e-77 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

    if -2.99999999999999997e26 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.9999999999999997e-77

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - y\right) \cdot 60}{z - t} \leq -3 \cdot 10^{+26}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \mathbf{elif}\;\frac{\left(x - y\right) \cdot 60}{z - t} \leq 4 \cdot 10^{-77}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 55.1% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 96.0%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6460.7

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Applied rewrites60.7%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    7. Step-by-step derivation
      1. lower-/.f6456.7

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    8. Applied rewrites56.7%

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

    if -2.00000000000000007e170 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999982e108

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 97.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6448.9

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
    5. Applied rewrites48.9%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} \]
      4. lower-*.f6434.9

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} \]
    8. Applied rewrites34.9%

      \[\leadsto \color{blue}{\frac{x \cdot 60}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.2%

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

Alternative 6: 55.1% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot -60}{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)) < -2.00000000000000007e170

    1. Initial program 96.0%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6460.7

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Applied rewrites60.7%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    7. Step-by-step derivation
      1. lower-/.f6456.7

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    8. Applied rewrites56.7%

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

    if -2.00000000000000007e170 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e211

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 95.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6455.6

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

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{x}{t}} \]
    8. Applied rewrites44.1%

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot -60}}{t} \]
      4. lower-*.f6444.2

        \[\leadsto \frac{\color{blue}{x \cdot -60}}{t} \]
    10. Applied rewrites44.2%

      \[\leadsto \color{blue}{\frac{x \cdot -60}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.9%

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

Alternative 7: 55.2% accurate, 0.4× speedup?

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

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

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

\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)) < -2.00000000000000007e170

    1. Initial program 96.0%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6460.7

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Applied rewrites60.7%

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

      \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    7. Step-by-step derivation
      1. lower-/.f6456.7

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    8. Applied rewrites56.7%

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

    if -2.00000000000000007e170 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e211

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 95.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6455.6

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

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{x}{t}} \]
    8. Applied rewrites44.1%

      \[\leadsto \color{blue}{-60 \cdot \frac{x}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.8%

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

Alternative 8: 53.0% accurate, 0.4× speedup?

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

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

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

\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.99999999999999958e27 or 1.9999999999999999e211 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 97.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6449.6

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

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{x}{t}} \]
    8. Applied rewrites31.7%

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

    if -9.99999999999999958e27 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e211

    1. Initial program 99.8%

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

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

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

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

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

Alternative 9: 83.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{x - y}{t \cdot -0.016666666666666666}\right)\\
\mathbf{if}\;t \leq -9.6 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.60000000000000019e57 or 1.19999999999999989e-7 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.60000000000000019e57 < t < 1.19999999999999989e-7

    1. Initial program 98.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.6 \cdot 10^{+57}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t \cdot -0.016666666666666666}\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t \cdot -0.016666666666666666}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 82.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.39999999999999983e113 < t < 1.19999999999999989e-7

    1. Initial program 98.6%

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

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

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

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

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

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

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

    if 1.19999999999999989e-7 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+113}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, -60 \cdot \frac{x - y}{t}\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 82.9% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.39999999999999983e113 or 1.19999999999999989e-7 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -2.39999999999999983e113 < t < 1.19999999999999989e-7

    1. Initial program 98.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+113}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 82.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.77999999999999997e137 or 2.35000000000000004e129 < y

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

    if -1.77999999999999997e137 < y < 2.35000000000000004e129

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.78 \cdot 10^{+137}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 58.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.78 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+132}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.77999999999999997e137 or 4.49999999999999972e132 < y

    1. Initial program 97.1%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6464.7

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Applied rewrites64.7%

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

    if -1.77999999999999997e137 < y < 4.49999999999999972e132

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.78 \cdot 10^{+137}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+132}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.3% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, 120, \frac{\mathsf{neg}\left(\color{blue}{\left(x - y\right) \cdot 60}\right)}{\mathsf{neg}\left(\left(z - t\right)\right)}\right) \]
    16. distribute-rgt-neg-inN/A

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot -60}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(t\right)\right) + z\right)}}\right) \]
    23. associate--r+N/A

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

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

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

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

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

Alternative 15: 51.1% accurate, 5.2× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 99.1%

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification49.2%

    \[\leadsto a \cdot 120 \]
  7. Add Preprocessing

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

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))

  (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))