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

Percentage Accurate: 99.5% → 99.8%
Time: 11.3s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 82.0% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -2.0000000000000002e-130 or 1.00000000000000006e-158 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} + a \cdot 120 \]
      2. remove-double-neg85.5%

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-185.5%

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

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

        \[\leadsto \color{blue}{60} \cdot \frac{y}{-\left(z - t\right)} + a \cdot 120 \]
      6. neg-sub085.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{0 - \left(z - t\right)}} + a \cdot 120 \]
      7. sub-neg85.5%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      8. +-commutative85.5%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+85.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub085.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg85.5%

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

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

    if -2.0000000000000002e-130 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000006e-158

    1. Initial program 99.5%

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

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

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

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

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

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

Alternative 3: 81.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

    if -2.0000000000000002e-130 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000006e-158

    1. Initial program 99.5%

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

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

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

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

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

    if 1.00000000000000006e-158 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} + a \cdot 120 \]
      2. remove-double-neg86.4%

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-186.4%

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

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

        \[\leadsto \color{blue}{60} \cdot \frac{y}{-\left(z - t\right)} + a \cdot 120 \]
      6. neg-sub086.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{0 - \left(z - t\right)}} + a \cdot 120 \]
      7. sub-neg86.5%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      8. +-commutative86.5%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+86.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub086.5%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg86.5%

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

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

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

Alternative 4: 72.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-46} \lor \neg \left(a \cdot 120 \leq 50\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -4.99999999999999992e-46 < (*.f64 a #s(literal 120 binary64)) < 50

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 5: 88.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-187.9%

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

        \[\leadsto \color{blue}{\frac{-60}{-1} \cdot \frac{y}{-\left(z - t\right)}} + a \cdot 120 \]
      5. metadata-eval87.9%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{0 - \left(z - t\right)}} + a \cdot 120 \]
      7. sub-neg87.9%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      8. +-commutative87.9%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+87.9%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub087.9%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg87.9%

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

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

    if -1e-22 < y < 7.50000000000000031e70

    1. Initial program 99.8%

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

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

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

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

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

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

    if 7.50000000000000031e70 < y

    1. Initial program 99.8%

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

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

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

Alternative 6: 74.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{-49} \lor \neg \left(a \leq 15\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.40000000000000005e-49 or 15 < a

    1. Initial program 99.9%

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

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

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

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

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

    if -3.40000000000000005e-49 < a < 15

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 7: 57.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-139} \lor \neg \left(a \leq 4.2 \cdot 10^{-160}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.5000000000000003e-139 or 4.2000000000000001e-160 < a

    1. Initial program 99.9%

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

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

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

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

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

    if -8.5000000000000003e-139 < a < 4.2000000000000001e-160

    1. Initial program 99.5%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(-60 \cdot \frac{y}{x \cdot \left(z - t\right)} + \left(120 \cdot \frac{a}{x} + 60 \cdot \frac{1}{z - t}\right)\right)} \]
    6. Taylor expanded in x around inf 59.4%

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

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

Alternative 8: 57.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+141} \lor \neg \left(y \leq 4.4 \cdot 10^{+156}\right):\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.0000000000000003e141 or 4.40000000000000008e156 < y

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-193.9%

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

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

        \[\leadsto \color{blue}{60} \cdot \frac{y}{-\left(z - t\right)} + a \cdot 120 \]
      6. neg-sub094.0%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{0 - \left(z - t\right)}} + a \cdot 120 \]
      7. sub-neg94.0%

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

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+94.0%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub094.0%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg94.0%

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

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

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

    if -9.0000000000000003e141 < y < 4.40000000000000008e156

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 9: 51.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+221} \lor \neg \left(y \leq 4 \cdot 10^{+267}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.0499999999999999e221 or 3.9999999999999999e267 < y

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} + a \cdot 120 \]
      2. remove-double-neg95.2%

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-195.2%

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

        \[\leadsto \color{blue}{\frac{-60}{-1} \cdot \frac{y}{-\left(z - t\right)}} + a \cdot 120 \]
      5. metadata-eval95.3%

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

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

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

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+95.3%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub095.3%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg95.3%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t - z}} \]
      2. *-commutative85.9%

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

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

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

    if -3.0499999999999999e221 < y < 3.9999999999999999e267

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 10: 52.0% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+156}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-192.3%

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+92.4%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg92.4%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t - z}} \]
      2. *-commutative77.4%

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t - z} \]
    10. Simplified77.4%

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

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

    if -1.12e221 < y < 3.20000000000000002e156

    1. Initial program 99.8%

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

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

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

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

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

    if 3.20000000000000002e156 < y

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} + a \cdot 120 \]
      2. remove-double-neg92.8%

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-\left(z - t\right)\right)}} + a \cdot 120 \]
      3. neg-mul-192.8%

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

        \[\leadsto \color{blue}{\frac{-60}{-1} \cdot \frac{y}{-\left(z - t\right)}} + a \cdot 120 \]
      5. metadata-eval92.9%

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{0 - \left(z - t\right)}} + a \cdot 120 \]
      7. sub-neg92.9%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(z + \left(-t\right)\right)}} + a \cdot 120 \]
      8. +-commutative92.9%

        \[\leadsto 60 \cdot \frac{y}{0 - \color{blue}{\left(\left(-t\right) + z\right)}} + a \cdot 120 \]
      9. associate--r+92.9%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(0 - \left(-t\right)\right) - z}} + a \cdot 120 \]
      10. neg-sub092.9%

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} + a \cdot 120 \]
      11. remove-double-neg92.9%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t - z}} \]
      2. *-commutative65.4%

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t - z} \]
    10. Simplified65.4%

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

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

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

Alternative 11: 50.0% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024132 
(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)))