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

Percentage Accurate: 99.4% → 99.8%
Time: 21.1s
Alternatives: 24
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 24 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.8% accurate, 0.1× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative99.8%

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

Alternative 3: 72.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+101} \lor \neg \left(a \cdot 120 \leq -4 \cdot 10^{+33}\right) \land \left(a \cdot 120 \leq -10 \lor \neg \left(a \cdot 120 \leq 4 \cdot 10^{-129} \lor \neg \left(a \cdot 120 \leq 10^{-86}\right) \land a \cdot 120 \leq 10^{+15}\right)\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+101)
         (and (not (<= (* a 120.0) -4e+33))
              (or (<= (* a 120.0) -10.0)
                  (not
                   (or (<= (* a 120.0) 4e-129)
                       (and (not (<= (* a 120.0) 1e-86))
                            (<= (* a 120.0) 1e+15)))))))
   (* a 120.0)
   (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -5e+101) || (!((a * 120.0) <= -4e+33) && (((a * 120.0) <= -10.0) || !(((a * 120.0) <= 4e-129) || (!((a * 120.0) <= 1e-86) && ((a * 120.0) <= 1e+15)))))) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (((a * 120.0d0) <= (-5d+101)) .or. (.not. ((a * 120.0d0) <= (-4d+33))) .and. ((a * 120.0d0) <= (-10.0d0)) .or. (.not. ((a * 120.0d0) <= 4d-129) .or. (.not. ((a * 120.0d0) <= 1d-86)) .and. ((a * 120.0d0) <= 1d+15))) then
        tmp = a * 120.0d0
    else
        tmp = 60.0d0 * ((x - y) / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((a * 120.0) <= -5e+101) || (!((a * 120.0) <= -4e+33) && (((a * 120.0) <= -10.0) || !(((a * 120.0) <= 4e-129) || (!((a * 120.0) <= 1e-86) && ((a * 120.0) <= 1e+15)))))) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if ((a * 120.0) <= -5e+101) or (not ((a * 120.0) <= -4e+33) and (((a * 120.0) <= -10.0) or not (((a * 120.0) <= 4e-129) or (not ((a * 120.0) <= 1e-86) and ((a * 120.0) <= 1e+15))))):
		tmp = a * 120.0
	else:
		tmp = 60.0 * ((x - y) / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((Float64(a * 120.0) <= -5e+101) || (!(Float64(a * 120.0) <= -4e+33) && ((Float64(a * 120.0) <= -10.0) || !((Float64(a * 120.0) <= 4e-129) || (!(Float64(a * 120.0) <= 1e-86) && (Float64(a * 120.0) <= 1e+15))))))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (((a * 120.0) <= -5e+101) || (~(((a * 120.0) <= -4e+33)) && (((a * 120.0) <= -10.0) || ~((((a * 120.0) <= 4e-129) || (~(((a * 120.0) <= 1e-86)) && ((a * 120.0) <= 1e+15)))))))
		tmp = a * 120.0;
	else
		tmp = 60.0 * ((x - y) / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+101], And[N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+33]], $MachinePrecision], Or[LessEqual[N[(a * 120.0), $MachinePrecision], -10.0], N[Not[Or[LessEqual[N[(a * 120.0), $MachinePrecision], 4e-129], And[N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-86]], $MachinePrecision], LessEqual[N[(a * 120.0), $MachinePrecision], 1e+15]]]], $MachinePrecision]]]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+101} \lor \neg \left(a \cdot 120 \leq -4 \cdot 10^{+33}\right) \land \left(a \cdot 120 \leq -10 \lor \neg \left(a \cdot 120 \leq 4 \cdot 10^{-129} \lor \neg \left(a \cdot 120 \leq 10^{-86}\right) \land a \cdot 120 \leq 10^{+15}\right)\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 120) < -4.99999999999999989e101 or -3.9999999999999998e33 < (*.f64 a 120) < -10 or 3.9999999999999997e-129 < (*.f64 a 120) < 1.00000000000000008e-86 or 1e15 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

    if -4.99999999999999989e101 < (*.f64 a 120) < -3.9999999999999998e33 or -10 < (*.f64 a 120) < 3.9999999999999997e-129 or 1.00000000000000008e-86 < (*.f64 a 120) < 1e15

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

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

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

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

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

Alternative 4: 71.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -4 \cdot 10^{+33}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{-136}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -4.99999999999999989e101 or -3.9999999999999998e33 < (*.f64 a 120) < -10 or 5.00000000000000008e99 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

    if -4.99999999999999989e101 < (*.f64 a 120) < -3.9999999999999998e33 or -10 < (*.f64 a 120) < 5.0000000000000002e-136

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

    if 5.0000000000000002e-136 < (*.f64 a 120) < 5.00000000000000008e99

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} + a \cdot 120 \]
    6. Simplified79.0%

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

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

