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

Percentage Accurate: 99.4% → 99.7%
Time: 16.4s
Alternatives: 19
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 19 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.4% 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.7% 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 98.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 \]
    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: 81.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{-98}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \cdot 120 \leq 10000:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4e-78 or 1e4 < (*.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.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 85.4%

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

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

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

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

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

    if -4e-78 < (*.f64 a #s(literal 120 binary64)) < 2e-165

    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.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 89.3%

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

    if 2e-165 < (*.f64 a #s(literal 120 binary64)) < 3.99999999999999976e-98

    1. Initial program 93.0%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative93.0%

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

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

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

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

    if 3.99999999999999976e-98 < (*.f64 a #s(literal 120 binary64)) < 1e4

    1. Initial program 99.6%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

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

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

Alternative 3: 73.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+173}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\

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

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

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


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

    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.1%

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

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

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

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

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

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

    if -5.00000000000000034e173 < (*.f64 a #s(literal 120 binary64)) < -2e21

    1. Initial program 95.8%

      \[\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 x around inf 75.6%

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

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

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

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

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

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

    if -2e21 < (*.f64 a #s(literal 120 binary64)) < -4e-78

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative99.7%

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

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

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

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

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

    if -4e-78 < (*.f64 a #s(literal 120 binary64)) < 1e4

    1. Initial program 98.1%

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

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

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

    1. Initial program 100.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 76.8%

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

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

Alternative 4: 58.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x - y}{z}\\ \mathbf{if}\;a \leq -1.6 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-189}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-240}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-87}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;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) z))))
   (if (<= a -1.6e-80)
     (* a 120.0)
     (if (<= a -2.6e-189)
       (/ (* y -60.0) (- z t))
       (if (<= a 7.5e-240)
         t_1
         (if (<= a 5e-87)
           (* -60.0 (/ (- x y) t))
           (if (<= a 43.0) t_1 (* a 120.0))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double tmp;
	if (a <= -1.6e-80) {
		tmp = a * 120.0;
	} else if (a <= -2.6e-189) {
		tmp = (y * -60.0) / (z - t);
	} else if (a <= 7.5e-240) {
		tmp = t_1;
	} else if (a <= 5e-87) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 43.0) {
		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) :: tmp
    t_1 = 60.0d0 * ((x - y) / z)
    if (a <= (-1.6d-80)) then
        tmp = a * 120.0d0
    else if (a <= (-2.6d-189)) then
        tmp = (y * (-60.0d0)) / (z - t)
    else if (a <= 7.5d-240) then
        tmp = t_1
    else if (a <= 5d-87) then
        tmp = (-60.0d0) * ((x - y) / t)
    else if (a <= 43.0d0) 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) / z);
	double tmp;
	if (a <= -1.6e-80) {
		tmp = a * 120.0;
	} else if (a <= -2.6e-189) {
		tmp = (y * -60.0) / (z - t);
	} else if (a <= 7.5e-240) {
		tmp = t_1;
	} else if (a <= 5e-87) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 43.0) {
		tmp = t_1;
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * ((x - y) / z)
	tmp = 0
	if a <= -1.6e-80:
		tmp = a * 120.0
	elif a <= -2.6e-189:
		tmp = (y * -60.0) / (z - t)
	elif a <= 7.5e-240:
		tmp = t_1
	elif a <= 5e-87:
		tmp = -60.0 * ((x - y) / t)
	elif a <= 43.0:
		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) / z))
	tmp = 0.0
	if (a <= -1.6e-80)
		tmp = Float64(a * 120.0);
	elseif (a <= -2.6e-189)
		tmp = Float64(Float64(y * -60.0) / Float64(z - t));
	elseif (a <= 7.5e-240)
		tmp = t_1;
	elseif (a <= 5e-87)
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	elseif (a <= 43.0)
		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) / z);
	tmp = 0.0;
	if (a <= -1.6e-80)
		tmp = a * 120.0;
	elseif (a <= -2.6e-189)
		tmp = (y * -60.0) / (z - t);
	elseif (a <= 7.5e-240)
		tmp = t_1;
	elseif (a <= 5e-87)
		tmp = -60.0 * ((x - y) / t);
	elseif (a <= 43.0)
		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] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.6e-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -2.6e-189], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e-240], t$95$1, If[LessEqual[a, 5e-87], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 43.0], t$95$1, N[(a * 120.0), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.6 \cdot 10^{-189}:\\
\;\;\;\;\frac{y \cdot -60}{z - t}\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-240}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-87}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

