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

Percentage Accurate: 99.4% → 99.8%
Time: 13.1s
Alternatives: 17
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 17 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.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\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(Float64(60.0 / Float64(z - t)) * Float64(x - y)))
end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

      \[\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.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, \frac{60}{z - t} \cdot \left(x - y\right)\right) \]

Alternative 2: 82.5% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(x - y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 120) < -5.0000000000000001e-192 or 9.9999999999999993e-78 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/84.5%

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

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

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

    if -5.0000000000000001e-192 < (*.f64 a 120) < 9.9999999999999993e-78

    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.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative87.9%

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

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

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

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

Alternative 3: 82.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq 10^{-77}:\\
\;\;\;\;t_1 \cdot \left(x - y\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot x + a \cdot 120\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -5.0000000000000001e-192

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*79.4%

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

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

    if -5.0000000000000001e-192 < (*.f64 a 120) < 9.9999999999999993e-78

    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.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative87.9%

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

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

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

    if 9.9999999999999993e-78 < (*.f64 a 120)

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/91.1%

        \[\leadsto \color{blue}{\frac{60}{z - t} \cdot x} + a \cdot 120 \]
      3. *-commutative91.1%

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

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

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

Alternative 4: 75.0% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a 120) < -1e-8

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

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

      \[\leadsto \color{blue}{120 \cdot a + -60 \cdot \frac{y}{z - t}} \]
    7. Step-by-step derivation
      1. fma-def92.4%

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

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

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

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

    if -1e-8 < (*.f64 a 120) < 3e10

    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.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative73.9%

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

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

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

    if 3e10 < (*.f64 a 120)

    1. Initial program 99.8%

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

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

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

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

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

Alternative 5: 57.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -5.0000000000000003e-34 or 5.00000000000000041e-6 < (-.f64 z t)

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

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

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

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

    if -5.0000000000000003e-34 < (-.f64 z t) < 5.00000000000000041e-6

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative89.6%

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

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

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

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

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

Alternative 6: 88.4% accurate, 0.9× speedup?

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

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

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

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


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

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.9%

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z - t} + a \cdot 120 \]
      3. associate-/l*90.8%

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

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

    if -4.50000000000000008e147 < x < 1.6e47

    1. Initial program 99.3%

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

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

    if 1.6e47 < x

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/93.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+147}:\\ \;\;\;\;\frac{x}{\frac{z - t}{60}} + a \cdot 120\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+47}:\\ \;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{z - t} \cdot x + a \cdot 120\\ \end{array} \]

Alternative 7: 88.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

    if -3.9999999999999999e147 < x < 2.40000000000000019e47

    1. Initial program 99.3%

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

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

    if 2.40000000000000019e47 < x

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z - t}} + a \cdot 120 \]
      2. associate-*l/93.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+147}:\\ \;\;\;\;\frac{60 \cdot x}{z - t} + a \cdot 120\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+47}:\\ \;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60}{z - t} \cdot x + a \cdot 120\\ \end{array} \]

Alternative 8: 58.4% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.25000000000000002e-195 or 2.0499999999999999e-78 < a

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -1.25000000000000002e-195 < a < -9.50000000000000023e-304

    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.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative84.3%

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

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

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

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

    if -9.50000000000000023e-304 < a < 2.0499999999999999e-78

    1. Initial program 97.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-195}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-304}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{-78}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 9: 76.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 225000000:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.04999999999999993e-19 or 2.25e8 < a

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -2.04999999999999993e-19 < a < 2.25e8

    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.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.05 \cdot 10^{-19}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 225000000:\\ \;\;\;\;60 \cdot \frac{x - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 10: 76.2% accurate, 1.0× speedup?

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

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

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

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


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

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if -8.79999999999999942e-15 < a < 2.25e8

    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.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative74.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.8 \cdot 10^{-15}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 225000000:\\ \;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 11: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{60}{z - t} \cdot \left(x - y\right) + 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(Float64(60.0 / 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[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

Alternative 12: 52.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.5 \cdot 10^{+196}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+260} \lor \neg \left(y \leq 1.35 \cdot 10^{+303}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 6.49999999999999968e196

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 6.49999999999999968e196 < y < 4.30000000000000024e260 or 1.35000000000000005e303 < y

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

    if 4.30000000000000024e260 < y < 1.35000000000000005e303

    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.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.5 \cdot 10^{+196}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+260} \lor \neg \left(y \leq 1.35 \cdot 10^{+303}\right):\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{y}{t}\\ \end{array} \]

Alternative 13: 58.8% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.79999999999999999e-156 or 1.85000000000000003e-78 < 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.8%

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

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

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

    if -1.79999999999999999e-156 < a < 1.85000000000000003e-78

    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.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.8 \cdot 10^{-156}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-78}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 14: 51.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{+182}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 1.9 \cdot 10^{+225}:\\
\;\;\;\;\frac{x}{t \cdot -0.016666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 2.80000000000000006e182

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 2.80000000000000006e182 < x < 1.9e225

    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*99.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - t}{60}}} \]
    8. Simplified77.1%

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

      \[\leadsto \frac{x}{\color{blue}{-0.016666666666666666 \cdot t}} \]
    10. Step-by-step derivation
      1. *-commutative70.1%

        \[\leadsto \frac{x}{\color{blue}{t \cdot -0.016666666666666666}} \]
    11. Simplified70.1%

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

    if 1.9e225 < x

    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.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - t}{60}}} \]
    8. Simplified84.5%

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

      \[\leadsto \frac{x}{\color{blue}{0.016666666666666666 \cdot z}} \]
    10. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot 0.016666666666666666}} \]
    11. Simplified69.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{+182}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+225}:\\ \;\;\;\;\frac{x}{t \cdot -0.016666666666666666}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot 0.016666666666666666}\\ \end{array} \]

Alternative 15: 51.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{+182}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;x \leq 2.7 \cdot 10^{+225}:\\
\;\;\;\;\frac{x \cdot -60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 3.80000000000000013e182

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 3.80000000000000013e182 < x < 2.6999999999999999e225

    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*99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. *-commutative77.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
    12. Simplified70.2%

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

    if 2.6999999999999999e225 < x

    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.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z - t}{60}}} \]
    8. Simplified84.5%

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

      \[\leadsto \frac{x}{\color{blue}{0.016666666666666666 \cdot z}} \]
    10. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot 0.016666666666666666}} \]
    11. Simplified69.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.8 \cdot 10^{+182}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+225}:\\ \;\;\;\;\frac{x \cdot -60}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot 0.016666666666666666}\\ \end{array} \]

Alternative 16: 52.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{+196}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.5000000000000005e196

    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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
    3. Simplified99.8%

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

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

    if 7.5000000000000005e196 < y

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7.5 \cdot 10^{+196}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 17: 50.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.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}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120 \]
  3. Simplified99.7%

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  5. Final simplification53.1%

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