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

Percentage Accurate: 92.9% → 97.3%
Time: 9.8s
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.3% 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.1%

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

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

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

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

Alternative 2: 49.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{a} \cdot \left(-y\right)\\ t_2 := \frac{y \cdot t}{a}\\ \mathbf{if}\;a \leq -3.7 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.46 \cdot 10^{-265}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-287}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-217}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{-64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ z a) (- y))) (t_2 (/ (* y t) a)))
   (if (<= a -3.7e-75)
     x
     (if (<= a -1.46e-265)
       t_2
       (if (<= a 6.4e-287)
         t_1
         (if (<= a 5.4e-217) t_2 (if (<= a 5.6e-64) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z / a) * -y;
	double t_2 = (y * t) / a;
	double tmp;
	if (a <= -3.7e-75) {
		tmp = x;
	} else if (a <= -1.46e-265) {
		tmp = t_2;
	} else if (a <= 6.4e-287) {
		tmp = t_1;
	} else if (a <= 5.4e-217) {
		tmp = t_2;
	} else if (a <= 5.6e-64) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z / a) * -y
    t_2 = (y * t) / a
    if (a <= (-3.7d-75)) then
        tmp = x
    else if (a <= (-1.46d-265)) then
        tmp = t_2
    else if (a <= 6.4d-287) then
        tmp = t_1
    else if (a <= 5.4d-217) then
        tmp = t_2
    else if (a <= 5.6d-64) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z / a) * -y;
	double t_2 = (y * t) / a;
	double tmp;
	if (a <= -3.7e-75) {
		tmp = x;
	} else if (a <= -1.46e-265) {
		tmp = t_2;
	} else if (a <= 6.4e-287) {
		tmp = t_1;
	} else if (a <= 5.4e-217) {
		tmp = t_2;
	} else if (a <= 5.6e-64) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z / a) * -y
	t_2 = (y * t) / a
	tmp = 0
	if a <= -3.7e-75:
		tmp = x
	elif a <= -1.46e-265:
		tmp = t_2
	elif a <= 6.4e-287:
		tmp = t_1
	elif a <= 5.4e-217:
		tmp = t_2
	elif a <= 5.6e-64:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z / a) * Float64(-y))
	t_2 = Float64(Float64(y * t) / a)
	tmp = 0.0
	if (a <= -3.7e-75)
		tmp = x;
	elseif (a <= -1.46e-265)
		tmp = t_2;
	elseif (a <= 6.4e-287)
		tmp = t_1;
	elseif (a <= 5.4e-217)
		tmp = t_2;
	elseif (a <= 5.6e-64)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z / a) * -y;
	t_2 = (y * t) / a;
	tmp = 0.0;
	if (a <= -3.7e-75)
		tmp = x;
	elseif (a <= -1.46e-265)
		tmp = t_2;
	elseif (a <= 6.4e-287)
		tmp = t_1;
	elseif (a <= 5.4e-217)
		tmp = t_2;
	elseif (a <= 5.6e-64)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -3.7e-75], x, If[LessEqual[a, -1.46e-265], t$95$2, If[LessEqual[a, 6.4e-287], t$95$1, If[LessEqual[a, 5.4e-217], t$95$2, If[LessEqual[a, 5.6e-64], t$95$1, x]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.46 \cdot 10^{-265}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 6.4 \cdot 10^{-287}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 5.4 \cdot 10^{-217}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 5.6 \cdot 10^{-64}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.70000000000000024e-75 or 5.60000000000000008e-64 < a

    1. Initial program 88.1%

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

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

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

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

    if -3.70000000000000024e-75 < a < -1.46000000000000005e-265 or 6.40000000000000037e-287 < a < 5.40000000000000032e-217

    1. Initial program 99.9%

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

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

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

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

    if -1.46000000000000005e-265 < a < 6.40000000000000037e-287 or 5.40000000000000032e-217 < a < 5.60000000000000008e-64

    1. Initial program 97.7%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} \]
    5. Applied egg-rr91.3%

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in63.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.7 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.46 \cdot 10^{-265}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{-287}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-217}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{-64}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 50.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot \left(-z\right)\\ t_2 := \frac{y \cdot t}{a}\\ \mathbf{if}\;a \leq -8.2 \cdot 10^{-77}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{-276}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-283}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-217}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{-64}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y a) (- z))) (t_2 (/ (* y t) a)))
   (if (<= a -8.2e-77)
     x
     (if (<= a -2.8e-276)
       t_2
       (if (<= a 3.3e-283)
         t_1
         (if (<= a 4.8e-217) t_2 (if (<= a 3.1e-64) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -z;
	double t_2 = (y * t) / a;
	double tmp;
	if (a <= -8.2e-77) {
		tmp = x;
	} else if (a <= -2.8e-276) {
		tmp = t_2;
	} else if (a <= 3.3e-283) {
		tmp = t_1;
	} else if (a <= 4.8e-217) {
		tmp = t_2;
	} else if (a <= 3.1e-64) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y / a) * -z
    t_2 = (y * t) / a
    if (a <= (-8.2d-77)) then
        tmp = x
    else if (a <= (-2.8d-276)) then
        tmp = t_2
    else if (a <= 3.3d-283) then
        tmp = t_1
    else if (a <= 4.8d-217) then
        tmp = t_2
    else if (a <= 3.1d-64) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -z;
	double t_2 = (y * t) / a;
	double tmp;
	if (a <= -8.2e-77) {
		tmp = x;
	} else if (a <= -2.8e-276) {
		tmp = t_2;
	} else if (a <= 3.3e-283) {
		tmp = t_1;
	} else if (a <= 4.8e-217) {
		tmp = t_2;
	} else if (a <= 3.1e-64) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / a) * -z
	t_2 = (y * t) / a
	tmp = 0
	if a <= -8.2e-77:
		tmp = x
	elif a <= -2.8e-276:
		tmp = t_2
	elif a <= 3.3e-283:
		tmp = t_1
	elif a <= 4.8e-217:
		tmp = t_2
	elif a <= 3.1e-64:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / a) * Float64(-z))
	t_2 = Float64(Float64(y * t) / a)
	tmp = 0.0
	if (a <= -8.2e-77)
		tmp = x;
	elseif (a <= -2.8e-276)
		tmp = t_2;
	elseif (a <= 3.3e-283)
		tmp = t_1;
	elseif (a <= 4.8e-217)
		tmp = t_2;
	elseif (a <= 3.1e-64)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / a) * -z;
	t_2 = (y * t) / a;
	tmp = 0.0;
	if (a <= -8.2e-77)
		tmp = x;
	elseif (a <= -2.8e-276)
		tmp = t_2;
	elseif (a <= 3.3e-283)
		tmp = t_1;
	elseif (a <= 4.8e-217)
		tmp = t_2;
	elseif (a <= 3.1e-64)
		tmp = t_1;
	else
		tmp = x;
	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[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -8.2e-77], x, If[LessEqual[a, -2.8e-276], t$95$2, If[LessEqual[a, 3.3e-283], t$95$1, If[LessEqual[a, 4.8e-217], t$95$2, If[LessEqual[a, 3.1e-64], t$95$1, x]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.8 \cdot 10^{-276}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 3.3 \cdot 10^{-283}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.8 \cdot 10^{-217}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 3.1 \cdot 10^{-64}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.19999999999999925e-77 or 3.10000000000000025e-64 < a

    1. Initial program 88.1%

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

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

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

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

    if -8.19999999999999925e-77 < a < -2.79999999999999986e-276 or 3.30000000000000019e-283 < a < 4.7999999999999997e-217

    1. Initial program 99.9%

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

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

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

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

    if -2.79999999999999986e-276 < a < 3.30000000000000019e-283 or 4.7999999999999997e-217 < a < 3.10000000000000025e-64

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{-77}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{-276}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-283}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-217}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 3.1 \cdot 10^{-64}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 75.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+204}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+57}\right) \land z \leq 2.2 \cdot 10^{+224}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.10000000000000006e204

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000006e204 < z < 2.7e29 or 1.60000000000000015e57 < z < 2.2e224

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2.7e29 < z < 1.60000000000000015e57 or 2.2e224 < z

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+204}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+29} \lor \neg \left(z \leq 1.6 \cdot 10^{+57}\right) \land z \leq 2.2 \cdot 10^{+224}:\\ \;\;\;\;x + \frac{y}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \end{array} \]

