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

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

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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.1%

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

      \[\leadsto \color{blue}{\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. Final simplification99.8%

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

Alternative 2: 75.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-66}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;t_1 \leq 200000000000:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{-t}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -5.00000000000000018e-11 or 2e11 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.2%

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

        \[\leadsto \color{blue}{\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 a around 0 81.1%

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

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

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

    if -5.00000000000000018e-11 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 4.99999999999999962e-66

    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 z around inf 78.3%

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

    if 4.99999999999999962e-66 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 2e11

    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 x around inf 86.8%

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

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

        \[\leadsto \frac{60}{\color{blue}{-\frac{t}{x}}} + a \cdot 120 \]
      2. distribute-neg-frac82.8%

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

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

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

Alternative 3: 75.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-66}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;t_1 \leq 200000000000:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -5.00000000000000018e-11 or 2e11 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t))

    1. Initial program 98.2%

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

        \[\leadsto \color{blue}{\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 a around 0 81.1%

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

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

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

    if -5.00000000000000018e-11 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 4.99999999999999962e-66

    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 z around inf 78.3%

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

    if 4.99999999999999962e-66 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 2e11

    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 x around inf 86.8%

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

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

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

Alternative 4: 74.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-27}:\\ \;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\ \mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{-8}:\\ \;\;\;\;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 120.0) -1e-27)
   (+ (* a 120.0) (/ -60.0 (/ z y)))
   (if (<= (* a 120.0) 5e-8) (* 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 * 120.0) <= -1e-27) {
		tmp = (a * 120.0) + (-60.0 / (z / y));
	} else if ((a * 120.0) <= 5e-8) {
		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 * 120.0d0) <= (-1d-27)) then
        tmp = (a * 120.0d0) + ((-60.0d0) / (z / y))
    else if ((a * 120.0d0) <= 5d-8) 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 * 120.0) <= -1e-27) {
		tmp = (a * 120.0) + (-60.0 / (z / y));
	} else if ((a * 120.0) <= 5e-8) {
		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 * 120.0) <= -1e-27:
		tmp = (a * 120.0) + (-60.0 / (z / y))
	elif (a * 120.0) <= 5e-8:
		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 (Float64(a * 120.0) <= -1e-27)
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y)));
	elseif (Float64(a * 120.0) <= 5e-8)
		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 * 120.0) <= -1e-27)
		tmp = (a * 120.0) + (-60.0 / (z / y));
	elseif ((a * 120.0) <= 5e-8)
		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[N[(a * 120.0), $MachinePrecision], -1e-27], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-8], 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 \cdot 120 \leq -1 \cdot 10^{-27}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\

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

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


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

    1. Initial program 98.1%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 0 85.2%

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

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

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

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

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

    if -1e-27 < (*.f64 a 120) < 4.9999999999999998e-8

    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.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 a around 0 79.4%

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

    if 4.9999999999999998e-8 < (*.f64 a 120)

    1. Initial program 98.3%

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

        \[\leadsto \color{blue}{\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 79.6%

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

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

Alternative 5: 73.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.1%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 0 85.2%

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

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

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

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

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

    if -1e-27 < (*.f64 a 120) < 4.9999999999999998e-8

    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.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 a around 0 79.4%

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

    if 4.9999999999999998e-8 < (*.f64 a 120)

    1. Initial program 98.3%

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

        \[\leadsto \color{blue}{\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 95.7%

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

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

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

Alternative 6: 73.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.1%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 0 85.2%

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

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

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

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

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

    if -1e-27 < (*.f64 a 120) < 4.9999999999999998e-8

    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.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 a around 0 79.4%

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u49.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)\right)} \]
      2. expm1-udef28.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)} - 1} \]
      3. associate-*r/28.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right)} - 1 \]
    6. Applied egg-rr28.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{60 \cdot \left(x - y\right)}{z - t}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def49.0%

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

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

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

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

    if 4.9999999999999998e-8 < (*.f64 a 120)

    1. Initial program 98.3%

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

        \[\leadsto \color{blue}{\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 95.7%

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

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

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

Alternative 7: 56.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 60 \cdot \frac{x}{z - t}\\ \mathbf{if}\;x \leq -8.5 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-268}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-227}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+21}:\\ \;\;\;\;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 (- z t)))))
   (if (<= x -8.5e+118)
     t_1
     (if (<= x 9.5e-268)
       (* a 120.0)
       (if (<= x 1.3e-227)
         (/ (* y -60.0) (- z t))
         (if (<= x 2.3e+21) (* a 120.0) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * (x / (z - t));
	double tmp;
	if (x <= -8.5e+118) {
		tmp = t_1;
	} else if (x <= 9.5e-268) {
		tmp = a * 120.0;
	} else if (x <= 1.3e-227) {
		tmp = (y * -60.0) / (z - t);
	} else if (x <= 2.3e+21) {
		tmp = a * 120.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 60.0d0 * (x / (z - t))
    if (x <= (-8.5d+118)) then
        tmp = t_1
    else if (x <= 9.5d-268) then
        tmp = a * 120.0d0
    else if (x <= 1.3d-227) then
        tmp = (y * (-60.0d0)) / (z - t)
    else if (x <= 2.3d+21) then
        tmp = a * 120.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 60.0 * (x / (z - t));
	double tmp;
	if (x <= -8.5e+118) {
		tmp = t_1;
	} else if (x <= 9.5e-268) {
		tmp = a * 120.0;
	} else if (x <= 1.3e-227) {
		tmp = (y * -60.0) / (z - t);
	} else if (x <= 2.3e+21) {
		tmp = a * 120.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 60.0 * (x / (z - t))
	tmp = 0
	if x <= -8.5e+118:
		tmp = t_1
	elif x <= 9.5e-268:
		tmp = a * 120.0
	elif x <= 1.3e-227:
		tmp = (y * -60.0) / (z - t)
	elif x <= 2.3e+21:
		tmp = a * 120.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(60.0 * Float64(x / Float64(z - t)))
	tmp = 0.0
	if (x <= -8.5e+118)
		tmp = t_1;
	elseif (x <= 9.5e-268)
		tmp = Float64(a * 120.0);
	elseif (x <= 1.3e-227)
		tmp = Float64(Float64(y * -60.0) / Float64(z - t));
	elseif (x <= 2.3e+21)
		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 / (z - t));
	tmp = 0.0;
	if (x <= -8.5e+118)
		tmp = t_1;
	elseif (x <= 9.5e-268)
		tmp = a * 120.0;
	elseif (x <= 1.3e-227)
		tmp = (y * -60.0) / (z - t);
	elseif (x <= 2.3e+21)
		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[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+118], t$95$1, If[LessEqual[x, 9.5e-268], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, 1.3e-227], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e+21], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-268}:\\
\;\;\;\;a \cdot 120\\

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{+21}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.50000000000000033e118 or 2.3e21 < x

    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.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 a around 0 78.9%

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

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

    if -8.50000000000000033e118 < x < 9.50000000000000007e-268 or 1.30000000000000006e-227 < x < 2.3e21

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

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

    if 9.50000000000000007e-268 < x < 1.30000000000000006e-227

    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.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 a around 0 78.3%

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
    7. Simplified70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+118}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-268}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-227}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+21}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \end{array} \]

