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

Percentage Accurate: 99.4% → 99.8%
Time: 15.1s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 99.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, 0.1× speedup?

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
    4. sub-neg99.4%

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

      \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
    6. neg-sub099.4%

      \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
    7. associate-+l-99.4%

      \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
    8. sub0-neg99.4%

      \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
    9. distribute-frac-neg299.4%

      \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
    10. distribute-neg-frac99.4%

      \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
    11. metadata-eval99.4%

      \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
  3. Simplified99.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
  4. Add Preprocessing
  5. Final simplification99.4%

    \[\leadsto \mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right) \]
  6. Add Preprocessing

Alternative 2: 53.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x - y \leq -4 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x - y \leq 10^{+236}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 x y) < -4e177 or 1.99999999999999998e204 < (-.f64 x y) < 1.00000000000000005e236

    1. Initial program 97.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity75.2%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac76.4%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity76.4%

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} \]
    8. Step-by-step derivation
      1. clear-num76.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) \]
      2. inv-pow76.3%

        \[\leadsto \color{blue}{{\left(\frac{z - t}{60}\right)}^{-1}} \cdot \left(x - y\right) \]
      3. div-inv76.4%

        \[\leadsto {\color{blue}{\left(\left(z - t\right) \cdot \frac{1}{60}\right)}}^{-1} \cdot \left(x - y\right) \]
      4. metadata-eval76.4%

        \[\leadsto {\left(\left(z - t\right) \cdot \color{blue}{0.016666666666666666}\right)}^{-1} \cdot \left(x - y\right) \]
    9. Applied egg-rr76.4%

      \[\leadsto \color{blue}{{\left(\left(z - t\right) \cdot 0.016666666666666666\right)}^{-1}} \cdot \left(x - y\right) \]
    10. Step-by-step derivation
      1. unpow-176.4%

        \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    11. Simplified76.4%

      \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    12. Taylor expanded in z around inf 53.6%

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

    if -4e177 < (-.f64 x y) < -4.00000000000000006e100 or 1.00000000000000005e236 < (-.f64 x y)

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity80.6%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac80.5%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity80.5%

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

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

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

    if -4.00000000000000006e100 < (-.f64 x y) < 1.99999999999999998e204

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

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

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

Alternative 3: 53.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x - y \leq -4 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x - y \leq 10^{+236}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

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


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

    1. Initial program 96.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity74.6%

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

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity76.1%

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

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

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

    if -4e177 < (-.f64 x y) < -4.00000000000000006e100 or 1.00000000000000005e236 < (-.f64 x y)

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity80.6%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac80.5%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity80.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
    10. Applied egg-rr62.2%

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

    if -4.00000000000000006e100 < (-.f64 x y) < 1.99999999999999998e204

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

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

    if 1.99999999999999998e204 < (-.f64 x y) < 1.00000000000000005e236

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity77.8%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac77.5%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity77.5%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) \]
      2. inv-pow77.7%

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

        \[\leadsto {\color{blue}{\left(\left(z - t\right) \cdot \frac{1}{60}\right)}}^{-1} \cdot \left(x - y\right) \]
      4. metadata-eval77.7%

        \[\leadsto {\left(\left(z - t\right) \cdot \color{blue}{0.016666666666666666}\right)}^{-1} \cdot \left(x - y\right) \]
    9. Applied egg-rr77.7%

      \[\leadsto \color{blue}{{\left(\left(z - t\right) \cdot 0.016666666666666666\right)}^{-1}} \cdot \left(x - y\right) \]
    10. Step-by-step derivation
      1. unpow-177.7%

        \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    11. Simplified77.7%

      \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    12. Taylor expanded in z around inf 77.7%

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

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

