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

Percentage Accurate: 92.9% → 96.0%
Time: 11.4s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 92.9% accurate, 1.0× speedup?

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

\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}

Alternative 1: 96.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-24}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.9999999999999998e-24

    1. Initial program 88.9%

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

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

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

    if -4.9999999999999998e-24 < y

    1. Initial program 96.7%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

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

Alternative 2: 49.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{-y}{a}\\ \mathbf{if}\;t \leq -2.7 \cdot 10^{-12}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-227}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{-257}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-135}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 40000000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (/ (- y) a))))
   (if (<= t -2.7e-12)
     (/ t (/ a y))
     (if (<= t -9.2e-227)
       x
       (if (<= t -6.5e-257)
         t_1
         (if (<= t 7e-135)
           x
           (if (<= t 9.5e-66)
             t_1
             (if (<= t 40000000000000.0) x (/ (* y t) a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (-y / a);
	double tmp;
	if (t <= -2.7e-12) {
		tmp = t / (a / y);
	} else if (t <= -9.2e-227) {
		tmp = x;
	} else if (t <= -6.5e-257) {
		tmp = t_1;
	} else if (t <= 7e-135) {
		tmp = x;
	} else if (t <= 9.5e-66) {
		tmp = t_1;
	} else if (t <= 40000000000000.0) {
		tmp = x;
	} else {
		tmp = (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) :: t_1
    real(8) :: tmp
    t_1 = z * (-y / a)
    if (t <= (-2.7d-12)) then
        tmp = t / (a / y)
    else if (t <= (-9.2d-227)) then
        tmp = x
    else if (t <= (-6.5d-257)) then
        tmp = t_1
    else if (t <= 7d-135) then
        tmp = x
    else if (t <= 9.5d-66) then
        tmp = t_1
    else if (t <= 40000000000000.0d0) then
        tmp = x
    else
        tmp = (y * t) / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (-y / a);
	double tmp;
	if (t <= -2.7e-12) {
		tmp = t / (a / y);
	} else if (t <= -9.2e-227) {
		tmp = x;
	} else if (t <= -6.5e-257) {
		tmp = t_1;
	} else if (t <= 7e-135) {
		tmp = x;
	} else if (t <= 9.5e-66) {
		tmp = t_1;
	} else if (t <= 40000000000000.0) {
		tmp = x;
	} else {
		tmp = (y * t) / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (-y / a)
	tmp = 0
	if t <= -2.7e-12:
		tmp = t / (a / y)
	elif t <= -9.2e-227:
		tmp = x
	elif t <= -6.5e-257:
		tmp = t_1
	elif t <= 7e-135:
		tmp = x
	elif t <= 9.5e-66:
		tmp = t_1
	elif t <= 40000000000000.0:
		tmp = x
	else:
		tmp = (y * t) / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(Float64(-y) / a))
	tmp = 0.0
	if (t <= -2.7e-12)
		tmp = Float64(t / Float64(a / y));
	elseif (t <= -9.2e-227)
		tmp = x;
	elseif (t <= -6.5e-257)
		tmp = t_1;
	elseif (t <= 7e-135)
		tmp = x;
	elseif (t <= 9.5e-66)
		tmp = t_1;
	elseif (t <= 40000000000000.0)
		tmp = x;
	else
		tmp = Float64(Float64(y * t) / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (-y / a);
	tmp = 0.0;
	if (t <= -2.7e-12)
		tmp = t / (a / y);
	elseif (t <= -9.2e-227)
		tmp = x;
	elseif (t <= -6.5e-257)
		tmp = t_1;
	elseif (t <= 7e-135)
		tmp = x;
	elseif (t <= 9.5e-66)
		tmp = t_1;
	elseif (t <= 40000000000000.0)
		tmp = x;
	else
		tmp = (y * t) / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e-12], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9.2e-227], x, If[LessEqual[t, -6.5e-257], t$95$1, If[LessEqual[t, 7e-135], x, If[LessEqual[t, 9.5e-66], t$95$1, If[LessEqual[t, 40000000000000.0], x, N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{a}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t \leq -9.2 \cdot 10^{-227}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -6.5 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 40000000000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.6999999999999998e-12

    1. Initial program 90.4%

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

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

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

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

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

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

    if -2.6999999999999998e-12 < t < -9.20000000000000048e-227 or -6.5000000000000002e-257 < t < 6.9999999999999997e-135 or 9.5000000000000004e-66 < t < 4e13

    1. Initial program 95.5%

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

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

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

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

    if -9.20000000000000048e-227 < t < -6.5000000000000002e-257 or 6.9999999999999997e-135 < t < 9.5000000000000004e-66

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

    if 4e13 < t

    1. Initial program 96.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{-12}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-227}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{-257}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-135}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-66}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 40000000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-39}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-275}:\\ \;\;\;\;\frac{-1}{a} \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{-135}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-67}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 6600000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -3.5e-39)
   (/ t (/ a y))
   (if (<= t -2.1e-275)
     (* (/ -1.0 a) (* y z))
     (if (<= t 5.4e-135)
       x
       (if (<= t 8.5e-67)
         (* z (/ (- y) a))
         (if (<= t 6600000000000.0) x (/ (* y t) a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -3.5e-39) {
		tmp = t / (a / y);
	} else if (t <= -2.1e-275) {
		tmp = (-1.0 / a) * (y * z);
	} else if (t <= 5.4e-135) {
		tmp = x;
	} else if (t <= 8.5e-67) {
		tmp = z * (-y / a);
	} else if (t <= 6600000000000.0) {
		tmp = x;
	} else {
		tmp = (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 (t <= (-3.5d-39)) then
        tmp = t / (a / y)
    else if (t <= (-2.1d-275)) then
        tmp = ((-1.0d0) / a) * (y * z)
    else if (t <= 5.4d-135) then
        tmp = x
    else if (t <= 8.5d-67) then
        tmp = z * (-y / a)
    else if (t <= 6600000000000.0d0) then
        tmp = x
    else
        tmp = (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 (t <= -3.5e-39) {
		tmp = t / (a / y);
	} else if (t <= -2.1e-275) {
		tmp = (-1.0 / a) * (y * z);
	} else if (t <= 5.4e-135) {
		tmp = x;
	} else if (t <= 8.5e-67) {
		tmp = z * (-y / a);
	} else if (t <= 6600000000000.0) {
		tmp = x;
	} else {
		tmp = (y * t) / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -3.5e-39:
		tmp = t / (a / y)
	elif t <= -2.1e-275:
		tmp = (-1.0 / a) * (y * z)
	elif t <= 5.4e-135:
		tmp = x
	elif t <= 8.5e-67:
		tmp = z * (-y / a)
	elif t <= 6600000000000.0:
		tmp = x
	else:
		tmp = (y * t) / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -3.5e-39)
		tmp = Float64(t / Float64(a / y));
	elseif (t <= -2.1e-275)
		tmp = Float64(Float64(-1.0 / a) * Float64(y * z));
	elseif (t <= 5.4e-135)
		tmp = x;
	elseif (t <= 8.5e-67)
		tmp = Float64(z * Float64(Float64(-y) / a));
	elseif (t <= 6600000000000.0)
		tmp = x;
	else
		tmp = Float64(Float64(y * t) / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -3.5e-39)
		tmp = t / (a / y);
	elseif (t <= -2.1e-275)
		tmp = (-1.0 / a) * (y * z);
	elseif (t <= 5.4e-135)
		tmp = x;
	elseif (t <= 8.5e-67)
		tmp = z * (-y / a);
	elseif (t <= 6600000000000.0)
		tmp = x;
	else
		tmp = (y * t) / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.5e-39], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.1e-275], N[(N[(-1.0 / a), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-135], x, If[LessEqual[t, 8.5e-67], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6600000000000.0], x, N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

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

\mathbf{elif}\;t \leq 5.4 \cdot 10^{-135}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 6600000000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.5e-39

    1. Initial program 90.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    7. Simplified59.1%

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

    if -3.5e-39 < t < -2.09999999999999988e-275

    1. Initial program 96.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot \left(-z\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out46.1%

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{a}{z}}} \]
      3. clear-num47.5%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{a}{z}}{y}}} \]
      4. distribute-neg-frac47.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{\frac{a}{z}}{y}}} \]
      5. metadata-eval47.5%

        \[\leadsto \frac{\color{blue}{-1}}{\frac{\frac{a}{z}}{y}} \]
      6. associate-/l/50.8%

        \[\leadsto \frac{-1}{\color{blue}{\frac{a}{y \cdot z}}} \]
      7. add-sqr-sqrt33.8%

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

        \[\leadsto \frac{-1}{\frac{a}{y \cdot \color{blue}{\sqrt{z \cdot z}}}} \]
      9. sqr-neg28.9%

        \[\leadsto \frac{-1}{\frac{a}{y \cdot \sqrt{\color{blue}{\left(-z\right) \cdot \left(-z\right)}}}} \]
      10. sqrt-unprod2.2%

        \[\leadsto \frac{-1}{\frac{a}{y \cdot \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)}}} \]
      11. add-sqr-sqrt3.5%

        \[\leadsto \frac{-1}{\frac{a}{y \cdot \color{blue}{\left(-z\right)}}} \]
      12. *-commutative3.5%

        \[\leadsto \frac{-1}{\frac{a}{\color{blue}{\left(-z\right) \cdot y}}} \]
      13. add-sqr-sqrt2.2%

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

        \[\leadsto \frac{-1}{\frac{a}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot y}} \]
      15. sqr-neg28.9%

        \[\leadsto \frac{-1}{\frac{a}{\sqrt{\color{blue}{z \cdot z}} \cdot y}} \]
      16. sqrt-unprod33.8%

        \[\leadsto \frac{-1}{\frac{a}{\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot y}} \]
      17. add-sqr-sqrt50.8%

        \[\leadsto \frac{-1}{\frac{a}{\color{blue}{z} \cdot y}} \]
    9. Applied egg-rr50.8%

      \[\leadsto \color{blue}{\frac{-1}{\frac{a}{z \cdot y}}} \]
    10. Step-by-step derivation
      1. associate-/r/50.8%

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

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

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

    if -2.09999999999999988e-275 < t < 5.39999999999999997e-135 or 8.49999999999999993e-67 < t < 6.6e12

    1. Initial program 94.9%

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

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

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

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

    if 5.39999999999999997e-135 < t < 8.49999999999999993e-67

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

    if 6.6e12 < t

    1. Initial program 96.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-39}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-275}:\\ \;\;\;\;\frac{-1}{a} \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{-135}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-67}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 6600000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.8% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1e15 or 4.30000000000000014e-10 < x

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

    if -4.1e15 < x < 4.30000000000000014e-10

    1. Initial program 94.6%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{a} \cdot \left(z - t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9.5 \lor \neg \left(t \leq 1050000000000\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 -9.5) (not (<= t 1050000000000.0)))
   (+ x (* t (/ y a)))
   (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -9.5) || !(t <= 1050000000000.0)) {
		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 <= (-9.5d0)) .or. (.not. (t <= 1050000000000.0d0))) 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 <= -9.5) || !(t <= 1050000000000.0)) {
		tmp = x + (t * (y / a));
	} else {
		tmp = x - (y / (a / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -9.5) or not (t <= 1050000000000.0):
		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 <= -9.5) || !(t <= 1050000000000.0))
		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 <= -9.5) || ~((t <= 1050000000000.0)))
		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, -9.5], N[Not[LessEqual[t, 1050000000000.0]], $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 -9.5 \lor \neg \left(t \leq 1050000000000\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 < -9.5 or 1.05e12 < t

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

    if -9.5 < t < 1.05e12

    1. Initial program 95.6%

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

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

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

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

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

Alternative 6: 68.3% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.69999999999999993e128 or 2.2999999999999998e35 < a

    1. Initial program 86.4%

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

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

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

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

    if -6.69999999999999993e128 < a < 2.2999999999999998e35

    1. Initial program 98.7%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{a} \cdot \left(z - t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 50.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.00000000000000026e-19 or 4.4e12 < t

    1. Initial program 93.6%

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

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

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

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

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

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

    if -9.00000000000000026e-19 < t < 4.4e12

    1. Initial program 95.6%

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

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

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

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

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

Alternative 8: 49.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\
\;\;\;\;x\\

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

    if -6.7999999999999996e-17 < t < 2.4e14

    1. Initial program 95.6%

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

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

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

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

    if 2.4e14 < t

    1. Initial program 96.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/59.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-17}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 49.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;x\\

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

    if -5.50000000000000001e-17 < t < 1.3e15

    1. Initial program 95.6%

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

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

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

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

    if 1.3e15 < t

    1. Initial program 96.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/59.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-17}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 50.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t \leq 112000000000:\\
\;\;\;\;x\\

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

    if -4.49999999999999981e-12 < t < 1.12e11

    1. Initial program 95.6%

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

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

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

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

    if 1.12e11 < t

    1. Initial program 96.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{y}} \cdot t} \]
      3. clear-num59.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 112000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 49.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+15}:\\
\;\;\;\;x\\

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

    if -1.5000000000000001e-12 < t < 1.35e15

    1. Initial program 95.6%

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

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

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

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

    if 1.35e15 < t

    1. Initial program 96.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 97.2% 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 94.6%

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

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

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

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

Alternative 13: 39.7% 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 94.6%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification35.5%

    \[\leadsto x \]
  7. Add Preprocessing

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

  :herbie-target
  (if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

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