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

Percentage Accurate: 99.4% → 99.8%
Time: 12.9s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0.02:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e30 or 0.0200000000000000004 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t))

    1. Initial program 99.0%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} \]
      4. --lowering--.f64N/A

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

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

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

    if -2e30 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 0.0200000000000000004

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified75.4%

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

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

Alternative 3: 82.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{if}\;y \leq -5 \cdot 10^{+156}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(120, a, \frac{60}{z - t} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
   (if (<= y -5e+156)
     t_1
     (if (<= y 5.2e+154) (fma 120.0 a (* (/ 60.0 (- z t)) x)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (60.0 * (x - y)) / (z - t);
	double tmp;
	if (y <= -5e+156) {
		tmp = t_1;
	} else if (y <= 5.2e+154) {
		tmp = fma(120.0, a, ((60.0 / (z - t)) * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t))
	tmp = 0.0
	if (y <= -5e+156)
		tmp = t_1;
	elseif (y <= 5.2e+154)
		tmp = fma(120.0, a, Float64(Float64(60.0 / Float64(z - t)) * x));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e+156], t$95$1, If[LessEqual[y, 5.2e+154], N[(120.0 * a + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{60}{z - t} \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.99999999999999992e156 or 5.19999999999999978e154 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} \]
      4. --lowering--.f64N/A

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

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

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

    if -4.99999999999999992e156 < y < 5.19999999999999978e154

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(120, a, x \cdot \frac{60}{z - t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.6%

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

Alternative 4: 84.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 400000000000:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma 60.0 (/ (- x y) z) (* a 120.0))))
   (if (<= z -2.2e-22)
     t_1
     (if (<= z 400000000000.0) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(60.0, ((x - y) / z), (a * 120.0));
	double tmp;
	if (z <= -2.2e-22) {
		tmp = t_1;
	} else if (z <= 400000000000.0) {
		tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0))
	tmp = 0.0
	if (z <= -2.2e-22)
		tmp = t_1;
	elseif (z <= 400000000000.0)
		tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-22], t$95$1, If[LessEqual[z, 400000000000.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000001e-22 or 4e11 < z

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{60 \cdot \frac{x - y}{z} + 120 \cdot a} \]
    4. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

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

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

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

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

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

    if -2.2000000000000001e-22 < z < 4e11

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
    4. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{\color{blue}{x - y}}{t}, 120 \cdot a\right) \]
      4. *-lowering-*.f6482.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-22}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \mathbf{elif}\;z \leq 400000000000:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\ \mathbf{if}\;z \leq -1.5 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 430000000000:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma 120.0 a (/ (* 60.0 x) z))))
   (if (<= z -1.5e-24)
     t_1
     (if (<= z 430000000000.0) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(120.0, a, ((60.0 * x) / z));
	double tmp;
	if (z <= -1.5e-24) {
		tmp = t_1;
	} else if (z <= 430000000000.0) {
		tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(120.0, a, Float64(Float64(60.0 * x) / z))
	tmp = 0.0
	if (z <= -1.5e-24)
		tmp = t_1;
	elseif (z <= 430000000000.0)
		tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(120.0 * a + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-24], t$95$1, If[LessEqual[z, 430000000000.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.49999999999999998e-24 or 4.3e11 < z

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(120, a, x \cdot \color{blue}{\frac{60}{z - t}}\right) \]
      11. --lowering--.f6480.0

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(120, a, \frac{\color{blue}{x \cdot 60}}{z}\right) \]
      4. *-lowering-*.f6474.9

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

      \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{\frac{x \cdot 60}{z}}\right) \]

    if -1.49999999999999998e-24 < z < 4.3e11

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
    4. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{\color{blue}{x - y}}{t}, 120 \cdot a\right) \]
      4. *-lowering-*.f6482.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-24}:\\ \;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\ \mathbf{elif}\;z \leq 430000000000:\\ \;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 52.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq -1.3 \cdot 10^{-302}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\

