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

Percentage Accurate: 99.4% → 99.8%
Time: 17.6s
Alternatives: 18
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 18 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} \\ a \cdot 120 - \frac{60}{\frac{t - z}{x - y}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (- (* a 120.0) (/ 60.0 (/ (- t z) (- x y)))))
double code(double x, double y, double z, double t, double a) {
	return (a * 120.0) - (60.0 / ((t - z) / (x - y)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (a * 120.0d0) - (60.0d0 / ((t - z) / (x - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (a * 120.0) - (60.0 / ((t - z) / (x - y)));
}
def code(x, y, z, t, a):
	return (a * 120.0) - (60.0 / ((t - z) / (x - y)))
function code(x, y, z, t, a)
	return Float64(Float64(a * 120.0) - Float64(60.0 / Float64(Float64(t - z) / Float64(x - y))))
end
function tmp = code(x, y, z, t, a)
	tmp = (a * 120.0) - (60.0 / ((t - z) / (x - y)));
end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 / N[(N[(t - z), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
a \cdot 120 - \frac{60}{\frac{t - z}{x - y}}
\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. Final simplification99.8%

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

Alternative 2: 50.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{-x}{t}\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+161}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+204}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{+273}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.2000000000000006e169 or 1.29999999999999997e273 < x

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{\color{blue}{-x}}{t} \]
    11. Simplified54.2%

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

    if -8.2000000000000006e169 < x < 5.5000000000000005e161 or 1.49999999999999991e204 < x < 1.29999999999999997e273

    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 inf 60.0%

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

    if 5.5000000000000005e161 < x < 1.49999999999999991e204

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{+169}:\\ \;\;\;\;60 \cdot \frac{-x}{t}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+161}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+204}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+273}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{-x}{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):\\ \;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\ \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)))
   (+ (/ 60.0 (/ (- z t) x)) (* a 120.0))
   (/ 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 = (60.0 / ((z - t) / x)) + (a * 120.0);
	} 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 = (60.0d0 / ((z - t) / x)) + (a * 120.0d0)
    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 = (60.0 / ((z - t) / x)) + (a * 120.0);
	} 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 = (60.0 / ((z - t) / x)) + (a * 120.0)
	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(60.0 / Float64(Float64(z - t) / x)) + Float64(a * 120.0));
	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 = (60.0 / ((z - t) / x)) + (a * 120.0);
	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[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $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):\\
\;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\

\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.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 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):\\ \;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\ \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):\\ \;\;\;\;60 \cdot \frac{x}{z - t} + a \cdot 120\\ \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)))
   (+ (* 60.0 (/ x (- z t))) (* a 120.0))
   (/ 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 = (60.0 * (x / (z - t))) + (a * 120.0);
	} 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 = (60.0d0 * (x / (z - t))) + (a * 120.0d0)
    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 = (60.0 * (x / (z - t))) + (a * 120.0);
	} 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 = (60.0 * (x / (z - t))) + (a * 120.0)
	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(60.0 * Float64(x / Float64(z - t))) + Float64(a * 120.0));
	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 = (60.0 * (x / (z - t))) + (a * 120.0);
	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[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $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):\\
\;\;\;\;60 \cdot \frac{x}{z - t} + a \cdot 120\\

\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):\\ \;\;\;\;60 \cdot \frac{x}{z - t} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.7% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.89999999999999989e-17 or 1.0499999999999999e22 < 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. Taylor expanded in a around inf 95.1%

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

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

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

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

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

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

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

    if -3.89999999999999989e-17 < z < 1.4e-291

    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-291 < z < 1.0499999999999999e22

    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 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.8%

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

