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

Percentage Accurate: 93.5% → 96.9%
Time: 7.5s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 93.5% 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.9% accurate, 1.0× speedup?

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

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

    \[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-num96.5%

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

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

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

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

Alternative 2: 72.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{+108}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+242}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 84.9%

      \[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 z around 0 84.9%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.9%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg5.5%

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt20.3%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt20.2%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt94.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg66.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    12. Step-by-step derivation
      1. distribute-rgt-neg-out74.5%

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

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

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

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

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

    if -1.1999999999999999e133 < t < 4.20000000000000019e108 or 2.9499999999999999e209 < t < 6.2000000000000002e242

    1. Initial program 94.7%

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

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

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

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

    if 4.20000000000000019e108 < t < 2.9499999999999999e209

    1. Initial program 91.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt95.5%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg57.8%

        \[\leadsto x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      4. sqrt-unprod0.0%

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt31.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod58.1%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg58.1%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod95.7%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt95.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg62.0%

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

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

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

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

    if 6.2000000000000002e242 < t

    1. Initial program 93.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      2. distribute-lft-neg-out86.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+133}:\\ \;\;\;\;\frac{-y}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{+108}:\\ \;\;\;\;x + \frac{z \cdot y}{a}\\ \mathbf{elif}\;t \leq 2.95 \cdot 10^{+209}:\\ \;\;\;\;\frac{t}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+242}:\\ \;\;\;\;x + \frac{z \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\ \end{array} \]

Alternative 3: 74.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 4.5 \cdot 10^{+108}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 7.8 \cdot 10^{+242}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 84.9%

      \[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 z around 0 84.9%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.9%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg5.5%

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt20.3%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt20.2%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt94.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg66.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    12. Step-by-step derivation
      1. distribute-rgt-neg-out74.5%

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

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

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

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

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

    if -1.1999999999999999e133 < t < 4.5e108 or 4.1000000000000002e139 < t < 7.8000000000000003e242

    1. Initial program 95.0%

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. +-commutative77.1%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      3. *-commutative80.6%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    6. Simplified80.6%

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

    if 4.5e108 < t < 4.1000000000000002e139

    1. Initial program 82.7%

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.7%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt99.6%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg99.6%

        \[\leadsto x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      4. sqrt-unprod0.0%

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt18.5%

        \[\leadsto x - \color{blue}{\left(-t\right)} \cdot \frac{y}{a} \]
      6. div-inv18.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod99.9%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg99.9%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod99.7%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt99.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg65.0%

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

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

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

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

    if 7.8000000000000003e242 < t

    1. Initial program 93.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      2. distribute-lft-neg-out86.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+133}:\\ \;\;\;\;\frac{-y}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+108}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+139}:\\ \;\;\;\;\frac{t}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+242}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\ \end{array} \]

Alternative 4: 74.4% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.50000000000000003e133

    1. Initial program 84.9%

      \[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 z around 0 84.9%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.9%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg5.5%

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt20.3%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt20.2%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg5.8%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt94.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg66.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    12. Step-by-step derivation
      1. distribute-rgt-neg-out74.5%

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

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

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

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

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

    if -1.50000000000000003e133 < t < 4.5e108

    1. Initial program 95.1%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. +-commutative79.1%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      3. *-commutative82.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    6. Simplified82.4%

      \[\leadsto \color{blue}{z \cdot \frac{y}{a} + x} \]
    7. Step-by-step derivation
      1. clear-num82.4%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} + x \]
    8. Applied egg-rr82.9%

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

    if 4.5e108 < t < 2.79999999999999983e140

    1. Initial program 82.7%

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.7%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt99.6%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg99.6%

        \[\leadsto x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      4. sqrt-unprod0.0%

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt18.5%

        \[\leadsto x - \color{blue}{\left(-t\right)} \cdot \frac{y}{a} \]
      6. div-inv18.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod99.9%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg99.9%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod99.7%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt99.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg65.0%

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

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

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

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

    if 2.79999999999999983e140 < t < 4.09999999999999993e244

    1. Initial program 94.4%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. +-commutative57.7%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      3. *-commutative63.0%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    6. Simplified63.0%

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

    if 4.09999999999999993e244 < t

    1. Initial program 93.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      2. distribute-lft-neg-out86.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+133}:\\ \;\;\;\;\frac{-y}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+108}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+140}:\\ \;\;\;\;\frac{t}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+244}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\ \end{array} \]

