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

Percentage Accurate: 93.1% → 97.2%
Time: 13.8s
Alternatives: 15
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 15 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: 97.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
  6. Final simplification97.5%

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

Alternative 2: 84.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-19}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2 \cdot 10^{-209}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\

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

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+155} \lor \neg \left(t \leq 2 \cdot 10^{+170}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.8e-19 or 6.09999999999999991e72 < t < 2.5e155 or 2.00000000000000007e170 < t

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

    if -5.8e-19 < t < 2.0000000000000001e-209

    1. Initial program 99.8%

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

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

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

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

    if 2.0000000000000001e-209 < t < 6.09999999999999991e72

    1. Initial program 91.0%

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

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

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

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

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

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

    if 2.5e155 < t < 2.00000000000000007e170

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-19}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-209}:\\ \;\;\;\;x - \frac{z \cdot y}{a}\\ \mathbf{elif}\;t \leq 6.1 \cdot 10^{+72}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+155} \lor \neg \left(t \leq 2 \cdot 10^{+170}\right):\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\ \end{array} \]

Alternative 3: 84.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;t \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-210}:\\ \;\;\;\;x - \frac{z \cdot y}{a}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+72}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+155}:\\ \;\;\;\;x - \frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{+174}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* t (/ y a)))))
   (if (<= t -6.6e-18)
     t_1
     (if (<= t 2.9e-210)
       (- x (/ (* z y) a))
       (if (<= t 6.2e+72)
         (- x (/ y (/ a z)))
         (if (<= t 4.1e+155)
           (- x (/ y (/ (- a) t)))
           (if (<= t 2.9e+174) (* (/ y a) (- t z)) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (t <= -6.6e-18) {
		tmp = t_1;
	} else if (t <= 2.9e-210) {
		tmp = x - ((z * y) / a);
	} else if (t <= 6.2e+72) {
		tmp = x - (y / (a / z));
	} else if (t <= 4.1e+155) {
		tmp = x - (y / (-a / t));
	} else if (t <= 2.9e+174) {
		tmp = (y / a) * (t - z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (t * (y / a))
    if (t <= (-6.6d-18)) then
        tmp = t_1
    else if (t <= 2.9d-210) then
        tmp = x - ((z * y) / a)
    else if (t <= 6.2d+72) then
        tmp = x - (y / (a / z))
    else if (t <= 4.1d+155) then
        tmp = x - (y / (-a / t))
    else if (t <= 2.9d+174) then
        tmp = (y / a) * (t - z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (t <= -6.6e-18) {
		tmp = t_1;
	} else if (t <= 2.9e-210) {
		tmp = x - ((z * y) / a);
	} else if (t <= 6.2e+72) {
		tmp = x - (y / (a / z));
	} else if (t <= 4.1e+155) {
		tmp = x - (y / (-a / t));
	} else if (t <= 2.9e+174) {
		tmp = (y / a) * (t - z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (t * (y / a))
	tmp = 0
	if t <= -6.6e-18:
		tmp = t_1
	elif t <= 2.9e-210:
		tmp = x - ((z * y) / a)
	elif t <= 6.2e+72:
		tmp = x - (y / (a / z))
	elif t <= 4.1e+155:
		tmp = x - (y / (-a / t))
	elif t <= 2.9e+174:
		tmp = (y / a) * (t - z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(t * Float64(y / a)))
	tmp = 0.0
	if (t <= -6.6e-18)
		tmp = t_1;
	elseif (t <= 2.9e-210)
		tmp = Float64(x - Float64(Float64(z * y) / a));
	elseif (t <= 6.2e+72)
		tmp = Float64(x - Float64(y / Float64(a / z)));
	elseif (t <= 4.1e+155)
		tmp = Float64(x - Float64(y / Float64(Float64(-a) / t)));
	elseif (t <= 2.9e+174)
		tmp = Float64(Float64(y / a) * Float64(t - z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (t * (y / a));
	tmp = 0.0;
	if (t <= -6.6e-18)
		tmp = t_1;
	elseif (t <= 2.9e-210)
		tmp = x - ((z * y) / a);
	elseif (t <= 6.2e+72)
		tmp = x - (y / (a / z));
	elseif (t <= 4.1e+155)
		tmp = x - (y / (-a / t));
	elseif (t <= 2.9e+174)
		tmp = (y / a) * (t - z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.6e-18], t$95$1, If[LessEqual[t, 2.9e-210], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+72], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+155], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+174], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.9 \cdot 10^{-210}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\

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

\mathbf{elif}\;t \leq 4.1 \cdot 10^{+155}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -6.6000000000000003e-18 or 2.9e174 < t

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

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

    if -6.6000000000000003e-18 < t < 2.90000000000000006e-210

    1. Initial program 99.8%

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

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

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

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

    if 2.90000000000000006e-210 < t < 6.19999999999999977e72

    1. Initial program 91.0%

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

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

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

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

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

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

    if 6.19999999999999977e72 < t < 4.0999999999999998e155

    1. Initial program 84.2%

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

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\frac{-1 \cdot a}{t}}} \]
      2. neg-mul-199.9%

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

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

    if 4.0999999999999998e155 < t < 2.9e174

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-210}:\\ \;\;\;\;x - \frac{z \cdot y}{a}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+72}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+155}:\\ \;\;\;\;x - \frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{+174}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 4: 49.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -7.6 \cdot 10^{+134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-196}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.82 \cdot 10^{-273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y) (/ a z))))
   (if (<= z -7.6e+134)
     t_1
     (if (<= z -3e-196)
       x
       (if (<= z 1.82e-273) (* y (/ t a)) (if (<= z 2.9e+67) x t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = -y / (a / z);
	double tmp;
	if (z <= -7.6e+134) {
		tmp = t_1;
	} else if (z <= -3e-196) {
		tmp = x;
	} else if (z <= 1.82e-273) {
		tmp = y * (t / a);
	} else if (z <= 2.9e+67) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -y / (a / z)
    if (z <= (-7.6d+134)) then
        tmp = t_1
    else if (z <= (-3d-196)) then
        tmp = x
    else if (z <= 1.82d-273) then
        tmp = y * (t / a)
    else if (z <= 2.9d+67) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = -y / (a / z);
	double tmp;
	if (z <= -7.6e+134) {
		tmp = t_1;
	} else if (z <= -3e-196) {
		tmp = x;
	} else if (z <= 1.82e-273) {
		tmp = y * (t / a);
	} else if (z <= 2.9e+67) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = -y / (a / z)
	tmp = 0
	if z <= -7.6e+134:
		tmp = t_1
	elif z <= -3e-196:
		tmp = x
	elif z <= 1.82e-273:
		tmp = y * (t / a)
	elif z <= 2.9e+67:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(-y) / Float64(a / z))
	tmp = 0.0
	if (z <= -7.6e+134)
		tmp = t_1;
	elseif (z <= -3e-196)
		tmp = x;
	elseif (z <= 1.82e-273)
		tmp = Float64(y * Float64(t / a));
	elseif (z <= 2.9e+67)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = -y / (a / z);
	tmp = 0.0;
	if (z <= -7.6e+134)
		tmp = t_1;
	elseif (z <= -3e-196)
		tmp = x;
	elseif (z <= 1.82e-273)
		tmp = y * (t / a);
	elseif (z <= 2.9e+67)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(a / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+134], t$95$1, If[LessEqual[z, -3e-196], x, If[LessEqual[z, 1.82e-273], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+67], x, t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+134}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3 \cdot 10^{-196}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+67}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.59999999999999997e134 or 2.90000000000000023e67 < z

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if -7.59999999999999997e134 < z < -3e-196 or 1.81999999999999997e-273 < z < 2.90000000000000023e67

    1. Initial program 92.5%

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

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

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

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

    if -3e-196 < z < 1.81999999999999997e-273

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.6 \cdot 10^{+134}:\\ \;\;\;\;\frac{-y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-196}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.82 \cdot 10^{-273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{a}{z}}\\ \end{array} \]

Alternative 5: 49.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-200}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 7.4 \cdot 10^{+68}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.34999999999999992e135

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999992e135 < z < -1.94999999999999999e-200 or 1.71999999999999996e-273 < z < 7.39999999999999996e68

    1. Initial program 92.5%

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

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

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

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

    if -1.94999999999999999e-200 < z < 1.71999999999999996e-273

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

    if 7.39999999999999996e68 < z

    1. Initial program 91.4%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{a}{z}}} \]
    6. Simplified58.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+135}:\\ \;\;\;\;y \cdot \frac{-z}{a}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.72 \cdot 10^{-273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{a}{z}}\\ \end{array} \]

