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

Percentage Accurate: 99.3% → 99.8%
Time: 14.5s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
  2. Step-by-step derivation
    1. associate-/l*99.8%

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
    2. fma-define99.8%

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

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

Alternative 2: 59.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x - y}{t}\\
t_2 := 60 \cdot \frac{x - y}{z}\\
\mathbf{if}\;a \leq -1.1 \cdot 10^{-67}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq -5.9 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -5.8 \cdot 10^{-150}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq -7.8 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{-305}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-148}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.1000000000000001e-67 or -5.89999999999999966e-142 < a < -5.7999999999999996e-150 or 5.80000000000000008e-27 < a

    1. Initial program 99.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 73.8%

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

    if -1.1000000000000001e-67 < a < -5.89999999999999966e-142 or -7.7999999999999997e-256 < a < 3.4999999999999998e-305 or 3.40000000000000002e-192 < a < 1.7000000000000001e-148

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 87.5%

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

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

    if -5.7999999999999996e-150 < a < -7.7999999999999997e-256 or 3.4999999999999998e-305 < a < 3.40000000000000002e-192 or 1.7000000000000001e-148 < a < 5.80000000000000008e-27

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 85.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.1 \cdot 10^{-67}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5.9 \cdot 10^{-142}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-150}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -7.8 \cdot 10^{-256}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-305}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-192}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-148}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-27}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+120} \lor \neg \left(y \leq -8 \cdot 10^{+108}\right) \land \left(y \leq -4.8 \cdot 10^{+19} \lor \neg \left(y \leq 9.5 \cdot 10^{+39}\right)\right):\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= y -3.9e+120)
         (and (not (<= y -8e+108)) (or (<= y -4.8e+19) (not (<= y 9.5e+39)))))
   (+ (* a 120.0) (/ (* y -60.0) (- z t)))
   (+ (* a 120.0) (* x (/ 60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -3.9e+120) || (!(y <= -8e+108) && ((y <= -4.8e+19) || !(y <= 9.5e+39)))) {
		tmp = (a * 120.0) + ((y * -60.0) / (z - t));
	} else {
		tmp = (a * 120.0) + (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) :: tmp
    if ((y <= (-3.9d+120)) .or. (.not. (y <= (-8d+108))) .and. (y <= (-4.8d+19)) .or. (.not. (y <= 9.5d+39))) then
        tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
    else
        tmp = (a * 120.0d0) + (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 tmp;
	if ((y <= -3.9e+120) || (!(y <= -8e+108) && ((y <= -4.8e+19) || !(y <= 9.5e+39)))) {
		tmp = (a * 120.0) + ((y * -60.0) / (z - t));
	} else {
		tmp = (a * 120.0) + (x * (60.0 / (z - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -3.9e+120) or (not (y <= -8e+108) and ((y <= -4.8e+19) or not (y <= 9.5e+39))):
		tmp = (a * 120.0) + ((y * -60.0) / (z - t))
	else:
		tmp = (a * 120.0) + (x * (60.0 / (z - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((y <= -3.9e+120) || (!(y <= -8e+108) && ((y <= -4.8e+19) || !(y <= 9.5e+39))))
		tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t)));
	else
		tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((y <= -3.9e+120) || (~((y <= -8e+108)) && ((y <= -4.8e+19) || ~((y <= 9.5e+39)))))
		tmp = (a * 120.0) + ((y * -60.0) / (z - t));
	else
		tmp = (a * 120.0) + (x * (60.0 / (z - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.9e+120], And[N[Not[LessEqual[y, -8e+108]], $MachinePrecision], Or[LessEqual[y, -4.8e+19], N[Not[LessEqual[y, 9.5e+39]], $MachinePrecision]]]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+120} \lor \neg \left(y \leq -8 \cdot 10^{+108}\right) \land \left(y \leq -4.8 \cdot 10^{+19} \lor \neg \left(y \leq 9.5 \cdot 10^{+39}\right)\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8999999999999998e120 or -8.0000000000000003e108 < y < -4.8e19 or 9.50000000000000011e39 < y

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 95.6%

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/95.5%

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

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

    if -3.8999999999999998e120 < y < -8.0000000000000003e108 or -4.8e19 < y < 9.50000000000000011e39

    1. Initial program 99.1%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 97.3%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/96.6%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative96.6%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/97.3%

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

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+120} \lor \neg \left(y \leq -8 \cdot 10^{+108}\right) \land \left(y \leq -4.8 \cdot 10^{+19} \lor \neg \left(y \leq 9.5 \cdot 10^{+39}\right)\right):\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 20:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+115}:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* a 120.0) -5e+23)
   (* a 120.0)
   (if (<= (* a 120.0) 20.0)
     (* 60.0 (/ (- x y) (- z t)))
     (if (<= (* a 120.0) 4e+115)
       (+ (* a 120.0) (/ (* 60.0 y) t))
       (+ (* a 120.0) (* x (/ -60.0 t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a * 120.0) <= -5e+23) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 20.0) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if ((a * 120.0) <= 4e+115) {
		tmp = (a * 120.0) + ((60.0 * y) / t);
	} else {
		tmp = (a * 120.0) + (x * (-60.0 / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((a * 120.0d0) <= (-5d+23)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 20.0d0) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if ((a * 120.0d0) <= 4d+115) then
        tmp = (a * 120.0d0) + ((60.0d0 * y) / t)
    else
        tmp = (a * 120.0d0) + (x * ((-60.0d0) / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a * 120.0) <= -5e+23) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 20.0) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if ((a * 120.0) <= 4e+115) {
		tmp = (a * 120.0) + ((60.0 * y) / t);
	} else {
		tmp = (a * 120.0) + (x * (-60.0 / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a * 120.0) <= -5e+23:
		tmp = a * 120.0
	elif (a * 120.0) <= 20.0:
		tmp = 60.0 * ((x - y) / (z - t))
	elif (a * 120.0) <= 4e+115:
		tmp = (a * 120.0) + ((60.0 * y) / t)
	else:
		tmp = (a * 120.0) + (x * (-60.0 / t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(a * 120.0) <= -5e+23)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 20.0)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (Float64(a * 120.0) <= 4e+115)
		tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * y) / t));
	else
		tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(-60.0 / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a * 120.0) <= -5e+23)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 20.0)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif ((a * 120.0) <= 4e+115)
		tmp = (a * 120.0) + ((60.0 * y) / t);
	else
		tmp = (a * 120.0) + (x * (-60.0 / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+23], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 20.0], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+115], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+115}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4.9999999999999999e23

    1. Initial program 98.0%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 88.6%

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

    if -4.9999999999999999e23 < (*.f64 a #s(literal 120 binary64)) < 20

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 78.9%

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

    if 20 < (*.f64 a #s(literal 120 binary64)) < 4.0000000000000001e115

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 88.0%

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/88.1%

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

      \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} + a \cdot 120 \]
    8. Taylor expanded in z around 0 85.8%

      \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} + a \cdot 120 \]
    9. Step-by-step derivation
      1. associate-*r/85.9%

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    10. Simplified85.9%

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

    if 4.0000000000000001e115 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 97.6%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/97.6%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative97.6%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/97.7%

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

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    8. Taylor expanded in z around 0 86.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 20:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+115}:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+104}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4.9999999999999999e23

    1. Initial program 98.0%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 88.6%

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

    if -4.9999999999999999e23 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999924e-25

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 80.3%

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

    if 9.99999999999999924e-25 < (*.f64 a #s(literal 120 binary64)) < 4e104

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 91.6%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/91.7%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative91.7%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/91.8%

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    7. Simplified91.8%

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    8. Taylor expanded in z around inf 79.4%

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

    if 4e104 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.9%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/93.9%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative93.9%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/94.0%

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    7. Simplified94.0%

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    8. Taylor expanded in z around 0 84.3%

      \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} + a \cdot 120 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-24}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+104}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{60}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 83.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-81} \lor \neg \left(a \cdot 120 \leq 10^{-24}\right):\\ \;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= (* a 120.0) -1e-81) (not (<= (* a 120.0) 1e-24)))
   (+ (* a 120.0) (* x (/ 60.0 (- z t))))
   (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -1e-81) || !((a * 120.0) <= 1e-24)) {
		tmp = (a * 120.0) + (x * (60.0 / (z - t)));
	} else {
		tmp = 60.0 * ((x - y) / (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) :: tmp
    if (((a * 120.0d0) <= (-1d-81)) .or. (.not. ((a * 120.0d0) <= 1d-24))) then
        tmp = (a * 120.0d0) + (x * (60.0d0 / (z - t)))
    else
        tmp = 60.0d0 * ((x - y) / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -1e-81) || !((a * 120.0) <= 1e-24)) {
		tmp = (a * 120.0) + (x * (60.0 / (z - t)));
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if ((a * 120.0) <= -1e-81) or not ((a * 120.0) <= 1e-24):
		tmp = (a * 120.0) + (x * (60.0 / (z - t)))
	else:
		tmp = 60.0 * ((x - y) / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((Float64(a * 120.0) <= -1e-81) || !(Float64(a * 120.0) <= 1e-24))
		tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t))));
	else
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (((a * 120.0) <= -1e-81) || ~(((a * 120.0) <= 1e-24)))
		tmp = (a * 120.0) + (x * (60.0 / (z - t)));
	else
		tmp = 60.0 * ((x - y) / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-81], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-24]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-81} \lor \neg \left(a \cdot 120 \leq 10^{-24}\right):\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999996e-82 or 9.99999999999999924e-25 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 89.8%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/89.2%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative89.2%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/89.9%

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    7. Simplified89.9%

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

    if -9.9999999999999996e-82 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999924e-25

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 85.2%

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

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

