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

Percentage Accurate: 99.4% → 99.4%
Time: 13.9s
Alternatives: 20
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 20 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.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}
Derivation
  1. Initial program 99.8%

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

Alternative 2: 59.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -4.8 \cdot 10^{-256}:\\
\;\;\;\;\frac{60 \cdot x}{z - t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.3999999999999996e-94 or 1.6000000000000001e-83 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.3999999999999996e-94 < a < -4.7999999999999999e-256

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

    if -4.7999999999999999e-256 < a < 6.4999999999999995e-141

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-eval91.3%

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

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

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

    if 6.4999999999999995e-141 < a < 1.6000000000000001e-83

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.5%

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}}\right) \]
      4. un-div-inv99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      2. *-commutative75.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.4 \cdot 10^{-94}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-256}:\\ \;\;\;\;\frac{60 \cdot x}{z - t}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-141}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-83}:\\ \;\;\;\;\frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -1 \cdot 10^{-256}:\\
\;\;\;\;\frac{60 \cdot x}{z - t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.2000000000000001e-93 or 1.69999999999999988e-82 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-93 < a < -9.99999999999999977e-257

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

    if -9.99999999999999977e-257 < a < 1.70000000000000004e-140

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-eval91.3%

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

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

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

    if 1.70000000000000004e-140 < a < 1.69999999999999988e-82

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{-93}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-256}:\\ \;\;\;\;\frac{60 \cdot x}{z - t}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-140}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-82}:\\ \;\;\;\;60 \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -1.15 \cdot 10^{-255}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.5000000000000002e-101 or 1.12e-82 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5000000000000002e-101 < a < -1.1499999999999999e-255

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

    if -1.1499999999999999e-255 < a < 1.80000000000000007e-141

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-eval91.3%

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

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

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

    if 1.80000000000000007e-141 < a < 1.12e-82

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.5 \cdot 10^{-101}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.15 \cdot 10^{-255}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-141}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{-82}:\\ \;\;\;\;60 \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -2.0000000000000001e-83 or 2e-140 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity87.9%

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

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

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -100000000 \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-28}\right):\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -1e8 or 1.99999999999999994e-28 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity90.8%

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

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

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

    if -1e8 < (*.f64 a #s(literal 120 binary64)) < 1.99999999999999994e-28

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 120 binary64)) < -1e4 or 4.00000000000000021e32 < (*.f64 a #s(literal 120 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.9%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.9%

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

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

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

    if -1e4 < (*.f64 a #s(literal 120 binary64)) < 4.00000000000000021e32

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 59.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -4.8 \cdot 10^{-259}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.44999999999999993e-99 or 1.25e-83 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999993e-99 < a < -4.8000000000000001e-259

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

    if -4.8000000000000001e-259 < a < 1.25e-83

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{-99}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-259}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-83}:\\ \;\;\;\;60 \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.6e94 or 3.19999999999999981e-10 < y

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity88.8%

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

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

    if -6.6e94 < y < 3.19999999999999981e-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.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

Alternative 10: 89.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.9999999999999998e92

    1. Initial program 99.8%

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

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

    if -8.9999999999999998e92 < y < 2.80000000000000015e-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.8%

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

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

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

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

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

    if 2.80000000000000015e-10 < y

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} + a \cdot 120 \]
      3. *-lft-identity85.4%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity85.4%

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

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

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

Alternative 11: 89.2% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.20000000000000038e93

    1. Initial program 99.8%

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

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

    if -6.20000000000000038e93 < y < 3.19999999999999981e-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.8%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

    if 3.19999999999999981e-10 < y

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} + a \cdot 120 \]
      3. *-lft-identity85.4%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity85.4%

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

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

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

Alternative 12: 77.7% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5e32

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

    if -1.5e32 < z < 1.2999999999999999e68

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

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

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

    if 1.2999999999999999e68 < z

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-60}{z - t}} + a \cdot 120 \]
      5. /-rgt-identity86.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z}} + a \cdot 120 \]
    10. Applied egg-rr84.8%

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

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

