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

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

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\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. Final simplification99.8%

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

Alternative 2: 82.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+88}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -3.99999999999999984e88

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Applied egg-rr88.0%

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

    if -3.99999999999999984e88 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e119

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

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

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

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

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

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

    if 4.9999999999999999e119 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 87.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 95.9%

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

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

Alternative 3: 82.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t_1 \leq -4 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+119}:\\ \;\;\;\;a \cdot 120 + \frac{60}{\frac{z - t}{x}}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -4e+88)
     t_1
     (if (<= t_1 5e+119)
       (+ (* 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 t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -4e+88) {
		tmp = t_1;
	} else if (t_1 <= 5e+119) {
		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) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-4d+88)) then
        tmp = t_1
    else if (t_1 <= 5d+119) 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 t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -4e+88) {
		tmp = t_1;
	} else if (t_1 <= 5e+119) {
		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):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -4e+88:
		tmp = t_1
	elif t_1 <= 5e+119:
		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)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_1 <= -4e+88)
		tmp = t_1;
	elseif (t_1 <= 5e+119)
		tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(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)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_1 <= -4e+88)
		tmp = t_1;
	elseif (t_1 <= 5e+119)
		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_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+88], t$95$1, If[LessEqual[t$95$1, 5e+119], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+88}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -3.99999999999999984e88

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
    6. Applied egg-rr88.0%

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

    if -3.99999999999999984e88 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e119

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

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

    if 4.9999999999999999e119 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 87.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 95.9%

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

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

Alternative 4: 66.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + \frac{60}{\frac{z}{x}}\\ t_2 := a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{if}\;z \leq -2.3 \cdot 10^{+111}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-156}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-174}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 10^{-118}:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+49}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (/ 60.0 (/ z x))))
        (t_2 (+ (* a 120.0) (/ -60.0 (/ t x)))))
   (if (<= z -2.3e+111)
     t_1
     (if (<= z -9.2e-156)
       (* 60.0 (/ (- x y) (- z t)))
       (if (<= z 7e-174)
         t_2
         (if (<= z 1e-118)
           (+ (* a 120.0) (/ (* 60.0 y) t))
           (if (<= z 6e+49) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (60.0 / (z / x));
	double t_2 = (a * 120.0) + (-60.0 / (t / x));
	double tmp;
	if (z <= -2.3e+111) {
		tmp = t_1;
	} else if (z <= -9.2e-156) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 7e-174) {
		tmp = t_2;
	} else if (z <= 1e-118) {
		tmp = (a * 120.0) + ((60.0 * y) / t);
	} else if (z <= 6e+49) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (a * 120.0d0) + (60.0d0 / (z / x))
    t_2 = (a * 120.0d0) + ((-60.0d0) / (t / x))
    if (z <= (-2.3d+111)) then
        tmp = t_1
    else if (z <= (-9.2d-156)) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 7d-174) then
        tmp = t_2
    else if (z <= 1d-118) then
        tmp = (a * 120.0d0) + ((60.0d0 * y) / t)
    else if (z <= 6d+49) then
        tmp = t_2
    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) + (60.0 / (z / x));
	double t_2 = (a * 120.0) + (-60.0 / (t / x));
	double tmp;
	if (z <= -2.3e+111) {
		tmp = t_1;
	} else if (z <= -9.2e-156) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 7e-174) {
		tmp = t_2;
	} else if (z <= 1e-118) {
		tmp = (a * 120.0) + ((60.0 * y) / t);
	} else if (z <= 6e+49) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (60.0 / (z / x))
	t_2 = (a * 120.0) + (-60.0 / (t / x))
	tmp = 0
	if z <= -2.3e+111:
		tmp = t_1
	elif z <= -9.2e-156:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 7e-174:
		tmp = t_2
	elif z <= 1e-118:
		tmp = (a * 120.0) + ((60.0 * y) / t)
	elif z <= 6e+49:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(z / x)))
	t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x)))
	tmp = 0.0
	if (z <= -2.3e+111)
		tmp = t_1;
	elseif (z <= -9.2e-156)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 7e-174)
		tmp = t_2;
	elseif (z <= 1e-118)
		tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * y) / t));
	elseif (z <= 6e+49)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (60.0 / (z / x));
	t_2 = (a * 120.0) + (-60.0 / (t / x));
	tmp = 0.0;
	if (z <= -2.3e+111)
		tmp = t_1;
	elseif (z <= -9.2e-156)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 7e-174)
		tmp = t_2;
	elseif (z <= 1e-118)
		tmp = (a * 120.0) + ((60.0 * y) / t);
	elseif (z <= 6e+49)
		tmp = t_2;
	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[(60.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+111], t$95$1, If[LessEqual[z, -9.2e-156], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-174], t$95$2, If[LessEqual[z, 1e-118], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+49], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 7 \cdot 10^{-174}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+49}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.30000000000000002e111 or 6.0000000000000005e49 < z

    1. Initial program 99.0%

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

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

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

    if -2.30000000000000002e111 < z < -9.1999999999999998e-156

    1. Initial program 96.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 73.0%

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

    if -9.1999999999999998e-156 < z < 6.99999999999999975e-174 or 9.99999999999999985e-119 < z < 6.0000000000000005e49

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

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

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

        \[\leadsto \frac{60}{\color{blue}{-\frac{t}{x}}} + a \cdot 120 \]
      2. distribute-neg-frac79.0%

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

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

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

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

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

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

    if 6.99999999999999975e-174 < z < 9.99999999999999985e-119

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    5. Simplified88.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+111}:\\ \;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-156}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-174}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{elif}\;z \leq 10^{-118}:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+49}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x}}\\ \end{array} \]

