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

Percentage Accurate: 93.6% → 97.5%
Time: 8.6s
Alternatives: 9
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 9 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.6% 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.5% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 77.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+194} \lor \neg \left(z \leq 2.2 \cdot 10^{+101} \lor \neg \left(z \leq 4.5 \cdot 10^{+138}\right) \land z \leq 1.6 \cdot 10^{+203}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.05e194 or 2.2000000000000001e101 < z < 4.49999999999999982e138 or 1.5999999999999998e203 < z

    1. Initial program 90.0%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in85.8%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. distribute-frac-neg85.8%

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

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

    if -2.05e194 < z < 2.2000000000000001e101 or 4.49999999999999982e138 < z < 1.5999999999999998e203

    1. Initial program 93.5%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y \cdot t}{a}} \]
      4. +-commutative80.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    6. Simplified83.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+194} \lor \neg \left(z \leq 2.2 \cdot 10^{+101} \lor \neg \left(z \leq 4.5 \cdot 10^{+138}\right) \land z \leq 1.6 \cdot 10^{+203}\right):\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \end{array} \]

Alternative 3: 84.6% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;t \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-18}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.50000000000000036e77 or 3.6000000000000001e-18 < t

    1. Initial program 90.5%

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. sub-neg80.3%

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

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{y \cdot t}{a}\right)}\right) \]
      3. remove-double-neg80.3%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
      6. *-commutative88.6%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    6. Simplified88.6%

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

    if -5.50000000000000036e77 < t < -2.2e17

    1. Initial program 91.8%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{a} \cdot \left(z - t\right)\right)} \]
      2. associate-*r*99.9%

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

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

        \[\leadsto \color{blue}{\frac{-y}{a}} \cdot \left(z - t\right) \]
      5. *-commutative99.9%

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

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

    if -2.2e17 < t < -7.2000000000000002e-19

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{y \cdot t}{a}\right)}\right) \]
      3. remove-double-neg95.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    8. Applied egg-rr96.1%

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

    if -7.2000000000000002e-19 < t < 3.6000000000000001e-18

    1. Initial program 95.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{+77}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-19}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-18}:\\ \;\;\;\;x - y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \end{array} \]

Alternative 4: 51.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq -3.3 \cdot 10^{-235}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -2.6 \cdot 10^{-299}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+118}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.1e18

    1. Initial program 89.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
      2. *-commutative65.0%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified65.0%

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

    if -2.1e18 < t < -3.30000000000000028e-235 or -2.5999999999999999e-299 < t < 1.5e118

    1. Initial program 96.4%

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

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

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

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

    if -3.30000000000000028e-235 < t < -2.5999999999999999e-299

    1. Initial program 86.1%

      \[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 inf 68.7%

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in82.4%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. distribute-frac-neg82.4%

        \[\leadsto z \cdot \color{blue}{\frac{-y}{a}} \]
    6. Simplified82.4%

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

    if 1.5e118 < t

    1. Initial program 87.8%

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified68.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Applied egg-rr68.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{+18}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-235}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-299}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 5: 84.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-22} \lor \neg \left(t \leq 2.2 \cdot 10^{-20}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.5000000000000001e-22 or 2.19999999999999991e-20 < t

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
      6. *-commutative86.5%

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

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

    if -5.5000000000000001e-22 < t < 2.19999999999999991e-20

    1. Initial program 95.0%

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

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

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

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

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

Alternative 6: 51.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+18} \lor \neg \left(t \leq 3 \cdot 10^{+119}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.4e18 or 3.00000000000000001e119 < t

    1. Initial program 88.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
      2. *-commutative66.2%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified66.2%

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

    if -1.4e18 < t < 3.00000000000000001e119

    1. Initial program 95.9%

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

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

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

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

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

Alternative 7: 51.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+118}:\\
\;\;\;\;x\\

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


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

    1. Initial program 89.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
      2. *-commutative65.0%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified65.0%

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

    if -2.5e18 < t < 1.39999999999999993e118

    1. Initial program 95.9%

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

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

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

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

    if 1.39999999999999993e118 < t

    1. Initial program 87.8%

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified68.4%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Applied egg-rr68.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{+18}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 8: 93.0% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{t - z}{a}
\end{array}
Derivation
  1. Initial program 92.9%

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Final simplification95.0%

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

Alternative 9: 39.0% 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 92.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification36.9%

    \[\leadsto x \]

Developer target: 99.3% 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 2023192 
(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)))