Alternative 6: 50.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-201}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+71}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000002e133

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000002e133 < z < -9.99999999999999946e-202 or 1.57999999999999994e-273 < z < 1.9e71

    1. Initial program 92.5%

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

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

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

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

    if -9.99999999999999946e-202 < z < 1.57999999999999994e-273

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

    if 1.9e71 < z

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-y}{a}} \]
      6. *-lft-identity62.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+133}:\\ \;\;\;\;y \cdot \frac{-z}{a}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-201}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.58 \cdot 10^{-273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+71}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]

Alternative 7: 50.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -215:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{+141}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 2.95 \cdot 10^{+209}:\\
\;\;\;\;x\\

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -215 < t < 2.79999999999999991e141 or 7.00000000000000026e198 < t < 2.9499999999999999e209

    1. Initial program 95.3%

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

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

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

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

    if 2.79999999999999991e141 < t < 7.00000000000000026e198

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9499999999999999e209 < t

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Simplified76.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -215:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+141}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+198}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 2.95 \cdot 10^{+209}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 8: 84.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 87.7%

      \[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. Taylor expanded in z around 0 78.2%

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

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

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

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

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

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

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

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

    if -7.79999999999999979e-17 < t < 1e-209

    1. Initial program 99.8%

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

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

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

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

    if 1e-209 < t < 6.09999999999999991e72

    1. Initial program 91.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.8 \cdot 10^{-17}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 10^{-209}:\\ \;\;\;\;x - \frac{z \cdot y}{a}\\ \mathbf{elif}\;t \leq 6.1 \cdot 10^{+72}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 9: 68.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-30} \lor \neg \left(y \leq 2.2 \cdot 10^{-77}\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 < -4.99999999999999972e-30 or 2.20000000000000007e-77 < y

    1. Initial program 86.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999972e-30 < y < 2.20000000000000007e-77

    1. Initial program 98.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-30} \lor \neg \left(y \leq 2.2 \cdot 10^{-77}\right):\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 79.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+135} \lor \neg \left(z \leq 3.7 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000007e135 or 3.6999999999999997e67 < z

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000007e135 < z < 3.6999999999999997e67

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+135} \lor \neg \left(z \leq 3.7 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 11: 84.9% accurate, 0.8× speedup?

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

    1. Initial program 87.7%

      \[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. Taylor expanded in z around 0 78.2%

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

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

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

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

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

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

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

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

    if -6.50000000000000011e-16 < t < 6.09999999999999991e72

    1. Initial program 96.1%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z}}} \]
    6. Simplified84.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{-16} \lor \neg \left(t \leq 6.1 \cdot 10^{+72}\right):\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \end{array} \]

Alternative 12: 50.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0019 \lor \neg \left(t \leq 2.85 \cdot 10^{+141}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0019 or 2.84999999999999999e141 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

    if -0.0019 < t < 2.84999999999999999e141

    1. Initial program 95.8%

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

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

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

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

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

Alternative 13: 50.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1200:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -1200 < t < 1.89999999999999995e142

    1. Initial program 95.8%

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

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

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

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

    if 1.89999999999999995e142 < t

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 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 92.2%

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

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

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

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

Alternative 15: 39.6% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification44.1%

    \[\leadsto x \]

Developer target: 99.3% accurate, 0.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t_1}\\


\end{array}
\end{array}

Reproduce

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