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

Percentage Accurate: 99.3% → 99.7%
Time: 12.8s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 99.3% 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.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}
Derivation
  1. Initial program 99.1%

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
    3. remove-double-negN/A

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
    6. lift-*.f64N/A

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
    8. clear-numN/A

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

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    10. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    11. lower-/.f6499.8

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

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

Alternative 2: 55.3% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot y}{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.99999999999999987e146

    1. Initial program 93.6%

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      6. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
      8. lower-/.f6493.5

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
    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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
      4. lower--.f6452.6

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{z - t}} \]
    7. Applied rewrites52.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
      3. lower-*.f6442.9

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z} \]
    10. Applied rewrites42.9%

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

    if -1.99999999999999987e146 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294

    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. lower-*.f6455.8

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites55.8%

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

    if 9.9999999999999998e294 < (/.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 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{x - y}{t}, \color{blue}{120 \cdot a}\right) \]
    5. Applied rewrites100.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. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
      4. lower-*.f6483.4

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
    8. Applied rewrites83.4%

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

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

Alternative 3: 55.3% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{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.99999999999999987e146

    1. Initial program 93.6%

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      6. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
      8. lower-/.f6493.5

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
    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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
      4. lower--.f6452.6

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{z - t}} \]
    7. Applied rewrites52.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} \]
      3. lower-*.f6442.9

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z} \]
    10. Applied rewrites42.9%

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

    if -1.99999999999999987e146 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294

    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. lower-*.f6455.8

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites55.8%

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

    if 9.9999999999999998e294 < (/.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 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{x - y}{t}, \color{blue}{120 \cdot a}\right) \]
    5. Applied rewrites100.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. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
      4. lower-*.f6483.4

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
    8. Applied rewrites83.4%

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

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

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot 60 \]
      3. lower-*.f6483.4

        \[\leadsto \color{blue}{\frac{y}{t} \cdot 60} \]
    10. Applied rewrites83.4%

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

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

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

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

\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{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.5000000000000001e126

    1. Initial program 94.8%

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

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

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

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

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

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
    5. Applied rewrites46.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. lift--.f64N/A

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
      5. lower-/.f6446.1

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{60}}{z} \]
      9. lower-/.f6433.3

        \[\leadsto x \cdot \color{blue}{\frac{60}{z}} \]
    10. Applied rewrites33.3%

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

    if -1.5000000000000001e126 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294

    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. lower-*.f6457.1

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

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

    if 9.9999999999999998e294 < (/.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 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{x - y}{t}, \color{blue}{120 \cdot a}\right) \]
    5. Applied rewrites100.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. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
      4. lower-*.f6483.4

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
    8. Applied rewrites83.4%

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

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

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot 60 \]
      3. lower-*.f6483.4

        \[\leadsto \color{blue}{\frac{y}{t} \cdot 60} \]
    10. Applied rewrites83.4%

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

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

Alternative 5: 58.4% accurate, 0.6× speedup?

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

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

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

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

\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.00000000000000011e-92 or 4e8 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.5%

      \[\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. lower-*.f6474.8

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites74.8%

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

    if -5.00000000000000011e-92 < (*.f64 a #s(literal 120 binary64)) < 1.99999999999999992e-268

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{-60 \cdot \left(x - y\right)}}{t} \]
      4. lower--.f6454.3

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

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

    if 1.99999999999999992e-268 < (*.f64 a #s(literal 120 binary64)) < 4e8

    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. lift--.f64N/A

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      6. lift-*.f64N/A

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      8. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      10. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      11. lower-/.f6499.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(x - y\right) \cdot 60}}{z} \]
      5. lower--.f6453.2

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

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

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

