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

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

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

Initial Program: 99.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a, 120, \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.5%

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

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

      \[\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: 74.4% 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 -2 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 500000:\\ \;\;\;\;a \cdot 120\\ \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 -2e+28)
     t_1
     (if (<= t_1 500000.0) (* a 120.0) (* 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 <= -2e+28) {
		tmp = t_1;
	} else if (t_1 <= 500000.0) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-2d+28)) then
        tmp = t_1
    else if (t_1 <= 500000.0d0) then
        tmp = a * 120.0d0
    else
        tmp = 60.0d0 * ((x - y) / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -2e+28) {
		tmp = t_1;
	} else if (t_1 <= 500000.0) {
		tmp = a * 120.0;
	} 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 <= -2e+28:
		tmp = t_1
	elif t_1 <= 500000.0:
		tmp = a * 120.0
	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 <= -2e+28)
		tmp = t_1;
	elseif (t_1 <= 500000.0)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_1 <= -2e+28)
		tmp = t_1;
	elseif (t_1 <= 500000.0)
		tmp = a * 120.0;
	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, -2e+28], t$95$1, If[LessEqual[t$95$1, 500000.0], 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}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 500000:\\
\;\;\;\;a \cdot 120\\

\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)) < -1.99999999999999992e28

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

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

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

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

    if -1.99999999999999992e28 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 5e5

    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 z around inf 74.8%

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

    if 5e5 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.3%

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

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

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

