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

Percentage Accurate: 93.2% → 96.8%
Time: 12.3s
Alternatives: 11
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 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 93.2% 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: 96.8% 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 93.4%

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

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

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

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

Alternative 2: 83.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{a} \cdot z\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+107}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;z \leq -3400000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-195}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* (/ y a) z))))
   (if (<= z -4.8e+107)
     t_1
     (if (<= z -2.5e+36)
       (* (/ y a) (- t z))
       (if (<= z -3400000.0)
         t_1
         (if (<= z -3.8e-195)
           (+ x (* y (/ t a)))
           (if (<= z 1.25e+64) (+ x (/ (* y t) a)) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((y / a) * z);
	double tmp;
	if (z <= -4.8e+107) {
		tmp = t_1;
	} else if (z <= -2.5e+36) {
		tmp = (y / a) * (t - z);
	} else if (z <= -3400000.0) {
		tmp = t_1;
	} else if (z <= -3.8e-195) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.25e+64) {
		tmp = x + ((y * t) / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - ((y / a) * z)
    if (z <= (-4.8d+107)) then
        tmp = t_1
    else if (z <= (-2.5d+36)) then
        tmp = (y / a) * (t - z)
    else if (z <= (-3400000.0d0)) then
        tmp = t_1
    else if (z <= (-3.8d-195)) then
        tmp = x + (y * (t / a))
    else if (z <= 1.25d+64) then
        tmp = x + ((y * t) / a)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((y / a) * z);
	double tmp;
	if (z <= -4.8e+107) {
		tmp = t_1;
	} else if (z <= -2.5e+36) {
		tmp = (y / a) * (t - z);
	} else if (z <= -3400000.0) {
		tmp = t_1;
	} else if (z <= -3.8e-195) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.25e+64) {
		tmp = x + ((y * t) / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((y / a) * z)
	tmp = 0
	if z <= -4.8e+107:
		tmp = t_1
	elif z <= -2.5e+36:
		tmp = (y / a) * (t - z)
	elif z <= -3400000.0:
		tmp = t_1
	elif z <= -3.8e-195:
		tmp = x + (y * (t / a))
	elif z <= 1.25e+64:
		tmp = x + ((y * t) / a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(y / a) * z))
	tmp = 0.0
	if (z <= -4.8e+107)
		tmp = t_1;
	elseif (z <= -2.5e+36)
		tmp = Float64(Float64(y / a) * Float64(t - z));
	elseif (z <= -3400000.0)
		tmp = t_1;
	elseif (z <= -3.8e-195)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 1.25e+64)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - ((y / a) * z);
	tmp = 0.0;
	if (z <= -4.8e+107)
		tmp = t_1;
	elseif (z <= -2.5e+36)
		tmp = (y / a) * (t - z);
	elseif (z <= -3400000.0)
		tmp = t_1;
	elseif (z <= -3.8e-195)
		tmp = x + (y * (t / a));
	elseif (z <= 1.25e+64)
		tmp = x + ((y * t) / a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+107], t$95$1, If[LessEqual[z, -2.5e+36], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3400000.0], t$95$1, If[LessEqual[z, -3.8e-195], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+64], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3400000:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.8000000000000001e107 or -2.49999999999999988e36 < z < -3.4e6 or 1.25e64 < z

    1. Initial program 92.3%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*92.3%

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

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

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

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

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

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

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

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

    if -4.8000000000000001e107 < z < -2.49999999999999988e36

    1. Initial program 95.6%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*95.6%

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{a} \cdot \left(z - t\right)\right)} \]
      2. sub-neg77.4%

        \[\leadsto -1 \cdot \left(\frac{y}{a} \cdot \color{blue}{\left(z + \left(-t\right)\right)}\right) \]
      3. distribute-lft-out63.1%

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\frac{y \cdot z}{a}} + \left(-t\right) \cdot \frac{y}{a}\right) \]
      6. distribute-lft-in58.8%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      11. mul-1-neg58.8%

        \[\leadsto t \cdot \frac{y}{a} + \color{blue}{\left(-\frac{y \cdot z}{a}\right)} \]
      12. sub-neg58.8%

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      14. *-commutative63.1%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      15. distribute-rgt-out--77.4%

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

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

    if -3.4e6 < z < -3.80000000000000013e-195

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000013e-195 < z < 1.25e64

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} + x \]
    9. Applied egg-rr92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+107}:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;z \leq -3400000:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-195}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+244}:\\
