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

Percentage Accurate: 92.9% → 97.0%
Time: 8.4s
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: 92.9% 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.0% 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 90.0%

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

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

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

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

Alternative 2: 50.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot \left(-z\right)\\ t_2 := \frac{t}{\frac{a}{y}}\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.95 \cdot 10^{-210}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-147}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y a) (- z))) (t_2 (/ t (/ a y))))
   (if (<= t -3.5e+40)
     t_2
     (if (<= t 1e-282)
       x
       (if (<= t 2.95e-210)
         t_1
         (if (<= t 4e-147)
           x
           (if (<= t 1.15e-119) t_1 (if (<= t 1.55e+20) x t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -z;
	double t_2 = t / (a / y);
	double tmp;
	if (t <= -3.5e+40) {
		tmp = t_2;
	} else if (t <= 1e-282) {
		tmp = x;
	} else if (t <= 2.95e-210) {
		tmp = t_1;
	} else if (t <= 4e-147) {
		tmp = x;
	} else if (t <= 1.15e-119) {
		tmp = t_1;
	} else if (t <= 1.55e+20) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (y / a) * -z
    t_2 = t / (a / y)
    if (t <= (-3.5d+40)) then
        tmp = t_2
    else if (t <= 1d-282) then
        tmp = x
    else if (t <= 2.95d-210) then
        tmp = t_1
    else if (t <= 4d-147) then
        tmp = x
    else if (t <= 1.15d-119) then
        tmp = t_1
    else if (t <= 1.55d+20) then
        tmp = x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -z;
	double t_2 = t / (a / y);
	double tmp;
	if (t <= -3.5e+40) {
		tmp = t_2;
	} else if (t <= 1e-282) {
		tmp = x;
	} else if (t <= 2.95e-210) {
		tmp = t_1;
	} else if (t <= 4e-147) {
		tmp = x;
	} else if (t <= 1.15e-119) {
		tmp = t_1;
	} else if (t <= 1.55e+20) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / a) * -z
	t_2 = t / (a / y)
	tmp = 0
	if t <= -3.5e+40:
		tmp = t_2
	elif t <= 1e-282:
		tmp = x
	elif t <= 2.95e-210:
		tmp = t_1
	elif t <= 4e-147:
		tmp = x
	elif t <= 1.15e-119:
		tmp = t_1
	elif t <= 1.55e+20:
		tmp = x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / a) * Float64(-z))
	t_2 = Float64(t / Float64(a / y))
	tmp = 0.0
	if (t <= -3.5e+40)
		tmp = t_2;
	elseif (t <= 1e-282)
		tmp = x;
	elseif (t <= 2.95e-210)
		tmp = t_1;
	elseif (t <= 4e-147)
		tmp = x;
	elseif (t <= 1.15e-119)
		tmp = t_1;
	elseif (t <= 1.55e+20)
		tmp = x;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / a) * -z;
	t_2 = t / (a / y);
	tmp = 0.0;
	if (t <= -3.5e+40)
		tmp = t_2;
	elseif (t <= 1e-282)
		tmp = x;
	elseif (t <= 2.95e-210)
		tmp = t_1;
	elseif (t <= 4e-147)
		tmp = x;
	elseif (t <= 1.15e-119)
		tmp = t_1;
	elseif (t <= 1.55e+20)
		tmp = x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e+40], t$95$2, If[LessEqual[t, 1e-282], x, If[LessEqual[t, 2.95e-210], t$95$1, If[LessEqual[t, 4e-147], x, If[LessEqual[t, 1.15e-119], t$95$1, If[LessEqual[t, 1.55e+20], x, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(-z\right)\\
t_2 := \frac{t}{\frac{a}{y}}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 10^{-282}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 2.95 \cdot 10^{-210}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-147}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{-119}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.55 \cdot 10^{+20}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.4999999999999999e40 or 1.55e20 < t

    1. Initial program 86.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified70.8%

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

    if -3.4999999999999999e40 < t < 1e-282 or 2.9499999999999999e-210 < t < 3.9999999999999999e-147 or 1.14999999999999997e-119 < t < 1.55e20

    1. Initial program 95.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. Taylor expanded in x around inf 56.3%

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

    if 1e-282 < t < 2.9499999999999999e-210 or 3.9999999999999999e-147 < t < 1.14999999999999997e-119

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{+40}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 10^{-282}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.95 \cdot 10^{-210}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-147}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-119}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 3: 81.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot \left(t - z\right)\\ t_2 := x - \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+181}:\\ \;\;\;\;x - \frac{y \cdot z}{a}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+90}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y a) (- t z))) (t_2 (- x (/ y (/ a z)))))
   (if (<= z -1.4e+181)
     (- x (/ (* y z) a))
     (if (<= z -2.6e+118)
       t_1
       (if (<= z -2.9e+90)
         t_2
         (if (<= z 3.7e-34)
           (+ x (* (/ y a) t))
           (if (<= z 1.2e+129) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * (t - z);
	double t_2 = x - (y / (a / z));
	double tmp;
	if (z <= -1.4e+181) {
		tmp = x - ((y * z) / a);
	} else if (z <= -2.6e+118) {
		tmp = t_1;
	} else if (z <= -2.9e+90) {
		tmp = t_2;
	} else if (z <= 3.7e-34) {
		tmp = x + ((y / a) * t);
	} else if (z <= 1.2e+129) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (y / a) * (t - z)
    t_2 = x - (y / (a / z))
    if (z <= (-1.4d+181)) then
        tmp = x - ((y * z) / a)
    else if (z <= (-2.6d+118)) then
        tmp = t_1
    else if (z <= (-2.9d+90)) then
        tmp = t_2
    else if (z <= 3.7d-34) then
        tmp = x + ((y / a) * t)
    else if (z <= 1.2d+129) then
        tmp = t_2
    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 = (y / a) * (t - z);
	double t_2 = x - (y / (a / z));
	double tmp;
	if (z <= -1.4e+181) {
		tmp = x - ((y * z) / a);
	} else if (z <= -2.6e+118) {
		tmp = t_1;
	} else if (z <= -2.9e+90) {
		tmp = t_2;
	} else if (z <= 3.7e-34) {
		tmp = x + ((y / a) * t);
	} else if (z <= 1.2e+129) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / a) * (t - z)
	t_2 = x - (y / (a / z))
	tmp = 0
	if z <= -1.4e+181:
		tmp = x - ((y * z) / a)
	elif z <= -2.6e+118:
		tmp = t_1
	elif z <= -2.9e+90:
		tmp = t_2
	elif z <= 3.7e-34:
		tmp = x + ((y / a) * t)
	elif z <= 1.2e+129:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / a) * Float64(t - z))
	t_2 = Float64(x - Float64(y / Float64(a / z)))
	tmp = 0.0
	if (z <= -1.4e+181)
		tmp = Float64(x - Float64(Float64(y * z) / a));
	elseif (z <= -2.6e+118)
		tmp = t_1;
	elseif (z <= -2.9e+90)
		tmp = t_2;
	elseif (z <= 3.7e-34)
		tmp = Float64(x + Float64(Float64(y / a) * t));
	elseif (z <= 1.2e+129)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / a) * (t - z);
	t_2 = x - (y / (a / z));
	tmp = 0.0;
	if (z <= -1.4e+181)
		tmp = x - ((y * z) / a);
	elseif (z <= -2.6e+118)
		tmp = t_1;
	elseif (z <= -2.9e+90)
		tmp = t_2;
	elseif (z <= 3.7e-34)
		tmp = x + ((y / a) * t);
	elseif (z <= 1.2e+129)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+181], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e+118], t$95$1, If[LessEqual[z, -2.9e+90], t$95$2, If[LessEqual[z, 3.7e-34], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+129], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
t_2 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+181}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{+90}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+129}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.39999999999999992e181

    1. Initial program 91.2%

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

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

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

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

    if -1.39999999999999992e181 < z < -2.60000000000000016e118 or 1.1999999999999999e129 < z

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t - z}}} \]
      2. associate-/r/89.8%

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

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

    if -2.60000000000000016e118 < z < -2.9000000000000001e90 or 3.69999999999999988e-34 < z < 1.1999999999999999e129

    1. Initial program 88.8%

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

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

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

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

    if -2.9000000000000001e90 < z < 3.69999999999999988e-34

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+181}:\\ \;\;\;\;x - \frac{y \cdot z}{a}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+118}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+90}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \end{array} \]

