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

Percentage Accurate: 99.4% → 99.4%
Time: 13.5s
Alternatives: 17
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 17 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.4% 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: 60.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+178}:\\
\;\;\;\;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.0000000000000001e94 or 1.0000000000000001e178 < (/.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-*.f6464.0

        \[\leadsto \mathsf{fma}\left(-60, \frac{x - y}{t}, \color{blue}{120 \cdot a}\right) \]
    5. Simplified64.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--.f6455.7

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

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

    if -5.0000000000000001e94 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e178

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

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

Alternative 3: 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 -1 \cdot 10^{+227}:\\ \;\;\;\;\frac{60 \cdot y}{t}\\ \mathbf{elif}\;t\_1 \leq 10^{+178}:\\ \;\;\;\;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 -1e+227)
     (/ (* 60.0 y) t)
     (if (<= t_1 1e+178) (* 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 <= -1e+227) {
		tmp = (60.0 * y) / t;
	} else if (t_1 <= 1e+178) {
		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 <= (-1d+227)) then
        tmp = (60.0d0 * y) / t
    else if (t_1 <= 1d+178) 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 <= -1e+227) {
		tmp = (60.0 * y) / t;
	} else if (t_1 <= 1e+178) {
		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 <= -1e+227:
		tmp = (60.0 * y) / t
	elif t_1 <= 1e+178:
		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 <= -1e+227)
		tmp = Float64(Float64(60.0 * y) / t);
	elseif (t_1 <= 1e+178)
		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 <= -1e+227)
		tmp = (60.0 * y) / t;
	elseif (t_1 <= 1e+178)
		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, -1e+227], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e+178], 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 -1 \cdot 10^{+227}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\

\mathbf{elif}\;t\_1 \leq 10^{+178}:\\
\;\;\;\;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.0000000000000001e227

    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-*.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 y around inf

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

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

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

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

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

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

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

    if -1.0000000000000001e227 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e178

    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-*.f6465.0

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified65.0%

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

    if 1.0000000000000001e178 < (/.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-*.f6459.9

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot y}}{t} \]
      5. *-lowering-*.f6439.1

        \[\leadsto \frac{\color{blue}{60 \cdot y}}{t} \]
    8. Simplified39.1%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{60}{t}} \]
      4. /-lowering-/.f6439.1

        \[\leadsto y \cdot \color{blue}{\frac{60}{t}} \]
    10. Applied egg-rr39.1%

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

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

Alternative 4: 55.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+178}:\\
\;\;\;\;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.0000000000000001e227 or 1.0000000000000001e178 < (/.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-*.f6460.8

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{60}{t}} \]
      4. /-lowering-/.f6444.3

        \[\leadsto y \cdot \color{blue}{\frac{60}{t}} \]
    10. Applied egg-rr44.3%

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

    if -1.0000000000000001e227 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e178

    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-*.f6465.0

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified65.0%

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

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

Alternative 5: 54.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+198}:\\
\;\;\;\;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)) < -9.9999999999999992e292 or 1.00000000000000002e198 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 100.0%

      \[\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-*.f6465.4

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

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

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

        \[\leadsto \color{blue}{-60 \cdot \frac{y}{z}} \]
      2. /-lowering-/.f6447.1

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z}} \]
    8. Simplified47.1%

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

    if -9.9999999999999992e292 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e198

    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-*.f6462.2

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

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

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

Alternative 6: 58.4% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified73.0%

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

    if -5.0000000000000002e-63 < (*.f64 a #s(literal 120 binary64)) < 1e-210

    1. Initial program 99.6%

      \[\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.6

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

      \[\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--.f6456.2

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

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

    if 1e-210 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999934e-89

    1. Initial program 99.6%

      \[\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. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
      3. clear-numN/A

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z - t}{60}}} \]
      4. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - t}{60}}} \]
      6. div-invN/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(z - t\right)} \cdot \frac{1}{60}} \]
      9. metadata-eval51.3

        \[\leadsto \frac{x}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} \]
    7. Applied egg-rr51.3%

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

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

