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

Percentage Accurate: 99.4% → 99.8%
Time: 20.4s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

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

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

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

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

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

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

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

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

Alternative 2: 75.1% accurate, 0.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -5 or 1e7 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 97.8%

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

        \[\leadsto \color{blue}{\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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

    if -5 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 1e7

    1. Initial program 99.9%

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

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

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

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

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

Alternative 3: 56.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 8 \cdot 10^{-100}:\\
\;\;\;\;a \cdot 120\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.95000000000000006e92 or 3.90000000000000002e148 < x

    1. Initial program 97.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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

    if -1.95000000000000006e92 < x < 8.0000000000000002e-100 or 4.39999999999999971e-82 < x < 3.90000000000000002e148

    1. Initial program 99.3%

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

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

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

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

    if 8.0000000000000002e-100 < x < 4.39999999999999971e-82

    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*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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+92}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-100}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-82}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{+148}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 4: 56.8% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-82}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

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

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.6%

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

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

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

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

    if -1.32000000000000003e94 < x < 4.8000000000000005e-100 or 5.4999999999999998e-82 < x < 4.2000000000000004e140

    1. Initial program 99.3%

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

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

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

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

    if 4.8000000000000005e-100 < x < 5.4999999999999998e-82

    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*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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

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

    if 4.2000000000000004e140 < x

    1. Initial program 94.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x}}} \]
    9. Applied egg-rr79.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.32 \cdot 10^{+94}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-100}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-82}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+140}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x}}\\ \end{array} \]

Alternative 5: 56.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 8 \cdot 10^{-100}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 4.6 \cdot 10^{-82}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

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

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.6%

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

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

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

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

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

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

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

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

    if -1.0499999999999999e93 < x < 8.0000000000000002e-100 or 4.59999999999999994e-82 < x < 1.86e140

    1. Initial program 99.3%

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

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

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

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

    if 8.0000000000000002e-100 < x < 4.59999999999999994e-82

    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*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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

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

    if 1.86e140 < x

    1. Initial program 94.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x}}} \]
    9. Applied egg-rr79.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+93}:\\ \;\;\;\;\frac{x \cdot 60}{z - t}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-100}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-82}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;x \leq 1.86 \cdot 10^{+140}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x}}\\ \end{array} \]

Alternative 6: 87.8% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.6000000000000002e78 or 1.7999999999999999e-65 < x

    1. Initial program 98.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. Taylor expanded in x around inf 91.1%

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

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

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

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

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

    if -3.6000000000000002e78 < x < 1.7999999999999999e-65

    1. Initial program 99.1%

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

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

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

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

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

Alternative 7: 87.8% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.99999999999999993e77 or 1.99999999999999985e-65 < x

    1. Initial program 98.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. Taylor expanded in x around inf 91.1%

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

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

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

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

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

    if -3.99999999999999993e77 < x < 1.99999999999999985e-65

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

Alternative 8: 82.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.0000000000000004e90

    1. Initial program 99.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.6%

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

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

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

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

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

    if -5.0000000000000004e90 < x < 2.7499999999999999e147

    1. Initial program 99.3%

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

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

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

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

    if 2.7499999999999999e147 < x

    1. Initial program 94.8%

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+90}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{+147}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \]

Alternative 9: 87.7% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.5999999999999999e77

    1. Initial program 99.8%

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

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

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

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

    if -4.5999999999999999e77 < x < 1.99999999999999985e-65

    1. Initial program 99.1%

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

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

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

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

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

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

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

    if 1.99999999999999985e-65 < x

    1. Initial program 97.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{x \cdot 60}{z - t} + a \cdot 120\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-65}:\\ \;\;\;\;\frac{-60}{\frac{z - t}{y}} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{60}{z - t} + a \cdot 120\\ \end{array} \]

