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

Percentage Accurate: 99.2% → 99.8%
Time: 13.7s
Alternatives: 15
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 15 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.2% 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, 0.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

Alternative 3: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-150}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot 120 \leq 10^{-130}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -1e16 or 2.00000000000000001e-150 < (*.f64 a 120) < 1.0000000000000001e-130

    1. Initial program 99.8%

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

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

    if -1e16 < (*.f64 a 120) < 2.00000000000000001e-150 or 1.0000000000000001e-130 < (*.f64 a 120) < 1.99999999999999992e-74

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    if 1.99999999999999992e-74 < (*.f64 a 120)

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+16}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-150}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 10^{-130}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-74}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\ \end{array} \]

Alternative 5: 81.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-75} \lor \neg \left(a \cdot 120 \leq 10^{-180}\right):\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - 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-75) (not (<= (* a 120.0) 1e-180)))
   (+ (* a 120.0) (* -60.0 (/ y (- z 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-75) || !((a * 120.0) <= 1e-180)) {
		tmp = (a * 120.0) + (-60.0 * (y / (z - 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-75)) .or. (.not. ((a * 120.0d0) <= 1d-180))) then
        tmp = (a * 120.0d0) + ((-60.0d0) * (y / (z - 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-75) || !((a * 120.0) <= 1e-180)) {
		tmp = (a * 120.0) + (-60.0 * (y / (z - 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-75) or not ((a * 120.0) <= 1e-180):
		tmp = (a * 120.0) + (-60.0 * (y / (z - 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-75) || !(Float64(a * 120.0) <= 1e-180))
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / Float64(z - 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-75) || ~(((a * 120.0) <= 1e-180)))
		tmp = (a * 120.0) + (-60.0 * (y / (z - 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-75], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-180]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / N[(z - t), $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 -5 \cdot 10^{-75} \lor \neg \left(a \cdot 120 \leq 10^{-180}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - 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 120) < -4.99999999999999979e-75 or 1e-180 < (*.f64 a 120)

    1. Initial program 99.8%

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

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

    if -4.99999999999999979e-75 < (*.f64 a 120) < 1e-180

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 71.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -58000000 \lor \neg \left(a \leq 1.25 \cdot 10^{-146}\right) \land \left(a \leq 5.4 \cdot 10^{-37} \lor \neg \left(a \leq 1.4 \cdot 10^{-11}\right)\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 -58000000.0)
         (and (not (<= a 1.25e-146)) (or (<= a 5.4e-37) (not (<= a 1.4e-11)))))
   (* 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 <= -58000000.0) || (!(a <= 1.25e-146) && ((a <= 5.4e-37) || !(a <= 1.4e-11)))) {
		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 <= (-58000000.0d0)) .or. (.not. (a <= 1.25d-146)) .and. (a <= 5.4d-37) .or. (.not. (a <= 1.4d-11))) 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 <= -58000000.0) || (!(a <= 1.25e-146) && ((a <= 5.4e-37) || !(a <= 1.4e-11)))) {
		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 <= -58000000.0) or (not (a <= 1.25e-146) and ((a <= 5.4e-37) or not (a <= 1.4e-11))):
		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 <= -58000000.0) || (!(a <= 1.25e-146) && ((a <= 5.4e-37) || !(a <= 1.4e-11))))
		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 <= -58000000.0) || (~((a <= 1.25e-146)) && ((a <= 5.4e-37) || ~((a <= 1.4e-11)))))
		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, -58000000.0], And[N[Not[LessEqual[a, 1.25e-146]], $MachinePrecision], Or[LessEqual[a, 5.4e-37], N[Not[LessEqual[a, 1.4e-11]], $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 -58000000 \lor \neg \left(a \leq 1.25 \cdot 10^{-146}\right) \land \left(a \leq 5.4 \cdot 10^{-37} \lor \neg \left(a \leq 1.4 \cdot 10^{-11}\right)\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 < -5.8e7 or 1.24999999999999989e-146 < a < 5.40000000000000032e-37 or 1.4e-11 < a

    1. Initial program 99.8%

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

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

    if -5.8e7 < a < 1.24999999999999989e-146 or 5.40000000000000032e-37 < a < 1.4e-11

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -58000000 \lor \neg \left(a \leq 1.25 \cdot 10^{-146}\right) \land \left(a \leq 5.4 \cdot 10^{-37} \lor \neg \left(a \leq 1.4 \cdot 10^{-11}\right)\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \end{array} \]

Alternative 7: 56.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+188}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-267}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-296}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{+181}:\\
\;\;\;\;a \cdot 120\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.60000000000000023e188 or 6.19999999999999978e181 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{y \cdot \frac{60}{z - t}}\right) + a \cdot 120 \]
      7. distribute-rgt-neg-in90.8%

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} + a \cdot 120 \]
    5. Step-by-step derivation
      1. *-commutative90.8%

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

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

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

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

    if -4.60000000000000023e188 < y < -1.09999999999999994e-267 or -6.79999999999999993e-296 < y < 6.19999999999999978e181

    1. Initial program 99.8%

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

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

    if -1.09999999999999994e-267 < y < -6.79999999999999993e-296

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+188}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-267}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-296}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+181}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array} \]