Alternative 4: 73.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ t_2 := a \cdot 120 + 60 \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -7 \cdot 10^{+81}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-90}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-197}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-97}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+76}:\\ \;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* a 120.0) (* -60.0 (/ (- x y) t))))
        (t_2 (+ (* a 120.0) (* 60.0 (/ x z)))))
   (if (<= z -7e+81)
     t_2
     (if (<= z -2.4e-90)
       t_1
       (if (<= z -1.8e-197)
         (* 60.0 (/ (- x y) (- z t)))
         (if (<= z 3.8e-97)
           t_1
           (if (<= z 2.6e+76)
             (/ (- x y) (* (- z t) 0.016666666666666666))
             t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 * ((x - y) / t));
	double t_2 = (a * 120.0) + (60.0 * (x / z));
	double tmp;
	if (z <= -7e+81) {
		tmp = t_2;
	} else if (z <= -2.4e-90) {
		tmp = t_1;
	} else if (z <= -1.8e-197) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 3.8e-97) {
		tmp = t_1;
	} else if (z <= 2.6e+76) {
		tmp = (x - y) / ((z - t) * 0.016666666666666666);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
    t_2 = (a * 120.0d0) + (60.0d0 * (x / z))
    if (z <= (-7d+81)) then
        tmp = t_2
    else if (z <= (-2.4d-90)) then
        tmp = t_1
    else if (z <= (-1.8d-197)) then
        tmp = 60.0d0 * ((x - y) / (z - t))
    else if (z <= 3.8d-97) then
        tmp = t_1
    else if (z <= 2.6d+76) then
        tmp = (x - y) / ((z - t) * 0.016666666666666666d0)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (a * 120.0) + (-60.0 * ((x - y) / t));
	double t_2 = (a * 120.0) + (60.0 * (x / z));
	double tmp;
	if (z <= -7e+81) {
		tmp = t_2;
	} else if (z <= -2.4e-90) {
		tmp = t_1;
	} else if (z <= -1.8e-197) {
		tmp = 60.0 * ((x - y) / (z - t));
	} else if (z <= 3.8e-97) {
		tmp = t_1;
	} else if (z <= 2.6e+76) {
		tmp = (x - y) / ((z - t) * 0.016666666666666666);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (a * 120.0) + (-60.0 * ((x - y) / t))
	t_2 = (a * 120.0) + (60.0 * (x / z))
	tmp = 0
	if z <= -7e+81:
		tmp = t_2
	elif z <= -2.4e-90:
		tmp = t_1
	elif z <= -1.8e-197:
		tmp = 60.0 * ((x - y) / (z - t))
	elif z <= 3.8e-97:
		tmp = t_1
	elif z <= 2.6e+76:
		tmp = (x - y) / ((z - t) * 0.016666666666666666)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t)))
	t_2 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z)))
	tmp = 0.0
	if (z <= -7e+81)
		tmp = t_2;
	elseif (z <= -2.4e-90)
		tmp = t_1;
	elseif (z <= -1.8e-197)
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	elseif (z <= 3.8e-97)
		tmp = t_1;
	elseif (z <= 2.6e+76)
		tmp = Float64(Float64(x - y) / Float64(Float64(z - t) * 0.016666666666666666));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (a * 120.0) + (-60.0 * ((x - y) / t));
	t_2 = (a * 120.0) + (60.0 * (x / z));
	tmp = 0.0;
	if (z <= -7e+81)
		tmp = t_2;
	elseif (z <= -2.4e-90)
		tmp = t_1;
	elseif (z <= -1.8e-197)
		tmp = 60.0 * ((x - y) / (z - t));
	elseif (z <= 3.8e-97)
		tmp = t_1;
	elseif (z <= 2.6e+76)
		tmp = (x - y) / ((z - t) * 0.016666666666666666);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+81], t$95$2, If[LessEqual[z, -2.4e-90], t$95$1, If[LessEqual[z, -1.8e-197], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-97], t$95$1, If[LessEqual[z, 2.6e+76], N[(N[(x - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+76}:\\
\;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.0000000000000001e81 or 2.5999999999999999e76 < z

    1. Initial program 98.7%

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

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

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

    if -7.0000000000000001e81 < z < -2.4000000000000002e-90 or -1.7999999999999999e-197 < z < 3.8000000000000001e-97

    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*98.8%

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

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

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

    if -2.4000000000000002e-90 < z < -1.7999999999999999e-197

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

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

    if 3.8000000000000001e-97 < z < 2.5999999999999999e76

    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 a around 0 71.4%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity71.2%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac71.4%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity71.4%

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} \]
    8. Step-by-step derivation
      1. clear-num71.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) \]
      2. inv-pow71.3%

        \[\leadsto \color{blue}{{\left(\frac{z - t}{60}\right)}^{-1}} \cdot \left(x - y\right) \]
      3. div-inv71.3%

        \[\leadsto {\color{blue}{\left(\left(z - t\right) \cdot \frac{1}{60}\right)}}^{-1} \cdot \left(x - y\right) \]
      4. metadata-eval71.3%

        \[\leadsto {\left(\left(z - t\right) \cdot \color{blue}{0.016666666666666666}\right)}^{-1} \cdot \left(x - y\right) \]
    9. Applied egg-rr71.3%

      \[\leadsto \color{blue}{{\left(\left(z - t\right) \cdot 0.016666666666666666\right)}^{-1}} \cdot \left(x - y\right) \]
    10. Step-by-step derivation
      1. unpow-171.3%

        \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    11. Simplified71.3%

      \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    12. Step-by-step derivation
      1. associate-*l/71.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(x - y\right)}{\left(z - t\right) \cdot 0.016666666666666666}} \]
      2. *-un-lft-identity71.4%

        \[\leadsto \frac{\color{blue}{x - y}}{\left(z - t\right) \cdot 0.016666666666666666} \]
    13. Applied egg-rr71.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+81}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-90}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-197}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-97}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+76}:\\ \;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -92 \lor \neg \left(a \leq 1.15 \cdot 10^{-13}\right) \land \left(a \leq 2.25 \cdot 10^{+135} \lor \neg \left(a \leq 5 \cdot 10^{+164}\right)\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -92 or 1.1499999999999999e-13 < a < 2.25000000000000004e135 or 4.9999999999999995e164 < a

    1. Initial program 98.3%

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

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

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

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

    if -92 < a < 1.1499999999999999e-13 or 2.25000000000000004e135 < a < 4.9999999999999995e164

    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. Taylor expanded in a around 0 82.8%

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

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

Alternative 6: 73.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -20 \lor \neg \left(a \leq 2.9 \cdot 10^{-13} \lor \neg \left(a \leq 2.25 \cdot 10^{+135}\right) \land a \leq 1.95 \cdot 10^{+164}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -20 or 2.8999999999999998e-13 < a < 2.25000000000000004e135 or 1.94999999999999993e164 < a

    1. Initial program 98.3%

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

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

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

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

    if -20 < a < 2.8999999999999998e-13 or 2.25000000000000004e135 < a < 1.94999999999999993e164

    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. Taylor expanded in a around 0 82.8%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity82.8%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac82.8%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity82.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -20 \lor \neg \left(a \leq 2.9 \cdot 10^{-13} \lor \neg \left(a \leq 2.25 \cdot 10^{+135}\right) \land a \leq 1.95 \cdot 10^{+164}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -1.65 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-235}:\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\

\mathbf{elif}\;a \leq 2.3 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.4000000000000004e-121 or 2.3000000000000001e-41 < a

    1. Initial program 98.6%

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

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

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

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

    if -7.4000000000000004e-121 < a < -1.64999999999999999e-289 or 1.2499999999999999e-235 < a < 2.3000000000000001e-41

    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. Taylor expanded in x around inf 53.1%

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

    if -1.64999999999999999e-289 < a < 1.2499999999999999e-235

    1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
      4. sub-neg99.6%

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

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
      6. neg-sub099.6%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
      7. associate-+l-99.6%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
      8. sub0-neg99.6%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
      9. distribute-frac-neg299.6%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.6%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.6%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 72.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.4 \cdot 10^{-121}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-289}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-235}:\\ \;\;\;\;60 \cdot \frac{y}{t - z}\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{-41}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.2% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -2.0000000000000001e-58 or 4.9999999999999998e-39 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.6%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
      4. sub-neg99.2%

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

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
      6. neg-sub099.2%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
      7. associate-+l-99.2%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
      8. sub0-neg99.2%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
      9. distribute-frac-neg299.2%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.2%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 82.9%

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

    if -2.0000000000000001e-58 < (*.f64 a #s(literal 120 binary64)) < 4.9999999999999998e-39

    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. Taylor expanded in a around 0 84.5%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity84.6%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac84.6%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity84.6%

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} \]
    8. Step-by-step derivation
      1. clear-num84.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) \]
      2. inv-pow84.5%

        \[\leadsto \color{blue}{{\left(\frac{z - t}{60}\right)}^{-1}} \cdot \left(x - y\right) \]
      3. div-inv84.5%

        \[\leadsto {\color{blue}{\left(\left(z - t\right) \cdot \frac{1}{60}\right)}}^{-1} \cdot \left(x - y\right) \]
      4. metadata-eval84.5%

        \[\leadsto {\left(\left(z - t\right) \cdot \color{blue}{0.016666666666666666}\right)}^{-1} \cdot \left(x - y\right) \]
    9. Applied egg-rr84.5%

      \[\leadsto \color{blue}{{\left(\left(z - t\right) \cdot 0.016666666666666666\right)}^{-1}} \cdot \left(x - y\right) \]
    10. Step-by-step derivation
      1. unpow-184.5%

        \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    11. Simplified84.5%

      \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    12. Step-by-step derivation
      1. associate-*l/84.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(x - y\right)}{\left(z - t\right) \cdot 0.016666666666666666}} \]
      2. *-un-lft-identity84.6%

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

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

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