Alternative 8: 89.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.2e8 or 8.0000000000000005e-9 < x

    1. Initial program 98.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 x around inf 89.1%

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

    if -2.2e8 < x < 8.0000000000000005e-9

    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 0 96.9%

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

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

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

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

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

Alternative 9: 89.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1e7 or 2.05000000000000016e-8 < x

    1. Initial program 98.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 x around inf 89.1%

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

    if -2.1e7 < x < 2.05000000000000016e-8

    1. Initial program 99.9%

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

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

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

Alternative 10: 80.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+117}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\


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

    1. Initial program 95.1%

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

        \[\leadsto \color{blue}{\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 a around 0 76.9%

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u36.5%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(60 \cdot \frac{x - y}{z - t}\right)} - 1} \]
      3. associate-*r/24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}}\right)} - 1 \]
    6. Applied egg-rr24.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{60 \cdot \left(x - y\right)}{z - t}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def36.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{60 \cdot \left(x - y\right)}{z - t}\right)\right)} \]
      2. expm1-log1p77.0%

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

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

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

    if -4.70000000000000006e117 < x < 2.2e21

    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 0 91.6%

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

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

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

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

    if 2.2e21 < x

    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 a around 0 80.5%

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

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

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

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

Alternative 11: 75.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.4 \cdot 10^{-31}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-10}:\\ \;\;\;\;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 -3.4e-31)
   (* a 120.0)
   (if (<= a 4.8e-10) (* 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 <= -3.4e-31) {
		tmp = a * 120.0;
	} else if (a <= 4.8e-10) {
		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 <= (-3.4d-31)) then
        tmp = a * 120.0d0
    else if (a <= 4.8d-10) 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 <= -3.4e-31) {
		tmp = a * 120.0;
	} else if (a <= 4.8e-10) {
		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 <= -3.4e-31:
		tmp = a * 120.0
	elif a <= 4.8e-10:
		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 <= -3.4e-31)
		tmp = Float64(a * 120.0);
	elseif (a <= 4.8e-10)
		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 <= -3.4e-31)
		tmp = a * 120.0;
	elseif (a <= 4.8e-10)
		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, -3.4e-31], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 4.8e-10], 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 -3.4 \cdot 10^{-31}:\\
\;\;\;\;a \cdot 120\\

\mathbf{elif}\;a \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;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 < -3.4000000000000001e-31 or 4.8e-10 < a

    1. Initial program 98.2%

      \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120 \]
    2. Step-by-step derivation
      1. associate-/l*99.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 74.9%

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

    if -3.4000000000000001e-31 < a < 4.8e-10

    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.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 a around 0 79.4%

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

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

Alternative 12: 57.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+122} \lor \neg \left(x \leq 2.5 \cdot 10^{+21}\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8000000000000001e122 or 2.5e21 < x

    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.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 a around 0 78.9%

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

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

    if -1.8000000000000001e122 < x < 2.5e21

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

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

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

Alternative 13: 59.9% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.1999999999999997e-105 or 7.99999999999999992e-95 < a

    1. Initial program 98.6%

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

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

    if -5.1999999999999997e-105 < a < 7.99999999999999992e-95

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-105}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-95}:\\ \;\;\;\;-60 \cdot \frac{x - y}{t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]

Alternative 14: 52.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+185} \lor \neg \left(x \leq 5 \cdot 10^{+163}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.49999999999999955e185 or 5e163 < x

    1. Initial program 96.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 a around 0 83.1%

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

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

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

    if -7.49999999999999955e185 < x < 5e163

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

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

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

Alternative 15: 52.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+182}:\\
\;\;\;\;\frac{x \cdot -60}{t}\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+162}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 93.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot x}{t}} \]
    8. Simplified46.7%

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

    if -6.4999999999999998e182 < x < 1.70000000000000001e162

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

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

    if 1.70000000000000001e162 < x

    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 a around 0 86.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+182}:\\ \;\;\;\;\frac{x \cdot -60}{t}\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+162}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \end{array} \]

Alternative 16: 51.3% 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.1%

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

      \[\leadsto \color{blue}{\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 46.6%

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

    \[\leadsto a \cdot 120 \]

Developer target: 99.8% accurate, 1.0× speedup?

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

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

Reproduce

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