Alternative 5: 71.7% accurate, 0.3× speedup?

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

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

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a 120) < -4.99999999999999989e101 or -3.9999999999999998e33 < (*.f64 a 120) < -10 or 5.00000000000000008e99 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

    if -4.99999999999999989e101 < (*.f64 a 120) < -3.9999999999999998e33

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

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

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

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

    if -10 < (*.f64 a 120) < 5.0000000000000002e-136

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    6. Step-by-step derivation
      1. clear-num76.9%

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} \]
      2. un-div-inv76.9%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} \]
    7. Applied egg-rr76.9%

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

    if 5.0000000000000002e-136 < (*.f64 a 120) < 5.00000000000000008e99

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} + a \cdot 120 \]
    6. Simplified79.0%

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

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

Alternative 6: 71.7% accurate, 0.3× speedup?

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

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

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a 120) < -4.99999999999999989e101 or -3.9999999999999998e33 < (*.f64 a 120) < -10 or 5.00000000000000008e99 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

    if -4.99999999999999989e101 < (*.f64 a 120) < -3.9999999999999998e33

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

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

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

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

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

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

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

    if -10 < (*.f64 a 120) < 5.0000000000000002e-136

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    6. Step-by-step derivation
      1. clear-num76.9%

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} \]
      2. un-div-inv76.9%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} \]
    7. Applied egg-rr76.9%

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

    if 5.0000000000000002e-136 < (*.f64 a 120) < 5.00000000000000008e99

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} + a \cdot 120 \]
    6. Simplified79.0%

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

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

Alternative 7: 58.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq 1.12 \cdot 10^{-184}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

\mathbf{elif}\;a \leq 3.75 \cdot 10^{-159}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{-126}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;a \leq 7.8 \cdot 10^{-89} \lor \neg \left(a \leq 8000000000000\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -5.3999999999999999e-107 or 6.50000000000000014e-126 < a < 7.79999999999999957e-89 or 8e12 < a

    1. Initial program 99.9%

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

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

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

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

    if -5.3999999999999999e-107 < a < 1.11999999999999997e-184

    1. Initial program 99.6%

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

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

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

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

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

    if 1.11999999999999997e-184 < a < 3.75e-159

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified98.8%

      \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    9. Step-by-step derivation
      1. associate-/r/99.3%

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

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

    if 3.75e-159 < a < 6.50000000000000014e-126

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

    if 7.79999999999999957e-89 < a < 8e12

    1. Initial program 99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{-107}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{-184}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 3.75 \cdot 10^{-159}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-126}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{-89} \lor \neg \left(a \leq 8000000000000\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq 3.7 \cdot 10^{-186}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

\mathbf{elif}\;a \leq 1.22 \cdot 10^{-158}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \leq 6.4 \cdot 10^{-131}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;a \leq 8.2 \cdot 10^{-89} \lor \neg \left(a \leq 16500000000000\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -4.0999999999999999e-106 or 6.3999999999999999e-131 < a < 8.1999999999999997e-89 or 1.65e13 < a

    1. Initial program 99.9%

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

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

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

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

    if -4.0999999999999999e-106 < a < 3.7000000000000002e-186

    1. Initial program 99.6%

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

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

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

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

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

    if 3.7000000000000002e-186 < a < 1.22000000000000007e-158

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified98.8%

      \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    9. Step-by-step derivation
      1. associate-/r/99.3%

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

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

    if 1.22000000000000007e-158 < a < 6.3999999999999999e-131

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

    if 8.1999999999999997e-89 < a < 1.65e13

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      2. *-commutative58.3%

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} \]
      3. associate-/l*58.4%

        \[\leadsto \color{blue}{\frac{y}{\frac{z - t}{-60}}} \]
    8. Applied egg-rr58.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{-106}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-186}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{-158}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-131}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{-89} \lor \neg \left(a \leq 16500000000000\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z - t}{-60}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z - t \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z - t \leq 10^{+18}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 z t) < -3.99999999999999998e89 or 1e18 < (-.f64 z t)

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -3.99999999999999998e89 < (-.f64 z t) < -1.99999999999999986e-39 or 4.9999999999999999e-133 < (-.f64 z t) < 1e18

    1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

    if -1.99999999999999986e-39 < (-.f64 z t) < 4.9999999999999999e-133

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

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

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

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

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

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