Alternative 9: 73.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -10000:\\
\;\;\;\;a \cdot 120\\

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

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


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

    1. Initial program 98.5%

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

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

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

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

    if -1e4 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000001e-41

    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. Taylor expanded in a around 0 82.2%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity82.3%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac82.2%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity82.2%

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

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

    if 1.00000000000000001e-41 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.3%

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

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

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

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

Alternative 10: 73.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -10000:\\
\;\;\;\;a \cdot 120\\

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

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


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

    1. Initial program 98.5%

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

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

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

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

    if -1e4 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000001e-41

    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. Taylor expanded in a around 0 82.2%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity82.3%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac82.2%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity82.2%

        \[\leadsto \frac{60}{z - t} \cdot \color{blue}{\left(x - y\right)} \]
      5. associate-/r/82.3%

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} \]
    7. Simplified82.3%

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

    if 1.00000000000000001e-41 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.3%

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

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

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

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

Alternative 11: 58.4% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.49999999999999995e-60 or 1.50000000000000014e-39 < a

    1. Initial program 98.6%

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

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

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

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

    if -6.49999999999999995e-60 < a < -1.14999999999999995e-138

    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.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. Taylor expanded in a around 0 74.0%

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity73.8%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac74.0%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity74.0%

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

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

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

    if -1.14999999999999995e-138 < a < 1.50000000000000014e-39

    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. Taylor expanded in a around 0 85.9%

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

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

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac85.9%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity85.9%

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

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

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

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

