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

Percentage Accurate: 99.4% → 99.5%
Time: 12.5s
Alternatives: 13
Speedup: 1.1×

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 13 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.5% accurate, 1.1× speedup?

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

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

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

      \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
    2. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t}\right) \]
    5. --lowering--.f64N/A

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

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

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

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+103}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} \]
      4. --lowering--.f64N/A

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

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

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

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

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6474.1

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified74.1%

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

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

Alternative 3: 60.0% 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 -2 \cdot 10^{+166}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+103}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -2e+166)
     (* -60.0 (/ y (- z t)))
     (if (<= t_1 2e+103) (* a 120.0) (/ (* (- x y) -60.0) t)))))
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 <= -2e+166) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= 2e+103) {
		tmp = a * 120.0;
	} else {
		tmp = ((x - y) * -60.0) / 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) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-2d+166)) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (t_1 <= 2d+103) then
        tmp = a * 120.0d0
    else
        tmp = ((x - y) * (-60.0d0)) / t
    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 <= -2e+166) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= 2e+103) {
		tmp = a * 120.0;
	} else {
		tmp = ((x - y) * -60.0) / t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -2e+166:
		tmp = -60.0 * (y / (z - t))
	elif t_1 <= 2e+103:
		tmp = a * 120.0
	else:
		tmp = ((x - y) * -60.0) / t
	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 <= -2e+166)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (t_1 <= 2e+103)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(Float64(Float64(x - y) * -60.0) / t);
	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 <= -2e+166)
		tmp = -60.0 * (y / (z - t));
	elseif (t_1 <= 2e+103)
		tmp = a * 120.0;
	else
		tmp = ((x - y) * -60.0) / t;
	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, -2e+166], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+103], N[(a * 120.0), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+103}:\\
\;\;\;\;a \cdot 120\\

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


\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)) < -1.99999999999999988e166

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6452.2

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Simplified52.2%

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

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

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6472.1

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified72.1%

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

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

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
    4. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-60, \color{blue}{\frac{x - y}{t}}, 120 \cdot a\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(-60, \frac{\color{blue}{x - y}}{t}, 120 \cdot a\right) \]
      4. *-lowering-*.f6462.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot -60}}{t} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot -60}}{t} \]
      5. --lowering--.f6458.9

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

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

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

Alternative 4: 59.2% 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 -2 \cdot 10^{+166}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+152}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -2e+166)
     (* -60.0 (/ y (- z t)))
     (if (<= t_1 5e+152) (* a 120.0) (/ (* y -60.0) (- z t))))))
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 <= -2e+166) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= 5e+152) {
		tmp = a * 120.0;
	} else {
		tmp = (y * -60.0) / (z - t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-2d+166)) then
        tmp = (-60.0d0) * (y / (z - t))
    else if (t_1 <= 5d+152) then
        tmp = a * 120.0d0
    else
        tmp = (y * (-60.0d0)) / (z - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_1 <= -2e+166) {
		tmp = -60.0 * (y / (z - t));
	} else if (t_1 <= 5e+152) {
		tmp = a * 120.0;
	} else {
		tmp = (y * -60.0) / (z - t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -2e+166:
		tmp = -60.0 * (y / (z - t))
	elif t_1 <= 5e+152:
		tmp = a * 120.0
	else:
		tmp = (y * -60.0) / (z - t)
	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 <= -2e+166)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (t_1 <= 5e+152)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(Float64(y * -60.0) / Float64(z - t));
	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 <= -2e+166)
		tmp = -60.0 * (y / (z - t));
	elseif (t_1 <= 5e+152)
		tmp = a * 120.0;
	else
		tmp = (y * -60.0) / (z - t);
	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, -2e+166], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+152], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;a \cdot 120\\

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


\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)) < -1.99999999999999988e166

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6452.2

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Simplified52.2%

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

    if -1.99999999999999988e166 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e152

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6470.2

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified70.2%

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

    if 5e152 < (/.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t}\right) \]
      5. --lowering--.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} \]
      5. --lowering--.f6461.2

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

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

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