Alternative 5: 61.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+111}:\\
\;\;\;\;a \cdot 120\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.79999999999999976e111 or 3.6e70 < z

    1. Initial program 99.0%

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

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

    if -3.79999999999999976e111 < z < -2.24999999999999993e-156

    1. Initial program 96.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 73.0%

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

    if -2.24999999999999993e-156 < z < 3.6e70

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+111}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-156}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+70}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 6: 67.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq -4.45 \cdot 10^{+74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-157}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 10^{-22}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (* -60.0 (/ y z)))))
   (if (<= z -4.45e+74)
     t_1
     (if (<= z -3e-157)
       (* 60.0 (/ (- x y) (- z t)))
       (if (<= z 1e-22) (+ (* a 120.0) (* -60.0 (/ x t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 * (y / z));
	double tmp;
	if (z <= -4.45e+74) {
		tmp = t_1;
	} else if (z <= -3e-157) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 1e-22) {
		tmp = (a * 120.0) + (-60.0 * (x / 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) + ((-60.0d0) * (y / z))
    if (z <= (-4.45d+74)) then
        tmp = t_1
    else if (z <= (-3d-157)) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 1d-22) then
        tmp = (a * 120.0d0) + ((-60.0d0) * (x / 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) + (-60.0 * (y / z));
	double tmp;
	if (z <= -4.45e+74) {
		tmp = t_1;
	} else if (z <= -3e-157) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 1e-22) {
		tmp = (a * 120.0) + (-60.0 * (x / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (-60.0 * (y / z))
	tmp = 0
	if z <= -4.45e+74:
		tmp = t_1
	elif z <= -3e-157:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 1e-22:
		tmp = (a * 120.0) + (-60.0 * (x / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z)))
	tmp = 0.0
	if (z <= -4.45e+74)
		tmp = t_1;
	elseif (z <= -3e-157)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 1e-22)
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (-60.0 * (y / z));
	tmp = 0.0;
	if (z <= -4.45e+74)
		tmp = t_1;
	elseif (z <= -3e-157)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 1e-22)
		tmp = (a * 120.0) + (-60.0 * (x / 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[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.45e+74], t$95$1, If[LessEqual[z, -3e-157], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-22], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4500000000000001e74 or 1e-22 < z

    1. Initial program 99.1%

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

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

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

    if -4.4500000000000001e74 < z < -3e-157

    1. Initial program 96.3%

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

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

    if -3e-157 < z < 1e-22

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.45 \cdot 10^{+74}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-157}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 10^{-22}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 7: 67.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-158}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-22}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (* -60.0 (/ y z)))))
   (if (<= z -5.2e+73)
     t_1
     (if (<= z -4.7e-158)
       (* 60.0 (/ (- x y) (- z t)))
       (if (<= z 7.2e-22) (+ (* a 120.0) (/ -60.0 (/ t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 * (y / z));
	double tmp;
	if (z <= -5.2e+73) {
		tmp = t_1;
	} else if (z <= -4.7e-158) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 7.2e-22) {
		tmp = (a * 120.0) + (-60.0 / (t / x));
	} 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) + ((-60.0d0) * (y / z))
    if (z <= (-5.2d+73)) then
        tmp = t_1
    else if (z <= (-4.7d-158)) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 7.2d-22) then
        tmp = (a * 120.0d0) + ((-60.0d0) / (t / x))
    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) + (-60.0 * (y / z));
	double tmp;
	if (z <= -5.2e+73) {
		tmp = t_1;
	} else if (z <= -4.7e-158) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 7.2e-22) {
		tmp = (a * 120.0) + (-60.0 / (t / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (-60.0 * (y / z))
	tmp = 0
	if z <= -5.2e+73:
		tmp = t_1
	elif z <= -4.7e-158:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 7.2e-22:
		tmp = (a * 120.0) + (-60.0 / (t / x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z)))
	tmp = 0.0
	if (z <= -5.2e+73)
		tmp = t_1;
	elseif (z <= -4.7e-158)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 7.2e-22)
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (-60.0 * (y / z));
	tmp = 0.0;
	if (z <= -5.2e+73)
		tmp = t_1;
	elseif (z <= -4.7e-158)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 7.2e-22)
		tmp = (a * 120.0) + (-60.0 / (t / x));
	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[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+73], t$95$1, If[LessEqual[z, -4.7e-158], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-22], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.2000000000000001e73 or 7.1999999999999996e-22 < z

    1. Initial program 99.1%

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

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

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

    if -5.2000000000000001e73 < z < -4.70000000000000036e-158

    1. Initial program 96.3%

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

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

    if -4.70000000000000036e-158 < z < 7.1999999999999996e-22

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+73}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-158}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-22}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 8: 66.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + \frac{60}{\frac{z}{x}}\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+111}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+49}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (/ 60.0 (/ z x)))))
   (if (<= z -2.9e+111)
     t_1
     (if (<= z -1.45e-155)
       (* 60.0 (/ (- x y) (- z t)))
       (if (<= z 6.2e+49) (+ (* a 120.0) (/ -60.0 (/ t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (60.0 / (z / x));
	double tmp;
	if (z <= -2.9e+111) {
		tmp = t_1;
	} else if (z <= -1.45e-155) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 6.2e+49) {
		tmp = (a * 120.0) + (-60.0 / (t / x));
	} 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) + (60.0d0 / (z / x))
    if (z <= (-2.9d+111)) then
        tmp = t_1
    else if (z <= (-1.45d-155)) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 6.2d+49) then
        tmp = (a * 120.0d0) + ((-60.0d0) / (t / x))
    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) + (60.0 / (z / x));
	double tmp;
	if (z <= -2.9e+111) {
		tmp = t_1;
	} else if (z <= -1.45e-155) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 6.2e+49) {
		tmp = (a * 120.0) + (-60.0 / (t / x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (60.0 / (z / x))
	tmp = 0
	if z <= -2.9e+111:
		tmp = t_1
	elif z <= -1.45e-155:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 6.2e+49:
		tmp = (a * 120.0) + (-60.0 / (t / x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(z / x)))
	tmp = 0.0
	if (z <= -2.9e+111)
		tmp = t_1;
	elseif (z <= -1.45e-155)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 6.2e+49)
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (60.0 / (z / x));
	tmp = 0.0;
	if (z <= -2.9e+111)
		tmp = t_1;
	elseif (z <= -1.45e-155)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 6.2e+49)
		tmp = (a * 120.0) + (-60.0 / (t / x));
	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[(60.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+111], t$95$1, If[LessEqual[z, -1.45e-155], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+49], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9e111 or 6.19999999999999985e49 < z

    1. Initial program 99.0%

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

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

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

    if -2.9e111 < z < -1.45000000000000005e-155

    1. Initial program 96.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 73.0%

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

    if -1.45000000000000005e-155 < z < 6.19999999999999985e49

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+111}:\\ \;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+49}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x}}\\ \end{array} \]

