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

Percentage Accurate: 99.5% → 99.8%
Time: 14.4s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 99.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right) \]

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
    2. fma-def99.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. Final simplification99.8%

    \[\leadsto \mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right) \]

Alternative 3: 74.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+141}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-6}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a 120) < -4.00000000000000007e141

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

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

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

    if -4.00000000000000007e141 < (*.f64 a 120) < -9.99999999999999955e-7 or 2.00000000000000009e93 < (*.f64 a 120)

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*92.6%

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

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

      \[\leadsto \frac{x}{\color{blue}{-0.016666666666666666 \cdot t}} + a \cdot 120 \]
    8. Step-by-step derivation
      1. *-commutative82.7%

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

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

    if -9.99999999999999955e-7 < (*.f64 a 120) < 1.00000000000000002e-46

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

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

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

    if 1.00000000000000002e-46 < (*.f64 a 120) < 1e85

    1. Initial program 99.9%

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

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

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

    if 1e85 < (*.f64 a 120) < 2.00000000000000009e93

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+141}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-6}:\\ \;\;\;\;a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-46}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 10^{+85}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+93}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\ \end{array} \]

Alternative 4: 74.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+141}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-6}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a 120) < -4.00000000000000007e141

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

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

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

    if -4.00000000000000007e141 < (*.f64 a 120) < -9.99999999999999955e-7 or 1e85 < (*.f64 a 120) < 1.99999999999999991e111

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*91.4%

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

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

      \[\leadsto \frac{x}{\color{blue}{-0.016666666666666666 \cdot t}} + a \cdot 120 \]
    8. Step-by-step derivation
      1. *-commutative78.3%

        \[\leadsto \frac{x}{\color{blue}{t \cdot -0.016666666666666666}} + a \cdot 120 \]
    9. Simplified78.3%

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

    if -9.99999999999999955e-7 < (*.f64 a 120) < 1.00000000000000002e-46

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

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

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

    if 1.00000000000000002e-46 < (*.f64 a 120) < 1e85

    1. Initial program 99.9%

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

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

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

    if 1.99999999999999991e111 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*94.1%

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

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

      \[\leadsto \frac{x}{\color{blue}{0.016666666666666666 \cdot z}} + a \cdot 120 \]
    8. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot 0.016666666666666666}} + a \cdot 120 \]
    9. Simplified87.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+141}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-6}:\\ \;\;\;\;a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-46}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 10^{+85}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+111}:\\ \;\;\;\;a \cdot 120 + \frac{x}{t \cdot -0.016666666666666666}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{x}{z \cdot 0.016666666666666666}\\ \end{array} \]