Alternative 6: 58.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-205}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 5000:\\ \;\;\;\;\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-80)
   (* a 120.0)
   (if (<= (* a 120.0) 1e-205)
     (/ (* y -60.0) (- z t))
     (if (<= (* a 120.0) 5000.0)
       (/ 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = (y * -60.0) / (z - t);
	} else if ((a * 120.0) <= 5000.0) {
		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-80)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 1d-205) then
        tmp = (y * (-60.0d0)) / (z - t)
    else if ((a * 120.0d0) <= 5000.0d0) 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = (y * -60.0) / (z - t);
	} else if ((a * 120.0) <= 5000.0) {
		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-80:
		tmp = a * 120.0
	elif (a * 120.0) <= 1e-205:
		tmp = (y * -60.0) / (z - t)
	elif (a * 120.0) <= 5000.0:
		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-80)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 1e-205)
		tmp = Float64(Float64(y * -60.0) / Float64(z - t));
	elseif (Float64(a * 120.0) <= 5000.0)
		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-80)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 1e-205)
		tmp = (y * -60.0) / (z - t);
	elseif ((a * 120.0) <= 5000.0)
		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-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-205], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5000.0], 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^{-80}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;a \cdot 120 \leq 5000:\\
\;\;\;\;\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)) < -5e-80 or 5e3 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.5%

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

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

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

    if -5e-80 < (*.f64 a #s(literal 120 binary64)) < 1e-205

    1. Initial program 99.7%

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      6. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
      8. lower-/.f6499.5

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60 \cdot \left(x - y\right)}}} + a \cdot 120 \]
    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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
      4. lower--.f6454.1

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{z - t}} \]
    7. Applied rewrites54.1%

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

    if 1e-205 < (*.f64 a #s(literal 120 binary64)) < 5e3

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6449.1

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

      \[\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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 7: 58.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-205}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 5000:\\ \;\;\;\;\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-80)
   (* a 120.0)
   (if (<= (* a 120.0) 1e-205)
     (* -60.0 (/ y (- z t)))
     (if (<= (* a 120.0) 5000.0)
       (/ 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = -60.0 * (y / (z - t));
	} else if ((a * 120.0) <= 5000.0) {
		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-80)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 1d-205) then
        tmp = (-60.0d0) * (y / (z - t))
    else if ((a * 120.0d0) <= 5000.0d0) 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = -60.0 * (y / (z - t));
	} else if ((a * 120.0) <= 5000.0) {
		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-80:
		tmp = a * 120.0
	elif (a * 120.0) <= 1e-205:
		tmp = -60.0 * (y / (z - t))
	elif (a * 120.0) <= 5000.0:
		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-80)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 1e-205)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (Float64(a * 120.0) <= 5000.0)
		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-80)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 1e-205)
		tmp = -60.0 * (y / (z - t));
	elseif ((a * 120.0) <= 5000.0)
		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-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-205], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5000.0], 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^{-80}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;a \cdot 120 \leq 5000:\\
\;\;\;\;\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)) < -5e-80 or 5e3 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.5%

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

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

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

    if -5e-80 < (*.f64 a #s(literal 120 binary64)) < 1e-205

    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. lower-*.f64N/A

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6454.1

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

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

    if 1e-205 < (*.f64 a #s(literal 120 binary64)) < 5e3

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6449.1

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

      \[\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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 5000:\\
\;\;\;\;60 \cdot \frac{x}{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)) < -5e-80 or 5e3 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.5%

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

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

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

    if -5e-80 < (*.f64 a #s(literal 120 binary64)) < -2.00000000000000013e-301

    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. lower-*.f64N/A

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6457.3

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

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

    if -2.00000000000000013e-301 < (*.f64 a #s(literal 120 binary64)) < 5e3

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6448.5

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z - t} \cdot 60} \]
      5. lower-/.f6448.4

        \[\leadsto \color{blue}{\frac{x}{z - t}} \cdot 60 \]
    7. Applied rewrites48.4%

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

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

Alternative 9: 58.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-205}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 5000:\\ \;\;\;\;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-80)
   (* a 120.0)
   (if (<= (* a 120.0) 1e-205)
     (* -60.0 (/ y (- z t)))
     (if (<= (* a 120.0) 5000.0) (* 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = -60.0 * (y / (z - t));
	} else if ((a * 120.0) <= 5000.0) {
		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-80)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 1d-205) then
        tmp = (-60.0d0) * (y / (z - t))
    else if ((a * 120.0d0) <= 5000.0d0) 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e-205) {
		tmp = -60.0 * (y / (z - t));
	} else if ((a * 120.0) <= 5000.0) {
		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-80:
		tmp = a * 120.0
	elif (a * 120.0) <= 1e-205:
		tmp = -60.0 * (y / (z - t))
	elif (a * 120.0) <= 5000.0:
		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-80)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 1e-205)
		tmp = Float64(-60.0 * Float64(y / Float64(z - t)));
	elseif (Float64(a * 120.0) <= 5000.0)
		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-80)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 1e-205)
		tmp = -60.0 * (y / (z - t));
	elseif ((a * 120.0) <= 5000.0)
		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-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-205], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5000.0], 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^{-80}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;a \cdot 120 \leq 5000:\\