\mathbf{elif}\;a \leq 43:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.5999999999999999e-80 or 43 < 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 71.9%

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

    if -1.5999999999999999e-80 < a < -2.5999999999999999e-189

    1. Initial program 94.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 a around 0 88.5%

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

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

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

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

    if -2.5999999999999999e-189 < a < 7.4999999999999995e-240 or 5.00000000000000042e-87 < a < 43

    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.6%

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

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

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

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

    if 7.4999999999999995e-240 < a < 5.00000000000000042e-87

    1. Initial program 97.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-189}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-240}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-87}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x - y}{z}\\ \mathbf{if}\;a \leq -1.6 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \frac{-60}{z - t}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-240}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-87}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;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) z))))
   (if (<= a -1.6e-80)
     (* a 120.0)
     (if (<= a -1.1e-187)
       (* y (/ -60.0 (- z t)))
       (if (<= a 1.15e-240)
         t_1
         (if (<= a 7.2e-87)
           (* -60.0 (/ (- x y) t))
           (if (<= a 43.0) t_1 (* a 120.0))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double tmp;
	if (a <= -1.6e-80) {
		tmp = a * 120.0;
	} else if (a <= -1.1e-187) {
		tmp = y * (-60.0 / (z - t));
	} else if (a <= 1.15e-240) {
		tmp = t_1;
	} else if (a <= 7.2e-87) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 43.0) {
		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) :: tmp
    t_1 = 60.0d0 * ((x - y) / z)
    if (a <= (-1.6d-80)) then
        tmp = a * 120.0d0
    else if (a <= (-1.1d-187)) then
        tmp = y * ((-60.0d0) / (z - t))
    else if (a <= 1.15d-240) then
        tmp = t_1
    else if (a <= 7.2d-87) then
        tmp = (-60.0d0) * ((x - y) / t)
    else if (a <= 43.0d0) 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) / z);
	double tmp;
	if (a <= -1.6e-80) {
		tmp = a * 120.0;
	} else if (a <= -1.1e-187) {
		tmp = y * (-60.0 / (z - t));
	} else if (a <= 1.15e-240) {
		tmp = t_1;
	} else if (a <= 7.2e-87) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 43.0) {
		tmp = t_1;
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * ((x - y) / z)
	tmp = 0
	if a <= -1.6e-80:
		tmp = a * 120.0
	elif a <= -1.1e-187:
		tmp = y * (-60.0 / (z - t))
	elif a <= 1.15e-240:
		tmp = t_1
	elif a <= 7.2e-87:
		tmp = -60.0 * ((x - y) / t)
	elif a <= 43.0:
		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) / z))
	tmp = 0.0
	if (a <= -1.6e-80)
		tmp = Float64(a * 120.0);
	elseif (a <= -1.1e-187)
		tmp = Float64(y * Float64(-60.0 / Float64(z - t)));
	elseif (a <= 1.15e-240)
		tmp = t_1;
	elseif (a <= 7.2e-87)
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	elseif (a <= 43.0)
		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) / z);
	tmp = 0.0;
	if (a <= -1.6e-80)
		tmp = a * 120.0;
	elseif (a <= -1.1e-187)
		tmp = y * (-60.0 / (z - t));
	elseif (a <= 1.15e-240)
		tmp = t_1;
	elseif (a <= 7.2e-87)
		tmp = -60.0 * ((x - y) / t);
	elseif (a <= 43.0)
		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] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.6e-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.1e-187], N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e-240], t$95$1, If[LessEqual[a, 7.2e-87], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 43.0], t$95$1, N[(a * 120.0), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.1 \cdot 10^{-187}:\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\

\mathbf{elif}\;a \leq 1.15 \cdot 10^{-240}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-87}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

