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

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

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

Initial Program: 99.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 73.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+85} \lor \neg \left(a \cdot 120 \leq 0.2\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4.0000000000000001e85 or 0.20000000000000001 < (*.f64 a #s(literal 120 binary64))

    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 \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e85 < (*.f64 a #s(literal 120 binary64)) < 0.20000000000000001

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

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

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

Alternative 3: 72.3% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e85 < (*.f64 a #s(literal 120 binary64)) < 4e18

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

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

    if 4e18 < (*.f64 a #s(literal 120 binary64))

    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. Taylor expanded in x around 0 95.8%

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}} + a \cdot 120 \]
      5. remove-double-neg95.8%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{t + \left(-z\right)}} + a \cdot 120 \]
      7. sub-neg95.8%

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

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

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

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

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

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

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

Alternative 4: 82.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+122} \lor \neg \left(x \leq 1.55 \cdot 10^{+177}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8000000000000004e122 or 1.55e177 < x

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{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. Taylor expanded in a around 0 74.6%

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

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      2. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    7. Applied egg-rr74.8%

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

    if -4.8000000000000004e122 < x < 1.55e177

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{-\color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      4. distribute-neg-in90.1%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}} + a \cdot 120 \]
      5. remove-double-neg90.1%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{t + \left(-z\right)}} + a \cdot 120 \]
      7. sub-neg90.1%

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

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

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

Alternative 5: 90.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+46}:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{t - z}{y}}\\

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

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


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

    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. Taylor expanded in x around 0 90.8%

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}} + a \cdot 120 \]
      5. remove-double-neg90.8%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{t + \left(-z\right)}} + a \cdot 120 \]
      7. sub-neg90.8%

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{t - z}{y}}} + a \cdot 120 \]
      2. un-div-inv90.9%

        \[\leadsto \color{blue}{\frac{60}{\frac{t - z}{y}}} + a \cdot 120 \]
    9. Applied egg-rr90.9%

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

    if -1.2599999999999999e46 < y < 1.2e24

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

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

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

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

    if 1.2e24 < y

    1. Initial program 98.2%

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

        \[\leadsto \color{blue}{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. Taylor expanded in x around 0 85.6%

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

        \[\leadsto 60 \cdot \color{blue}{\left(-\frac{y}{z - t}\right)} + a \cdot 120 \]
      2. distribute-neg-frac285.6%

        \[\leadsto 60 \cdot \color{blue}{\frac{y}{-\left(z - t\right)}} + a \cdot 120 \]
      3. sub-neg85.6%

        \[\leadsto 60 \cdot \frac{y}{-\color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      4. distribute-neg-in85.6%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}} + a \cdot 120 \]
      5. remove-double-neg85.6%

        \[\leadsto 60 \cdot \frac{y}{\left(-z\right) + \color{blue}{t}} + a \cdot 120 \]
      6. +-commutative85.6%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{t + \left(-z\right)}} + a \cdot 120 \]
      7. sub-neg85.6%

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

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

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

Alternative 6: 58.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-99} \lor \neg \left(a \leq 2.4 \cdot 10^{-20}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.10000000000000002e-99 or 2.39999999999999993e-20 < a

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000002e-99 < a < 2.39999999999999993e-20

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{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. Taylor expanded in a around inf 80.8%

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

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

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

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

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

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

Alternative 7: 50.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+119} \lor \neg \left(x \leq 2.3 \cdot 10^{+231}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8e119 or 2.29999999999999999e231 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if -4.8e119 < x < 2.29999999999999999e231

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 50.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 5 \cdot 10^{+231}:\\
\;\;\;\;a \cdot 120\\

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


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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000002e119 < x < 5.00000000000000028e231

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000028e231 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 50.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 2.75 \cdot 10^{+231}:\\
\;\;\;\;a \cdot 120\\

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


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

    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. Taylor expanded in a around inf 81.1%

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

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

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

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

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

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

        \[\leadsto a \cdot \left(120 + \frac{\color{blue}{x \cdot -60}}{a \cdot t}\right) \]
      3. times-frac32.1%

        \[\leadsto a \cdot \left(120 + \color{blue}{\frac{x}{a} \cdot \frac{-60}{t}}\right) \]
    11. Simplified32.1%

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
      2. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{x \cdot -60}}{t} \]
      3. associate-*r/50.3%

        \[\leadsto \color{blue}{x \cdot \frac{-60}{t}} \]
    14. Simplified50.3%

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

    if -1.3e119 < x < 2.75e231

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.75e231 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+119}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{+231}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 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.4%

    \[\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. clear-num99.7%

      \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    2. un-div-inv99.8%

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

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

Alternative 11: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 12: 50.8% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification50.2%

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