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

Percentage Accurate: 99.3% → 99.8%
Time: 12.4s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.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, 1.0× speedup?

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

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

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

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

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

Alternative 2: 58.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-288}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 3.3 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.40000000000000003e-103 or 3.2999999999999999e-66 < a

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 70.0%

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

    if -3.40000000000000003e-103 < a < 2.3999999999999998e-288 or 7.60000000000000037e-165 < a < 3.2999999999999999e-66

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in y around inf 55.1%

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

    if 2.3999999999999998e-288 < a < 7.60000000000000037e-165

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in x around inf 77.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.4 \cdot 10^{-103}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-288}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{-165}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-66}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 55.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq 7.6 \cdot 10^{-285}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{-139}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.7000000000000001e-103 or 3.19999999999999982e-66 < a

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 70.0%

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

    if -2.7000000000000001e-103 < a < 7.6000000000000003e-285 or 9.2000000000000005e-139 < a < 3.19999999999999982e-66

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in y around inf 56.9%

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

    if 7.6000000000000003e-285 < a < 9.2000000000000005e-139

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in x around inf 71.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{-103}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{-285}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-139}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-66}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-100} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-162}\right):\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -1e-100 or 5.00000000000000014e-162 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.8%

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

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

    if -1e-100 < (*.f64 a #s(literal 120 binary64)) < 5.00000000000000014e-162

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 87.8%

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

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

Alternative 5: 71.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-40} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-53}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999993e-41 or 5e-53 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

    if -9.9999999999999993e-41 < (*.f64 a #s(literal 120 binary64)) < 5e-53

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 81.7%

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

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

Alternative 6: 71.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 10000:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999993e-41

    1. Initial program 99.9%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.9%

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

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

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

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

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

    if -9.9999999999999993e-41 < (*.f64 a #s(literal 120 binary64)) < 1e4

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 80.2%

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

    if 1e4 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

Alternative 7: 89.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.35000000000000001e-8 or 6.4000000000000001e101 < y

    1. Initial program 99.8%

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

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

    if -1.35000000000000001e-8 < y < 6.4000000000000001e101

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

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

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

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

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

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

Alternative 8: 52.0% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-102}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.69999999999999971e-198 or 9.50000000000000025e-102 < a

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 64.0%

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

    if -3.69999999999999971e-198 < a < 6.2000000000000002e-285

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in y around inf 61.7%

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

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

    if 6.2000000000000002e-285 < a < 9.50000000000000025e-102

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in x around inf 67.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.7 \cdot 10^{-198}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-285}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-102}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 74.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.06 \cdot 10^{-42} \lor \neg \left(a \leq 4.6 \cdot 10^{-28}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.0600000000000001e-42 or 4.59999999999999971e-28 < a

    1. Initial program 99.9%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 74.0%

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

    if -1.0600000000000001e-42 < a < 4.59999999999999971e-28

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 81.2%

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

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

Alternative 10: 52.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-227} \lor \neg \left(a \leq 10^{-101}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.19999999999999981e-227 or 1.00000000000000005e-101 < a

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 61.5%

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

    if -2.19999999999999981e-227 < a < 1.00000000000000005e-101

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in x around inf 53.6%

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

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

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

Alternative 11: 52.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+267} \lor \neg \left(y \leq 1.3 \cdot 10^{+201}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999999e267 or 1.29999999999999993e201 < y

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in y around inf 83.3%

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

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

    if -7.19999999999999999e267 < y < 1.29999999999999993e201

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 54.0%

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

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

Alternative 12: 52.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-156} \lor \neg \left(a \leq 2.4 \cdot 10^{-187}\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.5e-156) (not (<= a 2.4e-187)))
   (* a 120.0)
   (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -9.5e-156) || !(a <= 2.4e-187)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (x / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((a <= (-9.5d-156)) .or. (.not. (a <= 2.4d-187))) then
        tmp = a * 120.0d0
    else
        tmp = (-60.0d0) * (x / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -9.5e-156) || !(a <= 2.4e-187)) {
		tmp = a * 120.0;
	} else {
		tmp = -60.0 * (x / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -9.5e-156) or not (a <= 2.4e-187):
		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.5e-156) || !(a <= 2.4e-187))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(-60.0 * Float64(x / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -9.5e-156) || ~((a <= 2.4e-187)))
		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.5e-156], N[Not[LessEqual[a, 2.4e-187]], $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.5 \cdot 10^{-156} \lor \neg \left(a \leq 2.4 \cdot 10^{-187}\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.4999999999999994e-156 or 2.40000000000000013e-187 < a

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 62.8%

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

    if -9.4999999999999994e-156 < a < 2.40000000000000013e-187

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    7. Taylor expanded in x around inf 51.0%

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

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

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

Alternative 13: 50.5% accurate, 4.3× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in z around inf 48.8%

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

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

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

  :alt
  (! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))

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