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

Percentage Accurate: 93.3% → 97.6%
Time: 8.3s
Alternatives: 10
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 10 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.3% 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.6% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 93.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{-260} \lor \neg \left(y \leq 6 \cdot 10^{-177}\right):\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.28000000000000002e-260 or 6.00000000000000015e-177 < y

    1. Initial program 87.0%

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

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

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

    if -1.28000000000000002e-260 < y < 6.00000000000000015e-177

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.28 \cdot 10^{-260} \lor \neg \left(y \leq 6 \cdot 10^{-177}\right):\\ \;\;\;\;x - y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot z}{a}\\ \end{array} \]

Alternative 3: 84.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+48} \lor \neg \left(t \leq 4.2 \cdot 10^{+94}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.40000000000000006e48 or 4.19999999999999979e94 < t

    1. Initial program 83.1%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 74.8%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.8%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out86.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
      2. +-commutative78.0%

        \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t}}} \]
      3. associate-/l*74.8%

        \[\leadsto x + \color{blue}{\frac{y \cdot t}{a}} \]
      4. *-commutative74.8%

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified86.9%

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

    if -1.40000000000000006e48 < t < 4.19999999999999979e94

    1. Initial program 92.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{+48} \lor \neg \left(t \leq 4.2 \cdot 10^{+94}\right):\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 4: 86.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+49} \lor \neg \left(t \leq 7.4 \cdot 10^{+92}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.4000000000000001e49 or 7.39999999999999997e92 < t

    1. Initial program 83.1%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 74.8%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.8%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out86.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
      2. +-commutative78.0%

        \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t}}} \]
      3. associate-/l*74.8%

        \[\leadsto x + \color{blue}{\frac{y \cdot t}{a}} \]
      4. *-commutative74.8%

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified86.9%

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

    if -3.4000000000000001e49 < t < 7.39999999999999997e92

    1. Initial program 92.6%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative91.8%

        \[\leadsto x - \color{blue}{z \cdot \frac{y}{a}} \]
    6. Simplified91.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+49} \lor \neg \left(t \leq 7.4 \cdot 10^{+92}\right):\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \end{array} \]

Alternative 5: 86.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 1.8 \cdot 10^{+92}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\

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


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

    1. Initial program 86.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 76.9%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.9%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out86.7%

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

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

    if -7.5000000000000003e46 < t < 1.8e92

    1. Initial program 92.6%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative91.8%

        \[\leadsto x - \color{blue}{z \cdot \frac{y}{a}} \]
    6. Simplified91.8%

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

    if 1.8e92 < t

    1. Initial program 80.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 72.8%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg72.8%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out87.2%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
      2. +-commutative77.8%

        \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t}}} \]
      3. associate-/l*72.8%

        \[\leadsto x + \color{blue}{\frac{y \cdot t}{a}} \]
      4. *-commutative72.8%

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified87.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+46}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+92}:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 6: 50.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 7.8 \cdot 10^{+72}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.7999999999999999e27 or 7.79999999999999984e72 < t

    1. Initial program 83.5%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 73.9%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.9%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out85.2%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    8. Step-by-step derivation
      1. *-commutative55.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified61.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    10. Step-by-step derivation
      1. associate-/r/54.2%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
    11. Applied egg-rr54.2%

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

    if -2.7999999999999999e27 < t < 7.79999999999999984e72

    1. Initial program 92.8%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 51.7%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg51.7%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out53.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 7.8 \cdot 10^{+72}\right):\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 52.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 1.42 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.7999999999999999e27 or 1.41999999999999997e72 < t

    1. Initial program 83.5%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 73.9%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.9%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out85.2%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    8. Step-by-step derivation
      1. *-commutative55.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified61.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    10. Step-by-step derivation
      1. div-inv61.8%

        \[\leadsto \color{blue}{t \cdot \frac{1}{\frac{a}{y}}} \]
      2. clear-num61.8%

        \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
      3. *-commutative61.8%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
    11. Applied egg-rr61.8%

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

    if -2.7999999999999999e27 < t < 1.41999999999999997e72

    1. Initial program 92.8%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 51.7%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg51.7%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out53.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 1.42 \cdot 10^{+72}\right):\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 52.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+71}:\\
\;\;\;\;x\\

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


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

    1. Initial program 85.5%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 75.0%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg75.0%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out84.0%

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    6. Simplified84.0%

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    8. Step-by-step derivation
      1. *-commutative56.6%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified60.3%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    10. Step-by-step derivation
      1. div-inv60.3%

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

        \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
      3. *-commutative60.4%

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

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

    if -7.3999999999999996e22 < t < 5.80000000000000014e71

    1. Initial program 92.8%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 51.7%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg51.7%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out53.6%

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

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

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

    if 5.80000000000000014e71 < t

    1. Initial program 81.6%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Taylor expanded in z around 0 73.0%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.0%

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

        \[\leadsto x - \left(-\color{blue}{\frac{y}{a} \cdot t}\right) \]
      3. distribute-rgt-neg-out86.3%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    8. Step-by-step derivation
      1. *-commutative55.1%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Simplified63.2%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification52.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.4 \cdot 10^{+22}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+71}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 9: 71.4% accurate, 1.3× speedup?

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

\\
x + \frac{t}{\frac{a}{y}}
\end{array}
Derivation
  1. Initial program 88.8%

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Taylor expanded in z around 0 61.2%

    \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
  5. Step-by-step derivation
    1. mul-1-neg61.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    2. +-commutative62.5%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t}}} \]
    3. associate-/l*61.2%

      \[\leadsto x + \color{blue}{\frac{y \cdot t}{a}} \]
    4. *-commutative61.2%

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

      \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
  9. Simplified67.1%

    \[\leadsto \color{blue}{x + \frac{t}{\frac{a}{y}}} \]
  10. Final simplification67.1%

    \[\leadsto x + \frac{t}{\frac{a}{y}} \]

Alternative 10: 40.5% 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 88.8%

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Taylor expanded in z around 0 61.2%

    \[\leadsto x - \color{blue}{-1 \cdot \frac{y \cdot t}{a}} \]
  5. Step-by-step derivation
    1. mul-1-neg61.2%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  8. Final simplification36.0%

    \[\leadsto x \]

Developer target: 99.2% accurate, 0.7× 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 2023229 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :precision binary64

  :herbie-target
  (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)))