Alternative 5: 59.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999988e166 or 5e152 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{-60 \cdot \frac{y}{z - t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6456.5

        \[\leadsto -60 \cdot \frac{y}{\color{blue}{z - t}} \]
    5. Simplified56.5%

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

    if -1.99999999999999988e166 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e152

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6470.2

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified70.2%

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

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

Alternative 6: 55.4% 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 -2 \cdot 10^{+166}:\\ \;\;\;\;60 \cdot \frac{x}{z}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+180}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{60}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_1 -2e+166)
     (* 60.0 (/ x z))
     (if (<= t_1 5e+180) (* a 120.0) (* y (/ 60.0 t))))))
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 <= -2e+166) {
		tmp = 60.0 * (x / z);
	} else if (t_1 <= 5e+180) {
		tmp = a * 120.0;
	} else {
		tmp = y * (60.0 / 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) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if (t_1 <= (-2d+166)) then
        tmp = 60.0d0 * (x / z)
    else if (t_1 <= 5d+180) then
        tmp = a * 120.0d0
    else
        tmp = y * (60.0d0 / t)
    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 <= -2e+166) {
		tmp = 60.0 * (x / z);
	} else if (t_1 <= 5e+180) {
		tmp = a * 120.0;
	} else {
		tmp = y * (60.0 / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_1 <= -2e+166:
		tmp = 60.0 * (x / z)
	elif t_1 <= 5e+180:
		tmp = a * 120.0
	else:
		tmp = y * (60.0 / t)
	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 <= -2e+166)
		tmp = Float64(60.0 * Float64(x / z));
	elseif (t_1 <= 5e+180)
		tmp = Float64(a * 120.0);
	else
		tmp = Float64(y * Float64(60.0 / t));
	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 <= -2e+166)
		tmp = 60.0 * (x / z);
	elseif (t_1 <= 5e+180)
		tmp = a * 120.0;
	else
		tmp = y * (60.0 / t);
	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, -2e+166], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+180], N[(a * 120.0), $MachinePrecision], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+180}:\\
\;\;\;\;a \cdot 120\\

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