Alternative 12: 89.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.00000000000000007e133 or 5.00000000000000022e47 < y

    1. Initial program 98.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
      4. sub-neg98.7%

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

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
      6. neg-sub098.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
      7. associate-+l-98.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
      8. sub0-neg98.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
      9. distribute-frac-neg298.7%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac98.7%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval98.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 89.0%

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

    if -3.00000000000000007e133 < y < 5.00000000000000022e47

    1. Initial program 99.8%

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

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

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

Alternative 13: 57.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-121} \lor \neg \left(a \leq 3 \cdot 10^{-32}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.9999999999999998e-121 or 3e-32 < a

    1. Initial program 98.6%

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

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

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

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

    if -7.9999999999999998e-121 < a < 3e-32

    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. Taylor expanded in x around inf 47.6%

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

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

Alternative 14: 50.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+58} \lor \neg \left(x \leq 6.4 \cdot 10^{+201}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.90000000000000018e58 or 6.3999999999999998e201 < x

    1. Initial program 98.6%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
      4. sub-neg99.7%

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

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
      6. neg-sub099.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
      7. associate-+l-99.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
      8. sub0-neg99.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
      9. distribute-frac-neg299.7%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.7%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.7%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 64.2%

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t - z}} \]
    7. Simplified63.1%

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

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

    if -4.90000000000000018e58 < x < 6.3999999999999998e201

    1. Initial program 99.2%

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

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

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

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

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

