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

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

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 71.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{-131} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-59}\right) \land a \cdot 120 \leq 10^{+47}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000028e-33

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000028e-33 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999999e-132 or 2.0000000000000001e-59 < (*.f64 a #s(literal 120 binary64)) < 1e47

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if 9.9999999999999999e-132 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e-59 or 1e47 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -4.99999999999999977e-58 or 2e10 < (-.f64 z t)

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

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

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

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

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

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

    if -4.99999999999999977e-58 < (-.f64 z t) < 2e10

    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. Step-by-step derivation
      1. clear-num99.6%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    8. Step-by-step derivation
      1. clear-num99.6%

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

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

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

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

Alternative 4: 79.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -4.99999999999999977e-58 or 5e21 < (-.f64 z t)

    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}{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 88.5%

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

    if -4.99999999999999977e-58 < (-.f64 z t) < 5e21

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    8. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

Alternative 5: 66.6% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.30000000000000009e-17

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

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

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

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

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

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

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

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

    if -2.30000000000000009e-17 < z < 7.2000000000000003e-295

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    8. Step-by-step derivation
      1. clear-num99.7%

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

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

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

    if 7.2000000000000003e-295 < z < 3.5e20

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

    if 3.5e20 < z

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 6: 66.6% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.4000000000000001e-16

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

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

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

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

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

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

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

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

    if -1.4000000000000001e-16 < z < 1.4e-288

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    8. Step-by-step derivation
      1. clear-num99.7%

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

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

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

    if 1.4e-288 < z < 6.99999999999999999e25

    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 z around 0 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999999e25 < z

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 7: 66.5% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.8000000000000004e-19

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

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

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

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

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

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

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

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

    if -6.8000000000000004e-19 < z < 2.00000000000000012e-295

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

    if 2.00000000000000012e-295 < z < 3.4999999999999999e26

    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 z around 0 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4999999999999999e26 < z

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 8: 66.6% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.32e-16 or 2.7000000000000002e22 < z

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

    if -1.32e-16 < z < 1.74999999999999994e-295

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

    if 1.74999999999999994e-295 < z < 2.7000000000000002e22

    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 z around 0 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 66.6% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6500000000000001e-18 or 1.75e28 < z

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

    if -1.6500000000000001e-18 < z < 7.8000000000000005e-294

    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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

    if 7.8000000000000005e-294 < z < 1.75e28

    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 z around 0 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z - t \leq -5 \cdot 10^{+146} \lor \neg \left(z - t \leq 10^{+106}\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 (<= (- z t) -5e+146) (not (<= (- z t) 1e+106)))
   (* a 120.0)
   (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((z - t) <= -5e+146) || !((z - t) <= 1e+106)) {
		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 (((z - t) <= (-5d+146)) .or. (.not. ((z - t) <= 1d+106))) 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 (((z - t) <= -5e+146) || !((z - t) <= 1e+106)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if ((z - t) <= -5e+146) or not ((z - t) <= 1e+106):
		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(z - t) <= -5e+146) || !(Float64(z - t) <= 1e+106))
		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 (((z - t) <= -5e+146) || ~(((z - t) <= 1e+106)))
		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[(z - t), $MachinePrecision], -5e+146], N[Not[LessEqual[N[(z - t), $MachinePrecision], 1e+106]], $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}\;z - t \leq -5 \cdot 10^{+146} \lor \neg \left(z - t \leq 10^{+106}\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 z t) < -4.9999999999999999e146 or 1.00000000000000009e106 < (-.f64 z t)

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

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

    if -4.9999999999999999e146 < (-.f64 z t) < 1.00000000000000009e106

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

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

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

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

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    7. Taylor expanded in a around 0 76.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}\;z - t \leq -5 \cdot 10^{+146} \lor \neg \left(z - t \leq 10^{+106}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 89.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if -2.35e24 < x < 1.45e7

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

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

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

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

    if 1.45e7 < x

    1. Initial program 98.2%

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

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

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

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

Alternative 12: 55.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+169} \lor \neg \left(x \leq 6 \cdot 10^{+29}\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.8000000000000001e169 or 5.9999999999999998e29 < x

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

    if -5.8000000000000001e169 < x < 5.9999999999999998e29

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

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

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

Alternative 13: 51.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+196} \lor \neg \left(y \leq 2.5 \cdot 10^{+245}\right):\\
\;\;\;\;60 \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4e196 or 2.50000000000000017e245 < y

    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 z around 0 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e196 < y < 2.50000000000000017e245

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

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

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

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

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

Alternative 14: 51.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+195}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+251}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999995e195 < y < 4.59999999999999976e251

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

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

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

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

    if 4.59999999999999976e251 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
    11. Simplified71.6%

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

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

Alternative 15: 99.7% 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.4%

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

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

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

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

Alternative 16: 49.6% accurate, 4.3× speedup?

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

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

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

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

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

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

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