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

Percentage Accurate: 93.1% → 97.0%
Time: 9.7s
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.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.0% 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 93.3%

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

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

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

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

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

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

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

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

Alternative 2: 47.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{-a}\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{+162}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{+65} \lor \neg \left(y \leq 1.55 \cdot 10^{+130}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t (- a)))))
   (if (<= y -4.5e+162)
     (/ (* z y) a)
     (if (<= y -2.1e+53)
       t_1
       (if (<= y -2.6e-36)
         (* y (/ z a))
         (if (<= y 2.7e-45)
           x
           (if (or (<= y 7.1e+65) (not (<= y 1.55e+130)))
             t_1
             (/ y (/ a z)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / -a);
	double tmp;
	if (y <= -4.5e+162) {
		tmp = (z * y) / a;
	} else if (y <= -2.1e+53) {
		tmp = t_1;
	} else if (y <= -2.6e-36) {
		tmp = y * (z / a);
	} else if (y <= 2.7e-45) {
		tmp = x;
	} else if ((y <= 7.1e+65) || !(y <= 1.55e+130)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * (t / -a)
    if (y <= (-4.5d+162)) then
        tmp = (z * y) / a
    else if (y <= (-2.1d+53)) then
        tmp = t_1
    else if (y <= (-2.6d-36)) then
        tmp = y * (z / a)
    else if (y <= 2.7d-45) then
        tmp = x
    else if ((y <= 7.1d+65) .or. (.not. (y <= 1.55d+130))) then
        tmp = t_1
    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 t_1 = y * (t / -a);
	double tmp;
	if (y <= -4.5e+162) {
		tmp = (z * y) / a;
	} else if (y <= -2.1e+53) {
		tmp = t_1;
	} else if (y <= -2.6e-36) {
		tmp = y * (z / a);
	} else if (y <= 2.7e-45) {
		tmp = x;
	} else if ((y <= 7.1e+65) || !(y <= 1.55e+130)) {
		tmp = t_1;
	} else {
		tmp = y / (a / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / -a)
	tmp = 0
	if y <= -4.5e+162:
		tmp = (z * y) / a
	elif y <= -2.1e+53:
		tmp = t_1
	elif y <= -2.6e-36:
		tmp = y * (z / a)
	elif y <= 2.7e-45:
		tmp = x
	elif (y <= 7.1e+65) or not (y <= 1.55e+130):
		tmp = t_1
	else:
		tmp = y / (a / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / Float64(-a)))
	tmp = 0.0
	if (y <= -4.5e+162)
		tmp = Float64(Float64(z * y) / a);
	elseif (y <= -2.1e+53)
		tmp = t_1;
	elseif (y <= -2.6e-36)
		tmp = Float64(y * Float64(z / a));
	elseif (y <= 2.7e-45)
		tmp = x;
	elseif ((y <= 7.1e+65) || !(y <= 1.55e+130))
		tmp = t_1;
	else
		tmp = Float64(y / Float64(a / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / -a);
	tmp = 0.0;
	if (y <= -4.5e+162)
		tmp = (z * y) / a;
	elseif (y <= -2.1e+53)
		tmp = t_1;
	elseif (y <= -2.6e-36)
		tmp = y * (z / a);
	elseif (y <= 2.7e-45)
		tmp = x;
	elseif ((y <= 7.1e+65) || ~((y <= 1.55e+130)))
		tmp = t_1;
	else
		tmp = y / (a / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+162], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, -2.1e+53], t$95$1, If[LessEqual[y, -2.6e-36], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-45], x, If[Or[LessEqual[y, 7.1e+65], N[Not[LessEqual[y, 1.55e+130]], $MachinePrecision]], t$95$1, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.1 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.6 \cdot 10^{-36}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-45}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 7.1 \cdot 10^{+65} \lor \neg \left(y \leq 1.55 \cdot 10^{+130}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -4.49999999999999972e162

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    10. Step-by-step derivation
      1. *-commutative64.2%

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{a}} \]
    11. Applied egg-rr72.6%

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

    if -4.49999999999999972e162 < y < -2.1000000000000002e53 or 2.69999999999999985e-45 < y < 7.1000000000000003e65 or 1.55e130 < y

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-t}{a}} \]
    13. Simplified57.5%

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

    if -2.1000000000000002e53 < y < -2.6e-36

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

    if -2.6e-36 < y < 2.69999999999999985e-45

    1. Initial program 99.9%

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

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

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

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

    if 7.1000000000000003e65 < y < 1.55e130

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    10. Step-by-step derivation
      1. clear-num65.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+162}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{+53}:\\ \;\;\;\;y \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{+65} \lor \neg \left(y \leq 1.55 \cdot 10^{+130}\right):\\ \;\;\;\;y \cdot \frac{t}{-a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.8% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;y \leq -9.2 \cdot 10^{+51}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\

\mathbf{elif}\;y \leq -2.3 \cdot 10^{-36}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{-44}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 10^{+66} \lor \neg \left(y \leq 1.85 \cdot 10^{+130}\right):\\
\;\;\;\;y \cdot \frac{t}{-a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -5.4000000000000001e157

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    10. Step-by-step derivation
      1. *-commutative64.2%

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{a}} \]
    11. Applied egg-rr72.6%

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

    if -5.4000000000000001e157 < y < -9.2000000000000002e51

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000002e51 < y < -2.29999999999999996e-36

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

    if -2.29999999999999996e-36 < y < 2.40000000000000009e-44

    1. Initial program 99.9%

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

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

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

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

    if 2.40000000000000009e-44 < y < 9.99999999999999945e65 or 1.8500000000000001e130 < y

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999945e65 < y < 1.8500000000000001e130

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    10. Step-by-step derivation
      1. clear-num65.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+157}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+51}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 10^{+66} \lor \neg \left(y \leq 1.85 \cdot 10^{+130}\right):\\ \;\;\;\;y \cdot \frac{t}{-a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq 2.75 \cdot 10^{-170}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.09999999999999992e-44 or 2.75000000000000009e-170 < y < 6.60000000000000009e-53

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + -1 \cdot \frac{t \cdot y}{a} \]
      3. mul-1-neg66.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative77.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified77.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    12. Taylor expanded in y around 0 77.5%

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

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

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

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

    if -4.09999999999999992e-44 < y < 2.75000000000000009e-170 or 6.60000000000000009e-53 < y < 2.49999999999999996e-46

    1. Initial program 99.9%

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

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

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

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

    if 2.49999999999999996e-46 < y

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative82.1%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified82.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{-44}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-53}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-46}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-44} \lor \neg \left(y \leq 3.6 \cdot 10^{-141}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.0000000000000005e-44 or 3.60000000000000015e-141 < y

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative81.1%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified81.1%

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

    if -6.0000000000000005e-44 < y < 3.60000000000000015e-141

    1. Initial program 99.9%

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

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

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

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

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

Alternative 6: 76.5% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a} + \frac{y \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutative57.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative86.1%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified86.1%

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

    if -2.6500000000000001e183 < t < 3.2e115

    1. Initial program 95.3%

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

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

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

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

    if 3.2e115 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a} + \frac{y \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutative60.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative84.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified84.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    12. Taylor expanded in y around 0 76.5%

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

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

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

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

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

Alternative 7: 79.0% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative83.9%

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

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

    if -6.19999999999999976e172 < t < 5.5000000000000001e114

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Applied egg-rr88.2%

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

    if 5.5000000000000001e114 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a} + \frac{y \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutative60.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative84.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified84.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    12. Taylor expanded in y around 0 76.5%

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

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

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

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

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

Alternative 8: 82.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.29999999999999965e137 < t < 2.05e114

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Applied egg-rr88.0%

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

    if 2.05e114 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a} + \frac{y \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutative60.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
      12. *-commutative84.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Simplified84.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    12. Taylor expanded in y around 0 76.5%

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

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

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

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

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

Alternative 9: 49.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-36} \lor \neg \left(y \leq 1.75 \cdot 10^{+34}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.50000000000000002e-36 or 1.74999999999999999e34 < y

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

    if -2.50000000000000002e-36 < y < 1.74999999999999999e34

    1. Initial program 99.9%

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

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

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

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

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

Alternative 10: 48.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-36}:\\
\;\;\;\;\frac{z \cdot y}{a}\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+34}:\\
\;\;\;\;x\\

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


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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{a}} \]
    11. Applied egg-rr61.4%

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

    if -2.50000000000000002e-36 < y < 1.54999999999999989e34

    1. Initial program 99.9%

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

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

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

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

    if 1.54999999999999989e34 < y

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-36}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+34}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 12: 38.5% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification36.8%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.9% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024096 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

  :alt
  (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)))