Alternative 5: 84.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 48:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.69999999999999994e-73

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.69999999999999994e-73 < t < 48

    1. Initial program 92.7%

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

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

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

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

    if 48 < t

    1. Initial program 90.3%

      \[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 81.9%

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

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

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

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

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

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

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

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

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

Alternative 6: 84.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 51:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.1999999999999998e-76

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999998e-76 < t < 51

    1. Initial program 92.7%

      \[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}{\frac{a}{z - t}}} \]
    3. Simplified96.6%

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

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

    if 51 < t

    1. Initial program 90.3%

      \[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 81.9%

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

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

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

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

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

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

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

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

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

Alternative 7: 50.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+36} \lor \neg \left(t \leq 1.55 \cdot 10^{+134}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.39999999999999992e36 or 1.54999999999999991e134 < t

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if -2.39999999999999992e36 < t < 1.54999999999999991e134

    1. Initial program 92.3%

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

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

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

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

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

Alternative 8: 51.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+132}:\\
\;\;\;\;x\\

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


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

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999992e31 < t < 1.90000000000000003e132

    1. Initial program 92.3%

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

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

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

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

    if 1.90000000000000003e132 < t

    1. Initial program 91.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{+31}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+132}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \end{array} \]

Alternative 9: 93.2% 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.1%

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

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

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

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

Alternative 10: 39.1% 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.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification43.0%

    \[\leadsto x \]

Developer target: 99.0% 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 2023196 
(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)))