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

Percentage Accurate: 93.2% → 97.1%
Time: 12.0s
Alternatives: 12
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 12 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: 97.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto x - \color{blue}{\left(z - t\right) \cdot \frac{y}{a}} \]
  8. Step-by-step derivation
    1. clear-num96.6%

      \[\leadsto x - \left(z - t\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
    2. un-div-inv96.9%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
  9. Applied egg-rr96.9%

    \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
  10. Final simplification96.9%

    \[\leadsto x + \frac{t - z}{\frac{a}{y}} \]
  11. Add Preprocessing

Alternative 2: 49.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -1.45 \cdot 10^{-244}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

    if -6.79999999999999989e106 < t < -1.44999999999999998e-244 or 5.2e-253 < t < 4.2e-7

    1. Initial program 95.5%

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

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

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

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

    if -1.44999999999999998e-244 < t < 5.2e-253

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e-7 < t

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
      2. clear-num58.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{+106}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-244}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-253}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-7}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -3.5 \cdot 10^{-244}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-254}:\\
\;\;\;\;y \cdot \frac{-z}{a}\\

\mathbf{elif}\;t \leq 2.25 \cdot 10^{-7}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

    if -4.2000000000000001e106 < t < -3.49999999999999992e-244 or 4.80000000000000003e-254 < t < 2.2499999999999999e-7

    1. Initial program 95.5%

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

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

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

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

    if -3.49999999999999992e-244 < t < 4.80000000000000003e-254

    1. Initial program 92.8%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{-a}} \]
    7. Simplified70.5%

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

    if 2.2499999999999999e-7 < t

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
      2. clear-num58.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+106}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-244}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-254}:\\ \;\;\;\;y \cdot \frac{-z}{a}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-7}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 82.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-161} \lor \neg \left(t \leq 10^{-44}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25e-161 or 9.99999999999999953e-45 < t

    1. Initial program 94.6%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Step-by-step derivation
      1. associate-/l*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. Add Preprocessing
    5. Taylor expanded in y around 0 94.6%

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

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

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

      \[\leadsto x - \color{blue}{\left(z - t\right) \cdot \frac{y}{a}} \]
    8. Step-by-step derivation
      1. clear-num96.4%

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    9. Applied egg-rr96.4%

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

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

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

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

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

        \[\leadsto x + 1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      5. *-lft-identity81.8%

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

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

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

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

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

    if -1.25e-161 < t < 9.99999999999999953e-45

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    9. Applied egg-rr97.7%

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

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

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

Alternative 5: 81.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-161} \lor \neg \left(t \leq 1.7 \cdot 10^{-44}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25e-161 or 1.70000000000000008e-44 < t

    1. Initial program 94.6%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Step-by-step derivation
      1. associate-/l*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. Add Preprocessing
    5. Taylor expanded in y around 0 94.6%

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

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

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

      \[\leadsto x - \color{blue}{\left(z - t\right) \cdot \frac{y}{a}} \]
    8. Step-by-step derivation
      1. clear-num96.4%

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    9. Applied egg-rr96.4%

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

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

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

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

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

        \[\leadsto x + 1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      5. *-lft-identity81.8%

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

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

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

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

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

    if -1.25e-161 < t < 1.70000000000000008e-44

    1. Initial program 95.9%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.8%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    6. Applied egg-rr96.9%

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

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

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

Alternative 6: 80.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+142} \lor \neg \left(z \leq 9.2 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3000000000000002e142 or 9.19999999999999951e117 < z

    1. Initial program 89.2%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Step-by-step derivation
      1. associate-/l*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. Add Preprocessing
    5. Taylor expanded in x around 0 69.8%

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

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

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

        \[\leadsto \frac{-\color{blue}{\left(z - t\right) \cdot y}}{a} \]
      4. distribute-lft-neg-in69.8%

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

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

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

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

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

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

        \[\leadsto \frac{y}{a} \cdot \color{blue}{\left(\left(0 - \left(-t\right)\right) - z\right)} \]
      11. neg-sub075.4%

        \[\leadsto \frac{y}{a} \cdot \left(\color{blue}{\left(-\left(-t\right)\right)} - z\right) \]
      12. remove-double-neg75.4%

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

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

    if -3.3000000000000002e142 < z < 9.19999999999999951e117

    1. Initial program 97.0%

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(z - t\right) \cdot \frac{y}{a}} \]
    8. Step-by-step derivation
      1. clear-num97.0%

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    9. Applied egg-rr97.4%

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

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

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

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

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

        \[\leadsto x + 1 \cdot \color{blue}{\left(y \cdot \frac{t}{a}\right)} \]
      5. *-lft-identity79.7%

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

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

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

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

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

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

Alternative 7: 68.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+14} \lor \neg \left(y \leq 2.3 \cdot 10^{-93}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5e14 or 2.2999999999999998e-93 < y

    1. Initial program 92.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num97.9%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    6. Applied egg-rr98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e14 < y < 2.2999999999999998e-93

    1. Initial program 99.0%

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

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

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

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

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

Alternative 8: 68.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-151}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-93}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -3.5e-151)
   (* (/ y a) (- t z))
   (if (<= y 9.8e-93) x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.5e-151) {
		tmp = (y / a) * (t - z);
	} else if (y <= 9.8e-93) {
		tmp = x;
	} else {
		tmp = y * ((t - z) / a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (y <= (-3.5d-151)) then
        tmp = (y / a) * (t - z)
    else if (y <= 9.8d-93) then
        tmp = x
    else
        tmp = y * ((t - z) / a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.5e-151) {
		tmp = (y / a) * (t - z);
	} else if (y <= 9.8e-93) {
		tmp = x;
	} else {
		tmp = y * ((t - z) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -3.5e-151:
		tmp = (y / a) * (t - z)
	elif y <= 9.8e-93:
		tmp = x
	else:
		tmp = y * ((t - z) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -3.5e-151)
		tmp = Float64(Float64(y / a) * Float64(t - z));
	elseif (y <= 9.8e-93)
		tmp = x;
	else
		tmp = Float64(y * Float64(Float64(t - z) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -3.5e-151)
		tmp = (y / a) * (t - z);
	elseif (y <= 9.8e-93)
		tmp = x;
	else
		tmp = y * ((t - z) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.5e-151], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e-93], x, N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 9.8 \cdot 10^{-93}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.49999999999999995e-151

    1. Initial program 93.0%

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\left(z - t\right) \cdot y}}{a} \]
      4. distribute-lft-neg-in62.8%

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

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

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

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

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

        \[\leadsto \frac{y}{a} \cdot \left(0 - \color{blue}{\left(\left(-t\right) + z\right)}\right) \]
      10. associate--r+68.7%

        \[\leadsto \frac{y}{a} \cdot \color{blue}{\left(\left(0 - \left(-t\right)\right) - z\right)} \]
      11. neg-sub068.7%

        \[\leadsto \frac{y}{a} \cdot \left(\color{blue}{\left(-\left(-t\right)\right)} - z\right) \]
      12. remove-double-neg68.7%

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

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

    if -3.49999999999999995e-151 < y < 9.7999999999999993e-93

    1. Initial program 98.6%

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

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

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

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

    if 9.7999999999999993e-93 < y

    1. Initial program 94.2%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    6. Applied egg-rr99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{t + \color{blue}{\left(-z\right)}}{a} \]
      11. sub-neg73.7%

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

      \[\leadsto \color{blue}{y \cdot \frac{t - z}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 49.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+71} \lor \neg \left(y \leq 2.05 \cdot 10^{-92}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7999999999999997e71 or 2.0500000000000001e-92 < y

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    10. Simplified53.8%

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

    if -6.7999999999999997e71 < y < 2.0500000000000001e-92

    1. Initial program 99.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+71} \lor \neg \left(y \leq 2.05 \cdot 10^{-92}\right):\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 97.1% 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 95.1%

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

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

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

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

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

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

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

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

Alternative 11: 93.6% 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 95.1%

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

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

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

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

Alternative 12: 39.0% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 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 2024170 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t)))))))

  (- x (/ (* y (- z t)) a)))