\;\;\;\;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)) < -5e-80 or 5e3 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.5%

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

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

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

    if -5e-80 < (*.f64 a #s(literal 120 binary64)) < 1e-205

    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. lower-*.f64N/A

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6454.1

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

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

    if 1e-205 < (*.f64 a #s(literal 120 binary64)) < 5e3

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6449.1

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

      \[\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. lift--.f64N/A

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
      5. lower-/.f6449.0

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
    7. Applied rewrites49.0%

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

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

Alternative 10: 84.2% accurate, 0.6× 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 -4.6 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-100}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+57}:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\ \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 -4.6e-26)
     t_1
     (if (<= t -5e-113)
       (/ (* 60.0 (- x y)) (- z t))
       (if (<= t 1.05e-100)
         (fma 60.0 (/ (- x y) z) (* a 120.0))
         (if (<= t 7.5e+57) (+ (* a 120.0) (/ (* 60.0 x) (- z t))) 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 <= -4.6e-26) {
		tmp = t_1;
	} else if (t <= -5e-113) {
		tmp = (60.0 * (x - y)) / (z - t);
	} else if (t <= 1.05e-100) {
		tmp = fma(60.0, ((x - y) / z), (a * 120.0));
	} else if (t <= 7.5e+57) {
		tmp = (a * 120.0) + ((60.0 * x) / (z - t));
	} 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 <= -4.6e-26)
		tmp = t_1;
	elseif (t <= -5e-113)
		tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t));
	elseif (t <= 1.05e-100)
		tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0));
	elseif (t <= 7.5e+57)
		tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / Float64(z - t)));
	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, -4.6e-26], t$95$1, If[LessEqual[t, -5e-113], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-100], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+57], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $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 -4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.60000000000000018e-26 or 7.5000000000000006e57 < 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. lower-fma.f64N/A

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

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

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

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

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

    if -4.60000000000000018e-26 < t < -4.9999999999999997e-113

    1. Initial program 95.5%

      \[\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. lower-/.f64N/A

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

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

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

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

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

    if -4.9999999999999997e-113 < t < 1.05000000000000005e-100

    1. Initial program 98.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. lower-fma.f64N/A

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

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

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

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

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

    if 1.05000000000000005e-100 < t < 7.5000000000000006e57

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
      4. lower--.f6489.5

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

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

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

Alternative 11: 84.2% accurate, 0.6× 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 -4.6 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-100}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+57}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\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 -4.6e-26)
     t_1
     (if (<= t -5e-113)
       (/ (* 60.0 (- x y)) (- z t))
       (if (<= t 1.05e-100)
         (fma 60.0 (/ (- x y) z) (* a 120.0))
         (if (<= t 7.5e+57)
           (fma a 120.0 (/ x (* (- z t) 0.016666666666666666)))
           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 <= -4.6e-26) {
		tmp = t_1;
	} else if (t <= -5e-113) {
		tmp = (60.0 * (x - y)) / (z - t);
	} else if (t <= 1.05e-100) {
		tmp = fma(60.0, ((x - y) / z), (a * 120.0));
	} else if (t <= 7.5e+57) {
		tmp = fma(a, 120.0, (x / ((z - t) * 0.016666666666666666)));
	} 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 <= -4.6e-26)
		tmp = t_1;
	elseif (t <= -5e-113)
		tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t));
	elseif (t <= 1.05e-100)
		tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0));
	elseif (t <= 7.5e+57)
		tmp = fma(a, 120.0, Float64(x / Float64(Float64(z - t) * 0.016666666666666666)));
	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, -4.6e-26], t$95$1, If[LessEqual[t, -5e-113], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-100], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+57], N[(a * 120.0 + N[(x / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $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 -4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.60000000000000018e-26 or 7.5000000000000006e57 < 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. lower-fma.f64N/A

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

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

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

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

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

    if -4.60000000000000018e-26 < t < -4.9999999999999997e-113

    1. Initial program 95.5%

      \[\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. lower-/.f64N/A

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

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

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

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

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

    if -4.9999999999999997e-113 < t < 1.05000000000000005e-100

    1. Initial program 98.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. lower-fma.f64N/A

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

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

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

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

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

    if 1.05000000000000005e-100 < t < 7.5000000000000006e57

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
      4. lower--.f6489.5

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

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      4. lift-*.f64N/A

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

        \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot x}{z - t}} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{a \cdot 120} + \frac{60 \cdot x}{z - t} \]
      7. lower-fma.f6489.5

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x}{\frac{z - t}{60}}}\right) \]
      15. div-invN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, \frac{x}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}}\right) \]
    7. Applied rewrites89.5%

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

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

