Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E

Percentage Accurate: 93.1% → 97.1%
Time: 15.4s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
x + \frac{y \cdot \left(z - t\right)}{a}
\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 13 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: 93.1% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} + x \]
    3. fma-define91.3%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
    2. associate-*r/96.2%

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

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

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

    \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{a} + x} \]
  7. Add Preprocessing

Alternative 2: 49.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{-a}\\ \mathbf{if}\;a \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{-88}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t (- a)))))
   (if (<= a -1.6e+44)
     x
     (if (<= a -5.5e-81)
       t_1
       (if (<= a 3.1e-88)
         (* z (/ y a))
         (if (<= a 9.5e-17) t_1 (if (<= a 5.2e+48) (* y (/ z a)) x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / -a);
	double tmp;
	if (a <= -1.6e+44) {
		tmp = x;
	} else if (a <= -5.5e-81) {
		tmp = t_1;
	} else if (a <= 3.1e-88) {
		tmp = z * (y / a);
	} else if (a <= 9.5e-17) {
		tmp = t_1;
	} else if (a <= 5.2e+48) {
		tmp = y * (z / a);
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = y * (t / -a)
    if (a <= (-1.6d+44)) then
        tmp = x
    else if (a <= (-5.5d-81)) then
        tmp = t_1
    else if (a <= 3.1d-88) then
        tmp = z * (y / a)
    else if (a <= 9.5d-17) then
        tmp = t_1
    else if (a <= 5.2d+48) then
        tmp = y * (z / a)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / -a);
	double tmp;
	if (a <= -1.6e+44) {
		tmp = x;
	} else if (a <= -5.5e-81) {
		tmp = t_1;
	} else if (a <= 3.1e-88) {
		tmp = z * (y / a);
	} else if (a <= 9.5e-17) {
		tmp = t_1;
	} else if (a <= 5.2e+48) {
		tmp = y * (z / a);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / -a)
	tmp = 0
	if a <= -1.6e+44:
		tmp = x
	elif a <= -5.5e-81:
		tmp = t_1
	elif a <= 3.1e-88:
		tmp = z * (y / a)
	elif a <= 9.5e-17:
		tmp = t_1
	elif a <= 5.2e+48:
		tmp = y * (z / a)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / Float64(-a)))
	tmp = 0.0
	if (a <= -1.6e+44)
		tmp = x;
	elseif (a <= -5.5e-81)
		tmp = t_1;
	elseif (a <= 3.1e-88)
		tmp = Float64(z * Float64(y / a));
	elseif (a <= 9.5e-17)
		tmp = t_1;
	elseif (a <= 5.2e+48)
		tmp = Float64(y * Float64(z / a));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / -a);
	tmp = 0.0;
	if (a <= -1.6e+44)
		tmp = x;
	elseif (a <= -5.5e-81)
		tmp = t_1;
	elseif (a <= 3.1e-88)
		tmp = z * (y / a);
	elseif (a <= 9.5e-17)
		tmp = t_1;
	elseif (a <= 5.2e+48)
		tmp = y * (z / a);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.6e+44], x, If[LessEqual[a, -5.5e-81], t$95$1, If[LessEqual[a, 3.1e-88], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-17], t$95$1, If[LessEqual[a, 5.2e+48], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{-a}\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+44}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -5.5 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.1 \cdot 10^{-88}:\\
\;\;\;\;z \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 5.2 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.60000000000000002e44 or 5.1999999999999999e48 < a

    1. Initial program 92.8%

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

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

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

      \[\leadsto \color{blue}{x} \]

    if -1.60000000000000002e44 < a < -5.50000000000000026e-81 or 3.0999999999999998e-88 < a < 9.50000000000000029e-17

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+88.1%

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

        \[\leadsto y \cdot \left(\frac{x}{y} + \color{blue}{\frac{z - t}{a}}\right) \]
    7. Simplified88.1%

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/57.4%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{a}} \]
      2. mul-1-neg57.4%

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{a} \]
    10. Simplified57.4%

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

    if -5.50000000000000026e-81 < a < 3.0999999999999998e-88

    1. Initial program 98.9%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+72.2%

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a} - \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. div-sub70.2%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified70.2%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    11. Taylor expanded in z around inf 59.6%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    13. Applied egg-rr63.8%

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

    if 9.50000000000000029e-17 < a < 5.1999999999999999e48

    1. Initial program 92.4%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+92.4%

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\frac{z}{a} - \frac{t}{a}\right)\right)} \]
      2. div-sub92.4%

        \[\leadsto y \cdot \left(\frac{x}{y} + \color{blue}{\frac{z - t}{a}}\right) \]
    7. Simplified92.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-81}:\\ \;\;\;\;y \cdot \frac{t}{-a}\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{-88}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-17}:\\ \;\;\;\;y \cdot \frac{t}{-a}\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 94.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+155} \lor \neg \left(z \leq 1.72 \cdot 10^{+162}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e155 or 1.72e162 < z

    1. Initial program 92.9%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} + x \]
      3. fma-define80.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified80.2%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/92.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} + x \]
    8. Step-by-step derivation
      1. associate-*l/97.0%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      2. *-commutative97.0%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    9. Simplified97.0%

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

    if -1.7e155 < z < 1.72e162

    1. Initial program 97.4%

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{z - t}}} \]
      2. un-div-inv95.5%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    6. Applied egg-rr95.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.9%

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