Alternative 6: 66.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x}{z} + a \cdot 120\\ \mathbf{if}\;z \leq -3.8 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-295}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+21}:\\ \;\;\;\;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 (+ (* 60.0 (/ x z)) (* a 120.0))))
   (if (<= z -3.8e-17)
     t_1
     (if (<= z 1.2e-295)
       (/ 60.0 (/ (- z t) (- x y)))
       (if (<= z 1.02e+21) (+ (* a 120.0) (* -60.0 (/ x t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x / z)) + (a * 120.0);
	double tmp;
	if (z <= -3.8e-17) {
		tmp = t_1;
	} else if (z <= 1.2e-295) {
		tmp = 60.0 / ((z - t) / (x - y));
	} else if (z <= 1.02e+21) {
		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 = (60.0d0 * (x / z)) + (a * 120.0d0)
    if (z <= (-3.8d-17)) then
        tmp = t_1
    else if (z <= 1.2d-295) then
        tmp = 60.0d0 / ((z - t) / (x - y))
    else if (z <= 1.02d+21) 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 = (60.0 * (x / z)) + (a * 120.0);
	double tmp;
	if (z <= -3.8e-17) {
		tmp = t_1;
	} else if (z <= 1.2e-295) {
		tmp = 60.0 / ((z - t) / (x - y));
	} else if (z <= 1.02e+21) {
		tmp = (a * 120.0) + (-60.0 * (x / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x / z)) + (a * 120.0)
	tmp = 0
	if z <= -3.8e-17:
		tmp = t_1
	elif z <= 1.2e-295:
		tmp = 60.0 / ((z - t) / (x - y))
	elif z <= 1.02e+21:
		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(60.0 * Float64(x / z)) + Float64(a * 120.0))
	tmp = 0.0
	if (z <= -3.8e-17)
		tmp = t_1;
	elseif (z <= 1.2e-295)
		tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y)));
	elseif (z <= 1.02e+21)
		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 = (60.0 * (x / z)) + (a * 120.0);
	tmp = 0.0;
	if (z <= -3.8e-17)
		tmp = t_1;
	elseif (z <= 1.2e-295)
		tmp = 60.0 / ((z - t) / (x - y));
	elseif (z <= 1.02e+21)
		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[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-17], t$95$1, If[LessEqual[z, 1.2e-295], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+21], 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 := 60 \cdot \frac{x}{z} + a \cdot 120\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+21}:\\
\;\;\;\;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 < -3.8000000000000001e-17 or 1.02e21 < 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. Taylor expanded in a around inf 95.1%

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

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

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

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

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

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

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

    if -3.8000000000000001e-17 < z < 1.1999999999999999e-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 1.1999999999999999e-295 < z < 1.02e21

    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 a around inf 88.0%

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

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

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

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

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

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

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

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

Alternative 7: 66.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x}{z} + a \cdot 120\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-293}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+27}:\\ \;\;\;\;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 (+ (* 60.0 (/ x z)) (* a 120.0))))
   (if (<= z -5.8e-17)
     t_1
     (if (<= z 1.15e-293)
       (* 60.0 (/ (- x y) (- z t)))
       (if (<= z 1.02e+27) (+ (* a 120.0) (* -60.0 (/ x t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x / z)) + (a * 120.0);
	double tmp;
	if (z <= -5.8e-17) {
		tmp = t_1;
	} else if (z <= 1.15e-293) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 1.02e+27) {
		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 = (60.0d0 * (x / z)) + (a * 120.0d0)
    if (z <= (-5.8d-17)) then
        tmp = t_1
    else if (z <= 1.15d-293) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 1.02d+27) 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 = (60.0 * (x / z)) + (a * 120.0);
	double tmp;
	if (z <= -5.8e-17) {
		tmp = t_1;
	} else if (z <= 1.15e-293) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 1.02e+27) {
		tmp = (a * 120.0) + (-60.0 * (x / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x / z)) + (a * 120.0)
	tmp = 0
	if z <= -5.8e-17:
		tmp = t_1
	elif z <= 1.15e-293:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 1.02e+27:
		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(60.0 * Float64(x / z)) + Float64(a * 120.0))
	tmp = 0.0
	if (z <= -5.8e-17)
		tmp = t_1;
	elseif (z <= 1.15e-293)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 1.02e+27)
		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 = (60.0 * (x / z)) + (a * 120.0);
	tmp = 0.0;
	if (z <= -5.8e-17)
		tmp = t_1;
	elseif (z <= 1.15e-293)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 1.02e+27)
		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[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e-17], t$95$1, If[LessEqual[z, 1.15e-293], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+27], 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 := 60 \cdot \frac{x}{z} + a \cdot 120\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+27}:\\
\;\;\;\;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 < -5.8000000000000006e-17 or 1.0199999999999999e27 < 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. Taylor expanded in a around inf 95.1%

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

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

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

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

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

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

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

    if -5.8000000000000006e-17 < z < 1.14999999999999998e-293

    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.14999999999999998e-293 < z < 1.0199999999999999e27

    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 a around inf 88.0%

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

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

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

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

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

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

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

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

