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

Percentage Accurate: 99.3% → 99.8%
Time: 16.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.1× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative99.8%

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a, 120, \frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\right) \]
  8. Add Preprocessing

Alternative 2: 73.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+112}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\ \mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-7}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\ \mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-41} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+65}\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 (<= (* a 120.0) -1e+112)
   (+ (* a 120.0) (* -60.0 (/ y z)))
   (if (<= (* a 120.0) -2e-7)
     (+ (* a 120.0) (* 60.0 (/ x z)))
     (if (or (<= (* a 120.0) -1e-41) (not (<= (* a 120.0) 5e+65)))
       (* 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) <= -1e+112) {
		tmp = (a * 120.0) + (-60.0 * (y / z));
	} else if ((a * 120.0) <= -2e-7) {
		tmp = (a * 120.0) + (60.0 * (x / z));
	} else if (((a * 120.0) <= -1e-41) || !((a * 120.0) <= 5e+65)) {
		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) <= (-1d+112)) then
        tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
    else if ((a * 120.0d0) <= (-2d-7)) then
        tmp = (a * 120.0d0) + (60.0d0 * (x / z))
    else if (((a * 120.0d0) <= (-1d-41)) .or. (.not. ((a * 120.0d0) <= 5d+65))) 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) <= -1e+112) {
		tmp = (a * 120.0) + (-60.0 * (y / z));
	} else if ((a * 120.0) <= -2e-7) {
		tmp = (a * 120.0) + (60.0 * (x / z));
	} else if (((a * 120.0) <= -1e-41) || !((a * 120.0) <= 5e+65)) {
		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) <= -1e+112:
		tmp = (a * 120.0) + (-60.0 * (y / z))
	elif (a * 120.0) <= -2e-7:
		tmp = (a * 120.0) + (60.0 * (x / z))
	elif ((a * 120.0) <= -1e-41) or not ((a * 120.0) <= 5e+65):
		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) <= -1e+112)
		tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z)));
	elseif (Float64(a * 120.0) <= -2e-7)
		tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z)));
	elseif ((Float64(a * 120.0) <= -1e-41) || !(Float64(a * 120.0) <= 5e+65))
		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) <= -1e+112)
		tmp = (a * 120.0) + (-60.0 * (y / z));
	elseif ((a * 120.0) <= -2e-7)
		tmp = (a * 120.0) + (60.0 * (x / z));
	elseif (((a * 120.0) <= -1e-41) || ~(((a * 120.0) <= 5e+65)))
		tmp = a * 120.0;
	else
		tmp = (x - y) * (60.0 / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+112], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-7], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-41], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e+65]], $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 -1 \cdot 10^{+112}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\

\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-41} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+65}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a 120) < -9.9999999999999993e111

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999993e111 < (*.f64 a 120) < -1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < (*.f64 a 120) < -1.00000000000000001e-41 or 4.99999999999999973e65 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

    if -1.00000000000000001e-41 < (*.f64 a 120) < 4.99999999999999973e65

    1. Initial program 99.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval77.1%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac77.1%

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

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

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

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

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

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

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

Alternative 3: 73.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-63}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a 120) < -9.9999999999999993e111

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999993e111 < (*.f64 a 120) < -1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < (*.f64 a 120) < -1.00000000000000007e-63

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.00000000000000007e-63 < (*.f64 a 120) < 4.99999999999999973e65

    1. Initial program 98.9%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval77.0%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac77.0%

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

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

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

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

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

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

    if 4.99999999999999973e65 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

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

Alternative 4: 72.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-63}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a 120) < -9.9999999999999993e111

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999993e111 < (*.f64 a 120) < -1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < (*.f64 a 120) < -1.00000000000000007e-63

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.00000000000000007e-63 < (*.f64 a 120) < 5.00000000000000031e-10

    1. Initial program 98.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval79.5%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac79.5%

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

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

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

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

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

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

    if 5.00000000000000031e-10 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 5: 72.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\

\mathbf{elif}\;a \cdot 120 \leq -1 \cdot 10^{-63}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot 60}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a 120) < -9.9999999999999993e111

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999993e111 < (*.f64 a 120) < -1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < (*.f64 a 120) < -1.00000000000000007e-63

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} + a \cdot 120 \]
    10. Applied egg-rr76.7%

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

    if -1.00000000000000007e-63 < (*.f64 a 120) < 5.00000000000000031e-10

    1. Initial program 98.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval79.5%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac79.5%

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

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

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

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

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

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

    if 5.00000000000000031e-10 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 6: 82.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a 120) < -5.0000000000000003e-134 or 1.00000000000000006e-32 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

    if -5.0000000000000003e-134 < (*.f64 a 120) < 1.00000000000000006e-32

    1. Initial program 98.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval82.7%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac82.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{60}{z - t}} \]
    10. Step-by-step derivation
      1. clear-num82.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}} \]
    11. Applied egg-rr82.7%

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

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