Alternative 5: 59.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x}{z - t}\\ t_2 := -60 \cdot \frac{y}{z - t}\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{-17}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-83}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-199}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-300}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.28 \cdot 10^{-11}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* 60.0 (/ x (- z t)))) (t_2 (* -60.0 (/ y (- z t)))))
   (if (<= a -1.25e-17)
     (* a 120.0)
     (if (<= a -2.3e-83)
       t_2
       (if (<= a -1.05e-157)
         t_1
         (if (<= a -1.75e-199)
           t_2
           (if (<= a -6e-300)
             t_1
             (if (<= a 1.28e-11) (* 60.0 (/ (- x y) z)) (* a 120.0)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * (x / (z - t));
	double t_2 = -60.0 * (y / (z - t));
	double tmp;
	if (a <= -1.25e-17) {
		tmp = a * 120.0;
	} else if (a <= -2.3e-83) {
		tmp = t_2;
	} else if (a <= -1.05e-157) {
		tmp = t_1;
	} else if (a <= -1.75e-199) {
		tmp = t_2;
	} else if (a <= -6e-300) {
		tmp = t_1;
	} else if (a <= 1.28e-11) {
		tmp = 60.0 * ((x - y) / z);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 60.0d0 * (x / (z - t))
    t_2 = (-60.0d0) * (y / (z - t))
    if (a <= (-1.25d-17)) then
        tmp = a * 120.0d0
    else if (a <= (-2.3d-83)) then
        tmp = t_2
    else if (a <= (-1.05d-157)) then
        tmp = t_1
    else if (a <= (-1.75d-199)) then
        tmp = t_2
    else if (a <= (-6d-300)) then
        tmp = t_1
    else if (a <= 1.28d-11) then
        tmp = 60.0d0 * ((x - y) / z)
    else
        tmp = a * 120.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * (x / (z - t));
	double t_2 = -60.0 * (y / (z - t));
	double tmp;
	if (a <= -1.25e-17) {
		tmp = a * 120.0;
	} else if (a <= -2.3e-83) {
		tmp = t_2;
	} else if (a <= -1.05e-157) {
		tmp = t_1;
	} else if (a <= -1.75e-199) {
		tmp = t_2;
	} else if (a <= -6e-300) {
		tmp = t_1;
	} else if (a <= 1.28e-11) {
		tmp = 60.0 * ((x - y) / z);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * (x / (z - t))
	t_2 = -60.0 * (y / (z - t))
	tmp = 0
	if a <= -1.25e-17:
		tmp = a * 120.0
	elif a <= -2.3e-83:
		tmp = t_2
	elif a <= -1.05e-157:
		tmp = t_1
	elif a <= -1.75e-199:
		tmp = t_2
	elif a <= -6e-300:
		tmp = t_1
	elif a <= 1.28e-11:
		tmp = 60.0 * ((x - y) / z)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(60.0 * Float64(x / Float64(z - t)))
	t_2 = Float64(-60.0 * Float64(y / Float64(z - t)))
	tmp = 0.0
	if (a <= -1.25e-17)
		tmp = Float64(a * 120.0);
	elseif (a <= -2.3e-83)
		tmp = t_2;
	elseif (a <= -1.05e-157)
		tmp = t_1;
	elseif (a <= -1.75e-199)
		tmp = t_2;
	elseif (a <= -6e-300)
		tmp = t_1;
	elseif (a <= 1.28e-11)
		tmp = Float64(60.0 * Float64(Float64(x - y) / z));
	else
		tmp = Float64(a * 120.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = 60.0 * (x / (z - t));
	t_2 = -60.0 * (y / (z - t));
	tmp = 0.0;
	if (a <= -1.25e-17)
		tmp = a * 120.0;
	elseif (a <= -2.3e-83)
		tmp = t_2;
	elseif (a <= -1.05e-157)
		tmp = t_1;
	elseif (a <= -1.75e-199)
		tmp = t_2;
	elseif (a <= -6e-300)
		tmp = t_1;
	elseif (a <= 1.28e-11)
		tmp = 60.0 * ((x - y) / z);
	else
		tmp = a * 120.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e-17], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -2.3e-83], t$95$2, If[LessEqual[a, -1.05e-157], t$95$1, If[LessEqual[a, -1.75e-199], t$95$2, If[LessEqual[a, -6e-300], t$95$1, If[LessEqual[a, 1.28e-11], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -1.05 \cdot 10^{-157}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -1.75 \cdot 10^{-199}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -6 \cdot 10^{-300}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.28 \cdot 10^{-11}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.25e-17 or 1.28e-11 < a

    1. Initial program 99.8%

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

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

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

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

    if -1.25e-17 < a < -2.2999999999999999e-83 or -1.05e-157 < a < -1.7499999999999999e-199

    1. Initial program 99.5%

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

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

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

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

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

    if -2.2999999999999999e-83 < a < -1.05e-157 or -1.7499999999999999e-199 < a < -6.00000000000000048e-300

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

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

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

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

    if -6.00000000000000048e-300 < a < 1.28e-11

    1. Initial program 99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-17}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-83}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-157}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-199}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-300}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.28 \cdot 10^{-11}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 6: 82.5% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 120) < -2e-14 or 0.10000000000000001 < (*.f64 a 120)

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/91.0%

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

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

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

    if -2e-14 < (*.f64 a 120) < 0.10000000000000001

    1. Initial program 99.7%

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

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

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

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

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

Alternative 7: 56.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -9.5 \cdot 10^{-241}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 1.18 \cdot 10^{-291}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\
\;\;\;\;a \cdot 120\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.55e147 or 9.00000000000000018e154 < x

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

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

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

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

    if -1.55e147 < x < -9.49999999999999971e-241 or 1.18e-291 < x < 9.00000000000000018e154

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

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

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

    if -9.49999999999999971e-241 < x < 1.18e-291

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{+147}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-241}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.18 \cdot 10^{-291}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 8: 74.8% accurate, 0.9× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 1.5 \cdot 10^{+91}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.2e45 or 1.50000000000000003e91 < a

    1. Initial program 99.8%

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

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

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

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

    if -7.2e45 < a < 1.2e-48

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

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

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

    if 1.2e-48 < a < 9.49999999999999979e84

    1. Initial program 99.9%

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

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

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

    if 9.49999999999999979e84 < a < 1.50000000000000003e91

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+45}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-48}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+84}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+91}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 9: 89.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.19999999999999996e36 or 2.7e25 < x

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/88.2%

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

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

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

    if -1.19999999999999996e36 < x < 2.7e25

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+36} \lor \neg \left(x \leq 2.7 \cdot 10^{+25}\right):\\ \;\;\;\;a \cdot 120 + \frac{60}{z - t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z - t}{y}}\\ \end{array} \]