\mathbf{elif}\;a \leq 4.3 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{z \cdot 0.016666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.79999999999999964e-127 or 4.29999999999999982e-120 < a

    1. Initial program 99.3%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified64.4%

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

    if -4.79999999999999964e-127 < a < -1.30000000000000006e-302

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

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

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

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

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

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6451.6

        \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Simplified51.6%

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

      \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6439.1

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

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

    if -1.30000000000000006e-302 < a < 4.29999999999999982e-120

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

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

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

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

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

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6450.6

        \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Simplified50.6%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot x}{z}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} \]
      4. *-lowering-*.f6441.4

        \[\leadsto \frac{\color{blue}{x \cdot 60}}{z} \]
    8. Simplified41.4%

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

        \[\leadsto \color{blue}{x \cdot \frac{60}{z}} \]
      2. clear-numN/A

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{z}{60}}} \]
      3. un-div-invN/A

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{60}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{60}}} \]
      5. div-invN/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{1}{60}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\frac{1}{60}}} \]
      7. *-lowering-*.f6441.4

        \[\leadsto \frac{x}{\color{blue}{z \cdot 0.016666666666666666}} \]
    10. Applied egg-rr41.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.8 \cdot 10^{-127}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -1.3 \cdot 10^{-302}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{-120}:\\ \;\;\;\;\frac{x}{z \cdot 0.016666666666666666}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq -8.5 \cdot 10^{-307}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.80000000000000003e-127 or 2.9e-120 < a

    1. Initial program 99.3%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified64.4%

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

    if -3.80000000000000003e-127 < a < -8.4999999999999995e-307

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

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

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

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

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

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6451.6

        \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Simplified51.6%

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

      \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6439.1

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

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

    if -8.4999999999999995e-307 < a < 2.9e-120

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

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

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

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

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

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6450.6

        \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Simplified50.6%

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

      \[\leadsto x \cdot \color{blue}{\frac{60}{z}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6441.4

        \[\leadsto x \cdot \color{blue}{\frac{60}{z}} \]
    8. Simplified41.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{-127}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-60}{t}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \frac{60}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.1 \cdot 10^{-45}:\\ \;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-17}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -5.1e-45)
   (fma 120.0 a (/ (* 60.0 x) z))
   (if (<= a 2.8e-17) (/ (* 60.0 (- x y)) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.1e-45) {
		tmp = fma(120.0, a, ((60.0 * x) / z));
	} else if (a <= 2.8e-17) {
		tmp = (60.0 * (x - y)) / (z - t);
	} else {
		tmp = a * 120.0;
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -5.1e-45)
		tmp = fma(120.0, a, Float64(Float64(60.0 * x) / z));
	elseif (a <= 2.8e-17)
		tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t));
	else
		tmp = Float64(a * 120.0);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.1e-45], N[(120.0 * a + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-17], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.0999999999999997e-45

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(120, a, x \cdot \color{blue}{\frac{60}{z - t}}\right) \]
      11. --lowering--.f6481.3

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(120, a, \frac{\color{blue}{x \cdot 60}}{z}\right) \]
      4. *-lowering-*.f6466.8

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

      \[\leadsto \mathsf{fma}\left(120, a, \color{blue}{\frac{x \cdot 60}{z}}\right) \]

    if -5.0999999999999997e-45 < a < 2.7999999999999999e-17

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot \left(x - y\right)}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{60 \cdot \left(x - y\right)}}{z - t} \]
      4. --lowering--.f64N/A

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

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

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

    if 2.7999999999999999e-17 < a

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6479.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.1 \cdot 10^{-45}:\\ \;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-17}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 2 \cdot 10^{+142}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6464.3

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

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

    if -1.45e155 < y < 2.0000000000000001e142

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6460.3

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified60.3%

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

    if 2.0000000000000001e142 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
      4. --lowering--.f6470.7

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

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

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

