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

Percentage Accurate: 99.4% → 99.8%
Time: 12.2s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 82.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+35} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+129}\right):\\ \;\;\;\;60 \cdot \frac{y - x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (or (<= t_1 -5e+35) (not (<= t_1 4e+129)))
     (* 60.0 (/ (- y x) (- t z)))
     (- (* a 120.0) (* 60.0 (/ x (- t z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -5e+35) || !(t_1 <= 4e+129)) {
		tmp = 60.0 * ((y - x) / (t - z));
	} else {
		tmp = (a * 120.0) - (60.0 * (x / (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) :: t_1
    real(8) :: tmp
    t_1 = (60.0d0 * (x - y)) / (z - t)
    if ((t_1 <= (-5d+35)) .or. (.not. (t_1 <= 4d+129))) then
        tmp = 60.0d0 * ((y - x) / (t - z))
    else
        tmp = (a * 120.0d0) - (60.0d0 * (x / (t - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if ((t_1 <= -5e+35) || !(t_1 <= 4e+129)) {
		tmp = 60.0 * ((y - x) / (t - z));
	} else {
		tmp = (a * 120.0) - (60.0 * (x / (t - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if (t_1 <= -5e+35) or not (t_1 <= 4e+129):
		tmp = 60.0 * ((y - x) / (t - z))
	else:
		tmp = (a * 120.0) - (60.0 * (x / (t - z)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if ((t_1 <= -5e+35) || !(t_1 <= 4e+129))
		tmp = Float64(60.0 * Float64(Float64(y - x) / Float64(t - z)));
	else
		tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / Float64(t - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if ((t_1 <= -5e+35) || ~((t_1 <= 4e+129)))
		tmp = 60.0 * ((y - x) / (t - z));
	else
		tmp = (a * 120.0) - (60.0 * (x / (t - z)));
	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[Or[LessEqual[t$95$1, -5e+35], N[Not[LessEqual[t$95$1, 4e+129]], $MachinePrecision]], N[(60.0 * N[(N[(y - x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 97.6%

      \[\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 83.7%

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

    if -5.00000000000000021e35 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4e129

    1. Initial program 99.8%

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

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

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

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

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

Alternative 3: 73.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+79} \lor \neg \left(a \cdot 120 \leq 10^{-84}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999967e78 or 1e-84 < (*.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 \]
      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 77.9%

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

    if -9.99999999999999967e78 < (*.f64 a #s(literal 120 binary64)) < 1e-84

    1. Initial program 98.2%

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

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

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

      \[\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 78.9%

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

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

Alternative 4: 71.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;a \cdot 120\\

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

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


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

    1. Initial program 100.0%

      \[\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 \]
      2. fma-define100.0%

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

      \[\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 88.0%

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

    if -9.99999999999999967e78 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e-123

    1. Initial program 98.1%

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

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

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

      \[\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 80.5%

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

    if 2.0000000000000001e-123 < (*.f64 a #s(literal 120 binary64))

    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. *-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot y\right)} \cdot \frac{60}{z - t} + a \cdot 120 \]
    6. Step-by-step derivation
      1. neg-mul-185.5%

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

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

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

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

Alternative 5: 60.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -3.7 \cdot 10^{-207}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\

\mathbf{elif}\;a \leq 7 \cdot 10^{-132}:\\
\;\;\;\;60 \cdot \frac{y - x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.1499999999999999e-35 or 6.9999999999999999e-132 < 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 68.9%

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

    if -1.1499999999999999e-35 < a < -3.69999999999999984e-207

    1. Initial program 92.4%

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

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

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

      \[\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 65.7%

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

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

    if -3.69999999999999984e-207 < a < 6.9999999999999999e-132

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 91.6%

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{x - y}{t}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/60.0%

        \[\leadsto 60 \cdot \color{blue}{\frac{-1 \cdot \left(x - y\right)}{t}} \]
      2. neg-mul-160.0%

        \[\leadsto 60 \cdot \frac{\color{blue}{-\left(x - y\right)}}{t} \]
      3. neg-sub060.0%

        \[\leadsto 60 \cdot \frac{\color{blue}{0 - \left(x - y\right)}}{t} \]
      4. sub-neg60.0%

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

        \[\leadsto 60 \cdot \frac{0 - \color{blue}{\left(\left(-y\right) + x\right)}}{t} \]
      6. associate--r+60.0%

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

        \[\leadsto 60 \cdot \frac{\color{blue}{\left(-\left(-y\right)\right)} - x}{t} \]
      8. remove-double-neg60.0%

        \[\leadsto 60 \cdot \frac{\color{blue}{y} - x}{t} \]
    8. Simplified60.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{-35}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-207}:\\ \;\;\;\;60 \cdot \frac{x - y}{z}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{-132}:\\ \;\;\;\;60 \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 54.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -1.35 \cdot 10^{-233}:\\
\;\;\;\;60 \cdot \frac{y}{-z}\\

\mathbf{elif}\;a \leq 1.15 \cdot 10^{-132}:\\
\;\;\;\;\frac{x \cdot \left(-60\right)}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.6000000000000003e-176 or 1.15000000000000002e-132 < a

    1. Initial program 99.3%

      \[\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 65.2%

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

    if -5.6000000000000003e-176 < a < -1.35e-233

    1. Initial program 92.8%

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

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

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

      \[\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 88.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{60} \cdot \frac{y}{-\left(z - t\right)} \]
      6. neg-sub073.6%

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{\left(-\left(-t\right)\right)} - z} \]
      11. remove-double-neg73.6%

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

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. associate-*r/45.8%

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

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

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

    if -1.35e-233 < a < 1.15000000000000002e-132

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 90.4%

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

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

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

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

      \[\leadsto \frac{60 \cdot x}{\color{blue}{-1 \cdot t}} \]
    10. Step-by-step derivation
      1. neg-mul-140.3%

        \[\leadsto \frac{60 \cdot x}{\color{blue}{-t}} \]
    11. Simplified40.3%

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

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

Alternative 7: 90.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+59}:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\

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

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


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

    1. Initial program 98.1%

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

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

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

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

    if -4.8000000000000004e59 < x < 1.8999999999999999e57

    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. *-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot y\right)} \cdot \frac{60}{z - t} + a \cdot 120 \]
    6. Step-by-step derivation
      1. neg-mul-195.2%

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

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

    if 1.8999999999999999e57 < x

    1. Initial program 98.1%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

Alternative 8: 89.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+59}:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\

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

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


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

    1. Initial program 98.1%

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

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

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

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

    if -1.3e59 < x < 4.8e53

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

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

    if 4.8e53 < x

    1. Initial program 98.1%

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x}{z - t}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

Alternative 9: 59.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.18 \cdot 10^{-173} \lor \neg \left(a \leq 1.15 \cdot 10^{-115}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.1800000000000001e-173 or 1.14999999999999992e-115 < a

    1. Initial program 99.3%

      \[\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 66.8%

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

    if -1.1800000000000001e-173 < a < 1.14999999999999992e-115

    1. Initial program 98.4%

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

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

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

      \[\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 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 53.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.20000000000000007e-207 or 4.7000000000000002e-132 < a

    1. Initial program 98.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 64.1%

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

    if -4.20000000000000007e-207 < a < 4.7000000000000002e-132

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} + a \cdot 120 \]
      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 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 52.1% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.19999999999999961e201

    1. Initial program 96.2%

      \[\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 a around 0 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{y}{\color{blue}{t} - z} \]
    8. Simplified78.0%

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

      \[\leadsto 60 \cdot \color{blue}{\left(-1 \cdot \frac{y}{z}\right)} \]
    10. Step-by-step derivation
      1. associate-*r/52.0%

        \[\leadsto 60 \cdot \color{blue}{\frac{-1 \cdot y}{z}} \]
      2. mul-1-neg52.0%

        \[\leadsto 60 \cdot \frac{\color{blue}{-y}}{z} \]
    11. Simplified52.0%

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

    if -6.19999999999999961e201 < y

    1. Initial program 99.4%

      \[\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 z around inf 53.6%

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

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

Alternative 12: 51.8% 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.0%

    \[\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 z around inf 50.0%

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification50.0%

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