Alternative 10: 89.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/85.6%

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

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

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

    if -6.39999999999999965e35 < x < 1.30000000000000001e26

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

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

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

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

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

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

    if 1.30000000000000001e26 < x

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*91.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+35}:\\ \;\;\;\;a \cdot 120 + \frac{60}{z - t} \cdot x\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+26}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{x}{\frac{z - t}{60}}\\ \end{array} \]

Alternative 11: 89.8% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/85.6%

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

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

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

    if -4.8e37 < x < 2.8e16

    1. Initial program 99.8%

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

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

    if 2.8e16 < x

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*91.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+37}:\\ \;\;\;\;a \cdot 120 + \frac{60}{z - t} \cdot x\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+16}:\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{x}{\frac{z - t}{60}}\\ \end{array} \]

Alternative 12: 59.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq -1.65 \cdot 10^{-202}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \leq 2 \cdot 10^{-11}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.6000000000000001e-17 or 1.99999999999999988e-11 < a

    1. Initial program 99.8%

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

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

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

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

    if -1.6000000000000001e-17 < a < -1.64999999999999995e-202

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    7. Simplified52.3%

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

        \[\leadsto \color{blue}{\frac{-60}{t} \cdot \left(x - y\right)} \]
    9. Applied egg-rr52.5%

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

    if -1.64999999999999995e-202 < a < 1.99999999999999988e-11

    1. Initial program 99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-17}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-202}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 2 \cdot 10^{-11}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 13: 59.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq -2.25 \cdot 10^{-203}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.07999999999999995e-17 or 9.99999999999999939e-12 < a

    1. Initial program 99.8%

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

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

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

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

    if -1.07999999999999995e-17 < a < -2.2500000000000001e-203

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    7. Simplified52.3%

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

        \[\leadsto \color{blue}{\frac{-60}{t} \cdot \left(x - y\right)} \]
    9. Applied egg-rr52.5%

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

    if -2.2500000000000001e-203 < a < 9.99999999999999939e-12

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u54.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)\right)} \]
      2. expm1-udef28.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)} - 1} \]
    6. Applied egg-rr28.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def54.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)\right)} \]
      2. expm1-log1p83.0%

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

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

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} \]
      5. associate-/r/83.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.08 \cdot 10^{-17}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -2.25 \cdot 10^{-203}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 10^{-11}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 14: 73.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+46}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+91}:\\ \;\;\;\;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 -1.3e+46)
   (* a 120.0)
   (if (<= a 1.5e+91) (* 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 <= -1.3e+46) {
		tmp = a * 120.0;
	} else if (a <= 1.5e+91) {
		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 <= (-1.3d+46)) then
        tmp = a * 120.0d0
    else if (a <= 1.5d+91) 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 <= -1.3e+46) {
		tmp = a * 120.0;
	} else if (a <= 1.5e+91) {
		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 <= -1.3e+46:
		tmp = a * 120.0
	elif a <= 1.5e+91:
		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 (a <= -1.3e+46)
		tmp = Float64(a * 120.0);
	elseif (a <= 1.5e+91)
		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 <= -1.3e+46)
		tmp = a * 120.0;
	elseif (a <= 1.5e+91)
		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[a, -1.3e+46], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 1.5e+91], 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 \leq -1.3 \cdot 10^{+46}:\\
\;\;\;\;a \cdot 120\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.30000000000000007e46 or 1.50000000000000003e91 < a

    1. Initial program 99.8%

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

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

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

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

    if -1.30000000000000007e46 < a < 1.50000000000000003e91

    1. Initial program 99.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+46}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+91}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 15: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 16: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 58.2% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.35e-17 or 5.50000000000000033e-4 < a

    1. Initial program 99.8%

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

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

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

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

    if -2.35e-17 < a < 5.50000000000000033e-4

    1. Initial program 99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.35 \cdot 10^{-17}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 0.00055:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 18: 51.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2 \cdot 10^{+155}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.2000000000000001e155

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

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

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

    if 1.2000000000000001e155 < x

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x - y}}} \]
    7. Simplified61.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.2 \cdot 10^{+155}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \end{array} \]

Alternative 19: 51.0% accurate, 4.3× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  5. Final simplification47.3%

    \[\leadsto a \cdot 120 \]

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

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

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