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

Percentage Accurate: 93.3% → 99.2%
Time: 11.8s
Alternatives: 15
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 93.3% 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: 99.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+167} \lor \neg \left(t\_1 \leq 10^{+156}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (-.f64 z t)) < -2.0000000000000001e167 or 9.9999999999999998e155 < (*.f64 y (-.f64 z t))

    1. Initial program 85.8%

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

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

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

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

    if -2.0000000000000001e167 < (*.f64 y (-.f64 z t)) < 9.9999999999999998e155

    1. Initial program 99.4%

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

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

Alternative 2: 50.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{-a}\\ t_2 := t \cdot \frac{y}{a}\\ \mathbf{if}\;y \leq -1700:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-52}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-117}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.9 \cdot 10^{+198}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ z (- a)))) (t_2 (* t (/ y a))))
   (if (<= y -1700.0)
     t_2
     (if (<= y -1e-24)
       t_1
       (if (<= y -6.2e-52)
         t_2
         (if (<= y -5.2e-87)
           x
           (if (<= y -2.85e-117)
             (/ (* y t) a)
             (if (<= y 2.75e-14)
               x
               (if (<= y 6.9e+198) (* y (/ t a)) t_1)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (y <= -1700.0) {
		tmp = t_2;
	} else if (y <= -1e-24) {
		tmp = t_1;
	} else if (y <= -6.2e-52) {
		tmp = t_2;
	} else if (y <= -5.2e-87) {
		tmp = x;
	} else if (y <= -2.85e-117) {
		tmp = (y * t) / a;
	} else if (y <= 2.75e-14) {
		tmp = x;
	} else if (y <= 6.9e+198) {
		tmp = y * (t / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (z / -a)
    t_2 = t * (y / a)
    if (y <= (-1700.0d0)) then
        tmp = t_2
    else if (y <= (-1d-24)) then
        tmp = t_1
    else if (y <= (-6.2d-52)) then
        tmp = t_2
    else if (y <= (-5.2d-87)) then
        tmp = x
    else if (y <= (-2.85d-117)) then
        tmp = (y * t) / a
    else if (y <= 2.75d-14) then
        tmp = x
    else if (y <= 6.9d+198) then
        tmp = y * (t / a)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (y <= -1700.0) {
		tmp = t_2;
	} else if (y <= -1e-24) {
		tmp = t_1;
	} else if (y <= -6.2e-52) {
		tmp = t_2;
	} else if (y <= -5.2e-87) {
		tmp = x;
	} else if (y <= -2.85e-117) {
		tmp = (y * t) / a;
	} else if (y <= 2.75e-14) {
		tmp = x;
	} else if (y <= 6.9e+198) {
		tmp = y * (t / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / -a)
	t_2 = t * (y / a)
	tmp = 0
	if y <= -1700.0:
		tmp = t_2
	elif y <= -1e-24:
		tmp = t_1
	elif y <= -6.2e-52:
		tmp = t_2
	elif y <= -5.2e-87:
		tmp = x
	elif y <= -2.85e-117:
		tmp = (y * t) / a
	elif y <= 2.75e-14:
		tmp = x
	elif y <= 6.9e+198:
		tmp = y * (t / a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / Float64(-a)))
	t_2 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (y <= -1700.0)
		tmp = t_2;
	elseif (y <= -1e-24)
		tmp = t_1;
	elseif (y <= -6.2e-52)
		tmp = t_2;
	elseif (y <= -5.2e-87)
		tmp = x;
	elseif (y <= -2.85e-117)
		tmp = Float64(Float64(y * t) / a);
	elseif (y <= 2.75e-14)
		tmp = x;
	elseif (y <= 6.9e+198)
		tmp = Float64(y * Float64(t / a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (z / -a);
	t_2 = t * (y / a);
	tmp = 0.0;
	if (y <= -1700.0)
		tmp = t_2;
	elseif (y <= -1e-24)
		tmp = t_1;
	elseif (y <= -6.2e-52)
		tmp = t_2;
	elseif (y <= -5.2e-87)
		tmp = x;
	elseif (y <= -2.85e-117)
		tmp = (y * t) / a;
	elseif (y <= 2.75e-14)
		tmp = x;
	elseif (y <= 6.9e+198)
		tmp = y * (t / a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1700.0], t$95$2, If[LessEqual[y, -1e-24], t$95$1, If[LessEqual[y, -6.2e-52], t$95$2, If[LessEqual[y, -5.2e-87], x, If[LessEqual[y, -2.85e-117], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 2.75e-14], x, If[LessEqual[y, 6.9e+198], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{-a}\\
t_2 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1700:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-52}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -5.2 \cdot 10^{-87}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -2.85 \cdot 10^{-117}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1700 or -9.99999999999999924e-25 < y < -6.1999999999999998e-52

    1. Initial program 88.8%

      \[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. Step-by-step derivation
      1. associate-*r/88.8%

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr88.8%

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

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

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

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

    if -1700 < y < -9.99999999999999924e-25 or 6.89999999999999963e198 < y

    1. Initial program 89.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 z around inf 64.6%

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

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

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

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

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

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

    if -6.1999999999999998e-52 < y < -5.20000000000000005e-87 or -2.85e-117 < y < 2.74999999999999996e-14

    1. Initial program 99.2%

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

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

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

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

    if -5.20000000000000005e-87 < y < -2.85e-117

    1. Initial program 99.5%

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

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

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

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

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

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

    if 2.74999999999999996e-14 < y < 6.89999999999999963e198

    1. Initial program 91.8%

      \[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 t around inf 50.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1700:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-24}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-52}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-117}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.9 \cdot 10^{+198}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a}\\ \mathbf{if}\;y \leq -1920:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-38}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-85}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-117}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{+199}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y a))))
   (if (<= y -1920.0)
     t_1
     (if (<= y -1.3e-38)
       (/ (* y (- z)) a)
       (if (<= y -3.9e-53)
         t_1
         (if (<= y -4.2e-85)
           x
           (if (<= y -2.15e-117)
             (/ (* y t) a)
             (if (<= y 2.35e-14)
               x
               (if (<= y 1.26e+199) (* y (/ t a)) (* y (/ z (- a))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (y <= -1920.0) {
		tmp = t_1;
	} else if (y <= -1.3e-38) {
		tmp = (y * -z) / a;
	} else if (y <= -3.9e-53) {
		tmp = t_1;
	} else if (y <= -4.2e-85) {
		tmp = x;
	} else if (y <= -2.15e-117) {
		tmp = (y * t) / a;
	} else if (y <= 2.35e-14) {
		tmp = x;
	} else if (y <= 1.26e+199) {
		tmp = y * (t / a);
	} 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) :: t_1
    real(8) :: tmp
    t_1 = t * (y / a)
    if (y <= (-1920.0d0)) then
        tmp = t_1
    else if (y <= (-1.3d-38)) then
        tmp = (y * -z) / a
    else if (y <= (-3.9d-53)) then
        tmp = t_1
    else if (y <= (-4.2d-85)) then
        tmp = x
    else if (y <= (-2.15d-117)) then
        tmp = (y * t) / a
    else if (y <= 2.35d-14) then
        tmp = x
    else if (y <= 1.26d+199) then
        tmp = y * (t / a)
    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 t_1 = t * (y / a);
	double tmp;
	if (y <= -1920.0) {
		tmp = t_1;
	} else if (y <= -1.3e-38) {
		tmp = (y * -z) / a;
	} else if (y <= -3.9e-53) {
		tmp = t_1;
	} else if (y <= -4.2e-85) {
		tmp = x;
	} else if (y <= -2.15e-117) {
		tmp = (y * t) / a;
	} else if (y <= 2.35e-14) {
		tmp = x;
	} else if (y <= 1.26e+199) {
		tmp = y * (t / a);
	} else {
		tmp = y * (z / -a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / a)
	tmp = 0
	if y <= -1920.0:
		tmp = t_1
	elif y <= -1.3e-38:
		tmp = (y * -z) / a
	elif y <= -3.9e-53:
		tmp = t_1
	elif y <= -4.2e-85:
		tmp = x
	elif y <= -2.15e-117:
		tmp = (y * t) / a
	elif y <= 2.35e-14:
		tmp = x
	elif y <= 1.26e+199:
		tmp = y * (t / a)
	else:
		tmp = y * (z / -a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (y <= -1920.0)
		tmp = t_1;
	elseif (y <= -1.3e-38)
		tmp = Float64(Float64(y * Float64(-z)) / a);
	elseif (y <= -3.9e-53)
		tmp = t_1;
	elseif (y <= -4.2e-85)
		tmp = x;
	elseif (y <= -2.15e-117)
		tmp = Float64(Float64(y * t) / a);
	elseif (y <= 2.35e-14)
		tmp = x;
	elseif (y <= 1.26e+199)
		tmp = Float64(y * Float64(t / a));
	else
		tmp = Float64(y * Float64(z / Float64(-a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / a);
	tmp = 0.0;
	if (y <= -1920.0)
		tmp = t_1;
	elseif (y <= -1.3e-38)
		tmp = (y * -z) / a;
	elseif (y <= -3.9e-53)
		tmp = t_1;
	elseif (y <= -4.2e-85)
		tmp = x;
	elseif (y <= -2.15e-117)
		tmp = (y * t) / a;
	elseif (y <= 2.35e-14)
		tmp = x;
	elseif (y <= 1.26e+199)
		tmp = y * (t / a);
	else
		tmp = y * (z / -a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1920.0], t$95$1, If[LessEqual[y, -1.3e-38], N[(N[(y * (-z)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, -3.9e-53], t$95$1, If[LessEqual[y, -4.2e-85], x, If[LessEqual[y, -2.15e-117], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 2.35e-14], x, If[LessEqual[y, 1.26e+199], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1920:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\

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

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-85}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -2.15 \cdot 10^{-117}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

\mathbf{elif}\;y \leq 2.35 \cdot 10^{-14}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1920 or -1.30000000000000005e-38 < y < -3.9000000000000002e-53

    1. Initial program 88.8%

      \[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. Step-by-step derivation
      1. associate-*r/88.8%

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr88.8%

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

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

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

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

    if -1920 < y < -1.30000000000000005e-38

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{-a} \cdot y} \]
      2. distribute-frac-neg283.5%

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

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

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

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

    if -3.9000000000000002e-53 < y < -4.2e-85 or -2.15e-117 < y < 2.3500000000000001e-14

    1. Initial program 99.2%

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

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

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

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

    if -4.2e-85 < y < -2.15e-117

    1. Initial program 99.5%

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

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

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

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

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

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

    if 2.3500000000000001e-14 < y < 1.26000000000000002e199

    1. Initial program 91.8%

      \[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 t around inf 50.1%

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

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

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

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

    if 1.26000000000000002e199 < y

    1. Initial program 86.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 z around inf 59.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1920:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-38}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-53}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-85}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-117}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{+199}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-56} \lor \neg \left(y \leq -6 \cdot 10^{-80} \lor \neg \left(y \leq -3.8 \cdot 10^{-118}\right) \land y \leq 2.15 \cdot 10^{-14}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.39999999999999997e-56 or -6.00000000000000014e-80 < y < -3.8000000000000001e-118 or 2.14999999999999999e-14 < y

    1. Initial program 90.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    8. Step-by-step derivation
      1. frac-2neg84.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      12. sqr-neg52.2%

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \sqrt{\color{blue}{t \cdot t}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      13. sqrt-unprod39.5%

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      14. add-sqr-sqrt84.3%

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

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

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

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

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

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

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

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

    if -1.39999999999999997e-56 < y < -6.00000000000000014e-80 or -3.8000000000000001e-118 < y < 2.14999999999999999e-14

    1. Initial program 99.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-56} \lor \neg \left(y \leq -6 \cdot 10^{-80} \lor \neg \left(y \leq -3.8 \cdot 10^{-118}\right) \land y \leq 2.15 \cdot 10^{-14}\right):\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -1.5 \cdot 10^{-81}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -4 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.0500000000000001e-55 or -1.4999999999999999e-81 < y < -3.9999999999999999e-132

    1. Initial program 91.0%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      13. associate-*r/74.3%

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

        \[\leadsto t \cdot \frac{y}{a} + \color{blue}{\left(-\frac{y \cdot z}{a}\right)} \]
      15. distribute-frac-neg74.3%

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

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

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

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

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

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

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

    if -1.0500000000000001e-55 < y < -1.4999999999999999e-81 or -3.9999999999999999e-132 < y < 1.9499999999999999e-14

    1. Initial program 99.2%

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

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

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

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

    if 1.9499999999999999e-14 < y

    1. Initial program 90.1%

      \[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 x around 0 77.2%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    8. Step-by-step derivation
      1. frac-2neg85.4%

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \left(-\color{blue}{t}\right)\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      10. add-sqr-sqrt19.5%

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

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

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

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      14. add-sqr-sqrt85.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-55}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-81}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-132}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-55} \lor \neg \left(y \leq -1.95 \cdot 10^{-86}\right) \land \left(y \leq -3 \cdot 10^{-117} \lor \neg \left(y \leq 4.2 \cdot 10^{-14}\right)\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.15000000000000005e-55 or -1.9500000000000001e-86 < y < -2.99999999999999991e-117 or 4.1999999999999998e-14 < y

    1. Initial program 90.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr90.5%

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

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

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

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

    if -2.15000000000000005e-55 < y < -1.9500000000000001e-86 or -2.99999999999999991e-117 < y < 4.1999999999999998e-14

    1. Initial program 99.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{-55} \lor \neg \left(y \leq -1.95 \cdot 10^{-86}\right) \land \left(y \leq -3 \cdot 10^{-117} \lor \neg \left(y \leq 4.2 \cdot 10^{-14}\right)\right):\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -2.55 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-87}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -2.95 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{-14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.55000000000000005e-54 or -5.00000000000000042e-87 < y < -2.9500000000000002e-117

    1. Initial program 90.8%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr90.8%

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

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

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

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

    if -2.55000000000000005e-54 < y < -5.00000000000000042e-87 or -2.9500000000000002e-117 < y < 2e-14

    1. Initial program 99.2%

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

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

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

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

    if 2e-14 < y

    1. Initial program 90.1%

      \[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 t around inf 44.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{-54}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.95 \cdot 10^{-117}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 49.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.2 \cdot 10^{-86}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.30000000000000002e-51

    1. Initial program 89.8%

      \[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. Step-by-step derivation
      1. associate-*r/89.8%

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

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

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

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

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

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

    if -2.30000000000000002e-51 < y < -1.20000000000000007e-86 or -2.9000000000000001e-117 < y < 3.10000000000000004e-14

    1. Initial program 99.2%

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

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

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

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

    if -1.20000000000000007e-86 < y < -2.9000000000000001e-117

    1. Initial program 99.5%

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

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

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

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

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

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

    if 3.10000000000000004e-14 < y

    1. Initial program 90.1%

      \[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 t around inf 44.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-51}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-86}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-117}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 82.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-6} \lor \neg \left(z \leq 5.8 \cdot 10^{+54}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.1999999999999999e-6 or 5.7999999999999997e54 < z

    1. Initial program 92.5%

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

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

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

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

    if -6.1999999999999999e-6 < z < 5.7999999999999997e54

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-t}{a}} + x \]
      10. add-sqr-sqrt25.4%

        \[\leadsto y \cdot \frac{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}{a} + x \]
      11. sqrt-unprod58.0%

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

        \[\leadsto y \cdot \frac{\sqrt{\color{blue}{t \cdot t}}}{a} + x \]
      13. sqrt-unprod38.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    11. Applied egg-rr91.8%

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

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

Alternative 10: 81.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{-17} \lor \neg \left(z \leq 7.6 \cdot 10^{+80}\right):\\
\;\;\;\;x - \frac{y \cdot z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.3999999999999999e-17 or 7.59999999999999995e80 < z

    1. Initial program 93.1%

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

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

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

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

    if -9.3999999999999999e-17 < z < 7.59999999999999995e80

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot \left(-t\right)}{-a}} + x \]
      4. add-sqr-sqrt48.8%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-t}{a}} + x \]
      10. add-sqr-sqrt24.9%

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

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

        \[\leadsto y \cdot \frac{\sqrt{\color{blue}{t \cdot t}}}{a} + x \]
      13. sqrt-unprod38.6%

        \[\leadsto y \cdot \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{a} + x \]
      14. add-sqr-sqrt90.3%

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

      \[\leadsto \color{blue}{y \cdot \frac{t}{a} + x} \]
    10. Step-by-step derivation
      1. clear-num90.2%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    11. Applied egg-rr91.1%

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

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

Alternative 11: 83.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+68} \lor \neg \left(z \leq 1.14 \cdot 10^{+83}\right):\\
\;\;\;\;x - \frac{y \cdot z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2500000000000001e68 or 1.14000000000000003e83 < z

    1. Initial program 92.9%

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

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

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

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

    if -1.2500000000000001e68 < z < 1.14000000000000003e83

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 78.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{-42}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+26}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


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

    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. Step-by-step derivation
      1. associate-*r/89.5%

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}} \]
    6. Applied egg-rr89.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a} + y \cdot \frac{t}{a}} \]
      10. *-commutative74.1%

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

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + -1 \cdot \frac{y \cdot z}{a}} \]
      13. associate-*r/72.8%

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

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

        \[\leadsto t \cdot \frac{y}{a} + \color{blue}{\frac{-y \cdot z}{a}} \]
      16. distribute-rgt-neg-in72.8%

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

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

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

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

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

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

    if -2.85e-42 < y < 4.2999999999999998e26

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

    if 4.2999999999999998e26 < y

    1. Initial program 88.8%

      \[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 x around 0 80.7%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    8. Step-by-step derivation
      1. frac-2neg90.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      12. sqr-neg54.2%

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

        \[\leadsto y \cdot \left(\left(\left(-z\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right) \cdot \frac{1}{-\left(-a\right)}\right) \]
      14. add-sqr-sqrt90.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 92.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.30000000000000006e196

    1. Initial program 99.9%

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

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

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

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

    if -1.30000000000000006e196 < z

    1. Initial program 93.4%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification94.0%

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

Alternative 14: 93.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.3999999999999999e197

    1. Initial program 99.9%

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

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

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

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

    if -9.3999999999999999e197 < z

    1. Initial program 93.4%

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

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

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

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

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

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

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

Alternative 15: 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 94.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification38.0%

    \[\leadsto x \]
  7. Add Preprocessing

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