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

Percentage Accurate: 99.2% → 99.8%
Time: 12.3s
Alternatives: 18
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 18 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.2% 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.4%

    \[\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, -60 \cdot \frac{1}{t - z}, a \cdot 120\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: 58.9% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

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

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


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

    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 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--.f6474.2

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

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

    if -1.99999999999999995e233 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999998e125

    1. Initial program 99.7%

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

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

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

      \[\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--.f6462.2

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

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

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

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Taylor expanded in z 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--.f6450.7

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

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

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

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

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

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

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

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

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

    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-*.f6470.6

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

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

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

    1. Initial program 97.5%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. 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--.f6486.5

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - t}{60}}} \]
      8. div-invN/A

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

        \[\leadsto \frac{x - y}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} \]
      10. metadata-eval88.6

        \[\leadsto \frac{x - y}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} \]
    7. Applied rewrites88.6%

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

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

        \[\leadsto \frac{x - y}{\color{blue}{z \cdot \frac{1}{60}}} \]
      2. lower-*.f6458.0

        \[\leadsto \frac{x - y}{\color{blue}{z \cdot 0.016666666666666666}} \]
    10. Applied rewrites58.0%

      \[\leadsto \frac{x - y}{\color{blue}{z \cdot 0.016666666666666666}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification65.6%

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

Alternative 3: 58.9% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

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

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


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

    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 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--.f6474.2

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

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

    if -1.99999999999999995e233 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999998e125 or 9.9999999999999997e106 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.1%

      \[\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--.f6486.6

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

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

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

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

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

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

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Taylor expanded in z 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--.f6450.7

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+214}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e33 or 5e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999995e213

    1. Initial program 99.7%

      \[\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--.f6480.0

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

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

      \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
    7. Step-by-step derivation
      1. lower-*.f6451.3

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

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

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

    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-*.f6474.7

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

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

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

    1. Initial program 94.5%

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

      \[\leadsto \color{blue}{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--.f6462.1

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

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

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

Alternative 5: 57.7% accurate, 0.3× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-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)) < -1.9999999999999999e33 or 5e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e214

    1. Initial program 99.7%

      \[\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--.f6480.2

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

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

      \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
    7. Step-by-step derivation
      1. lower-*.f6450.8

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

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

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

    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-*.f6474.7

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

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

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

    1. Initial program 94.1%

      \[\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--.f6488.8

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Taylor expanded in z 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--.f6455.4

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

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

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

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

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

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

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

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

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

Alternative 6: 57.9% accurate, 0.3× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-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)) < -1.9999999999999999e33 or 5e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e214

    1. Initial program 99.7%

      \[\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--.f6450.8

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

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

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

    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-*.f6474.7

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

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

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

    1. Initial program 94.1%

      \[\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--.f6488.8

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Taylor expanded in z 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--.f6455.4

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

    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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 74.3% 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^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 10^{-16}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\mathsf{fma}\left(z, 0.016666666666666666, t \cdot -0.016666666666666666\right)}\\ \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+14)
     t_1
     (if (<= t_1 1e-16)
       (* a 120.0)
       (/ (- x y) (fma z 0.016666666666666666 (* t -0.016666666666666666)))))))
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+14) {
		tmp = t_1;
	} else if (t_1 <= 1e-16) {
		tmp = a * 120.0;
	} else {
		tmp = (x - y) / fma(z, 0.016666666666666666, (t * -0.016666666666666666));
	}
	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+14)
		tmp = t_1;
	elseif (t_1 <= 1e-16)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(Float64(x - y) / fma(z, 0.016666666666666666, Float64(t * -0.016666666666666666)));
	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[t$95$1, -2e+14], t$95$1, If[LessEqual[t$95$1, 1e-16], N[(a * 120.0), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / N[(z * 0.016666666666666666 + N[(t * -0.016666666666666666), $MachinePrecision]), $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^{+14}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x - y}{\mathsf{fma}\left(z, 0.016666666666666666, t \cdot -0.016666666666666666\right)}\\


\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)) < -2e14

    1. Initial program 99.7%

      \[\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--.f6483.1

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

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

    if -2e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e-17

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

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

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

    if 9.9999999999999998e-17 < (/.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.0

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - t}{60}}} \]
      8. div-invN/A

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

        \[\leadsto \frac{x - y}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} \]
      10. metadata-eval78.2

        \[\leadsto \frac{x - y}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} \]
    7. Applied rewrites78.2%

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

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

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

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

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

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

        \[\leadsto \frac{x - y}{\mathsf{fma}\left(z, 0.016666666666666666, \color{blue}{t \cdot -0.016666666666666666}\right)} \]
    10. Applied rewrites78.3%

      \[\leadsto \frac{x - y}{\color{blue}{\mathsf{fma}\left(z, 0.016666666666666666, t \cdot -0.016666666666666666\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.8%

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

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

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

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


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

    1. Initial program 99.7%

      \[\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--.f6483.1

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

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

    if -2e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e-17

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

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

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

    if 9.9999999999999998e-17 < (/.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.0

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

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

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

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

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

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

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

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

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

Alternative 10: 74.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{-16}:\\
\;\;\;\;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)) < -2e14 or 9.9999999999999998e-17 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.0%

      \[\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--.f6480.0

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

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

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

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

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

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

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

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

    if -2e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e-17

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

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

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

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

Alternative 11: 56.9% accurate, 0.4× speedup?

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

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

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

    1. Initial program 99.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--.f6448.2

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

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

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

    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-*.f6474.7

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

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

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

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

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

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

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


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

    1. Initial program 99.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}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z} + a \cdot 120 \]
      4. lower--.f6453.4

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
      3. lower-*.f6431.4

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

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

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

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 97.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}{60 \cdot \frac{x - y}{z}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z}} + a \cdot 120 \]
    6. Taylor expanded in x 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-*.f6440.3

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60}{z}} \cdot x \]
    10. Applied rewrites40.3%

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

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

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

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

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

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


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

    1. Initial program 99.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}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z} + a \cdot 120 \]
      4. lower--.f6453.4

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
      3. lower-*.f6431.4

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-60}{z}} \]
      4. lower-/.f6431.3

        \[\leadsto y \cdot \color{blue}{\frac{-60}{z}} \]
    10. Applied rewrites31.3%

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

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

    1. Initial program 99.8%

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

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

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

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

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

    1. Initial program 97.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}{60 \cdot \frac{x - y}{z}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z}} + a \cdot 120 \]
    6. Taylor expanded in x 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-*.f6440.3

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60}{z}} \cdot x \]
    10. Applied rewrites40.3%

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

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