Alternative 10: 58.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-129}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-89} \lor \neg \left(a \leq 6800000000000\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3999999999999999e-107 or 8.49999999999999937e-129 < a < 9.50000000000000028e-89 or 6.8e12 < a

    1. Initial program 99.9%

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

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

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

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

    if -1.3999999999999999e-107 < a < 8.49999999999999937e-129

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

    if 9.50000000000000028e-89 < a < 6.8e12

    1. Initial program 99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{-107}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-129}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-89} \lor \neg \left(a \leq 6800000000000\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 78.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -3.99999999999999998e89 or 1e18 < (-.f64 z t)

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

    if -3.99999999999999998e89 < (-.f64 z t) < 1e18

    1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

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

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

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

Alternative 12: 67.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-178}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1999999999999999e-79 or 3.8999999999999998e24 < z

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

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

    if -2.1999999999999999e-79 < z < 4.99999999999999976e-178

    1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

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

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

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

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

    if 4.99999999999999976e-178 < z < 3.8999999999999998e24

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

Alternative 13: 67.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 7.8 \cdot 10^{-177}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+25}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.00000000000000021e-83 or 1.44999999999999995e25 < z

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

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

    if -6.00000000000000021e-83 < z < 7.80000000000000028e-177

    1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

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

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

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

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

    if 7.80000000000000028e-177 < z < 1.44999999999999995e25

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

Alternative 14: 54.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -4 \cdot 10^{+89} \lor \neg \left(z - t \leq 10^{+18}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -3.99999999999999998e89 or 1e18 < (-.f64 z t)

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -3.99999999999999998e89 < (-.f64 z t) < 1e18

    1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

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

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

Alternative 15: 89.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+66} \lor \neg \left(y \leq 2.7 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8000000000000002e66 or 2.7e16 < y

    1. Initial program 99.8%

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

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

    if -3.8000000000000002e66 < y < 2.7e16

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

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

Alternative 16: 89.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+68} \lor \neg \left(y \leq 4.4 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.05e68 or 4.4e15 < y

    1. Initial program 99.8%

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

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

    if -2.05e68 < y < 4.4e15

    1. Initial program 99.8%

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

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

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

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

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

Alternative 17: 50.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+117}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq -6.6 \cdot 10^{+83}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+187}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.5e117 or -6.59999999999999969e83 < x < 1.5e187

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -1.5e117 < x < -6.59999999999999969e83

    1. Initial program 99.8%

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

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

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

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

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

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

    if 1.5e187 < x

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified49.1%

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

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

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

Alternative 18: 50.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+136}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{+84}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+188}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -8.00000000000000047e136

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z}} + a \cdot 120 \]
    9. Taylor expanded in x around inf 37.3%

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

    if -8.00000000000000047e136 < x < -1.44999999999999994e84

    1. Initial program 99.8%

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

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

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

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

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

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

    if -1.44999999999999994e84 < x < 1.09999999999999999e188

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 1.09999999999999999e188 < x

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified49.1%

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

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

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

Alternative 19: 50.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+137}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{+84}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+185}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.55e137

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z}} + a \cdot 120 \]
    9. Taylor expanded in x around inf 37.3%

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

    if -1.55e137 < x < -1.44999999999999994e84

    1. Initial program 99.8%

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

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

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

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

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

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

    if -1.44999999999999994e84 < x < 1.1e185

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 1.1e185 < x

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified49.1%

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{t} \cdot x} \]
      3. *-commutative49.5%

        \[\leadsto \color{blue}{x \cdot \frac{-60}{t}} \]
    11. Simplified49.5%

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

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

Alternative 20: 50.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+137}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{+84}:\\
\;\;\;\;y \cdot \frac{-60}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.44999999999999992e137

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z}} + a \cdot 120 \]
    9. Taylor expanded in x around inf 37.3%

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

    if -1.44999999999999992e137 < x < -1.44999999999999994e84

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{z} \cdot y} \]
      3. *-commutative70.7%

        \[\leadsto \color{blue}{y \cdot \frac{-60}{z}} \]
    9. Simplified70.7%

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

    if -1.44999999999999994e84 < x < 1e188

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 1e188 < x

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified49.1%

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{t} \cdot x} \]
      3. *-commutative49.5%

        \[\leadsto \color{blue}{x \cdot \frac{-60}{t}} \]
    11. Simplified49.5%

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

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

Alternative 21: 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}
Derivation
  1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
  3. Simplified99.7%

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

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

Alternative 22: 99.4% accurate, 1.0× speedup?

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

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

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
  2. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 23: 51.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.5 \cdot 10^{+184}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 9.4999999999999995e184

    1. Initial program 99.8%

      \[\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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 9.4999999999999995e184 < x

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    8. Simplified49.1%

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

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

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

Alternative 24: 50.5% accurate, 4.3× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 99.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
  3. Simplified99.7%

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

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

    \[\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 2024021 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

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

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