Alternative 3: 74.1% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a 120) < -3.9999999999999997e159

    1. Initial program 96.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 x around inf 93.9%

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

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

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

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

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

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

    if -3.9999999999999997e159 < (*.f64 a 120) < -1.99999999999999989e-67

    1. Initial program 99.9%

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

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

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

    if -1.99999999999999989e-67 < (*.f64 a 120) < 4.99999999999999977e-7

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999977e-7 < (*.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 z around inf 75.3%

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

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

Alternative 4: 56.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot x}{z}\\ t_2 := -60 \cdot \frac{x - y}{t}\\ \mathbf{if}\;a \leq -1.16 \cdot 10^{-69}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-271}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \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_2 (* -60.0 (/ (- x y) t))))
   (if (<= a -1.16e-69)
     (* a 120.0)
     (if (<= a 3.6e-271)
       t_2
       (if (<= a 2.5e-137)
         t_1
         (if (<= a 7.5e-95)
           t_2
           (if (<= a 1.75e-50)
             t_1
             (if (<= a 2.7e-9) (/ -60.0 (/ t x)) (* a 120.0)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * x) / z;
	double t_2 = -60.0 * ((x - y) / t);
	double tmp;
	if (a <= -1.16e-69) {
		tmp = a * 120.0;
	} else if (a <= 3.6e-271) {
		tmp = t_2;
	} else if (a <= 2.5e-137) {
		tmp = t_1;
	} else if (a <= 7.5e-95) {
		tmp = t_2;
	} else if (a <= 1.75e-50) {
		tmp = t_1;
	} else if (a <= 2.7e-9) {
		tmp = -60.0 / (t / x);
	} 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_2 = (-60.0d0) * ((x - y) / t)
    if (a <= (-1.16d-69)) then
        tmp = a * 120.0d0
    else if (a <= 3.6d-271) then
        tmp = t_2
    else if (a <= 2.5d-137) then
        tmp = t_1
    else if (a <= 7.5d-95) then
        tmp = t_2
    else if (a <= 1.75d-50) then
        tmp = t_1
    else if (a <= 2.7d-9) then
        tmp = (-60.0d0) / (t / x)
    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;
	double t_2 = -60.0 * ((x - y) / t);
	double tmp;
	if (a <= -1.16e-69) {
		tmp = a * 120.0;
	} else if (a <= 3.6e-271) {
		tmp = t_2;
	} else if (a <= 2.5e-137) {
		tmp = t_1;
	} else if (a <= 7.5e-95) {
		tmp = t_2;
	} else if (a <= 1.75e-50) {
		tmp = t_1;
	} else if (a <= 2.7e-9) {
		tmp = -60.0 / (t / x);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * x) / z
	t_2 = -60.0 * ((x - y) / t)
	tmp = 0
	if a <= -1.16e-69:
		tmp = a * 120.0
	elif a <= 3.6e-271:
		tmp = t_2
	elif a <= 2.5e-137:
		tmp = t_1
	elif a <= 7.5e-95:
		tmp = t_2
	elif a <= 1.75e-50:
		tmp = t_1
	elif a <= 2.7e-9:
		tmp = -60.0 / (t / x)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * x) / z)
	t_2 = Float64(-60.0 * Float64(Float64(x - y) / t))
	tmp = 0.0
	if (a <= -1.16e-69)
		tmp = Float64(a * 120.0);
	elseif (a <= 3.6e-271)
		tmp = t_2;
	elseif (a <= 2.5e-137)
		tmp = t_1;
	elseif (a <= 7.5e-95)
		tmp = t_2;
	elseif (a <= 1.75e-50)
		tmp = t_1;
	elseif (a <= 2.7e-9)
		tmp = Float64(-60.0 / Float64(t / x));
	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_2 = -60.0 * ((x - y) / t);
	tmp = 0.0;
	if (a <= -1.16e-69)
		tmp = a * 120.0;
	elseif (a <= 3.6e-271)
		tmp = t_2;
	elseif (a <= 2.5e-137)
		tmp = t_1;
	elseif (a <= 7.5e-95)
		tmp = t_2;
	elseif (a <= 1.75e-50)
		tmp = t_1;
	elseif (a <= 2.7e-9)
		tmp = -60.0 / (t / x);
	else
		tmp = a * 120.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.16e-69], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 3.6e-271], t$95$2, If[LessEqual[a, 2.5e-137], t$95$1, If[LessEqual[a, 7.5e-95], t$95$2, If[LessEqual[a, 1.75e-50], t$95$1, If[LessEqual[a, 2.7e-9], N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 3.6 \cdot 10^{-271}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{-137}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-95}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 1.75 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.15999999999999989e-69 or 2.7000000000000002e-9 < a

    1. Initial program 99.1%

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

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

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

    if -1.15999999999999989e-69 < a < 3.5999999999999998e-271 or 2.5e-137 < a < 7.5000000000000003e-95

    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 0 56.4%

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

    if 3.5999999999999998e-271 < a < 2.5e-137 or 7.5000000000000003e-95 < a < 1.74999999999999998e-50

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot x}}{z} \]
    9. Step-by-step derivation
      1. *-commutative47.9%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} \]
    10. Simplified47.9%

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

    if 1.74999999999999998e-50 < a < 2.7000000000000002e-9

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x}}} \]
    8. Simplified60.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.16 \cdot 10^{-69}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-271}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-137}:\\ \;\;\;\;\frac{60 \cdot x}{z}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-95}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-50}:\\ \;\;\;\;\frac{60 \cdot x}{z}\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 5: 74.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -1.99999999999999989e-67

    1. Initial program 98.5%

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

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

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

    if -1.99999999999999989e-67 < (*.f64 a 120) < 4.99999999999999977e-7

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999977e-7 < (*.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 z around inf 75.3%

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

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

Alternative 6: 82.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{+103} \lor \neg \left(y \leq 6.2 \cdot 10^{+116}\right):\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.59999999999999938e103 or 6.19999999999999992e116 < y

    1. Initial program 99.9%

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

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

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

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

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

    if -8.59999999999999938e103 < y < 6.19999999999999992e116

    1. Initial program 99.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 x around inf 90.2%

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

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

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

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

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

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

Alternative 7: 89.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.59999999999999991e50 or 2.1500000000000001e-38 < x

    1. Initial program 99.1%

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

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

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

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

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

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

    if -1.59999999999999991e50 < x < 2.1500000000000001e-38

    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 0 96.9%

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

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

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

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

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

Alternative 8: 89.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.4000000000000004e40 or 2.34999999999999999e-38 < x

    1. Initial program 99.1%

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

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

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

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

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

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

    if -8.4000000000000004e40 < x < 2.34999999999999999e-38

    1. Initial program 99.9%

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

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

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

Alternative 9: 51.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x - y \leq -1 \cdot 10^{+129}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;x - y \leq 4 \cdot 10^{+97}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 x y) < -1e129

    1. Initial program 98.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 a around 0 73.2%

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

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

    if -1e129 < (-.f64 x y) < 4.0000000000000003e97

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

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

    if 4.0000000000000003e97 < (-.f64 x y)

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x - y \leq -1 \cdot 10^{+129}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x - y \leq 4 \cdot 10^{+97}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \end{array} \]