\mathbf{elif}\;a \leq 43:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.5999999999999999e-80 or 43 < 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 71.9%

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

    if -1.5999999999999999e-80 < a < -1.10000000000000004e-187

    1. Initial program 94.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 a around inf 82.9%

      \[\leadsto \color{blue}{a \cdot \left(120 + 60 \cdot \frac{x - y}{a \cdot \left(z - t\right)}\right)} \]
    6. Step-by-step derivation
      1. *-commutative82.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
    12. Step-by-step derivation
      1. associate-*r/65.9%

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      2. *-rgt-identity65.9%

        \[\leadsto \frac{\color{blue}{\left(-60 \cdot y\right) \cdot 1}}{z - t} \]
      3. *-commutative65.9%

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

        \[\leadsto \color{blue}{\left(y \cdot -60\right) \cdot \frac{1}{z - t}} \]
      5. associate-*l*65.5%

        \[\leadsto \color{blue}{y \cdot \left(-60 \cdot \frac{1}{z - t}\right)} \]
      6. metadata-eval65.5%

        \[\leadsto y \cdot \left(\color{blue}{\left(-60\right)} \cdot \frac{1}{z - t}\right) \]
      7. distribute-lft-neg-in65.5%

        \[\leadsto y \cdot \color{blue}{\left(-60 \cdot \frac{1}{z - t}\right)} \]
      8. associate-*r/65.6%

        \[\leadsto y \cdot \left(-\color{blue}{\frac{60 \cdot 1}{z - t}}\right) \]
      9. metadata-eval65.6%

        \[\leadsto y \cdot \left(-\frac{\color{blue}{60}}{z - t}\right) \]
      10. distribute-neg-frac65.6%

        \[\leadsto y \cdot \color{blue}{\frac{-60}{z - t}} \]
      11. metadata-eval65.6%

        \[\leadsto y \cdot \frac{\color{blue}{-60}}{z - t} \]
    13. Simplified65.6%

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

    if -1.10000000000000004e-187 < a < 1.14999999999999996e-240 or 7.19999999999999986e-87 < a < 43

    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.6%

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

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

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

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

    if 1.14999999999999996e-240 < a < 7.19999999999999986e-87

    1. Initial program 97.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \frac{-60}{z - t}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-240}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-87}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x - y}{z}\\ t_2 := -60 \cdot \frac{x - y}{t}\\ \mathbf{if}\;a \leq -1.65 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-187}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 4.35 \cdot 10^{-240}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-88}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 64000:\\ \;\;\;\;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) z))) (t_2 (* -60.0 (/ (- x y) t))))
   (if (<= a -1.65e-80)
     (* a 120.0)
     (if (<= a -1.25e-187)
       t_2
       (if (<= a 4.35e-240)
         t_1
         (if (<= a 2.6e-88) t_2 (if (<= a 64000.0) t_1 (* a 120.0))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double t_2 = -60.0 * ((x - y) / t);
	double tmp;
	if (a <= -1.65e-80) {
		tmp = a * 120.0;
	} else if (a <= -1.25e-187) {
		tmp = t_2;
	} else if (a <= 4.35e-240) {
		tmp = t_1;
	} else if (a <= 2.6e-88) {
		tmp = t_2;
	} else if (a <= 64000.0) {
		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) / z)
    t_2 = (-60.0d0) * ((x - y) / t)
    if (a <= (-1.65d-80)) then
        tmp = a * 120.0d0
    else if (a <= (-1.25d-187)) then
        tmp = t_2
    else if (a <= 4.35d-240) then
        tmp = t_1
    else if (a <= 2.6d-88) then
        tmp = t_2
    else if (a <= 64000.0d0) 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) / z);
	double t_2 = -60.0 * ((x - y) / t);
	double tmp;
	if (a <= -1.65e-80) {
		tmp = a * 120.0;
	} else if (a <= -1.25e-187) {
		tmp = t_2;
	} else if (a <= 4.35e-240) {
		tmp = t_1;
	} else if (a <= 2.6e-88) {
		tmp = t_2;
	} else if (a <= 64000.0) {
		tmp = t_1;
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * ((x - y) / z)
	t_2 = -60.0 * ((x - y) / t)
	tmp = 0
	if a <= -1.65e-80:
		tmp = a * 120.0
	elif a <= -1.25e-187:
		tmp = t_2
	elif a <= 4.35e-240:
		tmp = t_1
	elif a <= 2.6e-88:
		tmp = t_2
	elif a <= 64000.0:
		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) / z))
	t_2 = Float64(-60.0 * Float64(Float64(x - y) / t))
	tmp = 0.0
	if (a <= -1.65e-80)
		tmp = Float64(a * 120.0);
	elseif (a <= -1.25e-187)
		tmp = t_2;
	elseif (a <= 4.35e-240)
		tmp = t_1;
	elseif (a <= 2.6e-88)
		tmp = t_2;
	elseif (a <= 64000.0)
		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) / z);
	t_2 = -60.0 * ((x - y) / t);
	tmp = 0.0;
	if (a <= -1.65e-80)
		tmp = a * 120.0;
	elseif (a <= -1.25e-187)
		tmp = t_2;
	elseif (a <= 4.35e-240)
		tmp = t_1;
	elseif (a <= 2.6e-88)
		tmp = t_2;
	elseif (a <= 64000.0)
		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] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.25e-187], t$95$2, If[LessEqual[a, 4.35e-240], t$95$1, If[LessEqual[a, 2.6e-88], t$95$2, If[LessEqual[a, 64000.0], t$95$1, N[(a * 120.0), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.25 \cdot 10^{-187}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 4.35 \cdot 10^{-240}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 2.6 \cdot 10^{-88}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 64000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.65e-80 or 64000 < 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 71.9%

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

    if -1.65e-80 < a < -1.2499999999999999e-187 or 4.3500000000000003e-240 < a < 2.60000000000000014e-88

    1. Initial program 96.3%

      \[\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 83.0%

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

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

    if -1.2499999999999999e-187 < a < 4.3500000000000003e-240 or 2.60000000000000014e-88 < a < 64000

    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.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-187}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 4.35 \cdot 10^{-240}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-88}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 64000:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq 9.6 \cdot 10^{-268}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-135}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-91}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

\mathbf{elif}\;a \leq 53:\\
\;\;\;\;\frac{y \cdot -60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3.49999999999999986e-81 or 53 < 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 71.9%

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

    if -3.49999999999999986e-81 < a < 9.5999999999999996e-268

    1. Initial program 97.9%

      \[\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 92.5%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
    8. Step-by-step derivation
      1. associate-*r/38.2%

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
    9. Simplified38.2%

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

    if 9.5999999999999996e-268 < a < 5.0000000000000002e-135

    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.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 79.5%

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

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

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

    if 5.0000000000000002e-135 < a < 4.1999999999999998e-91

    1. Initial program 88.7%

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

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

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

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

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

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

    if 4.1999999999999998e-91 < a < 53

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
    11. Simplified42.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{-81}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-268}:\\ \;\;\;\;\frac{60 \cdot y}{t}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-135}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-91}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 53:\\ \;\;\;\;\frac{y \cdot -60}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -3.9 \cdot 10^{-81}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-268}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{-134}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