Alternative 14: 53.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 -4 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{-60}{z}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+165}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{y}{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 -4e+65)
     (* y (/ -60.0 z))
     (if (<= t_1 4e+165) (* a 120.0) (* 60.0 (/ y 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 <= -4e+65) {
		tmp = y * (-60.0 / z);
	} else if (t_1 <= 4e+165) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * (y / 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 <= (-4d+65)) then
        tmp = y * ((-60.0d0) / z)
    else if (t_1 <= 4d+165) then
        tmp = a * 120.0d0
    else
        tmp = 60.0d0 * (y / 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 <= -4e+65) {
		tmp = y * (-60.0 / z);
	} else if (t_1 <= 4e+165) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((x - y) * 60.0) / (z - t)
	tmp = 0
	if t_1 <= -4e+65:
		tmp = y * (-60.0 / z)
	elif t_1 <= 4e+165:
		tmp = a * 120.0
	else:
		tmp = 60.0 * (y / 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 <= -4e+65)
		tmp = Float64(y * Float64(-60.0 / z));
	elseif (t_1 <= 4e+165)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(y / 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 <= -4e+65)
		tmp = y * (-60.0 / z);
	elseif (t_1 <= 4e+165)
		tmp = a * 120.0;
	else
		tmp = 60.0 * (y / 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, -4e+65], N[(y * N[(-60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+165], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / 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 -4 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{-60}{z}\\

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

\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{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)) < -4e65

    1. Initial program 99.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}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z} + a \cdot 120 \]
      4. lower--.f6453.4

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
      3. lower-*.f6431.4

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-60}{z}} \]
      4. lower-/.f6431.3

        \[\leadsto y \cdot \color{blue}{\frac{-60}{z}} \]
    10. Applied rewrites31.3%

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

    if -4e65 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.9999999999999996e165

    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-*.f6463.7

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

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

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

    1. Initial program 96.5%

      \[\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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, -60 \cdot \frac{1}{t - z}, a \cdot 120\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. 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-*.f6452.2

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

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{y}{t}} \]
    12. Applied rewrites36.2%

      \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.5%

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

Alternative 15: 55.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+165}:\\
\;\;\;\;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.00000000000000003e205 or 3.9999999999999996e165 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 97.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. 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. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, -60 \cdot \frac{1}{t - z}, a \cdot 120\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. 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-*.f6456.4

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

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

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

        \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
      2. lower-/.f6437.9

        \[\leadsto 60 \cdot \color{blue}{\frac{y}{t}} \]
    12. Applied rewrites37.9%

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

    if -2.00000000000000003e205 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.9999999999999996e165

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

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

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

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

Alternative 16: 84.3% 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 -1.3 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-9}:\\ \;\;\;\;\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 -1.3e-10)
     t_1
     (if (<= t 7.5e-9) (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 <= -1.3e-10) {
		tmp = t_1;
	} else if (t <= 7.5e-9) {
		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 <= -1.3e-10)
		tmp = t_1;
	elseif (t <= 7.5e-9)
		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, -1.3e-10], t$95$1, If[LessEqual[t, 7.5e-9], 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 -1.3 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-9}:\\
\;\;\;\;\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 < -1.29999999999999991e-10 or 7.49999999999999933e-9 < t

    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 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-*.f6486.1

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

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

    if -1.29999999999999991e-10 < t < 7.49999999999999933e-9

    1. Initial program 99.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-*.f6483.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-9}:\\ \;\;\;\;\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 17: 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.4%

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

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

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

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

Alternative 18: 51.0% 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.4%

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification46.9%

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

Developer Target 1: 99.7% 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 2024214 
(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)))