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

Percentage Accurate: 99.4% → 99.8%
Time: 14.3s
Alternatives: 13
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 57.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x - y}{z}\\ t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+78}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-41}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* 60.0 (/ (- x y) z))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e+78)
       (* 60.0 (/ x (- z t)))
       (if (<= t_2 5e-41) (* a 120.0) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e+78) {
		tmp = 60.0 * (x / (z - t));
	} else if (t_2 <= 5e-41) {
		tmp = a * 120.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * ((x - y) / z);
	double t_2 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -5e+78) {
		tmp = 60.0 * (x / (z - t));
	} else if (t_2 <= 5e-41) {
		tmp = a * 120.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * ((x - y) / z)
	t_2 = (60.0 * (x - y)) / (z - t)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -5e+78:
		tmp = 60.0 * (x / (z - t))
	elif t_2 <= 5e-41:
		tmp = a * 120.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(60.0 * Float64(Float64(x - y) / z))
	t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e+78)
		tmp = Float64(60.0 * Float64(x / Float64(z - t)));
	elseif (t_2 <= 5e-41)
		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 * ((x - y) / z);
	t_2 = (60.0 * (x - y)) / (z - t);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -5e+78)
		tmp = 60.0 * (x / (z - t));
	elseif (t_2 <= 5e-41)
		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[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e+78], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-41], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+78}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-41}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -inf.0 or 4.9999999999999996e-41 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 60 \cdot \color{blue}{\frac{x - y}{z}} \]
      3. lower--.f6441.6

        \[\leadsto 60 \cdot \frac{\color{blue}{x - y}}{z} \]
    10. Simplified41.6%

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

    if -inf.0 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999984e78

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 60 \cdot \frac{x}{\color{blue}{z - t}} \]
    9. Simplified37.9%

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

    if -4.99999999999999984e78 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999996e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Reproduce

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