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

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

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(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 98.6%

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

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

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

      \[\leadsto \color{blue}{a \cdot 120 + 60 \cdot \frac{x - y}{z - t}} \]
    2. fma-define99.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. Add Preprocessing

Alternative 2: 72.1% accurate, 0.4× speedup?

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

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

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

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

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


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

    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 \]
    3. Simplified99.9%

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

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

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

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

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

    if -3.99999999999999999e-73 < (*.f64 a #s(literal 120 binary64)) < 3.99999999999999978e-20

    1. Initial program 98.7%

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

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

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

        \[\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 a around 0 81.6%

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

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

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

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

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

    if 3.99999999999999978e-20 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000004e121

    1. Initial program 96.2%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 75.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/75.2%

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e121 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.0%

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

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

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

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

Alternative 3: 70.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{+142}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\

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


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

    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 \]
    3. Simplified99.9%

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

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

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

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

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

    if -3.99999999999999999e-73 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e57

    1. Initial program 98.0%

      \[\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 a around 0 79.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
    10. Step-by-step derivation
      1. clear-num79.7%

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - t}{60}}} \]
      3. div-inv79.8%

        \[\leadsto \frac{x - y}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} \]
      4. metadata-eval79.8%

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

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

    if 2.0000000000000001e57 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000005e142

    1. Initial program 95.4%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    7. Taylor expanded in y around 0 83.1%

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

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

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

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

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

    if 1.00000000000000005e142 < (*.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 93.8%

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

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

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

Alternative 4: 70.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{+142}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\

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


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

    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 \]
    3. Simplified99.9%

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

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

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

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

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

    if -3.99999999999999999e-73 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e57

    1. Initial program 98.0%

      \[\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 a around 0 79.7%

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

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

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

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

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

    if 2.0000000000000001e57 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000005e142

    1. Initial program 95.4%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    7. Taylor expanded in y around 0 83.1%

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

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

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

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

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

    if 1.00000000000000005e142 < (*.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 93.8%

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

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

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

Alternative 5: 70.6% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{+142}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\

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


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

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

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

    if -5.0000000000000002e-84 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e57

    1. Initial program 98.0%

      \[\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 a around 0 79.5%

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    8. Step-by-step derivation
      1. *-commutative79.5%

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

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

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

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

    if 2.0000000000000001e57 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000005e142

    1. Initial program 95.4%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    7. Taylor expanded in y around 0 83.1%

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

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

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

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

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

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

Alternative 6: 56.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{-111}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq -5 \cdot 10^{-226}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.90000000000000002e-111 or 1.12000000000000006e55 < a

    1. Initial program 99.2%

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

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

    if -2.90000000000000002e-111 < a < -4.9999999999999998e-226 or 6.4000000000000003e-113 < a < 1.12000000000000006e55

    1. Initial program 96.4%

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

        \[\leadsto \color{blue}{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 x around inf 58.3%

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

    if -4.9999999999999998e-226 < a < 6.4000000000000003e-113

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
    12. Simplified51.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-111}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-226}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-113}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 56.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{-97}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq -3.15 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.3999999999999998e-97 or 1.12000000000000006e55 < a

    1. Initial program 99.2%

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

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

    if -4.3999999999999998e-97 < a < -3.1499999999999997e-235 or 1.7000000000000001e-113 < a < 1.12000000000000006e55

    1. Initial program 96.5%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z - t}\right)} \]
    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 x around inf 58.1%

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

    if -3.1499999999999997e-235 < a < 1.7000000000000001e-113

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{-97}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.15 \cdot 10^{-235}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-113}:\\ \;\;\;\;y \cdot \frac{-60}{z - t}\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 56.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;a \leq -3 \cdot 10^{-96}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq -5.8 \cdot 10^{-234}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3e-96 or 1.12000000000000006e55 < a

    1. Initial program 99.2%

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

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

    if -3e-96 < a < -5.80000000000000031e-234 or 7.5000000000000002e-112 < a < 1.12000000000000006e55

    1. Initial program 96.5%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z - t}\right)} \]
    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 x around inf 58.1%

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

    if -5.80000000000000031e-234 < a < 7.5000000000000002e-112

    1. Initial program 99.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{-96}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-234}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-112}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{+55}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 79.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

    if -3.99999999999999999e-73 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e57

    1. Initial program 98.0%

      \[\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 a around 0 79.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
    10. Step-by-step derivation
      1. clear-num79.7%

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - t}{60}}} \]
      3. div-inv79.8%

        \[\leadsto \frac{x - y}{\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}} \]
      4. metadata-eval79.8%

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

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

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

