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

Percentage Accurate: 99.3% → 99.8%
Time: 13.4s
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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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 99.0%

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

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

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

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

Alternative 2: 73.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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

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

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


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

    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 \]
      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 89.7%

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

    if -1.9999999999999999e175 < (*.f64 a #s(literal 120 binary64)) < -4.99999999999999986e58

    1. Initial program 99.9%

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

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

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

    if -4.99999999999999986e58 < (*.f64 a #s(literal 120 binary64)) < -2.0000000000000001e-26

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-26 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999953e-45

    1. Initial program 99.6%

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

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

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

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

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

    if 9.99999999999999953e-45 < (*.f64 a #s(literal 120 binary64))

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

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

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

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

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

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

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

Alternative 3: 72.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -5 \cdot 10^{+76}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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

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

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


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

    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 \]
      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 89.7%

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

    if -1.9999999999999999e175 < (*.f64 a #s(literal 120 binary64)) < -4.99999999999999991e76

    1. Initial program 99.9%

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

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

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

    if -4.99999999999999991e76 < (*.f64 a #s(literal 120 binary64)) < -1.00000000000000001e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e-41 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999953e-45

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 85.9%

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

    if 9.99999999999999953e-45 < (*.f64 a #s(literal 120 binary64))

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

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

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

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

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

      \[\leadsto \frac{60 \cdot x}{\color{blue}{z}} + a \cdot 120 \]
  3. Recombined 5 regimes into one program.
  4. Final simplification82.4%

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

Alternative 4: 73.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -5 \cdot 10^{+76}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z}\\

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

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

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


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

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

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

    if -1.9999999999999999e175 < (*.f64 a #s(literal 120 binary64)) < -4.99999999999999991e76

    1. Initial program 99.9%

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

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

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

    if -4.99999999999999991e76 < (*.f64 a #s(literal 120 binary64)) < -1.00000000000000001e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e-41 < (*.f64 a #s(literal 120 binary64)) < 5.00000000000000039e-44

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 86.0%

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

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

Alternative 5: 73.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -5 \cdot 10^{+76}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{-60}{z}\\

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

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

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


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

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

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

    if -1.9999999999999999e175 < (*.f64 a #s(literal 120 binary64)) < -4.99999999999999991e76

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

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

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

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

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

        \[\leadsto \frac{60}{\color{blue}{-\frac{z - t}{y}}} + a \cdot 120 \]
      2. distribute-neg-frac288.4%

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

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

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

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

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

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

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

    if -4.99999999999999991e76 < (*.f64 a #s(literal 120 binary64)) < -1.00000000000000001e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e-41 < (*.f64 a #s(literal 120 binary64)) < 5.00000000000000039e-44

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 86.0%

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

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

Alternative 6: 82.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -2 \cdot 10^{-32} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-61}\right):\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\

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


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

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

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

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

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

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} + a \cdot 120 \]
      3. times-frac88.6%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(z - t\right) \cdot 0.016666666666666666}} + a \cdot 120 \]
      4. *-rgt-identity88.6%

        \[\leadsto \frac{\color{blue}{x}}{\left(z - t\right) \cdot 0.016666666666666666} + a \cdot 120 \]
    7. Simplified88.6%

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

    if -2.00000000000000011e-32 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e-61

    1. Initial program 99.6%

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

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

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

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

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

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

Alternative 7: 74.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -2 \cdot 10^{-32} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-44}\right):\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 98.5%

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

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

    if -2.00000000000000011e-32 < (*.f64 a #s(literal 120 binary64)) < 5.00000000000000039e-44

    1. Initial program 99.6%

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

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

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

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

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

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

Alternative 8: 89.8% accurate, 0.6× speedup?

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

\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 < -7.0000000000000001e82 or 4.3000000000000002e89 < x

    1. Initial program 98.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} + a \cdot 120 \]
      3. times-frac91.6%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(z - t\right) \cdot 0.016666666666666666}} + a \cdot 120 \]
      4. *-rgt-identity91.6%

        \[\leadsto \frac{\color{blue}{x}}{\left(z - t\right) \cdot 0.016666666666666666} + a \cdot 120 \]
    7. Simplified91.6%

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

    if -7.0000000000000001e82 < x < 4.3000000000000002e89

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

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

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