Alternative 8: 67.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5500000000:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-37}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.5e9

    1. Initial program 99.8%

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

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

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

    if -5.5e9 < z < 2.14999999999999996e-252

    1. Initial program 99.7%

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

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

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

    if 2.14999999999999996e-252 < z < 1.35000000000000008e-37

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 1.35000000000000008e-37 < z

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5500000000:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-252}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-37}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\ \end{array} \]

Alternative 9: 67.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4000000000:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-43}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4e9

    1. Initial program 99.8%

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

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

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

    if -4e9 < z < 1.39999999999999992e-254

    1. Initial program 99.7%

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

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

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

    if 1.39999999999999992e-254 < z < 3.0999999999999999e-43

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 3.0999999999999999e-43 < z

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z}} + a \cdot 120 \]
      2. *-commutative78.5%

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} + a \cdot 120 \]
    5. Simplified78.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4000000000:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-254}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-43}:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \frac{x \cdot 60}{z}\\ \end{array} \]

Alternative 10: 89.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.4000000000000002e74 or 6.2999999999999998e66 < y

    1. Initial program 99.6%

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

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

    if -4.4000000000000002e74 < y < 6.2999999999999998e66

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+74} \lor \neg \left(y \leq 6.3 \cdot 10^{+66}\right):\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 11: 99.8% accurate, 1.0× speedup?

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

\\
\left(x - y\right) \cdot \frac{60}{z - t} + a \cdot 120
\end{array}
Derivation
  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}{\frac{60}{z - t} \cdot \left(x - y\right)} + a \cdot 120 \]
  3. Applied egg-rr99.8%

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

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

Alternative 12: 99.7% accurate, 1.0× speedup?

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

\\
\frac{y - x}{\left(z - t\right) \cdot -0.016666666666666666} + a \cdot 120
\end{array}
Derivation
  1. Initial program 99.7%

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

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

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

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

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

      \[\leadsto \left(-\frac{x - y}{-\color{blue}{\left(z - t\right) \cdot \frac{1}{60}}}\right) + a \cdot 120 \]
    6. distribute-rgt-neg-in99.8%

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

      \[\leadsto \left(-\frac{x - y}{\left(z - t\right) \cdot \left(-\color{blue}{0.016666666666666666}\right)}\right) + a \cdot 120 \]
    8. metadata-eval99.8%

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

    \[\leadsto \color{blue}{\left(-\frac{x - y}{\left(z - t\right) \cdot -0.016666666666666666}\right)} + a \cdot 120 \]
  4. Final simplification99.8%

    \[\leadsto \frac{y - x}{\left(z - t\right) \cdot -0.016666666666666666} + a \cdot 120 \]

Alternative 13: 57.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{+188} \lor \neg \left(y \leq 3.5 \cdot 10^{+181}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.39999999999999945e188 or 3.50000000000000008e181 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{y \cdot \frac{60}{z - t}}\right) + a \cdot 120 \]
      7. distribute-rgt-neg-in90.8%

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} + a \cdot 120 \]
    5. Step-by-step derivation
      1. *-commutative90.8%

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

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

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

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

    if -8.39999999999999945e188 < y < 3.50000000000000008e181

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{+188} \lor \neg \left(y \leq 3.5 \cdot 10^{+181}\right):\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 14: 52.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+243} \lor \neg \left(y \leq 1.1 \cdot 10^{+184}\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 -4.4e+243) (not (<= y 1.1e+184)))
   (* -60.0 (/ y z))
   (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -4.4e+243) || !(y <= 1.1e+184)) {
		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 <= (-4.4d+243)) .or. (.not. (y <= 1.1d+184))) 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 <= -4.4e+243) || !(y <= 1.1e+184)) {
		tmp = -60.0 * (y / z);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -4.4e+243) or not (y <= 1.1e+184):
		tmp = -60.0 * (y / z)
	else:
		tmp = a * 120.0
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((y <= -4.4e+243) || !(y <= 1.1e+184))
		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 <= -4.4e+243) || ~((y <= 1.1e+184)))
		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, -4.4e+243], N[Not[LessEqual[y, 1.1e+184]], $MachinePrecision]], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+243} \lor \neg \left(y \leq 1.1 \cdot 10^{+184}\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 < -4.40000000000000018e243 or 1.1e184 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000018e243 < y < 1.1e184

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+243} \lor \neg \left(y \leq 1.1 \cdot 10^{+184}\right):\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  3. Final simplification51.6%

    \[\leadsto a \cdot 120 \]

Developer target: 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 2023305 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

  :herbie-target
  (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))

  (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))