Alternative 10: 50.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-93}:\\
\;\;\;\;a \cdot 120\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.09999999999999979e99 or 1.80000000000000003e148 < x

    1. Initial program 97.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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

    if -4.09999999999999979e99 < x < 3.9999999999999996e-93 or 4.39999999999999971e-82 < x < 1.80000000000000003e148

    1. Initial program 99.3%

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

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

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

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

    if 3.9999999999999996e-93 < x < 4.39999999999999971e-82

    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*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. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{-1 \cdot \left(x - y\right)}{t}} \]
      2. mul-1-neg99.7%

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

      \[\leadsto 60 \cdot \color{blue}{\frac{-\left(x - y\right)}{t}} \]
    10. Taylor expanded in x around 0 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+99}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-93}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-82}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \end{array} \]

Alternative 11: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 12: 56.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+237} \lor \neg \left(y \leq 3.4 \cdot 10^{+192}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.80000000000000007e237 or 3.39999999999999996e192 < y

    1. Initial program 95.8%

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

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    9. Taylor expanded in x around 0 75.4%

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

    if -1.80000000000000007e237 < y < 3.39999999999999996e192

    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}{\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. Taylor expanded in z around inf 55.3%

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

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

Alternative 13: 50.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -9.8 \cdot 10^{-61} \lor \neg \left(a \leq 3.7 \cdot 10^{-131}\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 -9.8e-61) (not (<= a 3.7e-131)))
   (* a 120.0)
   (* 60.0 (/ (- x) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -9.8e-61) || !(a <= 3.7e-131)) {
		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 <= (-9.8d-61)) .or. (.not. (a <= 3.7d-131))) 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 <= -9.8e-61) || !(a <= 3.7e-131)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * (-x / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -9.8e-61) or not (a <= 3.7e-131):
		tmp = a * 120.0
	else:
		tmp = 60.0 * (-x / t)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -9.8e-61) || !(a <= 3.7e-131))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(Float64(-x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -9.8e-61) || ~((a <= 3.7e-131)))
		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, -9.8e-61], N[Not[LessEqual[a, 3.7e-131]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[((-x) / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{-61} \lor \neg \left(a \leq 3.7 \cdot 10^{-131}\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 < -9.80000000000000004e-61 or 3.7000000000000002e-131 < a

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

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

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

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

    if -9.80000000000000004e-61 < a < 3.7000000000000002e-131

    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.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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.6%

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

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

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/30.2%

        \[\leadsto 60 \cdot \color{blue}{\frac{-1 \cdot x}{t}} \]
      2. neg-mul-130.2%

        \[\leadsto 60 \cdot \frac{\color{blue}{-x}}{t} \]
    10. Simplified30.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.8 \cdot 10^{-61} \lor \neg \left(a \leq 3.7 \cdot 10^{-131}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{-x}{t}\\ \end{array} \]

Alternative 14: 50.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+99} \lor \neg \left(x \leq 4.2 \cdot 10^{+151}\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 -4.5e+99) (not (<= x 4.2e+151))) (* 60.0 (/ x z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x <= -4.5e+99) || !(x <= 4.2e+151)) {
		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 <= (-4.5d+99)) .or. (.not. (x <= 4.2d+151))) 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 <= -4.5e+99) || !(x <= 4.2e+151)) {
		tmp = 60.0 * (x / z);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (x <= -4.5e+99) or not (x <= 4.2e+151):
		tmp = 60.0 * (x / z)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((x <= -4.5e+99) || !(x <= 4.2e+151))
		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 <= -4.5e+99) || ~((x <= 4.2e+151)))
		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, -4.5e+99], N[Not[LessEqual[x, 4.2e+151]], $MachinePrecision]], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+99} \lor \neg \left(x \leq 4.2 \cdot 10^{+151}\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 < -4.5e99 or 4.2000000000000001e151 < x

    1. Initial program 97.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. Step-by-step derivation
      1. clear-num99.5%

        \[\leadsto \frac{60}{\color{blue}{\frac{1}{\frac{x - y}{z - t}}}} + a \cdot 120 \]
      2. associate-/r/99.7%

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

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

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

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

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

    if -4.5e99 < x < 4.2000000000000001e151

    1. Initial program 99.3%

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

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

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

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

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

Alternative 15: 50.2% accurate, 4.3× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 98.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}{\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. Taylor expanded in z around inf 49.2%

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

    \[\leadsto a \cdot 120 \]

Developer target: 99.7% accurate, 1.0× speedup?

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

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

Reproduce

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