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

Percentage Accurate: 93.1% → 98.7%
Time: 10.2s
Alternatives: 12
Speedup: 0.5×

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.1% 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: 98.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x - y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t\_1 \leq 10^{+253}:\\ \;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - z}{\frac{a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) a)))
   (if (<= t_1 (- INFINITY))
     (- x (* y (/ (- z t) a)))
     (if (<= t_1 1e+253) (+ x (/ (* y (- t z)) a)) (/ (- t z) (/ a y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / a;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x - (y * ((z - t) / a));
	} else if (t_1 <= 1e+253) {
		tmp = x + ((y * (t - z)) / a);
	} else {
		tmp = (t - z) / (a / y);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / a;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x - (y * ((z - t) / a));
	} else if (t_1 <= 1e+253) {
		tmp = x + ((y * (t - z)) / a);
	} else {
		tmp = (t - z) / (a / y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / a
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x - (y * ((z - t) / a))
	elif t_1 <= 1e+253:
		tmp = x + ((y * (t - z)) / a)
	else:
		tmp = (t - z) / (a / y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / a)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x - Float64(y * Float64(Float64(z - t) / a)));
	elseif (t_1 <= 1e+253)
		tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a));
	else
		tmp = Float64(Float64(t - z) / Float64(a / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / a;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x - (y * ((z - t) / a));
	elseif (t_1 <= 1e+253)
		tmp = x + ((y * (t - z)) / a);
	else
		tmp = (t - z) / (a / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+253], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0

    1. Initial program 75.6%

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < 9.9999999999999994e252

    1. Initial program 99.1%

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

    if 9.9999999999999994e252 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(t - z\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv100.0%

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

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

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

Alternative 2: 94.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-246} \lor \neg \left(a \leq 4.8 \cdot 10^{-195}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.89999999999999979e-246 or 4.8e-195 < a

    1. Initial program 91.7%

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

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

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

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

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

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

    if -3.89999999999999979e-246 < a < 4.8e-195

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 93.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-244} \lor \neg \left(a \leq 6.6 \cdot 10^{-195}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9e-244 or 6.6e-195 < a

    1. Initial program 91.7%

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

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

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

    if -1.9e-244 < a < 6.6e-195

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+32} \lor \neg \left(z \leq 3.3 \cdot 10^{+92}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.85e32 or 3.29999999999999974e92 < z

    1. Initial program 89.7%

      \[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. Step-by-step derivation
      1. clear-num93.9%

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

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

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

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

    if -2.85e32 < z < 3.29999999999999974e92

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

Alternative 5: 81.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+33} \lor \neg \left(z \leq 1.85 \cdot 10^{+92}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.7999999999999999e33 or 1.84999999999999999e92 < z

    1. Initial program 89.7%

      \[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 z around inf 80.6%

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    7. Simplified85.4%

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

    if -6.7999999999999999e33 < z < 1.84999999999999999e92

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

Alternative 6: 76.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.15 \cdot 10^{-46} \lor \neg \left(y \leq 5 \cdot 10^{-70}\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 -3.15e-46) (not (<= y 5e-70)))
   (* (/ y a) (- t z))
   (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -3.15e-46) || !(y <= 5e-70)) {
		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 <= (-3.15d-46)) .or. (.not. (y <= 5d-70))) 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 <= -3.15e-46) || !(y <= 5e-70)) {
		tmp = (y / a) * (t - z);
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -3.15e-46) or not (y <= 5e-70):
		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 <= -3.15e-46) || !(y <= 5e-70))
		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 <= -3.15e-46) || ~((y <= 5e-70)))
		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, -3.15e-46], N[Not[LessEqual[y, 5e-70]], $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 -3.15 \cdot 10^{-46} \lor \neg \left(y \leq 5 \cdot 10^{-70}\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 < -3.15e-46 or 4.9999999999999998e-70 < y

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.15e-46 < y < 4.9999999999999998e-70

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

Alternative 7: 69.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-187} \lor \neg \left(y \leq 6.6 \cdot 10^{-105}\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 < -5.50000000000000033e-187 or 6.5999999999999997e-105 < y

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000033e-187 < y < 6.5999999999999997e-105

    1. Initial program 98.1%

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

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

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

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

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

Alternative 8: 50.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+25} \lor \neg \left(z \leq 1.7 \cdot 10^{+26}\right):\\
\;\;\;\;z \cdot \frac{-y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6e25 or 1.7000000000000001e26 < z

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{a} \cdot \color{blue}{\left(-1 \cdot z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-159.6%

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

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

    if -1.6e25 < z < 1.7000000000000001e26

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 48.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+25} \lor \neg \left(z \leq 1.45 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{-z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.75000000000000009e25 or 1.4499999999999999e93 < z

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

    if -2.75000000000000009e25 < z < 1.4499999999999999e93

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 47.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-68} \lor \neg \left(t \leq 7.2 \cdot 10^{-26}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.1999999999999996e-68 or 7.2000000000000003e-26 < t

    1. Initial program 92.1%

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

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

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

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

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

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

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

    if -5.1999999999999996e-68 < t < 7.2000000000000003e-26

    1. Initial program 94.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{-68} \lor \neg \left(t \leq 7.2 \cdot 10^{-26}\right):\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 49.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-13}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9e-13 or 1.70000000000000013e61 < a

    1. Initial program 85.7%

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

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

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

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

    if -1.9e-13 < a < 1.70000000000000013e61

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+61}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 38.2% 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.2%

    \[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 x around inf 32.1%

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

Developer Target 1: 99.2% 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 2024146 
(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)))