\;\;\;\;\frac{-y}{\frac{a}{z}}\\

\mathbf{elif}\;y \leq -8 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{elif}\;y \leq -7.4 \cdot 10^{-17}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -5.4 \cdot 10^{-98}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-59}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.70000000000000005e244

    1. Initial program 64.9%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified88.0%

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

    if -1.70000000000000005e244 < y < -7.9999999999999996e61

    1. Initial program 87.3%

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

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

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

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

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

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

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

    if -7.9999999999999996e61 < y < -7.3999999999999995e-17 or -5.3999999999999997e-98 < y < 3.40000000000000018e-59

    1. Initial program 98.6%

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

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

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

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

    if -7.3999999999999995e-17 < y < -5.3999999999999997e-98

    1. Initial program 99.9%

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

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

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

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

    if 3.40000000000000018e-59 < y

    1. Initial program 89.3%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*89.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    9. Simplified51.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+244}:\\ \;\;\;\;\frac{-y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq -8 \cdot 10^{+61}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq -7.4 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-98}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-59}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+172} \lor \neg \left(z \leq -8 \cdot 10^{+108} \lor \neg \left(z \leq -3.4 \cdot 10^{-25}\right) \land z \leq 5.2\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.50000000000000053e172 or -8.0000000000000003e108 < z < -3.40000000000000002e-25 or 5.20000000000000018 < z

    1. Initial program 92.7%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*92.7%

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{a} \cdot \left(z - t\right)\right)} \]
      2. sub-neg75.5%

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\frac{y \cdot z}{a}} + \left(-t\right) \cdot \frac{y}{a}\right) \]
      6. distribute-lft-in61.5%

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

        \[\leadsto -1 \cdot \frac{y \cdot z}{a} + \color{blue}{\left(-\left(-t\right) \cdot \frac{y}{a}\right)} \]
      8. sub-neg61.5%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      11. mul-1-neg61.5%

        \[\leadsto t \cdot \frac{y}{a} + \color{blue}{\left(-\frac{y \cdot z}{a}\right)} \]
      12. sub-neg61.5%

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      15. distribute-rgt-out--75.5%

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

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

    if -8.50000000000000053e172 < z < -8.0000000000000003e108 or -3.40000000000000002e-25 < z < 5.20000000000000018

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+172} \lor \neg \left(z \leq -8 \cdot 10^{+108} \lor \neg \left(z \leq -3.4 \cdot 10^{-25}\right) \land z \leq 5.2\right):\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+142} \lor \neg \left(y \leq -1.7 \cdot 10^{+16}\right) \land \left(y \leq -9 \cdot 10^{-74} \lor \neg \left(y \leq 5.6 \cdot 10^{-34}\right)\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.09999999999999982e142 or -1.7e16 < y < -8.9999999999999998e-74 or 5.59999999999999994e-34 < y

    1. Initial program 86.9%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*86.9%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{y}{a} \cdot \color{blue}{\left(z + \left(-t\right)\right)}\right) \]
      3. distribute-lft-out74.6%

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\frac{y \cdot z}{a}} + \left(-t\right) \cdot \frac{y}{a}\right) \]
      6. distribute-lft-in70.9%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a} - \left(-t\right) \cdot \frac{y}{a}} \]
      9. cancel-sign-sub70.9%

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      11. mul-1-neg70.9%

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

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      15. distribute-rgt-out--85.1%

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

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

    if -4.09999999999999982e142 < y < -1.7e16 or -8.9999999999999998e-74 < y < 5.59999999999999994e-34

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified72.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+142} \lor \neg \left(y \leq -1.7 \cdot 10^{+16}\right) \land \left(y \leq -9 \cdot 10^{-74} \lor \neg \left(y \leq 5.6 \cdot 10^{-34}\right)\right):\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+66} \lor \neg \left(y \leq -4.8 \cdot 10^{-15} \lor \neg \left(y \leq -1.9 \cdot 10^{-98}\right) \land y \leq 7 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.00000000000000005e66 or -4.7999999999999999e-15 < y < -1.9000000000000002e-98 or 6.99999999999999952e-60 < y

    1. Initial program 88.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(t \cdot \frac{1}{a}\right)} \cdot y \]
      3. associate-*l*53.0%

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

        \[\leadsto t \cdot \color{blue}{\frac{1 \cdot y}{a}} \]
      5. *-un-lft-identity53.0%

        \[\leadsto t \cdot \frac{\color{blue}{y}}{a} \]
    7. Applied egg-rr53.0%

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

    if -6.00000000000000005e66 < y < -4.7999999999999999e-15 or -1.9000000000000002e-98 < y < 6.99999999999999952e-60

    1. Initial program 98.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+66} \lor \neg \left(y \leq -4.8 \cdot 10^{-15} \lor \neg \left(y \leq -1.9 \cdot 10^{-98}\right) \land y \leq 7 \cdot 10^{-60}\right):\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-20} \lor \neg \left(y \leq -3.6 \cdot 10^{-97}\right) \land y \leq 3.2 \cdot 10^{-59}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8e62

    1. Initial program 83.2%

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

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

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

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

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

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

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

    if -1.8e62 < y < -1.8999999999999999e-20 or -3.59999999999999997e-97 < y < 3.1999999999999999e-59

    1. Initial program 98.6%

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

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

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

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

    if -1.8999999999999999e-20 < y < -3.59999999999999997e-97 or 3.1999999999999999e-59 < y

    1. Initial program 90.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(t \cdot \frac{1}{a}\right)} \cdot y \]
      3. associate-*l*52.8%

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

        \[\leadsto t \cdot \color{blue}{\frac{1 \cdot y}{a}} \]
      5. *-un-lft-identity52.9%

        \[\leadsto t \cdot \frac{\color{blue}{y}}{a} \]
    7. Applied egg-rr52.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-20} \lor \neg \left(y \leq -3.6 \cdot 10^{-97}\right) \land y \leq 3.2 \cdot 10^{-59}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 49.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-14}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{a} \cdot t\\

