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

Percentage Accurate: 99.3% → 99.8%
Time: 14.2s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 99.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

      \[\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)} \]
  6. Applied egg-rr99.9%

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)
\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.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. Add Preprocessing

Alternative 3: 82.2% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000011e-47 or 5.0000000000000002e-167 < (*.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 84.1%

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

    if -5.00000000000000011e-47 < (*.f64 a #s(literal 120 binary64)) < 5.0000000000000002e-167

    1. Initial program 99.7%

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

        \[\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 \]
    4. Applied egg-rr99.8%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative86.1%

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} \]
      3. associate-/l*86.1%

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

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

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

Alternative 4: 75.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+53} \lor \neg \left(a \cdot 120 \leq 100000\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) -1e+53) (not (<= (* a 120.0) 100000.0)))
   (* 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+53) || !((a * 120.0) <= 100000.0)) {
		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) <= (-1d+53)) .or. (.not. ((a * 120.0d0) <= 100000.0d0))) 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) <= -1e+53) || !((a * 120.0) <= 100000.0)) {
		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) <= -1e+53) or not ((a * 120.0) <= 100000.0):
		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) <= -1e+53) || !(Float64(a * 120.0) <= 100000.0))
		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) <= -1e+53) || ~(((a * 120.0) <= 100000.0)))
		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], -1e+53], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 100000.0]], $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 -1 \cdot 10^{+53} \lor \neg \left(a \cdot 120 \leq 100000\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)) < -9.9999999999999999e52 or 1e5 < (*.f64 a #s(literal 120 binary64))

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

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

    if -9.9999999999999999e52 < (*.f64 a #s(literal 120 binary64)) < 1e5

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

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

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

Alternative 5: 74.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

    if -9.9999999999999999e52 < (*.f64 a #s(literal 120 binary64)) < 1e5

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

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 6: 58.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 9 \cdot 10^{-148}:\\
\;\;\;\;\frac{y \cdot -60}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3499999999999999e-58 or 9.00000000000000029e-148 < 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 72.5%

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

    if -1.3499999999999999e-58 < a < -1.75000000000000005e-227

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{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)} \]
    6. Applied egg-rr99.9%

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

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

    if -1.75000000000000005e-227 < a < 9.00000000000000029e-148

    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)} \]
    6. Applied egg-rr99.7%

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      2. *-commutative62.8%

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} \]
    9. Simplified62.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{-58}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-227}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-148}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 2.2 \cdot 10^{-148}:\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.49999999999999951e-69 or 2.20000000000000017e-148 < 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 72.5%

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

    if -6.49999999999999951e-69 < a < -8.2000000000000003e-230

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{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)} \]
    6. Applied egg-rr99.9%

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

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

    if -8.2000000000000003e-230 < a < 2.20000000000000017e-148

    1. Initial program 99.7%

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

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

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

        \[\leadsto y \cdot \left(120 \cdot \frac{a}{y} - \color{blue}{\frac{60 \cdot 1}{z - t}}\right) \]
      2. metadata-eval72.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{-69}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -8.2 \cdot 10^{-230}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{-148}:\\ \;\;\;\;y \cdot \frac{-60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.1 \cdot 10^{-147}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.4e-57 or 1.1000000000000001e-147 < 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 72.5%

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

    if -1.4e-57 < a < -1.62e-229

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{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)} \]
    6. Applied egg-rr99.9%

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

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

    if -1.62e-229 < a < 1.1000000000000001e-147

    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)} \]
    6. Applied egg-rr99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{-57}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.62 \cdot 10^{-229}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-147}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.6e16 or 1.26e10 < 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.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 88.1%

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

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

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

    if -6.6e16 < x < 1.26e10

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

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

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

Alternative 10: 77.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+59} \lor \neg \left(z \leq 5.5 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{y \cdot -60}{z} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999959e59 or 5.4999999999999996e-9 < z

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

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

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

    if -4.49999999999999959e59 < z < 5.4999999999999996e-9

    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 z around 0 82.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 77.7% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-23}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t} + a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.40000000000000006e59

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

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

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

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z + \left(-t\right)}} + a \cdot 120 \]
      3. add-sqr-sqrt38.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z + t} + a \cdot 120 \]
      3. associate-*r/81.6%

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

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

    if -3.40000000000000006e59 < z < 1.99999999999999992e-23

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{1} \cdot \frac{-60}{t}} + a \cdot 120 \]
      5. /-rgt-identity82.3%

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

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

    if 1.99999999999999992e-23 < z

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+59}:\\ \;\;\;\;y \cdot \frac{-60}{z + t} + a \cdot 120\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot -60}{z} + a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 77.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.40000000000000006e59

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

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

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

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z + \left(-t\right)}} + a \cdot 120 \]
      3. add-sqr-sqrt38.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z + t} + a \cdot 120 \]
      3. associate-*r/81.6%

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

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

    if -3.40000000000000006e59 < z < 1.09999999999999996e-12

    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 z around 0 82.2%

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

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

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

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

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

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

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

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

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

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

    if 1.09999999999999996e-12 < z

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

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

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

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

Alternative 13: 52.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+244}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

\mathbf{elif}\;y \leq -6.8 \cdot 10^{+180}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+158}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.8e244

    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)} \]
    6. Applied egg-rr99.9%

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

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

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

    if -1.8e244 < y < -6.79999999999999969e180

    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)} \]
    6. Applied egg-rr99.8%

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

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

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

    if -6.79999999999999969e180 < y < 1.2499999999999999e158

    1. Initial program 99.8%

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

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

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

    if 1.2499999999999999e158 < y

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{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)} \]
    6. Applied egg-rr99.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
    10. Simplified46.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+244}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{+180}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+158}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot -60}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 52.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -3.8 \cdot 10^{+180}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+158}:\\
\;\;\;\;a \cdot 120\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.40000000000000012e242 or 2.05000000000000002e158 < y

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{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)} \]
    6. Applied egg-rr99.7%

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

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

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

    if -2.40000000000000012e242 < y < -3.8e180

    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)} \]
    6. Applied egg-rr99.8%

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

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

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

    if -3.8e180 < y < 2.05000000000000002e158

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+242}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{+180}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+158}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 59.1% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.20000000000000012e-88 or 1.1000000000000001e-147 < 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 70.1%

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

    if -3.20000000000000012e-88 < a < 1.1000000000000001e-147

    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)} \]
    6. Applied egg-rr99.8%

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

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

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

Alternative 16: 53.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{-108} \lor \neg \left(a \leq 1.15 \cdot 10^{-178}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.3000000000000002e-108 or 1.14999999999999997e-178 < 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 65.9%

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

    if -3.3000000000000002e-108 < a < 1.14999999999999997e-178

    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)} \]
    6. Applied egg-rr99.7%

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

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

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

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

Alternative 17: 52.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-118} \lor \neg \left(a \leq 4.3 \cdot 10^{-169}\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 < -2.30000000000000021e-118 or 4.29999999999999984e-169 < 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 66.6%

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

    if -2.30000000000000021e-118 < a < 4.29999999999999984e-169

    1. Initial program 99.7%

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

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

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

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

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

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

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

Alternative 18: 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 19: 51.0% 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.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 51.2%

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification51.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 2024145 
(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)))