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

Percentage Accurate: 99.2% → 99.8%
Time: 16.9s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 99.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

      \[\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, \frac{60}{z - t} \cdot \left(x - y\right)\right) \]
  6. Add Preprocessing

Alternative 2: 57.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x - y}{z}\\ \mathbf{if}\;a \leq -1 \cdot 10^{+40}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -8.7 \cdot 10^{+26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-63}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-92}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-153}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-12}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* 60.0 (/ (- x y) z))))
   (if (<= a -1e+40)
     (* a 120.0)
     (if (<= a -8.7e+26)
       t_1
       (if (<= a -6e-63)
         (* a 120.0)
         (if (<= a -3.7e-92)
           (* -60.0 (/ y (- z t)))
           (if (<= a -8.5e-153)
             (* a 120.0)
             (if (<= a -5e-183)
               t_1
               (if (<= a 1.2e-12) (* -60.0 (/ (- x y) t)) (* a 120.0))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double tmp;
	if (a <= -1e+40) {
		tmp = a * 120.0;
	} else if (a <= -8.7e+26) {
		tmp = t_1;
	} else if (a <= -6e-63) {
		tmp = a * 120.0;
	} else if (a <= -3.7e-92) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= -8.5e-153) {
		tmp = a * 120.0;
	} else if (a <= -5e-183) {
		tmp = t_1;
	} else if (a <= 1.2e-12) {
		tmp = -60.0 * ((x - y) / t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 60.0d0 * ((x - y) / z)
    if (a <= (-1d+40)) then
        tmp = a * 120.0d0
    else if (a <= (-8.7d+26)) then
        tmp = t_1
    else if (a <= (-6d-63)) then
        tmp = a * 120.0d0
    else if (a <= (-3.7d-92)) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (a <= (-8.5d-153)) then
        tmp = a * 120.0d0
    else if (a <= (-5d-183)) then
        tmp = t_1
    else if (a <= 1.2d-12) then
        tmp = (-60.0d0) * ((x - y) / t)
    else
        tmp = a * 120.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double tmp;
	if (a <= -1e+40) {
		tmp = a * 120.0;
	} else if (a <= -8.7e+26) {
		tmp = t_1;
	} else if (a <= -6e-63) {
		tmp = a * 120.0;
	} else if (a <= -3.7e-92) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= -8.5e-153) {
		tmp = a * 120.0;
	} else if (a <= -5e-183) {
		tmp = t_1;
	} else if (a <= 1.2e-12) {
		tmp = -60.0 * ((x - y) / t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * ((x - y) / z)
	tmp = 0
	if a <= -1e+40:
		tmp = a * 120.0
	elif a <= -8.7e+26:
		tmp = t_1
	elif a <= -6e-63:
		tmp = a * 120.0
	elif a <= -3.7e-92:
		tmp = -60.0 * (y / (z - t))
	elif a <= -8.5e-153:
		tmp = a * 120.0
	elif a <= -5e-183:
		tmp = t_1
	elif a <= 1.2e-12:
		tmp = -60.0 * ((x - y) / t)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(60.0 * Float64(Float64(x - y) / z))
	tmp = 0.0
	if (a <= -1e+40)
		tmp = Float64(a * 120.0);
	elseif (a <= -8.7e+26)
		tmp = t_1;
	elseif (a <= -6e-63)
		tmp = Float64(a * 120.0);
	elseif (a <= -3.7e-92)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (a <= -8.5e-153)
		tmp = Float64(a * 120.0);
	elseif (a <= -5e-183)
		tmp = t_1;
	elseif (a <= 1.2e-12)
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	else
		tmp = Float64(a * 120.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = 60.0 * ((x - y) / z);
	tmp = 0.0;
	if (a <= -1e+40)
		tmp = a * 120.0;
	elseif (a <= -8.7e+26)
		tmp = t_1;
	elseif (a <= -6e-63)
		tmp = a * 120.0;
	elseif (a <= -3.7e-92)
		tmp = -60.0 * (y / (z - t));
	elseif (a <= -8.5e-153)
		tmp = a * 120.0;
	elseif (a <= -5e-183)
		tmp = t_1;
	elseif (a <= 1.2e-12)
		tmp = -60.0 * ((x - y) / t);
	else
		tmp = a * 120.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+40], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -8.7e+26], t$95$1, If[LessEqual[a, -6e-63], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -3.7e-92], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8.5e-153], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -5e-183], t$95$1, If[LessEqual[a, 1.2e-12], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -8.7 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\

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

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

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

\mathbf{elif}\;a \leq -5 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.00000000000000003e40 or -8.70000000000000064e26 < a < -5.99999999999999959e-63 or -3.69999999999999977e-92 < a < -8.4999999999999996e-153 or 1.19999999999999994e-12 < a

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 72.7%

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

    if -1.00000000000000003e40 < a < -8.70000000000000064e26 or -8.4999999999999996e-153 < a < -5.0000000000000002e-183

    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 a around 0 92.6%

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

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

    if -5.99999999999999959e-63 < a < -3.69999999999999977e-92

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-175.8%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac75.8%

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

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

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

    if -5.0000000000000002e-183 < a < 1.19999999999999994e-12

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+40}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -8.7 \cdot 10^{+26}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-63}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-92}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-153}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-183}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-12}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 57.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+40}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.76 \cdot 10^{+27}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z}\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-64}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.3 \cdot 10^{-92}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{-157}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-185}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-12}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -1e+40)
   (* a 120.0)
   (if (<= a -1.76e+27)
     (/ (* 60.0 (- x y)) z)
     (if (<= a -4.5e-64)
       (* a 120.0)
       (if (<= a -3.3e-92)
         (* -60.0 (/ y (- z t)))
         (if (<= a -4.9e-157)
           (* a 120.0)
           (if (<= a -4.2e-185)
             (* 60.0 (/ (- x y) z))
             (if (<= a 1.2e-12) (* -60.0 (/ (- x y) t)) (* a 120.0)))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1e+40) {
		tmp = a * 120.0;
	} else if (a <= -1.76e+27) {
		tmp = (60.0 * (x - y)) / z;
	} else if (a <= -4.5e-64) {
		tmp = a * 120.0;
	} else if (a <= -3.3e-92) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= -4.9e-157) {
		tmp = a * 120.0;
	} else if (a <= -4.2e-185) {
		tmp = 60.0 * ((x - y) / z);
	} else if (a <= 1.2e-12) {
		tmp = -60.0 * ((x - y) / t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-1d+40)) then
        tmp = a * 120.0d0
    else if (a <= (-1.76d+27)) then
        tmp = (60.0d0 * (x - y)) / z
    else if (a <= (-4.5d-64)) then
        tmp = a * 120.0d0
    else if (a <= (-3.3d-92)) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (a <= (-4.9d-157)) then
        tmp = a * 120.0d0
    else if (a <= (-4.2d-185)) then
        tmp = 60.0d0 * ((x - y) / z)
    else if (a <= 1.2d-12) then
        tmp = (-60.0d0) * ((x - y) / t)
    else
        tmp = a * 120.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1e+40) {
		tmp = a * 120.0;
	} else if (a <= -1.76e+27) {
		tmp = (60.0 * (x - y)) / z;
	} else if (a <= -4.5e-64) {
		tmp = a * 120.0;
	} else if (a <= -3.3e-92) {
		tmp = -60.0 * (y / (z - t));
	} else if (a <= -4.9e-157) {
		tmp = a * 120.0;
	} else if (a <= -4.2e-185) {
		tmp = 60.0 * ((x - y) / z);
	} else if (a <= 1.2e-12) {
		tmp = -60.0 * ((x - y) / t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -1e+40:
		tmp = a * 120.0
	elif a <= -1.76e+27:
		tmp = (60.0 * (x - y)) / z
	elif a <= -4.5e-64:
		tmp = a * 120.0
	elif a <= -3.3e-92:
		tmp = -60.0 * (y / (z - t))
	elif a <= -4.9e-157:
		tmp = a * 120.0
	elif a <= -4.2e-185:
		tmp = 60.0 * ((x - y) / z)
	elif a <= 1.2e-12:
		tmp = -60.0 * ((x - y) / t)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -1e+40)
		tmp = Float64(a * 120.0);
	elseif (a <= -1.76e+27)
		tmp = Float64(Float64(60.0 * Float64(x - y)) / z);
	elseif (a <= -4.5e-64)
		tmp = Float64(a * 120.0);
	elseif (a <= -3.3e-92)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (a <= -4.9e-157)
		tmp = Float64(a * 120.0);
	elseif (a <= -4.2e-185)
		tmp = Float64(60.0 * Float64(Float64(x - y) / z));
	elseif (a <= 1.2e-12)
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	else
		tmp = Float64(a * 120.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -1e+40)
		tmp = a * 120.0;
	elseif (a <= -1.76e+27)
		tmp = (60.0 * (x - y)) / z;
	elseif (a <= -4.5e-64)
		tmp = a * 120.0;
	elseif (a <= -3.3e-92)
		tmp = -60.0 * (y / (z - t));
	elseif (a <= -4.9e-157)
		tmp = a * 120.0;
	elseif (a <= -4.2e-185)
		tmp = 60.0 * ((x - y) / z);
	elseif (a <= 1.2e-12)
		tmp = -60.0 * ((x - y) / t);
	else
		tmp = a * 120.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e+40], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.76e+27], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, -4.5e-64], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -3.3e-92], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.9e-157], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -4.2e-185], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-12], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.76 \cdot 10^{+27}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z}\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.00000000000000003e40 or -1.76000000000000006e27 < a < -4.5000000000000001e-64 or -3.29999999999999998e-92 < a < -4.8999999999999998e-157 or 1.19999999999999994e-12 < a

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 72.7%

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

    if -1.00000000000000003e40 < a < -1.76000000000000006e27

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\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 99.7%

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

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

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

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

    if -4.5000000000000001e-64 < a < -3.29999999999999998e-92

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-175.8%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac75.8%

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

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

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

    if -4.8999999999999998e-157 < a < -4.2e-185

    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*100.0%

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

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

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

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

    if -4.2e-185 < a < 1.19999999999999994e-12

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+40}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.76 \cdot 10^{+27}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z}\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-64}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.3 \cdot 10^{-92}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{-157}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-185}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-12}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.6% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a 120) < -3.9999999999999997e45 or 5.00000000000000021e35 < (*.f64 a 120)

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

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

    if -3.9999999999999997e45 < (*.f64 a 120) < -1.99999999999999983e29

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\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 99.7%

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

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

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

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

    if -1.99999999999999983e29 < (*.f64 a 120) < -1.9999999999999999e-48

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

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

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

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

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

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

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

    if -1.9999999999999999e-48 < (*.f64 a 120) < 5.00000000000000021e35

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

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

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

