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

Percentage Accurate: 99.4% → 99.8%
Time: 12.0s
Alternatives: 13
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 13 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{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.4%

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

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

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

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

Alternative 2: 62.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ t_2 := a \cdot 120 + -60 \cdot \frac{x}{t}\\ t_3 := 60 \cdot \frac{x}{z - t}\\ \mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-103}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.022:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+68}:\\ \;\;\;\;\frac{60}{z - t} \cdot x\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+218}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (/ -60.0 (/ z y))))
        (t_2 (+ (* a 120.0) (* -60.0 (/ x t))))
        (t_3 (* 60.0 (/ x (- z t)))))
   (if (<= t -5.6e+17)
     t_2
     (if (<= t 6.2e-189)
       t_1
       (if (<= t 1.45e-103)
         t_3
         (if (<= t 5e-81)
           t_1
           (if (<= t 0.022)
             t_3
             (if (<= t 3.1e+29)
               t_1
               (if (<= t 5.6e+68)
                 (* (/ 60.0 (- z t)) x)
                 (if (<= t 7e+218)
                   (+ (* a 120.0) (* 60.0 (/ y t)))
                   t_2))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 / (z / y));
	double t_2 = (a * 120.0) + (-60.0 * (x / t));
	double t_3 = 60.0 * (x / (z - t));
	double tmp;
	if (t <= -5.6e+17) {
		tmp = t_2;
	} else if (t <= 6.2e-189) {
		tmp = t_1;
	} else if (t <= 1.45e-103) {
		tmp = t_3;
	} else if (t <= 5e-81) {
		tmp = t_1;
	} else if (t <= 0.022) {
		tmp = t_3;
	} else if (t <= 3.1e+29) {
		tmp = t_1;
	} else if (t <= 5.6e+68) {
		tmp = (60.0 / (z - t)) * x;
	} else if (t <= 7e+218) {
		tmp = (a * 120.0) + (60.0 * (y / t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (a * 120.0d0) + ((-60.0d0) / (z / y))
    t_2 = (a * 120.0d0) + ((-60.0d0) * (x / t))
    t_3 = 60.0d0 * (x / (z - t))
    if (t <= (-5.6d+17)) then
        tmp = t_2
    else if (t <= 6.2d-189) then
        tmp = t_1
    else if (t <= 1.45d-103) then
        tmp = t_3
    else if (t <= 5d-81) then
        tmp = t_1
    else if (t <= 0.022d0) then
        tmp = t_3
    else if (t <= 3.1d+29) then
        tmp = t_1
    else if (t <= 5.6d+68) then
        tmp = (60.0d0 / (z - t)) * x
    else if (t <= 7d+218) then
        tmp = (a * 120.0d0) + (60.0d0 * (y / t))
    else
        tmp = t_2
    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 / (z / y));
	double t_2 = (a * 120.0) + (-60.0 * (x / t));
	double t_3 = 60.0 * (x / (z - t));
	double tmp;
	if (t <= -5.6e+17) {
		tmp = t_2;
	} else if (t <= 6.2e-189) {
		tmp = t_1;
	} else if (t <= 1.45e-103) {
		tmp = t_3;
	} else if (t <= 5e-81) {
		tmp = t_1;
	} else if (t <= 0.022) {
		tmp = t_3;
	} else if (t <= 3.1e+29) {
		tmp = t_1;
	} else if (t <= 5.6e+68) {
		tmp = (60.0 / (z - t)) * x;
	} else if (t <= 7e+218) {
		tmp = (a * 120.0) + (60.0 * (y / t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (-60.0 / (z / y))
	t_2 = (a * 120.0) + (-60.0 * (x / t))
	t_3 = 60.0 * (x / (z - t))
	tmp = 0
	if t <= -5.6e+17:
		tmp = t_2
	elif t <= 6.2e-189:
		tmp = t_1
	elif t <= 1.45e-103:
		tmp = t_3
	elif t <= 5e-81:
		tmp = t_1
	elif t <= 0.022:
		tmp = t_3
	elif t <= 3.1e+29:
		tmp = t_1
	elif t <= 5.6e+68:
		tmp = (60.0 / (z - t)) * x
	elif t <= 7e+218:
		tmp = (a * 120.0) + (60.0 * (y / t))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y)))
	t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / t)))
	t_3 = Float64(60.0 * Float64(x / Float64(z - t)))
	tmp = 0.0
	if (t <= -5.6e+17)
		tmp = t_2;
	elseif (t <= 6.2e-189)
		tmp = t_1;
	elseif (t <= 1.45e-103)
		tmp = t_3;
	elseif (t <= 5e-81)
		tmp = t_1;
	elseif (t <= 0.022)
		tmp = t_3;
	elseif (t <= 3.1e+29)
		tmp = t_1;
	elseif (t <= 5.6e+68)
		tmp = Float64(Float64(60.0 / Float64(z - t)) * x);
	elseif (t <= 7e+218)
		tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / t)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (-60.0 / (z / y));
	t_2 = (a * 120.0) + (-60.0 * (x / t));
	t_3 = 60.0 * (x / (z - t));
	tmp = 0.0;
	if (t <= -5.6e+17)
		tmp = t_2;
	elseif (t <= 6.2e-189)
		tmp = t_1;
	elseif (t <= 1.45e-103)
		tmp = t_3;
	elseif (t <= 5e-81)
		tmp = t_1;
	elseif (t <= 0.022)
		tmp = t_3;
	elseif (t <= 3.1e+29)
		tmp = t_1;
	elseif (t <= 5.6e+68)
		tmp = (60.0 / (z - t)) * x;
	elseif (t <= 7e+218)
		tmp = (a * 120.0) + (60.0 * (y / t));
	else
		tmp = t_2;
	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[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+17], t$95$2, If[LessEqual[t, 6.2e-189], t$95$1, If[LessEqual[t, 1.45e-103], t$95$3, If[LessEqual[t, 5e-81], t$95$1, If[LessEqual[t, 0.022], t$95$3, If[LessEqual[t, 3.1e+29], t$95$1, If[LessEqual[t, 5.6e+68], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7e+218], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.45 \cdot 10^{-103}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 0.022:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \leq 3.1 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.6e17 or 7.00000000000000038e218 < t

    1. Initial program 99.8%

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

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

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

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

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

    if -5.6e17 < t < 6.2000000000000001e-189 or 1.4499999999999999e-103 < t < 4.99999999999999981e-81 or 0.021999999999999999 < t < 3.0999999999999999e29

    1. Initial program 99.9%

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

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

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

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

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

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

    if 6.2000000000000001e-189 < t < 1.4499999999999999e-103 or 4.99999999999999981e-81 < t < 0.021999999999999999

    1. Initial program 99.7%

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

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

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

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

    if 3.0999999999999999e29 < t < 5.6e68

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot x} \]
      3. *-commutative76.0%

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
    6. Simplified76.0%

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

    if 5.6e68 < t < 7.00000000000000038e218

    1. Initial program 96.5%

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

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    4. Step-by-step derivation
      1. clear-num99.7%

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

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

        \[\leadsto \frac{1 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} + a \cdot 120 \]
      4. *-un-lft-identity99.8%

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

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

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

      \[\leadsto \frac{x - y}{\color{blue}{-0.016666666666666666 \cdot t}} + a \cdot 120 \]
    7. Step-by-step derivation
      1. *-commutative86.4%

        \[\leadsto \frac{x - y}{\color{blue}{t \cdot -0.016666666666666666}} + a \cdot 120 \]
    8. Simplified86.4%

      \[\leadsto \frac{x - y}{\color{blue}{t \cdot -0.016666666666666666}} + a \cdot 120 \]
    9. Taylor expanded in x around 0 76.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-103}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 0.022:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+29}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+68}:\\ \;\;\;\;\frac{60}{z - t} \cdot x\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+218}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \end{array} \]

Alternative 3: 71.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ t_2 := a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ \mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-103}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-83} \lor \neg \left(t \leq 0.6\right) \land t \leq 1.4 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (/ -60.0 (/ z y))))
        (t_2 (+ (* a 120.0) (* -60.0 (/ (- x y) t)))))
   (if (<= t -5.6e+17)
     t_2
     (if (<= t 6.2e-189)
       t_1
       (if (<= t 1.55e-103)
         (* 60.0 (/ x (- z t)))
         (if (or (<= t 1.25e-83) (and (not (<= t 0.6)) (<= t 1.4e+29)))
           t_1
           t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 / (z / y));
	double t_2 = (a * 120.0) + (-60.0 * ((x - y) / t));
	double tmp;
	if (t <= -5.6e+17) {
		tmp = t_2;
	} else if (t <= 6.2e-189) {
		tmp = t_1;
	} else if (t <= 1.55e-103) {
		tmp = 60.0 * (x / (z - t));
	} else if ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * 120.0d0) + ((-60.0d0) / (z / y))
    t_2 = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
    if (t <= (-5.6d+17)) then
        tmp = t_2
    else if (t <= 6.2d-189) then
        tmp = t_1
    else if (t <= 1.55d-103) then
        tmp = 60.0d0 * (x / (z - t))
    else if ((t <= 1.25d-83) .or. (.not. (t <= 0.6d0)) .and. (t <= 1.4d+29)) then
        tmp = t_1
    else
        tmp = t_2
    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 / (z / y));
	double t_2 = (a * 120.0) + (-60.0 * ((x - y) / t));
	double tmp;
	if (t <= -5.6e+17) {
		tmp = t_2;
	} else if (t <= 6.2e-189) {
		tmp = t_1;
	} else if (t <= 1.55e-103) {
		tmp = 60.0 * (x / (z - t));
	} else if ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (-60.0 / (z / y))
	t_2 = (a * 120.0) + (-60.0 * ((x - y) / t))
	tmp = 0
	if t <= -5.6e+17:
		tmp = t_2
	elif t <= 6.2e-189:
		tmp = t_1
	elif t <= 1.55e-103:
		tmp = 60.0 * (x / (z - t))
	elif (t <= 1.25e-83) or (not (t <= 0.6) and (t <= 1.4e+29)):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y)))
	t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t)))
	tmp = 0.0
	if (t <= -5.6e+17)
		tmp = t_2;
	elseif (t <= 6.2e-189)
		tmp = t_1;
	elseif (t <= 1.55e-103)
		tmp = Float64(60.0 * Float64(x / Float64(z - t)));
	elseif ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (-60.0 / (z / y));
	t_2 = (a * 120.0) + (-60.0 * ((x - y) / t));
	tmp = 0.0;
	if (t <= -5.6e+17)
		tmp = t_2;
	elseif (t <= 6.2e-189)
		tmp = t_1;
	elseif (t <= 1.55e-103)
		tmp = 60.0 * (x / (z - t));
	elseif ((t <= 1.25e-83) || (~((t <= 0.6)) && (t <= 1.4e+29)))
		tmp = t_1;
	else
		tmp = t_2;
	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[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+17], t$95$2, If[LessEqual[t, 6.2e-189], t$95$1, If[LessEqual[t, 1.55e-103], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.25e-83], And[N[Not[LessEqual[t, 0.6]], $MachinePrecision], LessEqual[t, 1.4e+29]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.25 \cdot 10^{-83} \lor \neg \left(t \leq 0.6\right) \land t \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.6e17 or 1.25e-83 < t < 0.599999999999999978 or 1.4e29 < t

    1. Initial program 99.0%

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

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

    if -5.6e17 < t < 6.2000000000000001e-189 or 1.5500000000000001e-103 < t < 1.25e-83 or 0.599999999999999978 < t < 1.4e29

    1. Initial program 99.9%

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

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

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

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

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

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

    if 6.2000000000000001e-189 < t < 1.5500000000000001e-103

    1. Initial program 99.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-103}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-83} \lor \neg \left(t \leq 0.6\right) \land t \leq 1.4 \cdot 10^{+29}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ \end{array} \]