Alternative 8: 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 9: 89.5% accurate, 0.6× speedup?

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

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

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

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


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

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

        \[\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 -4.2000000000000003e24 < x < 4.8e7

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

        \[\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 0 94.6%

      \[\leadsto \frac{60}{\frac{z - t}{\color{blue}{-1 \cdot y}}} + a \cdot 120 \]
    8. Step-by-step derivation
      1. neg-mul-194.6%

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

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

    if 4.8e7 < 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 -4.2 \cdot 10^{+24}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\ \mathbf{elif}\;x \leq 48000000:\\ \;\;\;\;\frac{60}{\frac{t - z}{y}} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t} + a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 89.4% accurate, 0.6× speedup?

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

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

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

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


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

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

        \[\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.14999999999999994e24 < x < 2e7

    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 2e7 < 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.15 \cdot 10^{+24}:\\ \;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\ \mathbf{elif}\;x \leq 20000000:\\ \;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t} + a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 50.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+169} \lor \neg \left(x \leq 8.5 \cdot 10^{+161}\right) \land x \leq 7.2 \cdot 10^{+203}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.99999999999999947e169 or 8.50000000000000007e161 < x < 7.19999999999999964e203

    1. Initial program 99.6%

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

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

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

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

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

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

    if -7.99999999999999947e169 < x < 8.50000000000000007e161 or 7.19999999999999964e203 < x

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+169} \lor \neg \left(x \leq 8.5 \cdot 10^{+161}\right) \land x \leq 7.2 \cdot 10^{+203}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 55.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.3 \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 -4.3e+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 <= -4.3e+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 <= (-4.3d+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 <= -4.3e+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 <= -4.3e+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 <= -4.3e+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 <= -4.3e+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, -4.3e+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 -4.3 \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 < -4.3000000000000001e169 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 -4.3000000000000001e169 < 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 -4.3 \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: 55.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 6 \cdot 10^{+29}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x}}} \]
      2. div-inv81.2%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x}}} \]
      3. frac-2neg81.2%

        \[\leadsto \color{blue}{\frac{-60}{-\frac{z - t}{x}}} \]
      4. metadata-eval81.2%

        \[\leadsto \frac{\color{blue}{-60}}{-\frac{z - t}{x}} \]
      5. distribute-neg-frac281.2%

        \[\leadsto \frac{-60}{\color{blue}{\frac{z - t}{-x}}} \]
    10. Applied egg-rr81.2%

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

    if -1.2999999999999999e170 < 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} \]

    if 5.9999999999999998e29 < x

    1. Initial program 98.1%

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

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

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

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

Alternative 14: 55.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 6 \cdot 10^{+29}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.6%

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

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

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

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

    if -6.0999999999999998e169 < 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} \]

    if 5.9999999999999998e29 < x

    1. Initial program 98.1%

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

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

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

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

Alternative 15: 51.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+196} \lor \neg \left(y \leq 2.6 \cdot 10^{+247}\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 -1.8e+196) (not (<= y 2.6e+247))) (* 60.0 (/ y t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -1.8e+196) || !(y <= 2.6e+247)) {
		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 <= (-1.8d+196)) .or. (.not. (y <= 2.6d+247))) 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 <= -1.8e+196) || !(y <= 2.6e+247)) {
		tmp = 60.0 * (y / t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -1.8e+196) or not (y <= 2.6e+247):
		tmp = 60.0 * (y / t)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((y <= -1.8e+196) || !(y <= 2.6e+247))
		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 <= -1.8e+196) || ~((y <= 2.6e+247)))
		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, -1.8e+196], N[Not[LessEqual[y, 2.6e+247]], $MachinePrecision]], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+196} \lor \neg \left(y \leq 2.6 \cdot 10^{+247}\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 < -1.80000000000000004e196 or 2.59999999999999991e247 < 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 x around 0 89.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot 60}{t}} + a \cdot 120 \]
    11. Taylor expanded in t around 0 58.2%

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

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

    if -1.80000000000000004e196 < y < 2.59999999999999991e247

    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 -1.8 \cdot 10^{+196} \lor \neg \left(y \leq 2.6 \cdot 10^{+247}\right):\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 51.4% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 9.8 \cdot 10^{+250}:\\
\;\;\;\;a \cdot 120\\

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


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

    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 x around 0 84.3%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} + a \cdot 120 \]
    10. Simplified55.9%

      \[\leadsto \color{blue}{\frac{y \cdot 60}{t}} + a \cdot 120 \]
    11. Taylor expanded in t around 0 50.8%

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

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

    if -6.50000000000000005e194 < y < 9.79999999999999986e250

    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 9.79999999999999986e250 < 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 x around 0 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
      2. *-commutative71.6%

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} + a \cdot 120 \]
    10. Simplified71.6%

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

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

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

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

Alternative 17: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 60 \cdot \frac{x - y}{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(60.0 * Float64(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[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
60 \cdot \frac{x - y}{z - t} + 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. Add Preprocessing

Alternative 18: 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)))