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

Percentage Accurate: 99.3% → 99.8%
Time: 15.8s
Alternatives: 11
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 11 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.3% 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, \left(x - y\right) \cdot \frac{60}{z - t}\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (fma a 120.0 (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return fma(a, 120.0, ((x - y) * (60.0 / (z - t))));
}
function code(x, y, z, t, a)
	return fma(a, 120.0, Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))))
end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

      \[\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) \]
    4. *-commutative99.8%

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

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

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

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

\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+143} \lor \neg \left(t_1 \leq 10^{+28}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}} + 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)) < -2e143 or 9.99999999999999958e27 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

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

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

    if -2e143 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 9.99999999999999958e27

    1. Initial program 99.8%

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

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

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

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

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

Alternative 3: 74.7% 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 -0.0002 \lor \neg \left(t_1 \leq 10^{+16}\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 -0.0002) (not (<= t_1 1e+16)))
     (* 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 <= -0.0002) || !(t_1 <= 1e+16)) {
		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 <= (-0.0002d0)) .or. (.not. (t_1 <= 1d+16))) 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 <= -0.0002) || !(t_1 <= 1e+16)) {
		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 <= -0.0002) or not (t_1 <= 1e+16):
		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 <= -0.0002) || !(t_1 <= 1e+16))
		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 <= -0.0002) || ~((t_1 <= 1e+16)))
		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, -0.0002], N[Not[LessEqual[t$95$1, 1e+16]], $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 -0.0002 \lor \neg \left(t_1 \leq 10^{+16}\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)) < -2.0000000000000001e-4 or 1e16 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

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

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

    if -2.0000000000000001e-4 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 1e16

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

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

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

Alternative 4: 53.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;z - t \leq -1 \cdot 10^{+108} \lor \neg \left(z - t \leq -5 \cdot 10^{+66}\right) \land z - t \leq 5 \cdot 10^{+110}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -1.9999999999999999e159 or -1e108 < (-.f64 z t) < -4.99999999999999991e66 or 4.99999999999999978e110 < (-.f64 z t)

    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 z around inf 75.5%

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

    if -1.9999999999999999e159 < (-.f64 z t) < -1e108 or -4.99999999999999991e66 < (-.f64 z t) < 4.99999999999999978e110

    1. Initial program 99.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;z - t \leq -1 \cdot 10^{+108} \lor \neg \left(z - t \leq -5 \cdot 10^{+66}\right) \land z - t \leq 5 \cdot 10^{+110}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 5: 53.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;z - t \leq -1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\

\mathbf{elif}\;z - t \leq -5 \cdot 10^{+66}:\\
\;\;\;\;a \cdot 120\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 z t) < -1.9999999999999999e159 or -1e108 < (-.f64 z t) < -4.99999999999999991e66 or 4.99999999999999978e110 < (-.f64 z t)

    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 z around inf 75.5%

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

    if -1.9999999999999999e159 < (-.f64 z t) < -1e108

    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. Taylor expanded in a around 0 87.4%

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

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

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

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

    if -4.99999999999999991e66 < (-.f64 z t) < 4.99999999999999978e110

    1. Initial program 98.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;z - t \leq -1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\ \mathbf{elif}\;z - t \leq -5 \cdot 10^{+66}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;z - t \leq 5 \cdot 10^{+110}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 6: 89.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+101} \lor \neg \left(y \leq 9.5 \cdot 10^{+76}\right):\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05e101 or 9.5000000000000003e76 < y

    1. Initial program 99.8%

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

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

    if -1.05e101 < y < 9.5000000000000003e76

    1. Initial program 98.6%

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

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

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

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

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

Alternative 7: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.59999999999999994e-63 or 6.4999999999999994e-61 < a

    1. Initial program 99.2%

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

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

    if -1.59999999999999994e-63 < a < -8.4999999999999998e-226

    1. Initial program 99.5%

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

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

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

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

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

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

    if -8.4999999999999998e-226 < a < 6.4999999999999994e-61

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-63}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-226}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-61}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 9: 50.8% accurate, 1.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.49999999999999949e-64 or 7.20000000000000015e-68 < a

    1. Initial program 99.2%

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

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

    if -7.49999999999999949e-64 < a < -1.9000000000000001e-225

    1. Initial program 99.5%

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

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

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

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

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

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

    if -1.9000000000000001e-225 < a < 7.20000000000000015e-68

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{-64}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.9 \cdot 10^{-225}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-68}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 10: 49.8% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-8} \lor \neg \left(a \leq 2.3 \cdot 10^{-65}\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 < -2e-8 or 2.3e-65 < a

    1. Initial program 99.2%

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

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

    if -2e-8 < a < 2.3e-65

    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}{\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 a around 0 87.0%

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

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

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

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  5. Final simplification47.8%

    \[\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 2023280 
(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)))