Alternative 4: 54.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -60 \cdot \frac{y}{z - t}\\ t_2 := 60 \cdot \frac{x}{z - t}\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{+61}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-110}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq -5.6 \cdot 10^{-149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+78}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* -60.0 (/ y (- z t)))) (t_2 (* 60.0 (/ x (- z t)))))
   (if (<= x -2.1e+61)
     t_2
     (if (<= x -7.2e-110)
       (* a 120.0)
       (if (<= x -5.6e-149)
         t_1
         (if (<= x 4.8e-18) (* a 120.0) (if (<= x 3.4e+78) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = -60.0 * (y / (z - t));
	double t_2 = 60.0 * (x / (z - t));
	double tmp;
	if (x <= -2.1e+61) {
		tmp = t_2;
	} else if (x <= -7.2e-110) {
		tmp = a * 120.0;
	} else if (x <= -5.6e-149) {
		tmp = t_1;
	} else if (x <= 4.8e-18) {
		tmp = a * 120.0;
	} else if (x <= 3.4e+78) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-60.0d0) * (y / (z - t))
    t_2 = 60.0d0 * (x / (z - t))
    if (x <= (-2.1d+61)) then
        tmp = t_2
    else if (x <= (-7.2d-110)) then
        tmp = a * 120.0d0
    else if (x <= (-5.6d-149)) then
        tmp = t_1
    else if (x <= 4.8d-18) then
        tmp = a * 120.0d0
    else if (x <= 3.4d+78) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = -60.0 * (y / (z - t));
	double t_2 = 60.0 * (x / (z - t));
	double tmp;
	if (x <= -2.1e+61) {
		tmp = t_2;
	} else if (x <= -7.2e-110) {
		tmp = a * 120.0;
	} else if (x <= -5.6e-149) {
		tmp = t_1;
	} else if (x <= 4.8e-18) {
		tmp = a * 120.0;
	} else if (x <= 3.4e+78) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = -60.0 * (y / (z - t))
	t_2 = 60.0 * (x / (z - t))
	tmp = 0
	if x <= -2.1e+61:
		tmp = t_2
	elif x <= -7.2e-110:
		tmp = a * 120.0
	elif x <= -5.6e-149:
		tmp = t_1
	elif x <= 4.8e-18:
		tmp = a * 120.0
	elif x <= 3.4e+78:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(-60.0 * Float64(y / Float64(z - t)))
	t_2 = Float64(60.0 * Float64(x / Float64(z - t)))
	tmp = 0.0
	if (x <= -2.1e+61)
		tmp = t_2;
	elseif (x <= -7.2e-110)
		tmp = Float64(a * 120.0);
	elseif (x <= -5.6e-149)
		tmp = t_1;
	elseif (x <= 4.8e-18)
		tmp = Float64(a * 120.0);
	elseif (x <= 3.4e+78)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = -60.0 * (y / (z - t));
	t_2 = 60.0 * (x / (z - t));
	tmp = 0.0;
	if (x <= -2.1e+61)
		tmp = t_2;
	elseif (x <= -7.2e-110)
		tmp = a * 120.0;
	elseif (x <= -5.6e-149)
		tmp = t_1;
	elseif (x <= 4.8e-18)
		tmp = a * 120.0;
	elseif (x <= 3.4e+78)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+61], t$95$2, If[LessEqual[x, -7.2e-110], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, -5.6e-149], t$95$1, If[LessEqual[x, 4.8e-18], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, 3.4e+78], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
t_2 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+61}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -7.2 \cdot 10^{-110}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq -5.6 \cdot 10^{-149}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{+78}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.1000000000000001e61 or 3.40000000000000007e78 < x

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

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

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

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

    if -2.1000000000000001e61 < x < -7.1999999999999999e-110 or -5.5999999999999997e-149 < x < 4.79999999999999988e-18

    1. Initial program 99.9%

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

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

    if -7.1999999999999999e-110 < x < -5.5999999999999997e-149 or 4.79999999999999988e-18 < x < 3.40000000000000007e78

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+61}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-110}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq -5.6 \cdot 10^{-149}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+78}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 5: 54.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq -6.4 \cdot 10^{-108}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq -1.8 \cdot 10^{-147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.45 \cdot 10^{-18}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 3.3 \cdot 10^{+78}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.9e60 or 3.3e78 < x

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

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

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

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

    if -2.9e60 < x < -6.3999999999999999e-108 or -1.80000000000000006e-147 < x < 3.4500000000000001e-18

    1. Initial program 99.9%

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

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

    if -6.3999999999999999e-108 < x < -1.80000000000000006e-147 or 3.4500000000000001e-18 < x < 3.3e78

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{z - t}{y}}} \]
    6. Applied egg-rr68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{-108}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-147}:\\ \;\;\;\;\frac{-60}{\frac{z - t}{y}}\\ \mathbf{elif}\;x \leq 3.45 \cdot 10^{-18}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{+78}:\\ \;\;\;\;\frac{-60}{\frac{z - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 6: 53.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+54}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -2.1 \cdot 10^{-63}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.29999999999999994e54 or 1.3000000000000001e77 < y

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

    if -2.29999999999999994e54 < y < -0.47999999999999998 or -2.1e-63 < y < 1.3000000000000001e77

    1. Initial program 99.2%

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

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

    if -0.47999999999999998 < y < -2.1e-63

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
    6. Simplified80.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;y \leq -0.48:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-63}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+77}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]

