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

Percentage Accurate: 99.4% → 99.4%
Time: 14.6s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 1.0× speedup?

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

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

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
  2. Add Preprocessing
  3. Final simplification99.8%

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

Alternative 2: 74.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+71} \lor \neg \left(a \cdot 120 \leq -4 \cdot 10^{+38} \lor \neg \left(a \cdot 120 \leq -5 \cdot 10^{-29}\right) \land a \cdot 120 \leq 100000000000\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 120) < -1e71 or -3.99999999999999991e38 < (*.f64 a 120) < -4.99999999999999986e-29 or 1e11 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

    if -1e71 < (*.f64 a 120) < -3.99999999999999991e38 or -4.99999999999999986e-29 < (*.f64 a 120) < 1e11

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 3: 74.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot 120 \leq 100000000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -1e71 or 1e11 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

    if -1e71 < (*.f64 a 120) < -3.99999999999999991e38 or -3.9999999999999998e-7 < (*.f64 a 120) < 1e11

    1. Initial program 99.8%

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

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

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

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

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

    if -3.99999999999999991e38 < (*.f64 a 120) < -3.9999999999999998e-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.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+71}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq -4 \cdot 10^{+38}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq -4 \cdot 10^{-7}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\ \mathbf{elif}\;a \cdot 120 \leq 100000000000:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.6% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

    if -1e71 < (*.f64 a 120) < -3.99999999999999991e38

    1. Initial program 100.0%

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

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

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

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

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

    if -3.99999999999999991e38 < (*.f64 a 120) < -3.9999999999999998e-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.8%

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

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

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

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

    if -3.9999999999999998e-7 < (*.f64 a 120) < 1e11

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Alternative 5: 89.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0071999999999999998 or 1.4e53 < 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}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
    3. Simplified99.7%

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

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

    if -0.0071999999999999998 < y < 1.4e53

    1. Initial program 99.9%

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

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

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

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

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

Alternative 6: 82.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

    if -4.9999999999999997e174 < x < 5.99999999999999968e108

    1. Initial program 99.9%

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

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

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

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

    if 5.99999999999999968e108 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Alternative 7: 89.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.012:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.012

    1. Initial program 99.8%

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

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

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

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

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

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

    if -0.012 < y < 7.5e60

    1. Initial program 99.9%

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

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

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

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

    if 7.5e60 < 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.8%

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

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

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

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

Alternative 8: 89.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.011:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.010999999999999999

    1. Initial program 99.8%

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

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

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

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

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

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

    if -0.010999999999999999 < y < 3.7000000000000002e55

    1. Initial program 99.9%

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

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

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

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

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

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

    if 3.7000000000000002e55 < 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.8%

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

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

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

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

Alternative 9: 58.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-31} \lor \neg \left(a \leq 3.8 \cdot 10^{-92}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.10000000000000005e-31 or 3.8000000000000001e-92 < a

    1. Initial program 99.9%

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

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

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

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

    if -1.10000000000000005e-31 < a < 3.8000000000000001e-92

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 10: 52.5% accurate, 0.9× speedup?

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

    1. Initial program 99.7%

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

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

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

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

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

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

    if -1.4e179 < x < 6.39999999999999965e195

    1. Initial program 99.9%

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

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

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

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

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

Alternative 11: 52.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+180} \lor \neg \left(x \leq 2 \cdot 10^{+197}\right):\\
\;\;\;\;\frac{x \cdot -60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.5000000000000003e180 or 1.9999999999999999e197 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if -5.5000000000000003e180 < x < 1.9999999999999999e197

    1. Initial program 99.9%

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

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

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

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

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

Alternative 12: 52.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 4.3 \cdot 10^{+195}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

    if -5.8e175 < x < 4.29999999999999981e195

    1. Initial program 99.9%

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

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

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

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

    if 4.29999999999999981e195 < x

    1. Initial program 99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x}{t}} \]
    8. Step-by-step derivation
      1. clear-num52.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+175}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+195}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 14: 51.3% 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.8%

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification49.2%

    \[\leadsto a \cdot 120 \]
  7. Add Preprocessing

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

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

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