Alternative 9: 56.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -1.99999999999999989e66 or 3.9999999999999999e-48 < (-.f64 z t)

    1. Initial program 98.5%

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

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

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

    if -1.99999999999999989e66 < (-.f64 z t) < 3.9999999999999999e-48

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

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

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

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

Alternative 10: 89.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.49999999999999947e101 or 7.39999999999999994e56 < y

    1. Initial program 98.8%

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

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

    if -9.49999999999999947e101 < y < 7.39999999999999994e56

    1. Initial program 98.7%

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

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

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

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

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

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

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

Alternative 11: 74.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-34} \lor \neg \left(a \leq 1.8 \cdot 10^{-48}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6e-34 or 1.8000000000000001e-48 < a

    1. Initial program 99.2%

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

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

    if -6e-34 < a < 1.8000000000000001e-48

    1. Initial program 98.2%

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

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

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

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

Alternative 12: 55.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.66 \cdot 10^{+264} \lor \neg \left(x \leq 5 \cdot 10^{+182}\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6599999999999999e264 or 4.99999999999999973e182 < x

    1. Initial program 95.5%

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

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

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

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

    if -1.6599999999999999e264 < x < 4.99999999999999973e182

    1. Initial program 99.4%

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

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

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

Alternative 13: 51.3% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

    if 1.6999999999999999e214 < x

    1. Initial program 96.9%

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

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{-1 \cdot x}{t}} \]
      2. neg-mul-151.9%

        \[\leadsto 60 \cdot \frac{\color{blue}{-x}}{t} \]
    8. Simplified51.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.7 \cdot 10^{+214}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} \cdot \left(-60\right)\\ \end{array} \]

Alternative 14: 51.1% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

    if 2.70000000000000008e187 < x

    1. Initial program 97.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.7 \cdot 10^{+187}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \end{array} \]

Alternative 15: 51.1% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

    if 9.7999999999999999e182 < x

    1. Initial program 97.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z}} \]
    8. Simplified37.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 9.8 \cdot 10^{+182}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{60}{z}\\ \end{array} \]

Alternative 16: 51.2% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

    if 2.9999999999999999e215 < x

    1. Initial program 96.9%

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

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

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

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

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

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

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

Alternative 17: 50.6% accurate, 4.3× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 98.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 z around inf 53.0%

    \[\leadsto \color{blue}{120 \cdot a} \]
  5. Final simplification53.0%

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