Alternative 7: 58.4% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified73.0%

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

    if -5.0000000000000002e-63 < (*.f64 a #s(literal 120 binary64)) < 1e-210

    1. Initial program 99.6%

      \[\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.2

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

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

    if 1e-210 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999934e-89

    1. Initial program 99.6%

      \[\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. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
      3. clear-numN/A

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z - t}{60}}} \]
      4. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - t}{60}}} \]
      6. div-invN/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(z - t\right)} \cdot \frac{1}{60}} \]
      9. metadata-eval51.3

        \[\leadsto \frac{x}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} \]
    7. Applied egg-rr51.3%

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

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

Alternative 8: 58.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{-88}:\\
\;\;\;\;x \cdot \frac{60}{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)) < -5.0000000000000002e-63 or 9.99999999999999934e-89 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified73.0%

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

    if -5.0000000000000002e-63 < (*.f64 a #s(literal 120 binary64)) < 1e-210

    1. Initial program 99.6%

      \[\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.2

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

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

    if 1e-210 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999934e-89

    1. Initial program 99.6%

      \[\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. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+23}:\\
\;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4e-14 or 3.9999999999999997e23 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 100.0%

      \[\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-*.f6485.1

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

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

    if -4e-14 < (*.f64 a #s(literal 120 binary64)) < 3.9999999999999997e23

    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--.f6477.1

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

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

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

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

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{\frac{1}{60}}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

Alternative 10: 74.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{-14}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+23}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* a 120.0) -4e-14)
   (* a 120.0)
   (if (<= (* a 120.0) 4e+23) (/ (* 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) <= -4e-14) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 4e+23) {
		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) <= (-4d-14)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 4d+23) 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) <= -4e-14) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 4e+23) {
		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) <= -4e-14:
		tmp = a * 120.0
	elif (a * 120.0) <= 4e+23:
		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) <= -4e-14)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 4e+23)
		tmp = Float64(Float64(60.0 * 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) <= -4e-14)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 4e+23)
		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], -4e-14], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+23], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -4e-14 or 3.9999999999999997e23 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 100.0%

      \[\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-*.f6485.1

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

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

    if -4e-14 < (*.f64 a #s(literal 120 binary64)) < 3.9999999999999997e23

    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--.f6477.1

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

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

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

Alternative 11: 83.0% accurate, 0.7× 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.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.16 \cdot 10^{-222}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z}\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.2e+17)
     t_1
     (if (<= t -1.16e-222)
       (fma a 120.0 (/ (* 60.0 x) (- z t)))
       (if (<= t 7.5e-7) (fma a 120.0 (/ (* 60.0 (- x y)) z)) 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.2e+17) {
		tmp = t_1;
	} else if (t <= -1.16e-222) {
		tmp = fma(a, 120.0, ((60.0 * x) / (z - t)));
	} else if (t <= 7.5e-7) {
		tmp = fma(a, 120.0, ((60.0 * (x - y)) / z));
	} 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.2e+17)
		tmp = t_1;
	elseif (t <= -1.16e-222)
		tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / Float64(z - t)));
	elseif (t <= 7.5e-7)
		tmp = fma(a, 120.0, Float64(Float64(60.0 * Float64(x - y)) / z));
	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.2e+17], t$95$1, If[LessEqual[t, -1.16e-222], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-7], N[(a * 120.0 + N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $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.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.16 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.2e17 or 7.5000000000000002e-7 < 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-*.f6492.9

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

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

    if -3.2e17 < t < -1.16e-222

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

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

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

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

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

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

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

    if -1.16e-222 < t < 7.5000000000000002e-7

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

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

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

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

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

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

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

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

Alternative 12: 83.0% accurate, 0.7× 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 -1 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-229}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-6}:\\ \;\;\;\;\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 -1e+19)
     t_1
     (if (<= t -1.35e-229)
       (fma a 120.0 (/ (* 60.0 x) (- z t)))
       (if (<= t 3.3e-6) (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 <= -1e+19) {
		tmp = t_1;
	} else if (t <= -1.35e-229) {
		tmp = fma(a, 120.0, ((60.0 * x) / (z - t)));
	} else if (t <= 3.3e-6) {
		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 <= -1e+19)
		tmp = t_1;
	elseif (t <= -1.35e-229)
		tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / Float64(z - t)));
	elseif (t <= 3.3e-6)
		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, -1e+19], t$95$1, If[LessEqual[t, -1.35e-229], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-6], 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 -1 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.35 \cdot 10^{-229}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\