Alternative 4: 93.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-120} \lor \neg \left(y \leq 2.1 \cdot 10^{-230}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.20000000000000068e-120 or 2.0999999999999998e-230 < y

    1. Initial program 95.8%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified97.1%

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing

    if -8.20000000000000068e-120 < y < 2.0999999999999998e-230

    1. Initial program 98.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified68.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/98.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a}} + x \]
      3. *-commutative98.0%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} + x \]
    8. Step-by-step derivation
      1. associate-*l/90.5%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      2. *-commutative90.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    9. Simplified90.5%

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

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

Alternative 5: 96.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z - t\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t\_1}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (- z t) y)))
   (if (<= t_1 (- INFINITY)) (+ x (/ y (/ a (- z t)))) (+ x (/ t_1 a)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) * y;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + (y / (a / (z - t)));
	} else {
		tmp = x + (t_1 / a);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) * y;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + (y / (a / (z - t)));
	} else {
		tmp = x + (t_1 / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) * y
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + (y / (a / (z - t)))
	else:
		tmp = x + (t_1 / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) * y)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(y / Float64(a / Float64(z - t))));
	else
		tmp = Float64(x + Float64(t_1 / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z - t) * y;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + (y / (a / (z - t)));
	else
		tmp = x + (t_1 / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{t\_1}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (-.f64 z t)) < -inf.0

    1. Initial program 78.5%

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{z - t}}} \]
      2. un-div-inv100.0%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    6. Applied egg-rr100.0%

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

    if -inf.0 < (*.f64 y (-.f64 z t))

    1. Initial program 97.9%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z - t\right) \cdot y \leq -\infty:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+46} \lor \neg \left(t \leq 2.85 \cdot 10^{+51}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.80000000000000017e46 or 2.8500000000000001e51 < t

    1. Initial program 96.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified89.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/96.2%

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    8. Step-by-step derivation
      1. associate-*l/86.4%

        \[\leadsto x + -1 \cdot \color{blue}{\left(\frac{t}{a} \cdot y\right)} \]
      2. *-commutative86.4%

        \[\leadsto x + -1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      3. neg-mul-186.4%

        \[\leadsto x + \color{blue}{\left(-y \cdot \frac{t}{a}\right)} \]
      4. sub-neg86.4%

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. associate-*r/89.2%

        \[\leadsto x - \color{blue}{\frac{y \cdot t}{a}} \]
      6. associate-*l/92.8%

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      7. *-commutative92.8%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    9. Simplified92.8%

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

    if -4.80000000000000017e46 < t < 2.8500000000000001e51

    1. Initial program 96.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified93.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/96.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} + x \]
    8. Step-by-step derivation
      1. associate-*l/90.9%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    9. Simplified90.9%

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

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

Alternative 7: 77.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9000000000 \lor \neg \left(y \leq 1.7 \cdot 10^{+171}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e9 or 1.7000000000000001e171 < y

    1. Initial program 92.0%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+95.8%

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a} - \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. div-sub83.1%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified83.1%

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

    if -9e9 < y < 1.7000000000000001e171

    1. Initial program 98.7%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/98.7%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a}} + x \]
      3. *-commutative98.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      2. *-commutative81.3%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    9. Simplified81.3%

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

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

