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

Percentage Accurate: 99.4% → 99.8%
Time: 13.4s
Alternatives: 21
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 21 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(a, 120, \frac{60}{\frac{z - t}{x - y}}\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (fma a 120.0 (/ 60.0 (/ (- z t) (- x y)))))
double code(double x, double y, double z, double t, double a) {
	return fma(a, 120.0, (60.0 / ((z - t) / (x - y))));
}
function code(x, y, z, t, a)
	return fma(a, 120.0, Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))))
end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

Alternative 2: 82.7% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000002e75

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

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

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

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

    if -5.0000000000000002e75 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e153

    1. Initial program 99.8%

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

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

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

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

    if 2e153 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 3: 71.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -1.9999999999999999e45 or 9.99999999999999946e33 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e45 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999946e33

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

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

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

Alternative 4: 71.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -1.9999999999999999e45 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999946e33

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

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

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

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

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

    if 9.99999999999999946e33 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{60}{\color{blue}{\frac{-1 \cdot z}{y}}} + a \cdot 120 \]
      2. neg-mul-190.7%

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

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

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

Alternative 5: 71.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -1.9999999999999999e45 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999946e33

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

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

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

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

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

    if 9.99999999999999946e33 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 71.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -1.9999999999999999e45 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999946e33

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

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

    if 9.99999999999999946e33 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -1e11 < (*.f64 a #s(literal 120 binary64)) < 4e5

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

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

    if 4e5 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 88.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.75e37 or 1.4000000000000001e-29 < y

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

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

    if -1.75e37 < y < 1.4000000000000001e-29

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

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

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

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

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

Alternative 9: 89.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e37 or 1.99999999999999989e-29 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity87.0%

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

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

    if -1.3e37 < y < 1.99999999999999989e-29

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

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

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

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

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

Alternative 10: 88.9% accurate, 0.6× speedup?

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

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

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

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


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

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

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

    if -6.5000000000000003e35 < y < 2.39999999999999992e-29

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

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

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

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

    if 2.39999999999999992e-29 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{60}{\color{blue}{-\frac{z - t}{y}}} + a \cdot 120 \]
      2. distribute-neg-frac289.9%

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

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

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

Alternative 11: 74.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -124 \lor \neg \left(a \leq 5500\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 -124.0) (not (<= a 5500.0)))
   (* a 120.0)
   (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -124.0) || !(a <= 5500.0)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((a <= (-124.0d0)) .or. (.not. (a <= 5500.0d0))) then
        tmp = a * 120.0d0
    else
        tmp = 60.0d0 * ((x - y) / (z - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -124.0) || !(a <= 5500.0)) {
		tmp = a * 120.0;
	} else {
		tmp = 60.0 * ((x - y) / (z - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -124.0) or not (a <= 5500.0):
		tmp = a * 120.0
	else:
		tmp = 60.0 * ((x - y) / (z - t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -124.0) || !(a <= 5500.0))
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -124.0) || ~((a <= 5500.0)))
		tmp = a * 120.0;
	else
		tmp = 60.0 * ((x - y) / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -124.0], N[Not[LessEqual[a, 5500.0]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -124 \lor \neg \left(a \leq 5500\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 < -124 or 5500 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -124 < a < 5500

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

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

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

Alternative 12: 58.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+161} \lor \neg \left(y \leq 1.8 \cdot 10^{+77}\right):\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.00000000000000011e161 or 1.7999999999999999e77 < y

    1. Initial program 99.7%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 y around inf 62.0%

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

    if -3.00000000000000011e161 < y < 1.7999999999999999e77

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 62.6%

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

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

Alternative 13: 57.3% accurate, 0.8× speedup?

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e-17 < a < 1.25e-14

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in x around inf 38.5%

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

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

Alternative 14: 58.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+77}:\\
\;\;\;\;a \cdot 120\\

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


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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in y around inf 67.4%

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
    9. Simplified67.6%

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

    if -4.2000000000000001e162 < y < 2.0999999999999999e77

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 62.6%

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

    if 2.0999999999999999e77 < y

    1. Initial program 99.7%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 y around inf 59.4%

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

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

Alternative 15: 50.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.3 \cdot 10^{-283} \lor \neg \left(z \leq 2.85 \cdot 10^{-173}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.29999999999999981e-283 or 2.85e-173 < z

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 54.1%

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

    if -8.29999999999999981e-283 < z < 2.85e-173

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in y around inf 66.2%

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
    9. Simplified66.3%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
      2. *-commutative66.3%

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
    12. Simplified66.3%

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

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

Alternative 16: 50.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-285} \lor \neg \left(z \leq 6.2 \cdot 10^{-183}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.3e-285 or 6.19999999999999999e-183 < z

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 54.1%

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

    if -5.3e-285 < z < 6.19999999999999999e-183

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in y around inf 66.2%

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
    9. Simplified66.3%

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

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

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

Alternative 17: 52.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+163} \lor \neg \left(y \leq 3.9 \cdot 10^{+172}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.44999999999999999e163 or 3.89999999999999967e172 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in y around inf 67.6%

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

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

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

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

    if -1.44999999999999999e163 < y < 3.89999999999999967e172

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 59.6%

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

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

Alternative 18: 99.8% accurate, 1.0× speedup?

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

\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
Derivation
  1. Initial program 99.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. Step-by-step derivation
    1. clear-num99.8%

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

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

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

Alternative 19: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 20: 52.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8999999999999999e215

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)} \]
    7. Taylor expanded in x around inf 74.1%

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

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

    if -2.8999999999999999e215 < x

    1. Initial program 99.8%

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z - t} + a \cdot 120 \]
      2. associate-/l*99.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 t around inf 52.1%

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

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

Alternative 21: 51.1% accurate, 4.3× speedup?

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

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

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

      \[\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 t around inf 49.4%

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

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

Developer Target 1: 99.8% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024163 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))

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