Alternative 4: 82.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+128}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ y (/ a z)))))
   (if (<= z -9.5e+87)
     t_1
     (if (<= z 1.2e-33)
       (+ x (* (/ y a) t))
       (if (<= z 9e+128) t_1 (* (/ y a) (- t z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y / (a / z));
	double tmp;
	if (z <= -9.5e+87) {
		tmp = t_1;
	} else if (z <= 1.2e-33) {
		tmp = x + ((y / a) * t);
	} else if (z <= 9e+128) {
		tmp = t_1;
	} else {
		tmp = (y / a) * (t - z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (y / (a / z))
    if (z <= (-9.5d+87)) then
        tmp = t_1
    else if (z <= 1.2d-33) then
        tmp = x + ((y / a) * t)
    else if (z <= 9d+128) then
        tmp = t_1
    else
        tmp = (y / a) * (t - z)
    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 / z));
	double tmp;
	if (z <= -9.5e+87) {
		tmp = t_1;
	} else if (z <= 1.2e-33) {
		tmp = x + ((y / a) * t);
	} else if (z <= 9e+128) {
		tmp = t_1;
	} else {
		tmp = (y / a) * (t - z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y / (a / z))
	tmp = 0
	if z <= -9.5e+87:
		tmp = t_1
	elif z <= 1.2e-33:
		tmp = x + ((y / a) * t)
	elif z <= 9e+128:
		tmp = t_1
	else:
		tmp = (y / a) * (t - z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y / Float64(a / z)))
	tmp = 0.0
	if (z <= -9.5e+87)
		tmp = t_1;
	elseif (z <= 1.2e-33)
		tmp = Float64(x + Float64(Float64(y / a) * t));
	elseif (z <= 9e+128)
		tmp = t_1;
	else
		tmp = Float64(Float64(y / a) * Float64(t - z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y / (a / z));
	tmp = 0.0;
	if (z <= -9.5e+87)
		tmp = t_1;
	elseif (z <= 1.2e-33)
		tmp = x + ((y / a) * t);
	elseif (z <= 9e+128)
		tmp = t_1;
	else
		tmp = (y / a) * (t - z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+87], t$95$1, If[LessEqual[z, 1.2e-33], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+128], t$95$1, N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+87}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 9 \cdot 10^{+128}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.4999999999999992e87 or 1.2e-33 < z < 9.0000000000000003e128

    1. Initial program 88.6%

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

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

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

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

    if -9.4999999999999992e87 < z < 1.2e-33

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000003e128 < z

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t - z}}} \]
      2. associate-/r/89.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+128}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \end{array} \]