Alternative 13: 58.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-135}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.19999999999999997e-94 or 1.7e-85 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.19999999999999997e-94 < a < 4.49999999999999987e-135

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

    if 4.49999999999999987e-135 < a < 1.7e-85

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

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.4%

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}}\right) \]
      4. un-div-inv99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-60 \cdot y}{\color{blue}{-\left(-z\right)}} \]
      3. distribute-neg-frac256.4%

        \[\leadsto \color{blue}{-\frac{-60 \cdot y}{-z}} \]
      4. distribute-frac-neg56.4%

        \[\leadsto \color{blue}{\frac{--60 \cdot y}{-z}} \]
      5. distribute-frac-neg256.4%

        \[\leadsto \color{blue}{-\frac{--60 \cdot y}{z}} \]
      6. distribute-neg-frac56.4%

        \[\leadsto \color{blue}{\frac{-\left(--60 \cdot y\right)}{z}} \]
      7. *-commutative56.4%

        \[\leadsto \frac{-\left(-\color{blue}{y \cdot -60}\right)}{z} \]
      8. distribute-rgt-neg-in56.4%

        \[\leadsto \frac{-\color{blue}{y \cdot \left(--60\right)}}{z} \]
      9. metadata-eval56.4%

        \[\leadsto \frac{-y \cdot \color{blue}{60}}{z} \]
      10. distribute-lft-neg-out56.4%

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

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{60}{z}} \]
      12. *-commutative56.6%

        \[\leadsto \color{blue}{\frac{60}{z} \cdot \left(-y\right)} \]
      13. distribute-rgt-neg-out56.6%

        \[\leadsto \color{blue}{-\frac{60}{z} \cdot y} \]
      14. distribute-lft-neg-in56.6%

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

        \[\leadsto \color{blue}{\frac{-60}{z}} \cdot y \]
      16. metadata-eval56.6%

        \[\leadsto \frac{\color{blue}{-60}}{z} \cdot y \]
      17. associate-/r/56.6%

        \[\leadsto \color{blue}{\frac{-60}{\frac{z}{y}}} \]
    13. Simplified56.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{-94}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-135}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-85}:\\ \;\;\;\;\frac{-60}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 75.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -20.5 or 4.89999999999999984e30 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{-\frac{60}{t - z}}, a \cdot 120\right) \]
      10. distribute-neg-frac99.9%

        \[\leadsto \mathsf{fma}\left(x - y, \color{blue}{\frac{-60}{t - z}}, a \cdot 120\right) \]
      11. metadata-eval99.9%

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

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

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

    if -20.5 < a < 4.89999999999999984e30

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

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

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

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

Alternative 15: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 16: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 17: 51.0% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7.6000000000000001e205

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000001e205 < 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.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}}\right) \]
      4. un-div-inv99.9%

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x}{t}} \]
    9. Step-by-step derivation
      1. clear-num56.6%

        \[\leadsto -60 \cdot \color{blue}{\frac{1}{\frac{t}{x}}} \]
      2. un-div-inv56.7%

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x}}} \]
    10. Applied egg-rr56.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7.6 \cdot 10^{+205}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{-60}{\frac{t}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 51.1% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.30000000000000031e191

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.30000000000000031e191 < 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.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}}\right) \]
      4. un-div-inv99.9%

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

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

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x}{t}} \]
    9. Step-by-step derivation
      1. clear-num56.6%

        \[\leadsto -60 \cdot \color{blue}{\frac{1}{\frac{t}{x}}} \]
      2. un-div-inv56.7%

        \[\leadsto \color{blue}{\frac{-60}{\frac{t}{x}}} \]
    10. Applied egg-rr56.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.3 \cdot 10^{+191}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 51.1% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.30000000000000016e206

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.30000000000000016e206 < 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.7%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z - t} + a \cdot 120} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

        \[\leadsto \mathsf{fma}\left(a, 120, 60 \cdot \color{blue}{\frac{1}{\frac{z - t}{x - y}}}\right) \]
      4. un-div-inv99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.3 \cdot 10^{+206}:\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 50.6% 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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification47.1%

    \[\leadsto a \cdot 120 \]
  7. Add Preprocessing

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

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

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

Reproduce

?
herbie shell --seed 2024170 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))

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