\mathbf{elif}\;y \leq 1.38 \cdot 10^{-58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.40000000000000028e62

    1. Initial program 83.2%

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

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

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

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

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

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

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

    if -7.40000000000000028e62 < y < -2.5000000000000001e-14 or -1.4000000000000001e-97 < y < 1.37999999999999996e-58

    1. Initial program 98.6%

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

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

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

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

    if -2.5000000000000001e-14 < y < -1.4000000000000001e-97

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(t \cdot \frac{1}{a}\right)} \cdot y \]
      3. associate-*l*61.7%

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

        \[\leadsto t \cdot \color{blue}{\frac{1 \cdot y}{a}} \]
      5. *-un-lft-identity61.8%

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

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

    if 1.37999999999999996e-58 < y

    1. Initial program 89.3%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*89.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    9. Simplified51.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-97}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 49.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-22}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.15e64

    1. Initial program 83.2%

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

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

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

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

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

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

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

    if -1.15e64 < y < -2.79999999999999995e-22 or -3.59999999999999997e-97 < y < 1.24999999999999994e-58

    1. Initial program 98.6%

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

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

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

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

    if -2.79999999999999995e-22 < y < -3.59999999999999997e-97

    1. Initial program 99.9%

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

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

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

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

    if 1.24999999999999994e-58 < y

    1. Initial program 89.3%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*89.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    9. Simplified51.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+64}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-22}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-97}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-107} \lor \neg \left(y \leq 4.5 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8000000000000002e-107 or 4.50000000000000004e-85 < y

    1. Initial program 89.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}{\frac{a}{z - t}}} \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*89.7%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{y}{a} \cdot \color{blue}{\left(z + \left(-t\right)\right)}\right) \]
      3. distribute-lft-out69.8%

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\frac{y \cdot z}{a}} + \left(-t\right) \cdot \frac{y}{a}\right) \]
      6. distribute-lft-in67.0%

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

        \[\leadsto -1 \cdot \frac{y \cdot z}{a} + \color{blue}{\left(-\left(-t\right) \cdot \frac{y}{a}\right)} \]
      8. sub-neg67.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      11. mul-1-neg67.0%

        \[\leadsto t \cdot \frac{y}{a} + \color{blue}{\left(-\frac{y \cdot z}{a}\right)} \]
      12. sub-neg67.0%

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      14. *-commutative69.8%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      15. distribute-rgt-out--78.8%

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

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

    if -3.8000000000000002e-107 < y < 4.50000000000000004e-85

    1. Initial program 98.3%

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

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

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

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

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

Alternative 11: 39.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification38.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.3% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024027 
(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)))