Alternative 10: 58.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+143}:\\
\;\;\;\;a \cdot 120\\

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6464.3

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

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

    if -4.59999999999999975e160 < y < 1.9e143

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6460.3

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified60.3%

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

    if 1.9e143 < y

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-60 \cdot y}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{-60 \cdot y}}{z - t} \]
      4. --lowering--.f6470.7

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -60}}{z - t} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{y \cdot \frac{-60}{z - t}} \]
      4. frac-2negN/A

        \[\leadsto y \cdot \color{blue}{\frac{\mathsf{neg}\left(-60\right)}{\mathsf{neg}\left(\left(z - t\right)\right)}} \]
      5. metadata-evalN/A

        \[\leadsto y \cdot \frac{\color{blue}{60}}{\mathsf{neg}\left(\left(z - t\right)\right)} \]
      6. /-lowering-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{60}{\mathsf{neg}\left(\left(z - t\right)\right)}} \]
      7. neg-sub0N/A

        \[\leadsto y \cdot \frac{60}{\color{blue}{0 - \left(z - t\right)}} \]
      8. sub-negN/A

        \[\leadsto y \cdot \frac{60}{0 - \color{blue}{\left(z + \left(\mathsf{neg}\left(t\right)\right)\right)}} \]
      9. +-commutativeN/A

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

        \[\leadsto y \cdot \frac{60}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(t\right)\right)\right) - z}} \]
      11. neg-sub0N/A

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

        \[\leadsto y \cdot \frac{60}{\color{blue}{t} - z} \]
      13. --lowering--.f6470.6

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

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

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

Alternative 11: 58.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.82 \cdot 10^{+142}:\\
\;\;\;\;a \cdot 120\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6999999999999999e157 or 1.8200000000000001e142 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto -60 \cdot \color{blue}{\frac{y}{z - t}} \]
      3. --lowering--.f6467.2

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

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

    if -1.6999999999999999e157 < y < 1.8200000000000001e142

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{120 \cdot a} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6460.3

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified60.3%

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

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

Alternative 12: 52.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;a \leq 3.2 \cdot 10^{-204}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.99999999999999956e-128 or 3.2e-204 < a

    1. Initial program 99.4%

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

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

        \[\leadsto \color{blue}{120 \cdot a} \]
    5. Simplified60.4%

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

    if -5.99999999999999956e-128 < a < 3.2e-204

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(60 \cdot \frac{1}{z - t}\right) \cdot x} \]
      4. *-commutativeN/A

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

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

        \[\leadsto x \cdot \color{blue}{\frac{60 \cdot 1}{z - t}} \]
      7. metadata-evalN/A

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

        \[\leadsto x \cdot \color{blue}{\frac{60}{z - t}} \]
      9. --lowering--.f6452.6

        \[\leadsto x \cdot \frac{60}{\color{blue}{z - t}} \]
    5. Simplified52.6%

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

      \[\leadsto x \cdot \color{blue}{\frac{-60}{t}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6435.6

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

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

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

Alternative 13: 51.7% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

    if 1.32000000000000005e215 < y

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-60 \cdot \frac{x - y}{t} + 120 \cdot a} \]
    4. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(-60, \frac{\color{blue}{x - y}}{t}, 120 \cdot a\right) \]
      4. *-lowering-*.f6436.7

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

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

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

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{60 \cdot y}{t}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot 60}}{t} \]
      4. *-lowering-*.f6437.6

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

      \[\leadsto \color{blue}{\frac{y \cdot 60}{t}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{60 \cdot y}}{t} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{60 \cdot \frac{y}{t}} \]
      4. /-lowering-/.f6437.4

        \[\leadsto 60 \cdot \color{blue}{\frac{y}{t}} \]
    10. Applied egg-rr37.4%

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

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

Alternative 14: 50.8% accurate, 5.2× speedup?

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

\\
a \cdot 120
\end{array}
Derivation
  1. Initial program 99.4%

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

    \[\leadsto \color{blue}{120 \cdot a} \]
  4. Step-by-step derivation
    1. *-lowering-*.f6449.9

      \[\leadsto \color{blue}{120 \cdot a} \]
  5. Simplified49.9%

    \[\leadsto \color{blue}{120 \cdot a} \]
  6. Final simplification49.9%

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

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

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

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

Reproduce

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

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

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