Alternative 12: 73.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-57}:\\ \;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z}\right)\\ \mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\ \;\;\;\;\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) -1e-57)
   (fma a 120.0 (/ (* 60.0 x) z))
   (if (<= (* a 120.0) 1e+35)
     (/ (- 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) <= -1e-57) {
		tmp = fma(a, 120.0, ((60.0 * x) / z));
	} else if ((a * 120.0) <= 1e+35) {
		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) <= -1e-57)
		tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / z));
	elseif (Float64(a * 120.0) <= 1e+35)
		tmp = Float64(Float64(x - y) / Float64(Float64(z - t) * 0.016666666666666666));
	else
		tmp = Float64(a * 120.0);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-57], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+35], 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 -1 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z}\right)\\

\mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\
\;\;\;\;\frac{x - y}{\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)) < -9.99999999999999955e-58

    1. Initial program 98.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}} + a \cdot 120 \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
      4. lower--.f6481.1

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} + a \cdot 120 \]
    5. Applied rewrites81.1%

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} + a \cdot 120 \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      4. lift-*.f64N/A

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

        \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot x}{z - t}} \]
      6. lift-*.f64N/A

        \[\leadsto \color{blue}{a \cdot 120} + \frac{60 \cdot x}{z - t} \]
      7. lower-fma.f6481.1

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x}{\frac{z - t}{60}}}\right) \]
      15. div-invN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, \frac{\color{blue}{60 \cdot x}}{z}\right) \]
    10. Applied rewrites72.3%

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

    if -9.99999999999999955e-58 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999997e34

    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. lift--.f64N/A

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
      6. lift-*.f64N/A

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      8. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      10. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
      11. lower-/.f6499.7

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot 60}{z - t}} \]
    8. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\frac{z - t}{60}}} \]
      6. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{x - y}{\left(z - t\right) \cdot \color{blue}{0.016666666666666666}} \]
    9. Applied rewrites82.9%

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

    if 9.9999999999999997e34 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 97.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. lower-*.f6490.2

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

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

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

Alternative 13: 74.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-5}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\ \;\;\;\;\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) -5e-5)
   (* a 120.0)
   (if (<= (* a 120.0) 1e+35) (/ (* 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) <= -5e-5) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e+35) {
		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) <= (-5d-5)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 1d+35) 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) <= -5e-5) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 1e+35) {
		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) <= -5e-5:
		tmp = a * 120.0
	elif (a * 120.0) <= 1e+35:
		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) <= -5e-5)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 1e+35)
		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) <= -5e-5)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 1e+35)
		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], -5e-5], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+35], 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 -5 \cdot 10^{-5}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\
\;\;\;\;\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)) < -5.00000000000000024e-5 or 9.9999999999999997e34 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.3%

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

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

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

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

    if -5.00000000000000024e-5 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999997e34

    1. Initial program 99.8%

      \[\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. lower-/.f64N/A

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

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

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

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

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

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

Alternative 14: 83.6% 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 -4.6 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\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 -4.6e-26)
     t_1
     (if (<= t -5e-113)
       (/ (* 60.0 (- x y)) (- z t))
       (if (<= t 4.6e-19) (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 <= -4.6e-26) {
		tmp = t_1;
	} else if (t <= -5e-113) {
		tmp = (60.0 * (x - y)) / (z - t);
	} else if (t <= 4.6e-19) {
		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 <= -4.6e-26)
		tmp = t_1;
	elseif (t <= -5e-113)
		tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t));
	elseif (t <= 4.6e-19)
		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, -4.6e-26], t$95$1, If[LessEqual[t, -5e-113], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-19], 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 -4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-19}:\\