Alternative 10: 51.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x - y \leq -1 \cdot 10^{+129}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;x - y \leq 4 \cdot 10^{+97}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 x y) < -1e129

    1. Initial program 98.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 a around 0 73.2%

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

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

    if -1e129 < (-.f64 x y) < 4.0000000000000003e97

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

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

    if 4.0000000000000003e97 < (-.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 11: 88.9% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

    if -1.5999999999999999e46 < x < 2.34999999999999999e-38

    1. Initial program 99.9%

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

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

    if 2.34999999999999999e-38 < x

    1. Initial program 99.7%

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

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

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

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

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

Alternative 12: 59.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-72}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-301}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;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 -5.2e-72)
   (* a 120.0)
   (if (<= a 1.55e-301)
     (* -60.0 (/ (- x y) t))
     (if (<= a 2.7e-9) (* 60.0 (/ x (- z t))) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.2e-72) {
		tmp = a * 120.0;
	} else if (a <= 1.55e-301) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 2.7e-9) {
		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 <= (-5.2d-72)) then
        tmp = a * 120.0d0
    else if (a <= 1.55d-301) then
        tmp = (-60.0d0) * ((x - y) / t)
    else if (a <= 2.7d-9) 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 <= -5.2e-72) {
		tmp = a * 120.0;
	} else if (a <= 1.55e-301) {
		tmp = -60.0 * ((x - y) / t);
	} else if (a <= 2.7e-9) {
		tmp = 60.0 * (x / (z - t));
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -5.2e-72:
		tmp = a * 120.0
	elif a <= 1.55e-301:
		tmp = -60.0 * ((x - y) / t)
	elif a <= 2.7e-9:
		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 <= -5.2e-72)
		tmp = Float64(a * 120.0);
	elseif (a <= 1.55e-301)
		tmp = Float64(-60.0 * Float64(Float64(x - y) / t));
	elseif (a <= 2.7e-9)
		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 <= -5.2e-72)
		tmp = a * 120.0;
	elseif (a <= 1.55e-301)
		tmp = -60.0 * ((x - y) / t);
	elseif (a <= 2.7e-9)
		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, -5.2e-72], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 1.55e-301], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e-9], 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 -5.2 \cdot 10^{-72}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-301}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.19999999999999992e-72 or 2.7000000000000002e-9 < a

    1. Initial program 99.1%

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

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

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

    if -5.19999999999999992e-72 < a < 1.55000000000000007e-301

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

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

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

    if 1.55000000000000007e-301 < a < 2.7000000000000002e-9

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-72}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-301}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 13: 75.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-70} \lor \neg \left(a \leq 6.8 \cdot 10^{-9}\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 -5.2e-70) (not (<= a 6.8e-9)))
   (* 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 <= -5.2e-70) || !(a <= 6.8e-9)) {
		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 <= (-5.2d-70)) .or. (.not. (a <= 6.8d-9))) 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 <= -5.2e-70) || !(a <= 6.8e-9)) {
		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 <= -5.2e-70) or not (a <= 6.8e-9):
		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 <= -5.2e-70) || !(a <= 6.8e-9))
		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 <= -5.2e-70) || ~((a <= 6.8e-9)))
		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, -5.2e-70], N[Not[LessEqual[a, 6.8e-9]], $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 -5.2 \cdot 10^{-70} \lor \neg \left(a \leq 6.8 \cdot 10^{-9}\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 < -5.20000000000000004e-70 or 6.7999999999999997e-9 < a

    1. Initial program 99.1%

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

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

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

    if -5.20000000000000004e-70 < a < 6.7999999999999997e-9

    1. Initial program 99.8%

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

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

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

Alternative 14: 75.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9999999999999999e-69 or 7.49999999999999933e-9 < a

    1. Initial program 99.1%

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

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

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

    if -1.9999999999999999e-69 < a < 7.49999999999999933e-9

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 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 99.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. Final simplification99.8%

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

Alternative 16: 52.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+176} \lor \neg \left(x \leq 4.2 \cdot 10^{+262}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.02000000000000001e176 or 4.19999999999999979e262 < x

    1. Initial program 97.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 84.5%

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

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

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

    if -1.02000000000000001e176 < x < 4.19999999999999979e262

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+176} \lor \neg \left(x \leq 4.2 \cdot 10^{+262}\right):\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 17: 52.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+178}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+243}:\\ \;\;\;\;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.8e+178)
   (* -60.0 (/ x t))
   (if (<= x 4.5e+243) (* a 120.0) (* 60.0 (/ x z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -2.8e+178) {
		tmp = -60.0 * (x / t);
	} else if (x <= 4.5e+243) {
		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.8d+178)) then
        tmp = (-60.0d0) * (x / t)
    else if (x <= 4.5d+243) 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.8e+178) {
		tmp = -60.0 * (x / t);
	} else if (x <= 4.5e+243) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * (x / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -2.8e+178:
		tmp = -60.0 * (x / t)
	elif x <= 4.5e+243:
		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.8e+178)
		tmp = Float64(-60.0 * Float64(x / t));
	elseif (x <= 4.5e+243)
		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.8e+178)
		tmp = -60.0 * (x / t);
	elseif (x <= 4.5e+243)
		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.8e+178], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+243], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+178}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

\mathbf{elif}\;x \leq 4.5 \cdot 10^{+243}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 97.1%

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

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

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

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

    if -2.79999999999999993e178 < x < 4.5e243

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

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

    if 4.5e243 < x

    1. Initial program 99.8%

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

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

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

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

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

Alternative 18: 52.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+176}:\\
\;\;\;\;\frac{-60}{\frac{t}{x}}\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+243}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 97.1%

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

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

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

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

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

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

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

    if -5e176 < x < 4.10000000000000008e243

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

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

    if 4.10000000000000008e243 < x

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+176}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+243}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \end{array} \]

Alternative 19: 52.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+180}:\\
\;\;\;\;\frac{-60}{\frac{t}{x}}\\

\mathbf{elif}\;x \leq 4.5 \cdot 10^{+243}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 97.1%

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

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

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

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

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

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

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

    if -4.2999999999999999e180 < x < 4.5e243

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

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

    if 4.5e243 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{+180}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+243}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60 \cdot x}{z}\\ \end{array} \]

Alternative 20: 51.7% 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.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 45.7%

    \[\leadsto \color{blue}{120 \cdot a} \]
  5. Final simplification45.7%

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