Alternative 7: 83.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-81}:\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999996e-82

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 86.6%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/85.3%

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/86.6%

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

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    8. Step-by-step derivation
      1. clear-num86.6%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z - t}{60}}} + a \cdot 120 \]
      2. un-div-inv86.6%

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

        \[\leadsto \frac{x}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} + a \cdot 120 \]
      4. metadata-eval86.6%

        \[\leadsto \frac{x}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} + a \cdot 120 \]
    9. Applied egg-rr86.6%

      \[\leadsto \color{blue}{\frac{x}{\left(z - t\right) \cdot 0.016666666666666666}} + a \cdot 120 \]

    if -9.9999999999999996e-82 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999924e-25

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 85.2%

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

    if 9.99999999999999924e-25 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.2%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/93.2%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative93.2%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/93.3%

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

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.0%

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

Alternative 8: 74.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-15}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= (* a 120.0) -5e+23) (not (<= (* a 120.0) 2e-15)))
   (* a 120.0)
   (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -5e+23) || !((a * 120.0) <= 2e-15)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (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) :: tmp
    if (((a * 120.0d0) <= (-5d+23)) .or. (.not. ((a * 120.0d0) <= 2d-15))) then
        tmp = a * 120.0d0
    else
        tmp = 60.0d0 * ((x - y) / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -5e+23) || !((a * 120.0) <= 2e-15)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if ((a * 120.0) <= -5e+23) or not ((a * 120.0) <= 2e-15):
		tmp = a * 120.0
	else:
		tmp = 60.0 * ((x - y) / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((Float64(a * 120.0) <= -5e+23) || !(Float64(a * 120.0) <= 2e-15))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (((a * 120.0) <= -5e+23) || ~(((a * 120.0) <= 2e-15)))
		tmp = a * 120.0;
	else
		tmp = 60.0 * ((x - y) / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+23], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-15]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-15}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4.9999999999999999e23 or 2.0000000000000002e-15 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.1%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 80.4%

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

    if -4.9999999999999999e23 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000002e-15

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 80.2%

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

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