\;\;\;\;\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 < -4.60000000000000018e-26 or 4.5999999999999996e-19 < 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. lower-fma.f64N/A

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

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

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

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

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

    if -4.60000000000000018e-26 < t < -4.9999999999999997e-113

    1. Initial program 95.5%

      \[\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. lower-/.f64N/A

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

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

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

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

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

    if -4.9999999999999997e-113 < t < 4.5999999999999996e-19

    1. Initial program 99.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. lower-fma.f64N/A

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.6 \cdot 10^{-26}:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\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 15: 58.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-80}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+14}:\\ \;\;\;\;-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-80)
   (* a 120.0)
   (if (<= (* a 120.0) 4e+14) (* -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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 4e+14) {
		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-80)) then
        tmp = a * 120.0d0
    else if ((a * 120.0d0) <= 4d+14) 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-80) {
		tmp = a * 120.0;
	} else if ((a * 120.0) <= 4e+14) {
		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-80:
		tmp = a * 120.0
	elif (a * 120.0) <= 4e+14:
		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-80)
		tmp = Float64(a * 120.0);
	elseif (Float64(a * 120.0) <= 4e+14)
		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-80)
		tmp = a * 120.0;
	elseif ((a * 120.0) <= 4e+14)
		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-80], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+14], 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^{-80}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+14}:\\
\;\;\;\;-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)) < -5e-80 or 4e14 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 98.4%

      \[\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. lower-*.f6476.3

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites76.3%

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

    if -5e-80 < (*.f64 a #s(literal 120 binary64)) < 4e14

    1. Initial program 99.8%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. lower--.f6447.8

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

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

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

Alternative 16: 52.2% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq 6.8 \cdot 10^{+251}:\\
\;\;\;\;a \cdot 120\\

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


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

    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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6475.6

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
    5. Applied rewrites75.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
      3. lower-*.f6452.8

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-60}{t}} \]
      4. lower-/.f6452.8

        \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
    10. Applied rewrites52.8%

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

    if -1.5500000000000001e164 < x < 6.80000000000000023e251

    1. Initial program 99.4%

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Applied rewrites53.6%

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

    if 6.80000000000000023e251 < x

    1. Initial program 88.9%

      \[\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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6485.5

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

      \[\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. lift--.f64N/A

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

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z - t}} \]
      5. lower-/.f6485.4

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
    7. Applied rewrites85.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{60}}{z} \]
      9. lower-/.f6474.8

        \[\leadsto x \cdot \color{blue}{\frac{60}{z}} \]
    10. Applied rewrites74.8%

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

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

Alternative 17: 99.8% accurate, 1.1× speedup?

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

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

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
    3. remove-double-negN/A

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
    6. lift-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
    10. lift-*.f64N/A

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

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

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

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

Alternative 18: 99.4% accurate, 1.1× speedup?

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

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

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

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

      \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} + a \cdot 120 \]
    3. remove-double-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} + a \cdot 120 \]
    7. lift-*.f64N/A

      \[\leadsto \frac{60 \cdot \left(x - y\right)}{z - t} + \color{blue}{a \cdot 120} \]
    8. +-commutativeN/A

      \[\leadsto \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
    9. lift-*.f64N/A

      \[\leadsto \color{blue}{a \cdot 120} + \frac{60 \cdot \left(x - y\right)}{z - t} \]
    10. lower-fma.f6499.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 51.7% accurate, 1.3× speedup?

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

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

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


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

    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. lower-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{60 \cdot x}}{z - t} \]
      4. lower--.f6475.6

        \[\leadsto \frac{60 \cdot x}{\color{blue}{z - t}} \]
    5. Applied rewrites75.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
      3. lower-*.f6452.8

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-60}{t}} \]
      4. lower-/.f6452.8

        \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
    10. Applied rewrites52.8%

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

    if -1.5500000000000001e164 < x

    1. Initial program 99.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. lower-*.f6452.0

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

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

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

Alternative 20: 51.4% 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.1%

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

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

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

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