\mathbf{elif}\;a \leq 4.1 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 64000000:\\
\;\;\;\;\frac{y \cdot -60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.89999999999999985e-81 or 6.4e7 < 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 71.9%

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

    if -3.89999999999999985e-81 < a < 1.0200000000000001e-268 or 1.95e-134 < a < 4.10000000000000024e-91

    1. Initial program 96.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 90.4%

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

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

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

    if 1.0200000000000001e-268 < a < 1.95e-134

    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.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 79.5%

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

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

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

    if 4.10000000000000024e-91 < a < 6.4e7

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
    11. Simplified42.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.9 \cdot 10^{-81}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-268}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-134}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{-91}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 64000000:\\ \;\;\;\;\frac{y \cdot -60}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{-81}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-268}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-135}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 43:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.5e-81 or 43 < 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 71.9%

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

    if -4.5e-81 < a < 8.50000000000000052e-268 or 7.5e-135 < a < 2.8e-91

    1. Initial program 96.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 90.4%

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

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

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

    if 8.50000000000000052e-268 < a < 7.5e-135

    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.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 79.5%

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

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

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

    if 2.8e-91 < a < 43

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-81}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-268}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-135}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-91}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 57.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq 4.4 \cdot 10^{-87}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

\mathbf{elif}\;a \leq 1.76 \cdot 10^{-9}:\\
\;\;\;\;\frac{y \cdot -60}{z}\\