Alternative 10: 73.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-11} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{+57}\right):\\ \;\;\;\;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) -1e-11) (not (<= (* a 120.0) 2e+57)))
   (* 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) <= -1e-11) || !((a * 120.0) <= 2e+57)) {
		tmp = 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) <= (-1d-11)) .or. (.not. ((a * 120.0d0) <= 2d+57))) then
        tmp = 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) <= -1e-11) || !((a * 120.0) <= 2e+57)) {
		tmp = 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) <= -1e-11) or not ((a * 120.0) <= 2e+57):
		tmp = 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) <= -1e-11) || !(Float64(a * 120.0) <= 2e+57))
		tmp = 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) <= -1e-11) || ~(((a * 120.0) <= 2e+57)))
		tmp = 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], -1e-11], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+57]], $MachinePrecision]], N[(a * 120.0), $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 -1 \cdot 10^{-11} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{+57}\right):\\
\;\;\;\;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)) < -9.99999999999999939e-12 or 2.0000000000000001e57 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.1%

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

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

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

    if -9.99999999999999939e-12 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e57

    1. Initial program 98.2%

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

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

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

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

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

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

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

Alternative 11: 89.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.69999999999999985e105 or 2.4e19 < x

    1. Initial program 97.1%

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

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

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

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

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

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

    if -3.69999999999999985e105 < x < 2.4e19

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

      \[\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 -3.7 \cdot 10^{+105} \lor \neg \left(x \leq 2.4 \cdot 10^{+19}\right):\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 73.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-14} \lor \neg \left(a \leq 1.12 \cdot 10^{+55}\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 -4.6e-14) (not (<= a 1.12e+55)))
   (* 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 <= -4.6e-14) || !(a <= 1.12e+55)) {
		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 <= (-4.6d-14)) .or. (.not. (a <= 1.12d+55))) 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 <= -4.6e-14) || !(a <= 1.12e+55)) {
		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 <= -4.6e-14) or not (a <= 1.12e+55):
		tmp = a * 120.0
	else:
		tmp = 60.0 * ((x - y) / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -4.6e-14) || !(a <= 1.12e+55))
		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 <= -4.6e-14) || ~((a <= 1.12e+55)))
		tmp = a * 120.0;
	else
		tmp = 60.0 * ((x - y) / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.6e-14], N[Not[LessEqual[a, 1.12e+55]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{-14} \lor \neg \left(a \leq 1.12 \cdot 10^{+55}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.59999999999999996e-14 or 1.12000000000000006e55 < a

    1. Initial program 99.1%

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

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

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

    if -4.59999999999999996e-14 < a < 1.12000000000000006e55

    1. Initial program 98.2%

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

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

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

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

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

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

Alternative 13: 57.6% accurate, 0.8× speedup?

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

    1. Initial program 98.6%

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

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

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

    if -2.65e-76 < a < 6.4999999999999997e-56

    1. Initial program 98.7%

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

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

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

Alternative 14: 49.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-148} \lor \neg \left(z \leq 4 \cdot 10^{-264}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.2000000000000005e-148 or 4e-264 < z

    1. Initial program 98.9%

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

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

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

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

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

    if -8.2000000000000005e-148 < z < 4e-264

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

Alternative 15: 51.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-86} \lor \neg \left(a \leq 3.7 \cdot 10^{-215}\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 < -8.00000000000000068e-86 or 3.70000000000000009e-215 < a

    1. Initial program 98.8%

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

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

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

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

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

    if -8.00000000000000068e-86 < a < 3.70000000000000009e-215

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

Alternative 16: 99.8% accurate, 1.0× speedup?

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

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

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

      \[\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. Add Preprocessing

Alternative 17: 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 98.6%

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

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

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

Alternative 18: 50.6% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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