Alternative 15: 52.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+194} \lor \neg \left(x \leq 3.9 \cdot 10^{+202}\right):\\
\;\;\;\;60 \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4999999999999999e194 or 3.89999999999999983e202 < x

    1. Initial program 98.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{60}{z - t}, a \cdot 120\right)} \]
      4. sub-neg99.8%

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

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(-t\right) + z}}, a \cdot 120\right) \]
      6. neg-sub099.8%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{\left(0 - t\right)} + z}, a \cdot 120\right) \]
      7. associate-+l-99.8%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{0 - \left(t - z\right)}}, a \cdot 120\right) \]
      8. sub0-neg99.8%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{60}{\color{blue}{-\left(t - z\right)}}, a \cdot 120\right) \]
      9. distribute-frac-neg299.8%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.8%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.8%

        \[\leadsto \mathsf{fma}\left(x - y, \frac{\color{blue}{-60}}{t - z}, a \cdot 120\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - y, \frac{-60}{t - z}, a \cdot 120\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 70.7%

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t - z}} \]
    7. Simplified69.1%

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

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

    if -5.4999999999999999e194 < x < 3.89999999999999983e202

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

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

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

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

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

Alternative 16: 51.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+228} \lor \neg \left(y \leq 4.2 \cdot 10^{+100}\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 < -5.80000000000000003e228 or 4.1999999999999997e100 < y

    1. Initial program 98.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity80.1%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac79.9%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity79.9%

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

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

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

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

    if -5.80000000000000003e228 < y < 4.1999999999999997e100

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

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

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

Alternative 17: 51.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 3.8 \cdot 10^{+100}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity85.3%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac84.9%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity84.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
    10. Applied egg-rr74.3%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
    13. Simplified67.7%

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

    if -2.35e229 < y < 3.79999999999999963e100

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

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

    if 3.79999999999999963e100 < y

    1. Initial program 97.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity78.7%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac78.5%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity78.5%

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

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

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

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

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

Alternative 18: 99.8% 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.0%

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

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

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

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

Alternative 19: 51.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+137}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.20000000000000015e137

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

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

    if 2.20000000000000015e137 < y

    1. Initial program 97.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-rgt-identity81.6%

        \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac81.4%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \frac{x - y}{1}} \]
      4. /-rgt-identity81.4%

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} \]
    8. Step-by-step derivation
      1. clear-num81.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) \]
      2. inv-pow81.4%

        \[\leadsto \color{blue}{{\left(\frac{z - t}{60}\right)}^{-1}} \cdot \left(x - y\right) \]
      3. div-inv81.4%

        \[\leadsto {\color{blue}{\left(\left(z - t\right) \cdot \frac{1}{60}\right)}}^{-1} \cdot \left(x - y\right) \]
      4. metadata-eval81.4%

        \[\leadsto {\left(\left(z - t\right) \cdot \color{blue}{0.016666666666666666}\right)}^{-1} \cdot \left(x - y\right) \]
    9. Applied egg-rr81.4%

      \[\leadsto \color{blue}{{\left(\left(z - t\right) \cdot 0.016666666666666666\right)}^{-1}} \cdot \left(x - y\right) \]
    10. Step-by-step derivation
      1. unpow-181.4%

        \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    11. Simplified81.4%

      \[\leadsto \color{blue}{\frac{1}{\left(z - t\right) \cdot 0.016666666666666666}} \cdot \left(x - y\right) \]
    12. Taylor expanded in z around inf 46.9%

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

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

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

Alternative 20: 50.4% 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.0%

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

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

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

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

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