\mathbf{elif}\;a \leq 43:\\
\;\;\;\;\frac{60 \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.3500000000000001e-80 or 43 < 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 71.9%

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

    if -1.3500000000000001e-80 < a < 4.39999999999999976e-87

    1. Initial program 97.8%

      \[\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 86.8%

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

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

    if 4.39999999999999976e-87 < a < 1.75999999999999992e-9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
    11. Simplified44.1%

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

    if 1.75999999999999992e-9 < a < 43

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
    8. Step-by-step derivation
      1. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
    9. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{-87}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 1.76 \cdot 10^{-9}:\\ \;\;\;\;\frac{y \cdot -60}{z}\\ \mathbf{elif}\;a \leq 43:\\ \;\;\;\;\frac{60 \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 82.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{-78} \lor \neg \left(a \cdot 120 \leq 10000\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) -4e-78) (not (<= (* a 120.0) 10000.0)))
   (+ (* 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) <= -4e-78) || !((a * 120.0) <= 10000.0)) {
		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) <= (-4d-78)) .or. (.not. ((a * 120.0d0) <= 10000.0d0))) 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) <= -4e-78) || !((a * 120.0) <= 10000.0)) {
		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) <= -4e-78) or not ((a * 120.0) <= 10000.0):
		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) <= -4e-78) || !(Float64(a * 120.0) <= 10000.0))
		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) <= -4e-78) || ~(((a * 120.0) <= 10000.0)))
		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], -4e-78], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 10000.0]], $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 -4 \cdot 10^{-78} \lor \neg \left(a \cdot 120 \leq 10000\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)) < -4e-78 or 1e4 < (*.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.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 85.4%

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

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

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

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

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

    if -4e-78 < (*.f64 a #s(literal 120 binary64)) < 1e4

    1. Initial program 98.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{-78} \lor \neg \left(a \cdot 120 \leq 10000\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 12: 75.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-20} \lor \neg \left(a \cdot 120 \leq 10000\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-20) (not (<= (* a 120.0) 10000.0)))
   (* 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-20) || !((a * 120.0) <= 10000.0)) {
		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-20)) .or. (.not. ((a * 120.0d0) <= 10000.0d0))) 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-20) || !((a * 120.0) <= 10000.0)) {
		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-20) or not ((a * 120.0) <= 10000.0):
		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-20) || !(Float64(a * 120.0) <= 10000.0))
		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-20) || ~(((a * 120.0) <= 10000.0)))
		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-20], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 10000.0]], $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^{-20} \lor \neg \left(a \cdot 120 \leq 10000\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.9999999999999999e-20 or 1e4 < (*.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.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 73.9%

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

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

    1. Initial program 98.2%

      \[\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 82.1%

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

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

Alternative 13: 73.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{-78}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\

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

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


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

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative98.5%

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

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

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

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

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

    if -4e-78 < (*.f64 a #s(literal 120 binary64)) < 1e4

    1. Initial program 98.1%

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

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

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

    1. Initial program 100.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 76.8%

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

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

Alternative 14: 84.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-41} \lor \neg \left(t \leq 1.52 \cdot 10^{-61}\right):\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5999999999999999e-41 or 1.52000000000000003e-61 < t

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative98.5%

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

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

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

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

    if -2.5999999999999999e-41 < t < 1.52000000000000003e-61

    1. Initial program 98.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative98.9%

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

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

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

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

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

Alternative 15: 89.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+28}:\\ \;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{-8}:\\ \;\;\;\;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 (<= x -1.8e+28)
   (+ (* a 120.0) (/ x (* (- z t) 0.016666666666666666)))
   (if (<= x 1.32e-8)
     (+ (* 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 (x <= -1.8e+28) {
		tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666));
	} else if (x <= 1.32e-8) {
		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 (x <= (-1.8d+28)) then
        tmp = (a * 120.0d0) + (x / ((z - t) * 0.016666666666666666d0))
    else if (x <= 1.32d-8) 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 (x <= -1.8e+28) {
		tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666));
	} else if (x <= 1.32e-8) {
		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 x <= -1.8e+28:
		tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666))
	elif x <= 1.32e-8:
		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 (x <= -1.8e+28)
		tmp = Float64(Float64(a * 120.0) + Float64(x / Float64(Float64(z - t) * 0.016666666666666666)));
	elseif (x <= 1.32e-8)
		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 (x <= -1.8e+28)
		tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666));
	elseif (x <= 1.32e-8)
		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[LessEqual[x, -1.8e+28], N[(N[(a * 120.0), $MachinePrecision] + N[(x / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.32e-8], 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}\;x \leq -1.8 \cdot 10^{+28}:\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\

\mathbf{elif}\;x \leq 1.32 \cdot 10^{-8}:\\
\;\;\;\;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 3 regimes
  2. if x < -1.8e28

    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.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e28 < x < 1.32000000000000007e-8

    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 0 96.6%

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

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

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

    if 1.32000000000000007e-8 < x

    1. Initial program 98.1%

      \[\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 x around inf 89.9%

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. *-commutative88.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 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+28}:\\ \;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{-8}:\\ \;\;\;\;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 16: 53.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 8.6 \cdot 10^{-240}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-114}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.4999999999999996e-115 or 1.0199999999999999e-114 < 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.6%

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

    if -9.4999999999999996e-115 < a < 8.60000000000000027e-240

    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.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 93.0%

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

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

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

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

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

    if 8.60000000000000027e-240 < a < 1.0199999999999999e-114

    1. Initial program 96.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 81.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-115}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 8.6 \cdot 10^{-240}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-114}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 53.8% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e-151 or 2.35000000000000003e-114 < a

    1. Initial program 98.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 z around inf 60.8%

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

    if -1.2e-151 < a < 2.35000000000000003e-114

    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.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 88.4%

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

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

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

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

Alternative 18: 99.7% 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 98.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. Final simplification99.8%

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

Alternative 19: 51.6% 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 98.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 z around inf 45.4%

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

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

Developer target: 99.7% 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 2024101 
(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)))