Alternative 7: 74.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-41} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+65}\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) -1e-41) (not (<= (* a 120.0) 5e+65)))
   (* 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) <= -1e-41) || !((a * 120.0) <= 5e+65)) {
		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) <= (-1d-41)) .or. (.not. ((a * 120.0d0) <= 5d+65))) 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) <= -1e-41) || !((a * 120.0) <= 5e+65)) {
		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) <= -1e-41) or not ((a * 120.0) <= 5e+65):
		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) <= -1e-41) || !(Float64(a * 120.0) <= 5e+65))
		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) <= -1e-41) || ~(((a * 120.0) <= 5e+65)))
		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], -1e-41], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e+65]], $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 -1 \cdot 10^{-41} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+65}\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 120) < -1.00000000000000001e-41 or 4.99999999999999973e65 < (*.f64 a 120)

    1. Initial program 99.9%

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

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

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

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

    if -1.00000000000000001e-41 < (*.f64 a 120) < 4.99999999999999973e65

    1. Initial program 99.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval77.1%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac77.1%

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

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

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

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

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

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

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

Alternative 8: 58.4% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.65e-111 or 3.79999999999999976e-29 < a

    1. Initial program 99.9%

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

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

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

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

    if -1.65e-111 < a < -1.05e-135

    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 \color{blue}{a \cdot 120 + \frac{60 \cdot \left(x - y\right)}{z - t}} \]
      2. fma-def99.8%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}}\right) \]
    7. Step-by-step derivation
      1. fma-udef99.6%

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

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

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

    if -1.05e-135 < a < 3.79999999999999976e-29

    1. Initial program 98.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.7%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}}\right) \]
    7. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{-111}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-135}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-29}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 88.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4499999999999998e93 or 0.320000000000000007 < x

    1. Initial program 99.8%

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

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

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

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

    if -3.4499999999999998e93 < x < 0.320000000000000007

    1. Initial program 99.2%

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

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

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

Alternative 10: 88.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4499999999999998e93 or 0.13500000000000001 < x

    1. Initial program 99.8%

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

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

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

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

    if -3.4499999999999998e93 < x < 0.13500000000000001

    1. Initial program 99.2%

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

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

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

      \[\leadsto \frac{60}{\color{blue}{-1 \cdot \frac{z - t}{y}}} + a \cdot 120 \]
    6. Step-by-step derivation
      1. mul-1-neg95.9%

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

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

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

Alternative 11: 76.0% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1e-64

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.1e-64 < z < 2.25e-52

    1. Initial program 98.8%

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

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

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

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

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

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

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

    if 2.25e-52 < z

    1. Initial program 99.9%

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

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

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

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

Alternative 12: 74.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-44} \lor \neg \left(a \leq 2.85 \cdot 10^{+63}\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 -2e-44) (not (<= a 2.85e+63)))
   (* 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 <= -2e-44) || !(a <= 2.85e+63)) {
		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 <= (-2d-44)) .or. (.not. (a <= 2.85d+63))) 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 <= -2e-44) || !(a <= 2.85e+63)) {
		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 <= -2e-44) or not (a <= 2.85e+63):
		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 <= -2e-44) || !(a <= 2.85e+63))
		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 <= -2e-44) || ~((a <= 2.85e+63)))
		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, -2e-44], N[Not[LessEqual[a, 2.85e+63]], $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 -2 \cdot 10^{-44} \lor \neg \left(a \leq 2.85 \cdot 10^{+63}\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 < -1.99999999999999991e-44 or 2.8500000000000001e63 < a

    1. Initial program 99.9%

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

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

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

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

    if -1.99999999999999991e-44 < a < 2.8500000000000001e63

    1. Initial program 99.0%

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

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

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

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

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

Alternative 13: 58.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{-137} \lor \neg \left(a \leq 1.68 \cdot 10^{-34}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.4499999999999998e-137 or 1.68e-34 < a

    1. Initial program 99.9%

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

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

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

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

    if -2.4499999999999998e-137 < a < 1.68e-34

    1. Initial program 98.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.7%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}}\right) \]
    7. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

Alternative 14: 54.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-112} \lor \neg \left(z \leq 1.05 \cdot 10^{-44}\right):\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.50000000000000022e-112 or 1.05000000000000001e-44 < z

    1. Initial program 99.8%

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

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

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

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

    if -2.50000000000000022e-112 < z < 1.05000000000000001e-44

    1. Initial program 98.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x - y}{z - t} \cdot 60} \]
      2. metadata-eval67.5%

        \[\leadsto \frac{x - y}{z - t} \cdot \color{blue}{\frac{1}{0.016666666666666666}} \]
      3. times-frac67.6%

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

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

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

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

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

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

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

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

Alternative 15: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative99.8%

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a, 120, \color{blue}{\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}}\right) \]
  7. Step-by-step derivation
    1. fma-udef99.9%

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

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

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

Alternative 16: 50.5% 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.5%

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

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

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification54.0%

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

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

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

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