Alternative 5: 69.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.0000000000000001e-100 or 1.70000000000000009e-59 < y

    1. Initial program 85.2%

      \[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. Taylor expanded in x around 0 67.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e-100 < y < 1.70000000000000009e-59

    1. Initial program 98.0%

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

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

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

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

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

Alternative 6: 80.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.2000000000000001e88 or 8.20000000000000023e128 < z

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t - z}}} \]
      2. associate-/r/81.0%

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

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

    if -5.2000000000000001e88 < z < 8.20000000000000023e128

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity82.8%

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

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

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

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

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

Alternative 7: 67.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.3 \cdot 10^{+137}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.30000000000000003e137 or 1.24999999999999995e87 < a

    1. Initial program 81.3%

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

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

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

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

    if -3.30000000000000003e137 < a < 1.24999999999999995e87

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t - z}}} \]
      2. associate-/r/75.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.3 \cdot 10^{+137}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+87}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 51.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+41} \lor \neg \left(t \leq 6.6 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000022e41 or 6.6e19 < t

    1. Initial program 86.2%

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

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

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

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

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

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

    if -5.00000000000000022e41 < t < 6.6e19

    1. Initial program 93.2%

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

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

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

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

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

Alternative 9: 51.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+41} \lor \neg \left(t \leq 5.8 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.0000000000000002e41 or 5.8e19 < t

    1. Initial program 86.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    6. Simplified70.8%

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

    if -9.0000000000000002e41 < t < 5.8e19

    1. Initial program 93.2%

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

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

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

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

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

Alternative 10: 38.8% 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 90.0%

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

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

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

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

    \[\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 2023290 
(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)))