\mathbf{elif}\;t \leq 3.3 \cdot 10^{-6}:\\
\;\;\;\;\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 3 regimes
  2. if t < -1e19 or 3.30000000000000017e-6 < 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-*.f6492.9

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

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

    if -1e19 < t < -1.3499999999999999e-229

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

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

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

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

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

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

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

    if -1.3499999999999999e-229 < t < 3.30000000000000017e-6

    1. Initial program 99.9%

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

      \[\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 3 regimes into one program.
  4. Final simplification88.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-229}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-6}:\\ \;\;\;\;\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 13: 57.6% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -5.0000000000000002e-63 or 3.9999999999999997e23 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 100.0%

      \[\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-*.f6482.9

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

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

    if -5.0000000000000002e-63 < (*.f64 a #s(literal 120 binary64)) < 3.9999999999999997e23

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

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

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

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

Alternative 14: 76.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-87}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{+190}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma -60.0 (/ y z) (* a 120.0))))
   (if (<= z -2.7e+16)
     t_1
     (if (<= z 6.8e-87)
       (fma -60.0 (/ (- x y) t) (* a 120.0))
       (if (<= z 1.22e+190) t_1 (fma a 120.0 (/ (* 60.0 x) z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(-60.0, (y / z), (a * 120.0));
	double tmp;
	if (z <= -2.7e+16) {
		tmp = t_1;
	} else if (z <= 6.8e-87) {
		tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
	} else if (z <= 1.22e+190) {
		tmp = t_1;
	} else {
		tmp = fma(a, 120.0, ((60.0 * x) / z));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(-60.0, Float64(y / z), Float64(a * 120.0))
	tmp = 0.0
	if (z <= -2.7e+16)
		tmp = t_1;
	elseif (z <= 6.8e-87)
		tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0));
	elseif (z <= 1.22e+190)
		tmp = t_1;
	else
		tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / z));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+16], t$95$1, If[LessEqual[z, 6.8e-87], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.22e+190], t$95$1, N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.22 \cdot 10^{+190}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7e16 or 6.7999999999999997e-87 < z < 1.21999999999999995e190

    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-*.f6485.0

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

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

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

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

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

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

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

    if -2.7e16 < z < 6.7999999999999997e-87

    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-*.f6487.2

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

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

    if 1.21999999999999995e190 < z

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

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

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

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

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

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

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

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

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

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

    Alternative 15: 88.0% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

      if -9.5999999999999999e159 < x < 2.6e10

      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. Taylor expanded in x around 0

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

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

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

          \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} + 120 \cdot a \]
        4. metadata-evalN/A

          \[\leadsto y \cdot \frac{\color{blue}{\mathsf{neg}\left(60\right)}}{z - t} + 120 \cdot a \]
        5. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 16: 83.4% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-87}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 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) z) (* a 120.0))))
       (if (<= z -1.85e+16)
         t_1
         (if (<= z 4.6e-87) (fma -60.0 (/ (- x y) t) (* 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) / z), (a * 120.0));
    	double tmp;
    	if (z <= -1.85e+16) {
    		tmp = t_1;
    	} else if (z <= 4.6e-87) {
    		tmp = fma(-60.0, ((x - y) / t), (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) / z), Float64(a * 120.0))
    	tmp = 0.0
    	if (z <= -1.85e+16)
    		tmp = t_1;
    	elseif (z <= 4.6e-87)
    		tmp = fma(-60.0, Float64(Float64(x - y) / t), 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] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+16], t$95$1, If[LessEqual[z, 4.6e-87], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $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}{z}, a \cdot 120\right)\\
    \mathbf{if}\;z \leq -1.85 \cdot 10^{+16}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 4.6 \cdot 10^{-87}:\\
    \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.85e16 or 4.6000000000000003e-87 < z

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

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

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

      if -1.85e16 < z < 4.6000000000000003e-87

      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-*.f6487.2

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

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

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

    Alternative 17: 50.7% 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.7

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

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

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

    Developer Target 1: 99.7% 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 2024198 
    (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)))