\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)) < -1.99999999999999988e166

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t} \]
      2. associate-*l/N/A

        \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)} \]
      3. associate-*l*N/A

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
      6. associate-*r/N/A

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

        \[\leadsto x \cdot \frac{\color{blue}{60}}{z - t} \]
      8. /-lowering-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6445.1

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

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

      \[\leadsto x \cdot \frac{60}{\color{blue}{z}} \]
    7. Step-by-step derivation
      1. Simplified34.2%

        \[\leadsto x \cdot \frac{60}{\color{blue}{z}} \]
      2. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{x \cdot 60}{z}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{60 \cdot x}}{z} \]
        3. associate-/l*N/A

          \[\leadsto \color{blue}{60 \cdot \frac{x}{z}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{x}{z} \cdot 60} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{\frac{x}{z} \cdot 60} \]
        6. /-lowering-/.f6434.3

          \[\leadsto \color{blue}{\frac{x}{z}} \cdot 60 \]
      3. Applied egg-rr34.3%

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

      if -1.99999999999999988e166 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999996e180

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{120 \cdot a} \]
      4. Step-by-step derivation
        1. *-lowering-*.f6469.4

          \[\leadsto \color{blue}{120 \cdot a} \]
      5. Simplified69.4%

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

      if 4.9999999999999996e180 < (/.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. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
      4. Step-by-step derivation
        1. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fma}\left(-60, \color{blue}{\frac{x - y}{t}}, 120 \cdot a\right) \]
        3. --lowering--.f64N/A

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
      6. Taylor expanded in t around 0

        \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t}} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
        3. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot -60}}{t} \]
        4. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
      10. Step-by-step derivation
        1. *-lft-identityN/A

          \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
        2. associate-*l/N/A

          \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{t}\right) \cdot y} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \left(60 \cdot \frac{1}{t}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{y \cdot \left(60 \cdot \frac{1}{t}\right)} \]
        6. associate-*r/N/A

          \[\leadsto y \cdot \color{blue}{\frac{60 \cdot 1}{t}} \]
        7. metadata-evalN/A

          \[\leadsto y \cdot \frac{\color{blue}{60}}{t} \]
        8. /-lowering-/.f6451.7

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

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

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

    Alternative 7: 55.4% 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 -2 \cdot 10^{+166}:\\ \;\;\;\;x \cdot \frac{60}{z}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+180}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{60}{t}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
       (if (<= t_1 -2e+166)
         (* x (/ 60.0 z))
         (if (<= t_1 5e+180) (* a 120.0) (* y (/ 60.0 t))))))
    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 <= -2e+166) {
    		tmp = x * (60.0 / z);
    	} else if (t_1 <= 5e+180) {
    		tmp = a * 120.0;
    	} else {
    		tmp = y * (60.0 / 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) :: t_1
        real(8) :: tmp
        t_1 = (60.0d0 * (x - y)) / (z - t)
        if (t_1 <= (-2d+166)) then
            tmp = x * (60.0d0 / z)
        else if (t_1 <= 5d+180) then
            tmp = a * 120.0d0
        else
            tmp = y * (60.0d0 / t)
        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 <= -2e+166) {
    		tmp = x * (60.0 / z);
    	} else if (t_1 <= 5e+180) {
    		tmp = a * 120.0;
    	} else {
    		tmp = y * (60.0 / t);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = (60.0 * (x - y)) / (z - t)
    	tmp = 0
    	if t_1 <= -2e+166:
    		tmp = x * (60.0 / z)
    	elif t_1 <= 5e+180:
    		tmp = a * 120.0
    	else:
    		tmp = y * (60.0 / t)
    	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 <= -2e+166)
    		tmp = Float64(x * Float64(60.0 / z));
    	elseif (t_1 <= 5e+180)
    		tmp = Float64(a * 120.0);
    	else
    		tmp = Float64(y * Float64(60.0 / t));
    	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 <= -2e+166)
    		tmp = x * (60.0 / z);
    	elseif (t_1 <= 5e+180)
    		tmp = a * 120.0;
    	else
    		tmp = y * (60.0 / t);
    	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, -2e+166], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+180], N[(a * 120.0), $MachinePrecision], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+166}:\\
    \;\;\;\;x \cdot \frac{60}{z}\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+180}:\\
    \;\;\;\;a \cdot 120\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot \frac{60}{t}\\
    
    
    \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)) < -1.99999999999999988e166

      1. Initial program 99.7%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
      4. Step-by-step derivation
        1. *-lft-identityN/A

          \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t} \]
        2. associate-*l/N/A

          \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
        6. associate-*r/N/A

          \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
        7. metadata-evalN/A

          \[\leadsto x \cdot \frac{\color{blue}{60}}{z - t} \]
        8. /-lowering-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
        9. --lowering--.f6445.1

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

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

        \[\leadsto x \cdot \frac{60}{\color{blue}{z}} \]
      7. Step-by-step derivation
        1. Simplified34.2%

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

        if -1.99999999999999988e166 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999996e180

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{120 \cdot a} \]
        4. Step-by-step derivation
          1. *-lowering-*.f6469.4

            \[\leadsto \color{blue}{120 \cdot a} \]
        5. Simplified69.4%

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

        if 4.9999999999999996e180 < (/.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. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
        4. Step-by-step derivation
          1. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fma}\left(-60, \color{blue}{\frac{x - y}{t}}, 120 \cdot a\right) \]
          3. --lowering--.f64N/A

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
        6. Taylor expanded in t around 0

          \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t}} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \color{blue}{\frac{-60 \cdot \left(x - y\right)}{t}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot -60}}{t} \]
          4. *-lowering-*.f64N/A

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

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

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

          \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
        10. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
          2. associate-*l/N/A

            \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{t}\right) \cdot y} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{y \cdot \left(60 \cdot \frac{1}{t}\right)} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \left(60 \cdot \frac{1}{t}\right)} \]
          6. associate-*r/N/A

            \[\leadsto y \cdot \color{blue}{\frac{60 \cdot 1}{t}} \]
          7. metadata-evalN/A

            \[\leadsto y \cdot \frac{\color{blue}{60}}{t} \]
          8. /-lowering-/.f6451.7

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

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

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

      Alternative 8: 55.0% 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 -2 \cdot 10^{+166}:\\ \;\;\;\;x \cdot \frac{60}{z}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+103}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
         (if (<= t_1 -2e+166)
           (* x (/ 60.0 z))
           (if (<= t_1 2e+103) (* a 120.0) (* x (/ -60.0 t))))))
      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 <= -2e+166) {
      		tmp = x * (60.0 / z);
      	} else if (t_1 <= 2e+103) {
      		tmp = a * 120.0;
      	} else {
      		tmp = x * (-60.0 / 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) :: t_1
          real(8) :: tmp
          t_1 = (60.0d0 * (x - y)) / (z - t)
          if (t_1 <= (-2d+166)) then
              tmp = x * (60.0d0 / z)
          else if (t_1 <= 2d+103) then
              tmp = a * 120.0d0
          else
              tmp = x * ((-60.0d0) / t)
          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 <= -2e+166) {
      		tmp = x * (60.0 / z);
      	} else if (t_1 <= 2e+103) {
      		tmp = a * 120.0;
      	} else {
      		tmp = x * (-60.0 / t);
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = (60.0 * (x - y)) / (z - t)
      	tmp = 0
      	if t_1 <= -2e+166:
      		tmp = x * (60.0 / z)
      	elif t_1 <= 2e+103:
      		tmp = a * 120.0
      	else:
      		tmp = x * (-60.0 / t)
      	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 <= -2e+166)
      		tmp = Float64(x * Float64(60.0 / z));
      	elseif (t_1 <= 2e+103)
      		tmp = Float64(a * 120.0);
      	else
      		tmp = Float64(x * Float64(-60.0 / t));
      	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 <= -2e+166)
      		tmp = x * (60.0 / z);
      	elseif (t_1 <= 2e+103)
      		tmp = a * 120.0;
      	else
      		tmp = x * (-60.0 / t);
      	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, -2e+166], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+103], N[(a * 120.0), $MachinePrecision], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
      \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+166}:\\
      \;\;\;\;x \cdot \frac{60}{z}\\
      
      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+103}:\\
      \;\;\;\;a \cdot 120\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \frac{-60}{t}\\
      
      
      \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)) < -1.99999999999999988e166

        1. Initial program 99.7%

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

          \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
        4. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t} \]
          2. associate-*l/N/A

            \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)} \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
          6. associate-*r/N/A

            \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
          7. metadata-evalN/A

            \[\leadsto x \cdot \frac{\color{blue}{60}}{z - t} \]
          8. /-lowering-/.f64N/A

            \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
          9. --lowering--.f6445.1

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

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

          \[\leadsto x \cdot \frac{60}{\color{blue}{z}} \]
        7. Step-by-step derivation
          1. Simplified34.2%

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

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

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{120 \cdot a} \]
          4. Step-by-step derivation
            1. *-lowering-*.f6472.1

              \[\leadsto \color{blue}{120 \cdot a} \]
          5. Simplified72.1%

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

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

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
          4. Step-by-step derivation
            1. *-lft-identityN/A

              \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t} \]
            2. associate-*l/N/A

              \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)} \]
            3. associate-*l*N/A

              \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
            5. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
            6. associate-*r/N/A

              \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
            7. metadata-evalN/A

              \[\leadsto x \cdot \frac{\color{blue}{60}}{z - t} \]
            8. /-lowering-/.f64N/A

              \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
            9. --lowering--.f6440.0

              \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
          5. Simplified40.0%

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

            \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
          7. Step-by-step derivation
            1. /-lowering-/.f6427.4

              \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
          8. Simplified27.4%

            \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification60.7%

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

        Alternative 9: 55.3% accurate, 0.4× speedup?

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

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} \]
          4. Step-by-step derivation
            1. *-lft-identityN/A

              \[\leadsto 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t} \]
            2. associate-*l/N/A

              \[\leadsto 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)} \]
            3. associate-*l*N/A

              \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
            5. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)} \]
            6. associate-*r/N/A

              \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
            7. metadata-evalN/A

              \[\leadsto x \cdot \frac{\color{blue}{60}}{z - t} \]
            8. /-lowering-/.f64N/A

              \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
            9. --lowering--.f6444.2

              \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
          5. Simplified44.2%

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

            \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
          7. Step-by-step derivation
            1. /-lowering-/.f6427.9

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

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

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

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{120 \cdot a} \]
          4. Step-by-step derivation
            1. *-lowering-*.f6469.1

              \[\leadsto \color{blue}{120 \cdot a} \]
          5. Simplified69.1%

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

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

        Alternative 10: 89.5% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(120, a, x \cdot \frac{60}{z - t}\right)\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+64}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (fma 120.0 a (* x (/ 60.0 (- z t))))))
           (if (<= x -2.1e+34)
             t_1
             (if (<= x 1.65e+64) (fma a 120.0 (/ (* y -60.0) (- z t))) t_1))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = fma(120.0, a, (x * (60.0 / (z - t))));
        	double tmp;
        	if (x <= -2.1e+34) {
        		tmp = t_1;
        	} else if (x <= 1.65e+64) {
        		tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	t_1 = fma(120.0, a, Float64(x * Float64(60.0 / Float64(z - t))))
        	tmp = 0.0
        	if (x <= -2.1e+34)
        		tmp = t_1;
        	elseif (x <= 1.65e+64)
        		tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(120.0 * a + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+34], t$95$1, If[LessEqual[x, 1.65e+64], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(120, a, x \cdot \frac{60}{z - t}\right)\\
        \mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 1.65 \cdot 10^{+64}:\\
        \;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -2.10000000000000017e34 or 1.64999999999999994e64 < x

          1. Initial program 99.7%

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

            \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t} + 120 \cdot a} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{120 \cdot a + 60 \cdot \frac{x}{z - t}} \]
            2. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(120, a, 60 \cdot \frac{x}{z - t}\right)} \]
            3. *-lft-identityN/A

              \[\leadsto \mathsf{fma}\left(120, a, 60 \cdot \frac{\color{blue}{1 \cdot x}}{z - t}\right) \]
            4. associate-*l/N/A

              \[\leadsto \mathsf{fma}\left(120, a, 60 \cdot \color{blue}{\left(\frac{1}{z - t} \cdot x\right)}\right) \]
            5. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x}\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)}\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{x \cdot \left(60 \cdot \frac{1}{z - t}\right)}\right) \]
            8. associate-*r/N/A

              \[\leadsto \mathsf{fma}\left(120, a, x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}}\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{fma}\left(120, a, x \cdot \frac{\color{blue}{60}}{z - t}\right) \]
            10. /-lowering-/.f64N/A

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

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

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

          if -2.10000000000000017e34 < x < 1.64999999999999994e64

          1. Initial program 99.9%

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

              \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
            2. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
            3. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t}\right) \]
            5. --lowering--.f64N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{-60 \cdot \frac{y}{z - t}}\right) \]
          6. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{y \cdot -60}}{z - t}\right) \]
            4. *-lowering-*.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{y \cdot -60}{z - t}}\right) \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 11: 83.0% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-27}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (fma -60.0 (/ (- x y) t) (* a 120.0))))
           (if (<= t -3.8e+54)
             t_1
             (if (<= t 5.8e-27) (fma 60.0 (/ (- x y) z) (* a 120.0)) t_1))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = fma(-60.0, ((x - y) / t), (a * 120.0));
        	double tmp;
        	if (t <= -3.8e+54) {
        		tmp = t_1;
        	} else if (t <= 5.8e-27) {
        		tmp = fma(60.0, ((x - y) / z), (a * 120.0));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	t_1 = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0))
        	tmp = 0.0
        	if (t <= -3.8e+54)
        		tmp = t_1;
        	elseif (t <= 5.8e-27)
        		tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+54], t$95$1, If[LessEqual[t, 5.8e-27], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
        \mathbf{if}\;t \leq -3.8 \cdot 10^{+54}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 5.8 \cdot 10^{-27}:\\
        \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -3.8000000000000002e54 or 5.80000000000000008e-27 < t

          1. Initial program 99.7%

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

            \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
          4. Step-by-step derivation
            1. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(-60, \color{blue}{\frac{x - y}{t}}, 120 \cdot a\right) \]
            3. --lowering--.f64N/A

              \[\leadsto \mathsf{fma}\left(-60, \frac{\color{blue}{x - y}}{t}, 120 \cdot a\right) \]
            4. *-lowering-*.f6490.9

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

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

          if -3.8000000000000002e54 < t < 5.80000000000000008e-27

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
          4. Step-by-step derivation
            1. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(60, \color{blue}{\frac{x - y}{z}}, 120 \cdot a\right) \]
            3. --lowering--.f64N/A

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification88.6%

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

        Alternative 12: 77.2% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-41}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z}\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+69}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-60}{z}, y, a \cdot 120\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -4.3e-41)
           (fma a 120.0 (/ (* y -60.0) z))
           (if (<= z 1.9e+69)
             (fma -60.0 (/ (- x y) t) (* a 120.0))
             (fma (/ -60.0 z) y (* a 120.0)))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -4.3e-41) {
        		tmp = fma(a, 120.0, ((y * -60.0) / z));
        	} else if (z <= 1.9e+69) {
        		tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
        	} else {
        		tmp = fma((-60.0 / z), y, (a * 120.0));
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -4.3e-41)
        		tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / z));
        	elseif (z <= 1.9e+69)
        		tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0));
        	else
        		tmp = fma(Float64(-60.0 / z), y, Float64(a * 120.0));
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e-41], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+69], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(-60.0 / z), $MachinePrecision] * y + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -4.3 \cdot 10^{-41}:\\
        \;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z}\right)\\
        
        \mathbf{elif}\;z \leq 1.9 \cdot 10^{+69}:\\
        \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{-60}{z}, y, a \cdot 120\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -4.2999999999999999e-41

          1. Initial program 99.8%

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

              \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
            2. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
            3. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t}\right) \]
            5. --lowering--.f64N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{-60 \cdot \frac{y}{z - t}}\right) \]
          6. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{y \cdot -60}}{z - t}\right) \]
            4. *-lowering-*.f64N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(a, 120, \frac{y \cdot -60}{\color{blue}{z}}\right) \]
          9. Step-by-step derivation
            1. Simplified80.0%

              \[\leadsto \mathsf{fma}\left(a, 120, \frac{y \cdot -60}{\color{blue}{z}}\right) \]

            if -4.2999999999999999e-41 < z < 1.90000000000000014e69

            1. Initial program 99.7%

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

              \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
            4. Step-by-step derivation
              1. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fma}\left(-60, \color{blue}{\frac{x - y}{t}}, 120 \cdot a\right) \]
              3. --lowering--.f64N/A

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

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

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

            if 1.90000000000000014e69 < z

            1. Initial program 99.9%

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

                \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
              2. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z - t}\right)} \]
              3. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t}\right) \]
              5. --lowering--.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{-60 \cdot \frac{y}{z - t}}\right) \]
            6. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{-60 \cdot y}{z - t}}\right) \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{y \cdot -60}}{z - t}\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{y \cdot -60}}{z - t}\right) \]
              5. --lowering--.f6489.1

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

              \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{y \cdot -60}{z - t}}\right) \]
            8. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{y \cdot -60}{z - t} + a \cdot 120} \]
              2. associate-/l*N/A

                \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} + a \cdot 120 \]
              3. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{-60}{z - t} \cdot y} + a \cdot 120 \]
              4. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-60}{z - t}, y, a \cdot 120\right)} \]
              5. frac-2negN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(-60\right)}{\mathsf{neg}\left(\left(z - t\right)\right)}}, y, a \cdot 120\right) \]
              6. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(-60\right)}{\mathsf{neg}\left(\left(z - t\right)\right)}}, y, a \cdot 120\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{60}}{\mathsf{neg}\left(\left(z - t\right)\right)}, y, a \cdot 120\right) \]
              8. neg-sub0N/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{\color{blue}{0 - \left(z - t\right)}}, y, a \cdot 120\right) \]
              9. sub-negN/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{0 - \color{blue}{\left(z + \left(\mathsf{neg}\left(t\right)\right)\right)}}, y, a \cdot 120\right) \]
              10. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(t\right)\right) + z\right)}}, y, a \cdot 120\right) \]
              11. associate--r+N/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(t\right)\right)\right) - z}}, y, a \cdot 120\right) \]
              12. neg-sub0N/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(t\right)\right)\right)\right)} - z}, y, a \cdot 120\right) \]
              13. remove-double-negN/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{\color{blue}{t} - z}, y, a \cdot 120\right) \]
              14. --lowering--.f64N/A

                \[\leadsto \mathsf{fma}\left(\frac{60}{\color{blue}{t - z}}, y, a \cdot 120\right) \]
              15. *-lowering-*.f6489.1

                \[\leadsto \mathsf{fma}\left(\frac{60}{t - z}, y, \color{blue}{a \cdot 120}\right) \]
            9. Applied egg-rr89.1%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{60}{t - z}, y, a \cdot 120\right)} \]
            10. Taylor expanded in t around 0

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-60}{z}}, y, a \cdot 120\right) \]
            11. Step-by-step derivation
              1. /-lowering-/.f6485.8

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-60}{z}}, y, a \cdot 120\right) \]
          10. Recombined 3 regimes into one program.
          11. Final simplification81.4%

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

          Alternative 13: 50.9% accurate, 5.2× 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. Add Preprocessing
          3. Taylor expanded in z around inf

            \[\leadsto \color{blue}{120 \cdot a} \]
          4. Step-by-step derivation
            1. *-lowering-*.f6454.9

              \[\leadsto \color{blue}{120 \cdot a} \]
          5. Simplified54.9%

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

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

          Developer Target 1: 99.8% accurate, 0.8× 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 2024195 
          (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)))