Alternative 5: 49.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{\frac{a}{y}}\\ \mathbf{if}\;y \leq -1.22 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-60}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{a}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ z (/ a y))))
   (if (<= y -1.22e+51)
     t_1
     (if (<= y 7.2e-60) x (if (<= y 6.2e+85) t_1 (/ (- y) (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z / (a / y);
	double tmp;
	if (y <= -1.22e+51) {
		tmp = t_1;
	} else if (y <= 7.2e-60) {
		tmp = x;
	} else if (y <= 6.2e+85) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = z / (a / y)
    if (y <= (-1.22d+51)) then
        tmp = t_1
    else if (y <= 7.2d-60) then
        tmp = x
    else if (y <= 6.2d+85) then
        tmp = t_1
    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 t_1 = z / (a / y);
	double tmp;
	if (y <= -1.22e+51) {
		tmp = t_1;
	} else if (y <= 7.2e-60) {
		tmp = x;
	} else if (y <= 6.2e+85) {
		tmp = t_1;
	} else {
		tmp = -y / (a / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z / (a / y)
	tmp = 0
	if y <= -1.22e+51:
		tmp = t_1
	elif y <= 7.2e-60:
		tmp = x
	elif y <= 6.2e+85:
		tmp = t_1
	else:
		tmp = -y / (a / t)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z / Float64(a / y))
	tmp = 0.0
	if (y <= -1.22e+51)
		tmp = t_1;
	elseif (y <= 7.2e-60)
		tmp = x;
	elseif (y <= 6.2e+85)
		tmp = t_1;
	else
		tmp = Float64(Float64(-y) / Float64(a / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z / (a / y);
	tmp = 0.0;
	if (y <= -1.22e+51)
		tmp = t_1;
	elseif (y <= 7.2e-60)
		tmp = x;
	elseif (y <= 6.2e+85)
		tmp = t_1;
	else
		tmp = -y / (a / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.22e+51], t$95$1, If[LessEqual[y, 7.2e-60], x, If[LessEqual[y, 6.2e+85], t$95$1, N[((-y) / N[(a / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-60}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{+85}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.22000000000000005e51 or 7.2e-60 < y < 6.20000000000000023e85

    1. Initial program 93.1%

      \[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 y around inf 73.4%

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    6. Taylor expanded in y around 0 47.9%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    8. Simplified51.4%

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

    if -1.22000000000000005e51 < y < 7.2e-60

    1. Initial program 98.4%

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

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified95.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 6.20000000000000023e85 < y

    1. Initial program 79.7%

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg65.9%

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt31.3%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg35.7%

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt14.5%

        \[\leadsto x - \color{blue}{\left(-t\right)} \cdot \frac{y}{a} \]
      6. div-inv14.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt8.3%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod35.8%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg35.8%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod29.5%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt76.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    12. Step-by-step derivation
      1. distribute-rgt-neg-out65.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{+51}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-60}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+85}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{\frac{a}{t}}\\ \end{array} \]

Alternative 6: 49.8% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+57}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.15000000000000003e51 or 1.0999999999999999e-59 < y < 9.4999999999999997e57

    1. Initial program 93.7%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    6. Taylor expanded in y around 0 49.4%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    8. Simplified51.9%

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

    if -1.15000000000000003e51 < y < 1.0999999999999999e-59

    1. Initial program 98.4%

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

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified95.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.4999999999999997e57 < y

    1. Initial program 80.5%

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

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

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

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

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

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt30.9%

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

        \[\leadsto x - \color{blue}{\sqrt{t \cdot t}} \cdot \frac{y}{a} \]
      3. sqr-neg36.6%

        \[\leadsto x - \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      4. sqrt-unprod9.1%

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      5. add-sqr-sqrt14.6%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      11. add-sqr-sqrt9.1%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod35.1%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg35.1%

        \[\leadsto x - \frac{y}{\frac{a}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod27.8%

        \[\leadsto x - \frac{y}{\frac{a}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt74.6%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    10. Step-by-step derivation
      1. mul-1-neg55.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot t}}{a} \]
      4. distribute-rgt-neg-out55.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{-t}}} \]
      6. *-lft-identity61.7%

        \[\leadsto \frac{y}{\frac{\color{blue}{1 \cdot a}}{-t}} \]
      7. neg-mul-161.7%

        \[\leadsto \frac{y}{\frac{1 \cdot a}{\color{blue}{-1 \cdot t}}} \]
      8. times-frac61.7%

        \[\leadsto \frac{y}{\color{blue}{\frac{1}{-1} \cdot \frac{a}{t}}} \]
      9. metadata-eval61.7%

        \[\leadsto \frac{y}{\color{blue}{-1} \cdot \frac{a}{t}} \]
      10. neg-mul-161.7%

        \[\leadsto \frac{y}{\color{blue}{-\frac{a}{t}}} \]
      11. distribute-frac-neg61.7%

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

        \[\leadsto \color{blue}{\frac{y}{-a} \cdot t} \]
      13. *-commutative63.4%

        \[\leadsto \color{blue}{t \cdot \frac{y}{-a}} \]
    14. Simplified63.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+51}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-59}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+57}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \]

Alternative 7: 85.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -880000000000:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.8e11

    1. Initial program 94.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      3. *-commutative84.3%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    6. Simplified84.3%

      \[\leadsto \color{blue}{z \cdot \frac{y}{a} + x} \]
    7. Step-by-step derivation
      1. clear-num84.3%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} + x \]
    8. Applied egg-rr84.4%

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

    if -8.8e11 < z < 6.20000000000000052e-29

    1. Initial program 95.5%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg90.9%

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

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

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

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

    if 6.20000000000000052e-29 < z

    1. Initial program 88.7%

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. +-commutative77.6%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      3. *-commutative84.3%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    6. Simplified84.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -880000000000:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-29}:\\ \;\;\;\;x - t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \end{array} \]

Alternative 8: 47.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 2.1 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.40000000000000006e-73 or 2.1e82 < a

    1. Initial program 87.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 56.7%

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

    if -1.40000000000000006e-73 < a < 2.1e82

    1. Initial program 99.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{-73}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+82}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 47.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 7.8 \cdot 10^{+81}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.89999999999999981e-69 or 7.8000000000000002e81 < a

    1. Initial program 87.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 56.7%

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

    if -3.89999999999999981e-69 < a < 7.8000000000000002e81

    1. Initial program 99.2%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    6. Taylor expanded in y around 0 52.3%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    8. Simplified48.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.9 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{+81}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 49.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 8.6 \cdot 10^{+81}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.65e-69 or 8.6000000000000003e81 < a

    1. Initial program 87.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 56.7%

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

    if -1.65e-69 < a < 8.6000000000000003e81

    1. Initial program 99.2%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    6. Taylor expanded in y around 0 52.3%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    8. Simplified55.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 8.6 \cdot 10^{+81}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(z - t\right) \cdot \frac{y}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
	return x + ((z - t) * (y / 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 + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a):
	return x + ((z - t) * (y / a))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(z - t) * Float64(y / a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((z - t) * (y / a));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Derivation
  1. Initial program 92.9%

    \[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. Final simplification96.5%

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

Alternative 12: 39.8% 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.9%

    \[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. Taylor expanded in x around inf 36.4%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification36.4%

    \[\leadsto x \]

Developer target: 99.2% 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 2023297 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :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)))