Alternative 5: 80.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+236} \lor \neg \left(y \leq -1.65 \cdot 10^{+110} \lor \neg \left(y \leq -4.2 \cdot 10^{+54}\right) \land y \leq 2.45 \cdot 10^{+182}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.4999999999999999e236 or -1.64999999999999986e110 < y < -4.19999999999999972e54 or 2.45e182 < y

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 79.7%

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

    if -9.4999999999999999e236 < y < -1.64999999999999986e110 or -4.19999999999999972e54 < y < 2.45e182

    1. Initial program 98.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 84.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+236} \lor \neg \left(y \leq -1.65 \cdot 10^{+110} \lor \neg \left(y \leq -4.2 \cdot 10^{+54}\right) \land y \leq 2.45 \cdot 10^{+182}\right):\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{z - t} \cdot x + a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.0% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.6999999999999998e-64 or -2.49999999999999999e-91 < a < -1.7e-169 or 2.5999999999999997e33 < a

    1. Initial program 98.5%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 70.7%

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

    if -4.6999999999999998e-64 < a < -2.49999999999999999e-91 or -1.7e-169 < a < 2.5999999999999997e33

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-148.9%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac48.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.7 \cdot 10^{-64} \lor \neg \left(a \leq -2.5 \cdot 10^{-91}\right) \land \left(a \leq -1.7 \cdot 10^{-169} \lor \neg \left(a \leq 2.6 \cdot 10^{+33}\right)\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.4% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;a \leq -1.2 \cdot 10^{-175} \lor \neg \left(a \leq 1.6 \cdot 10^{-12}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.5000000000000001e-64 or -3.5e-92 < a < -1.2e-175 or 1.6e-12 < a

    1. Initial program 98.6%

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

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

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

    if -4.5000000000000001e-64 < a < -3.5e-92

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-175.8%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac75.8%

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

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

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

    if -1.2e-175 < a < 1.6e-12

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-64}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.5 \cdot 10^{-92}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-175} \lor \neg \left(a \leq 1.6 \cdot 10^{-12}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.7% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.6499999999999998e-10 or 1.9000000000000002e32 < t

    1. Initial program 99.0%

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

        \[\leadsto \color{blue}{\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 0 89.7%

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

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

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

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

    if -3.6499999999999998e-10 < t < 3.0000000000000002e-90

    1. Initial program 98.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 87.9%

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

    if 3.0000000000000002e-90 < t < 1.9000000000000002e32

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

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

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

Alternative 9: 74.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+45} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+35}\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) -4e+45) (not (<= (* a 120.0) 5e+35)))
   (* 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) <= -4e+45) || !((a * 120.0) <= 5e+35)) {
		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) <= (-4d+45)) .or. (.not. ((a * 120.0d0) <= 5d+35))) 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) <= -4e+45) || !((a * 120.0) <= 5e+35)) {
		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) <= -4e+45) or not ((a * 120.0) <= 5e+35):
		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) <= -4e+45) || !(Float64(a * 120.0) <= 5e+35))
		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) <= -4e+45) || ~(((a * 120.0) <= 5e+35)))
		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], -4e+45], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e+35]], $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 -4 \cdot 10^{+45} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+35}\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) < -3.9999999999999997e45 or 5.00000000000000021e35 < (*.f64 a 120)

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

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

    if -3.9999999999999997e45 < (*.f64 a 120) < 5.00000000000000021e35

    1. Initial program 99.0%

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

        \[\leadsto \color{blue}{\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 74.3%

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

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

Alternative 10: 88.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.1999999999999993e44 or 5.1999999999999997e173 < x

    1. Initial program 97.3%

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

        \[\leadsto \color{blue}{\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 88.3%

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

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

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

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

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

    if -8.1999999999999993e44 < x < 5.1999999999999997e173

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

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

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

Alternative 11: 52.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-212} \lor \neg \left(a \leq 1.4 \cdot 10^{-203}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.8e-212 or 1.40000000000000011e-203 < a

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

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

    if -7.8e-212 < a < 1.40000000000000011e-203

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\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 93.3%

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

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

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

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

Alternative 12: 51.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+237}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.6999999999999999e237

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-182.3%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac82.3%

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

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

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

    if -2.6999999999999999e237 < y < 1.00000000000000005e236

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

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

    if 1.00000000000000005e236 < y

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 87.3%

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-174.0%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac74.0%

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

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

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

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

Alternative 13: 52.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+237}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+234}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.42000000000000004e237

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-182.3%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac82.3%

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

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

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

    if -1.42000000000000004e237 < y < 2.3000000000000001e234

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

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

    if 2.3000000000000001e234 < y

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 87.3%

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-174.0%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac74.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-60}}} \]
    11. Simplified48.6%

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

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

Alternative 14: 99.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\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 15: 51.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.4 \cdot 10^{+232}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.39999999999999965e232

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

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

    if 8.39999999999999965e232 < y

    1. Initial program 99.7%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 87.3%

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z - t}\right)} \]
    7. Step-by-step derivation
      1. neg-mul-174.0%

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} \]
      2. distribute-neg-frac74.0%

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

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

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

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

Alternative 16: 50.4% 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.0%

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

      \[\leadsto \color{blue}{\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 49.8%

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

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

Developer target: 99.8% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024027 
(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)))