Alternative 9: 74.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+23}:\\
\;\;\;\;a \cdot 120\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4.9999999999999999e23

    1. Initial program 98.0%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 88.6%

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

    if -4.9999999999999999e23 < (*.f64 a #s(literal 120 binary64)) < 20

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 78.9%

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

    if 20 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 92.6%

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. associate-*r/92.6%

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative92.6%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-*r/92.7%

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

      \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} + a \cdot 120 \]
    8. Taylor expanded in z around 0 79.7%

      \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} + a \cdot 120 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

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

Alternative 10: 58.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-45} \lor \neg \left(a \leq 9.5 \cdot 10^{-24}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -1.25e-45) (not (<= a 9.5e-24)))
   (* a 120.0)
   (* -60.0 (/ (- x y) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1.25e-45) || !(a <= 9.5e-24)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * ((x - 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) :: tmp
    if ((a <= (-1.25d-45)) .or. (.not. (a <= 9.5d-24))) then
        tmp = a * 120.0d0
    else
        tmp = (-60.0d0) * ((x - y) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1.25e-45) || !(a <= 9.5e-24)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * ((x - y) / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -1.25e-45) or not (a <= 9.5e-24):
		tmp = a * 120.0
	else:
		tmp = -60.0 * ((x - y) / t)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -1.25e-45) || !(a <= 9.5e-24))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -1.25e-45) || ~((a <= 9.5e-24)))
		tmp = a * 120.0;
	else
		tmp = -60.0 * ((x - y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.25e-45], N[Not[LessEqual[a, 9.5e-24]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-45} \lor \neg \left(a \leq 9.5 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.24999999999999994e-45 or 9.50000000000000029e-24 < a

    1. Initial program 99.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 75.0%

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

    if -1.24999999999999994e-45 < a < 9.50000000000000029e-24

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 83.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-45} \lor \neg \left(a \leq 9.5 \cdot 10^{-24}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 59.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-94} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -2e-94) (not (<= a 5.8e-27)))
   (* a 120.0)
   (* -60.0 (/ y (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -2e-94) || !(a <= 5.8e-27)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (y / (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) :: tmp
    if ((a <= (-2d-94)) .or. (.not. (a <= 5.8d-27))) then
        tmp = a * 120.0d0
    else
        tmp = (-60.0d0) * (y / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -2e-94) || !(a <= 5.8e-27)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (y / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -2e-94) or not (a <= 5.8e-27):
		tmp = a * 120.0
	else:
		tmp = -60.0 * (y / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -2e-94) || !(a <= 5.8e-27))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -2e-94) || ~((a <= 5.8e-27)))
		tmp = a * 120.0;
	else
		tmp = -60.0 * (y / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-94], N[Not[LessEqual[a, 5.8e-27]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-94} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9999999999999999e-94 or 5.80000000000000008e-27 < a

    1. Initial program 99.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 72.7%

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

    if -1.9999999999999999e-94 < a < 5.80000000000000008e-27

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.4%

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      2. un-div-inv99.6%

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

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    7. Taylor expanded in a around inf 75.3%

      \[\leadsto \color{blue}{a \cdot \left(120 + 60 \cdot \frac{x - y}{a \cdot \left(z - t\right)}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/75.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-94} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 51.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{-151} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -1e-151) (not (<= a 5.8e-27))) (* a 120.0) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1e-151) || !(a <= 5.8e-27)) {
		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) :: tmp
    if ((a <= (-1d-151)) .or. (.not. (a <= 5.8d-27))) 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 tmp;
	if ((a <= -1e-151) || !(a <= 5.8e-27)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * (y / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -1e-151) or not (a <= 5.8e-27):
		tmp = a * 120.0
	else:
		tmp = 60.0 * (y / t)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -1e-151) || !(a <= 5.8e-27))
		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)
	tmp = 0.0;
	if ((a <= -1e-151) || ~((a <= 5.8e-27)))
		tmp = a * 120.0;
	else
		tmp = 60.0 * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1e-151], N[Not[LessEqual[a, 5.8e-27]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-151} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.9999999999999994e-152 or 5.80000000000000008e-27 < a

    1. Initial program 99.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 69.8%

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

    if -9.9999999999999994e-152 < a < 5.80000000000000008e-27

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.4%

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      2. un-div-inv99.5%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    6. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    7. Taylor expanded in a around inf 73.4%

      \[\leadsto \color{blue}{a \cdot \left(120 + 60 \cdot \frac{x - y}{a \cdot \left(z - t\right)}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/73.4%

        \[\leadsto a \cdot \left(120 + \color{blue}{\frac{60 \cdot \left(x - y\right)}{a \cdot \left(z - t\right)}}\right) \]
      2. *-commutative73.4%

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

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
    11. Taylor expanded in z around 0 27.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{-151} \lor \neg \left(a \leq 5.8 \cdot 10^{-27}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 52.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{-214} \lor \neg \left(a \leq 8.5 \cdot 10^{-111}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -1.45e-214) (not (<= a 8.5e-111)))
   (* a 120.0)
   (* -60.0 (/ y z))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1.45e-214) || !(a <= 8.5e-111)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (y / 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) :: tmp
    if ((a <= (-1.45d-214)) .or. (.not. (a <= 8.5d-111))) then
        tmp = a * 120.0d0
    else
        tmp = (-60.0d0) * (y / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -1.45e-214) || !(a <= 8.5e-111)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (y / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -1.45e-214) or not (a <= 8.5e-111):
		tmp = a * 120.0
	else:
		tmp = -60.0 * (y / z)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -1.45e-214) || !(a <= 8.5e-111))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(-60.0 * Float64(y / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -1.45e-214) || ~((a <= 8.5e-111)))
		tmp = a * 120.0;
	else
		tmp = -60.0 * (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.45e-214], N[Not[LessEqual[a, 8.5e-111]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{-214} \lor \neg \left(a \leq 8.5 \cdot 10^{-111}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.44999999999999993e-214 or 8.5000000000000003e-111 < a

    1. Initial program 99.3%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 62.0%

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

    if -1.44999999999999993e-214 < a < 8.5000000000000003e-111

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.3%

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      2. un-div-inv99.5%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    6. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    7. Taylor expanded in a around inf 68.0%

      \[\leadsto \color{blue}{a \cdot \left(120 + 60 \cdot \frac{x - y}{a \cdot \left(z - t\right)}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto a \cdot \left(120 + \color{blue}{\frac{60 \cdot \left(x - y\right)}{a \cdot \left(z - t\right)}}\right) \]
      2. *-commutative68.0%

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

        \[\leadsto a \cdot \left(120 + \frac{\left(x - y\right) \cdot 60}{\color{blue}{\left(z - t\right) \cdot a}}\right) \]
      4. times-frac71.2%

        \[\leadsto a \cdot \left(120 + \color{blue}{\frac{x - y}{z - t} \cdot \frac{60}{a}}\right) \]
    9. Simplified71.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{-214} \lor \neg \left(a \leq 8.5 \cdot 10^{-111}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.8% accurate, 1.0× speedup?

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

\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
  2. Step-by-step derivation
    1. associate-/l*99.8%

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

    \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
  4. Add Preprocessing
  5. Final simplification99.8%

    \[\leadsto a \cdot 120 + 60 \cdot \frac{x - y}{z - t} \]
  6. Add Preprocessing

Alternative 15: 50.5% accurate, 4.3× 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. Step-by-step derivation
    1. associate-/l*99.8%

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

    \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
  4. Add Preprocessing
  5. Taylor expanded in z around inf 49.6%

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

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

Developer target: 99.8% accurate, 1.0× 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 2024088 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

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

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