Alternative 9: 84.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-39} \lor \neg \left(t \leq 3.2 \cdot 10^{-65}\right):\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.4000000000000001e-39 or 3.1999999999999999e-65 < t

    1. Initial program 98.5%

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

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

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

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

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

    if -1.4000000000000001e-39 < t < 3.1999999999999999e-65

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Alternative 10: 89.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+81}:\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} + a \cdot 120 \]
      3. times-frac92.2%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(z - t\right) \cdot 0.016666666666666666}} + a \cdot 120 \]
      4. *-rgt-identity92.2%

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

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

    if -1.65e81 < x < 1.75e89

    1. Initial program 99.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{60}{\color{blue}{-\frac{z - t}{y}}} + a \cdot 120 \]
      2. distribute-neg-frac293.5%

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

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

    if 1.75e89 < x

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

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

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

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

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

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

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

Alternative 11: 89.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.3 \cdot 10^{+81}:\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} + a \cdot 120 \]
      3. times-frac92.2%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(z - t\right) \cdot 0.016666666666666666}} + a \cdot 120 \]
      4. *-rgt-identity92.2%

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

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

    if -6.3000000000000004e81 < x < 1.64999999999999987e89

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

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

    if 1.64999999999999987e89 < x

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

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

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

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

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

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

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

Alternative 12: 51.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.4999999999999997e-82 or 6.5e-139 < a

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

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

    if -6.4999999999999997e-82 < a < -4.9999999999999999e-249

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-249 < a < 6.5e-139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x}{t}} \]
    10. Step-by-step derivation
      1. clear-num33.9%

        \[\leadsto -60 \cdot \color{blue}{\frac{1}{\frac{t}{x}}} \]
      2. un-div-inv33.9%

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x}}} \]
    11. Applied egg-rr33.9%

      \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x}}} \]
    12. Step-by-step derivation
      1. associate-/r/34.1%

        \[\leadsto \color{blue}{\frac{-60}{t} \cdot x} \]
    13. Simplified34.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{-82}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-249}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-139}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 51.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.49999999999999917e-81 or 1.15000000000000002e-132 < a

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

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

    if -9.49999999999999917e-81 < a < -2.9000000000000001e-248

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000001e-248 < a < 1.15000000000000002e-132

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-81}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.9 \cdot 10^{-248}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-132}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 57.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.1999999999999997e-36 or 2.39999999999999997e-130 < a

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

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

    if -6.1999999999999997e-36 < a < 2.39999999999999997e-130

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 58.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{-45} \lor \neg \left(a \leq 2 \cdot 10^{-105}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.6499999999999999e-45 or 1.99999999999999993e-105 < 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.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 72.3%

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

    if -2.6499999999999999e-45 < a < 1.99999999999999993e-105

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\frac{-120 \cdot a}{x}} - 60 \cdot \frac{1}{z - t}\right) \]
      4. *-commutative55.9%

        \[\leadsto \left(-x\right) \cdot \left(\frac{\color{blue}{a \cdot -120}}{x} - 60 \cdot \frac{1}{z - t}\right) \]
      5. associate-*r/56.0%

        \[\leadsto \left(-x\right) \cdot \left(\frac{a \cdot -120}{x} - \color{blue}{\frac{60 \cdot 1}{z - t}}\right) \]
      6. metadata-eval56.0%

        \[\leadsto \left(-x\right) \cdot \left(\frac{a \cdot -120}{x} - \frac{\color{blue}{60}}{z - t}\right) \]
    10. Simplified56.0%

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

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

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

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

Alternative 16: 51.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-46} \lor \neg \left(a \leq 5.1 \cdot 10^{-141}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.2000000000000004e-46 or 5.09999999999999977e-141 < a

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

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

    if -5.2000000000000004e-46 < a < 5.09999999999999977e-141

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 18: 50.2% accurate, 4.3× speedup?

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

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

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

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

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

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