Alternative 7: 83.9% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.6e17 or 8.8e18 < t

    1. Initial program 98.9%

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

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

    if -5.6e17 < t < 8.8e18

    1. Initial program 99.8%

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

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

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

Alternative 8: 88.9% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -960 or 1.7499999999999999e75 < x

    1. Initial program 98.9%

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

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

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

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

    if -960 < x < 1.7499999999999999e75

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -960 \lor \neg \left(x \leq 1.75 \cdot 10^{+75}\right):\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \end{array} \]

Alternative 9: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{60}{z - t} \cdot \left(x - y\right) + 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(Float64(60.0 / 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[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 10: 51.1% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.85 \cdot 10^{+282}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.20000000000000001e121 or 2.50000000000000002e159 < x < 1.8500000000000001e282

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
    6. Simplified83.5%

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

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

    if -2.20000000000000001e121 < x < 2.50000000000000002e159

    1. Initial program 99.8%

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

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

    if 1.8500000000000001e282 < x

    1. Initial program 86.3%

      \[\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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr100.0%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
    6. Simplified73.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+121}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{+159}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{+282}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \end{array} \]

Alternative 11: 49.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+47} \lor \neg \left(y \leq 2.7 \cdot 10^{+200}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.50000000000000015e47 or 2.70000000000000016e200 < y

    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}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    3. Applied egg-rr99.7%

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

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

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

    if -3.50000000000000015e47 < y < 2.70000000000000016e200

    1. Initial program 99.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+47} \lor \neg \left(y \leq 2.7 \cdot 10^{+200}\right):\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 12: 51.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+119} \lor \neg \left(x \leq 5 \cdot 10^{+159}\right):\\
\;\;\;\;60 \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.80000000000000001e119 or 5.00000000000000003e159 < x

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

    if -1.80000000000000001e119 < x < 5.00000000000000003e159

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+119} \lor \neg \left(x \leq 5 \cdot 10^{+159}\right):\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 13: 50.3% accurate, 4.3× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 99.4%

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  3. Final simplification43.7%

    \[\leadsto a \cdot 120 \]

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 2023311 
(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)))