Alternative 8: 78.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -62000 \lor \neg \left(y \leq 4.8 \cdot 10^{+52}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -62000 or 4.8e52 < y

    1. Initial program 92.8%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+96.6%

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\frac{z}{a} - \frac{t}{a}\right)\right)} \]
      2. div-sub97.4%

        \[\leadsto y \cdot \left(\frac{x}{y} + \color{blue}{\frac{z - t}{a}}\right) \]
    7. Simplified97.4%

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

      \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a} - \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. div-sub81.5%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified81.5%

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

    if -62000 < y < 4.8e52

    1. Initial program 99.2%

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

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

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

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

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

Alternative 9: 69.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-119} \lor \neg \left(y \leq 6.2 \cdot 10^{-80}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.99999999999999993e-119 or 6.20000000000000032e-80 < y

    1. Initial program 94.9%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+95.3%

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a} - \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. div-sub74.7%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified74.7%

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

    if -4.99999999999999993e-119 < y < 6.20000000000000032e-80

    1. Initial program 98.8%

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.2%

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

Alternative 10: 85.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+41}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\

\mathbf{elif}\;t \leq 4.3 \cdot 10^{+48}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.2000000000000007e41

    1. Initial program 95.3%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} + x \]
      3. fma-define86.3%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/95.3%

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    8. Step-by-step derivation
      1. associate-*l/82.9%

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

        \[\leadsto x + -1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      3. neg-mul-182.9%

        \[\leadsto x + \color{blue}{\left(-y \cdot \frac{t}{a}\right)} \]
      4. sub-neg82.9%

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. associate-*r/86.0%

        \[\leadsto x - \color{blue}{\frac{y \cdot t}{a}} \]
      6. associate-*l/90.5%

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      7. *-commutative90.5%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    9. Simplified90.5%

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

    if -8.2000000000000007e41 < t < 4.29999999999999978e48

    1. Initial program 96.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified93.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/96.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} + x \]
    8. Step-by-step derivation
      1. associate-*l/90.9%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    9. Simplified90.9%

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

    if 4.29999999999999978e48 < t

    1. Initial program 97.6%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified93.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
      2. associate-*r/97.6%

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    8. Step-by-step derivation
      1. associate-*l/91.6%

        \[\leadsto x + -1 \cdot \color{blue}{\left(\frac{t}{a} \cdot y\right)} \]
      2. *-commutative91.6%

        \[\leadsto x + -1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      3. neg-mul-191.6%

        \[\leadsto x + \color{blue}{\left(-y \cdot \frac{t}{a}\right)} \]
      4. sub-neg91.6%

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. associate-*r/94.1%

        \[\leadsto x - \color{blue}{\frac{y \cdot t}{a}} \]
      6. associate-*l/96.3%

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      7. *-commutative96.3%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    9. Simplified96.3%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    10. Step-by-step derivation
      1. clear-num96.4%

        \[\leadsto x - t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. un-div-inv96.4%

        \[\leadsto x - \color{blue}{\frac{t}{\frac{a}{y}}} \]
    11. Applied egg-rr96.4%

      \[\leadsto x - \color{blue}{\frac{t}{\frac{a}{y}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{+41}:\\ \;\;\;\;x - t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{+48}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 49.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-97}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 7 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \frac{y}{a}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.10000000000000002e-97 or 6.9999999999999995e49 < a

    1. Initial program 94.5%

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

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

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

      \[\leadsto \color{blue}{x} \]

    if -3.10000000000000002e-97 < a < 6.9999999999999995e49

    1. Initial program 98.3%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+77.6%

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + \left(\frac{z}{a} - \frac{t}{a}\right)\right)} \]
      2. div-sub79.4%

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

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

      \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a} - \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. div-sub73.3%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified73.3%

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    11. Taylor expanded in z around inf 56.2%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    13. Applied egg-rr60.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.1 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+49}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 46.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 2.65 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.00000000000000022e-120 or 2.65e48 < a

    1. Initial program 94.6%

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

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

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

      \[\leadsto \color{blue}{x} \]

    if -6.00000000000000022e-120 < a < 2.65e48

    1. Initial program 98.3%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(\frac{x}{y} + \frac{z}{a}\right) - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. associate--l+78.7%

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

        \[\leadsto y \cdot \left(\frac{x}{y} + \color{blue}{\frac{z - t}{a}}\right) \]
    7. Simplified80.6%

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 39.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 96.2%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer target: 99.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024110 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

  :alt
  (if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))

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