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

Percentage Accurate: 93.2% → 97.0%
Time: 9.0s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 1.0× speedup?

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

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

    \[x - \frac{y \cdot \left(z - t\right)}{a} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative93.3%

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

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

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

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

Alternative 2: 49.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a}\\ t_2 := y \cdot \frac{z}{-a}\\ t_3 := z \cdot \frac{y}{-a}\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{+164}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-42}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.88 \cdot 10^{+130}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+273}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t a))) (t_2 (* y (/ z (- a)))) (t_3 (* z (/ y (- a)))))
   (if (<= y -1.1e+164)
     t_3
     (if (<= y -9.5e+52)
       (* t (/ y a))
       (if (<= y -3.2e-42)
         t_2
         (if (<= y 2.05e-44)
           x
           (if (<= y 7.7e+65)
             t_1
             (if (<= y 1.88e+130) t_2 (if (<= y 6.6e+273) t_1 t_3)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double t_2 = y * (z / -a);
	double t_3 = z * (y / -a);
	double tmp;
	if (y <= -1.1e+164) {
		tmp = t_3;
	} else if (y <= -9.5e+52) {
		tmp = t * (y / a);
	} else if (y <= -3.2e-42) {
		tmp = t_2;
	} else if (y <= 2.05e-44) {
		tmp = x;
	} else if (y <= 7.7e+65) {
		tmp = t_1;
	} else if (y <= 1.88e+130) {
		tmp = t_2;
	} else if (y <= 6.6e+273) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = y * (t / a)
    t_2 = y * (z / -a)
    t_3 = z * (y / -a)
    if (y <= (-1.1d+164)) then
        tmp = t_3
    else if (y <= (-9.5d+52)) then
        tmp = t * (y / a)
    else if (y <= (-3.2d-42)) then
        tmp = t_2
    else if (y <= 2.05d-44) then
        tmp = x
    else if (y <= 7.7d+65) then
        tmp = t_1
    else if (y <= 1.88d+130) then
        tmp = t_2
    else if (y <= 6.6d+273) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double t_2 = y * (z / -a);
	double t_3 = z * (y / -a);
	double tmp;
	if (y <= -1.1e+164) {
		tmp = t_3;
	} else if (y <= -9.5e+52) {
		tmp = t * (y / a);
	} else if (y <= -3.2e-42) {
		tmp = t_2;
	} else if (y <= 2.05e-44) {
		tmp = x;
	} else if (y <= 7.7e+65) {
		tmp = t_1;
	} else if (y <= 1.88e+130) {
		tmp = t_2;
	} else if (y <= 6.6e+273) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / a)
	t_2 = y * (z / -a)
	t_3 = z * (y / -a)
	tmp = 0
	if y <= -1.1e+164:
		tmp = t_3
	elif y <= -9.5e+52:
		tmp = t * (y / a)
	elif y <= -3.2e-42:
		tmp = t_2
	elif y <= 2.05e-44:
		tmp = x
	elif y <= 7.7e+65:
		tmp = t_1
	elif y <= 1.88e+130:
		tmp = t_2
	elif y <= 6.6e+273:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / a))
	t_2 = Float64(y * Float64(z / Float64(-a)))
	t_3 = Float64(z * Float64(y / Float64(-a)))
	tmp = 0.0
	if (y <= -1.1e+164)
		tmp = t_3;
	elseif (y <= -9.5e+52)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -3.2e-42)
		tmp = t_2;
	elseif (y <= 2.05e-44)
		tmp = x;
	elseif (y <= 7.7e+65)
		tmp = t_1;
	elseif (y <= 1.88e+130)
		tmp = t_2;
	elseif (y <= 6.6e+273)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / a);
	t_2 = y * (z / -a);
	t_3 = z * (y / -a);
	tmp = 0.0;
	if (y <= -1.1e+164)
		tmp = t_3;
	elseif (y <= -9.5e+52)
		tmp = t * (y / a);
	elseif (y <= -3.2e-42)
		tmp = t_2;
	elseif (y <= 2.05e-44)
		tmp = x;
	elseif (y <= 7.7e+65)
		tmp = t_1;
	elseif (y <= 1.88e+130)
		tmp = t_2;
	elseif (y <= 6.6e+273)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+164], t$95$3, If[LessEqual[y, -9.5e+52], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e-42], t$95$2, If[LessEqual[y, 2.05e-44], x, If[LessEqual[y, 7.7e+65], t$95$1, If[LessEqual[y, 1.88e+130], t$95$2, If[LessEqual[y, 6.6e+273], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{a}\\
t_2 := y \cdot \frac{z}{-a}\\
t_3 := z \cdot \frac{y}{-a}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+164}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;y \leq -3.2 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 7.7 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.88 \cdot 10^{+130}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.10000000000000003e164 or 6.59999999999999971e273 < y

    1. Initial program 83.6%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative83.6%

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

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

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

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

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

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

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

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

    if -1.10000000000000003e164 < y < -9.49999999999999994e52

    1. Initial program 85.5%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative85.5%

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

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

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

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

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

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

    if -9.49999999999999994e52 < y < -3.20000000000000025e-42 or 7.70000000000000038e65 < y < 1.88000000000000003e130

    1. Initial program 89.5%

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

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

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

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

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

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

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

    if -3.20000000000000025e-42 < y < 2.04999999999999996e-44

    1. Initial program 99.9%

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

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

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

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

    if 2.04999999999999996e-44 < y < 7.70000000000000038e65 or 1.88000000000000003e130 < y < 6.59999999999999971e273

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+164}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-42}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq 1.88 \cdot 10^{+130}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a}\\ t_2 := z \cdot \frac{y}{-a}\\ \mathbf{if}\;y \leq -7.2 \cdot 10^{+157}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq 4.25 \cdot 10^{+273}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t a))) (t_2 (* z (/ y (- a)))))
   (if (<= y -7.2e+157)
     t_2
     (if (<= y -5.5e+52)
       (* t (/ y a))
       (if (<= y -1.75e-36)
         (* y (/ z (- a)))
         (if (<= y 3.2e-44)
           x
           (if (<= y 9e+65)
             t_1
             (if (<= y 1.9e+130)
               (/ y (/ a (- z)))
               (if (<= y 4.25e+273) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double t_2 = z * (y / -a);
	double tmp;
	if (y <= -7.2e+157) {
		tmp = t_2;
	} else if (y <= -5.5e+52) {
		tmp = t * (y / a);
	} else if (y <= -1.75e-36) {
		tmp = y * (z / -a);
	} else if (y <= 3.2e-44) {
		tmp = x;
	} else if (y <= 9e+65) {
		tmp = t_1;
	} else if (y <= 1.9e+130) {
		tmp = y / (a / -z);
	} else if (y <= 4.25e+273) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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 * (t / a)
    t_2 = z * (y / -a)
    if (y <= (-7.2d+157)) then
        tmp = t_2
    else if (y <= (-5.5d+52)) then
        tmp = t * (y / a)
    else if (y <= (-1.75d-36)) then
        tmp = y * (z / -a)
    else if (y <= 3.2d-44) then
        tmp = x
    else if (y <= 9d+65) then
        tmp = t_1
    else if (y <= 1.9d+130) then
        tmp = y / (a / -z)
    else if (y <= 4.25d+273) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double t_2 = z * (y / -a);
	double tmp;
	if (y <= -7.2e+157) {
		tmp = t_2;
	} else if (y <= -5.5e+52) {
		tmp = t * (y / a);
	} else if (y <= -1.75e-36) {
		tmp = y * (z / -a);
	} else if (y <= 3.2e-44) {
		tmp = x;
	} else if (y <= 9e+65) {
		tmp = t_1;
	} else if (y <= 1.9e+130) {
		tmp = y / (a / -z);
	} else if (y <= 4.25e+273) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / a)
	t_2 = z * (y / -a)
	tmp = 0
	if y <= -7.2e+157:
		tmp = t_2
	elif y <= -5.5e+52:
		tmp = t * (y / a)
	elif y <= -1.75e-36:
		tmp = y * (z / -a)
	elif y <= 3.2e-44:
		tmp = x
	elif y <= 9e+65:
		tmp = t_1
	elif y <= 1.9e+130:
		tmp = y / (a / -z)
	elif y <= 4.25e+273:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / a))
	t_2 = Float64(z * Float64(y / Float64(-a)))
	tmp = 0.0
	if (y <= -7.2e+157)
		tmp = t_2;
	elseif (y <= -5.5e+52)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -1.75e-36)
		tmp = Float64(y * Float64(z / Float64(-a)));
	elseif (y <= 3.2e-44)
		tmp = x;
	elseif (y <= 9e+65)
		tmp = t_1;
	elseif (y <= 1.9e+130)
		tmp = Float64(y / Float64(a / Float64(-z)));
	elseif (y <= 4.25e+273)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / a);
	t_2 = z * (y / -a);
	tmp = 0.0;
	if (y <= -7.2e+157)
		tmp = t_2;
	elseif (y <= -5.5e+52)
		tmp = t * (y / a);
	elseif (y <= -1.75e-36)
		tmp = y * (z / -a);
	elseif (y <= 3.2e-44)
		tmp = x;
	elseif (y <= 9e+65)
		tmp = t_1;
	elseif (y <= 1.9e+130)
		tmp = y / (a / -z);
	elseif (y <= 4.25e+273)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+157], t$95$2, If[LessEqual[y, -5.5e+52], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e-36], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-44], x, If[LessEqual[y, 9e+65], t$95$1, If[LessEqual[y, 1.9e+130], N[(y / N[(a / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.25e+273], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{a}\\
t_2 := z \cdot \frac{y}{-a}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+157}:\\
\;\;\;\;t\_2\\

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

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

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

\mathbf{elif}\;y \leq 9 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\
\;\;\;\;\frac{y}{\frac{a}{-z}}\\

\mathbf{elif}\;y \leq 4.25 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -7.20000000000000049e157 or 4.2500000000000001e273 < y

    1. Initial program 83.6%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative83.6%

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

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

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

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

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

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

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

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

    if -7.20000000000000049e157 < y < -5.49999999999999996e52

    1. Initial program 85.5%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative85.5%

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

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

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

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

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

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

    if -5.49999999999999996e52 < y < -1.75e-36

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

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

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

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

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

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

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

    if -1.75e-36 < y < 3.19999999999999995e-44

    1. Initial program 99.9%

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

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

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

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

    if 3.19999999999999995e-44 < y < 9e65 or 1.9000000000000001e130 < y < 4.2500000000000001e273

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if 9e65 < y < 1.9000000000000001e130

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{-a}} \]
      2. add-sqr-sqrt30.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      3. sqrt-unprod30.1%

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      6. add-sqr-sqrt1.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
      9. frac-2neg1.1%

        \[\leadsto \color{blue}{\frac{-y}{-\frac{a}{z}}} \]
      10. distribute-neg-frac21.1%

        \[\leadsto \frac{-y}{\color{blue}{\frac{a}{-z}}} \]
      11. add-sqr-sqrt1.0%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}} \]
      12. sqrt-unprod36.3%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}} \]
      13. sqr-neg36.3%

        \[\leadsto \frac{-y}{\frac{a}{\sqrt{\color{blue}{z \cdot z}}}} \]
      14. sqrt-unprod35.4%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}} \]
      15. add-sqr-sqrt65.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+157}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq 4.25 \cdot 10^{+273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a}\\ \mathbf{if}\;y \leq -7.8 \cdot 10^{+157}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+51}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.72 \cdot 10^{-40}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.7 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+273}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t a))))
   (if (<= y -7.8e+157)
     (/ (* z (- y)) a)
     (if (<= y -9.2e+51)
       (* t (/ y a))
       (if (<= y -1.72e-40)
         (* y (/ z (- a)))
         (if (<= y 2.1e-44)
           x
           (if (<= y 6.7e+65)
             t_1
             (if (<= y 1.9e+130)
               (/ y (/ a (- z)))
               (if (<= y 8.5e+273) t_1 (* z (/ y (- a))))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double tmp;
	if (y <= -7.8e+157) {
		tmp = (z * -y) / a;
	} else if (y <= -9.2e+51) {
		tmp = t * (y / a);
	} else if (y <= -1.72e-40) {
		tmp = y * (z / -a);
	} else if (y <= 2.1e-44) {
		tmp = x;
	} else if (y <= 6.7e+65) {
		tmp = t_1;
	} else if (y <= 1.9e+130) {
		tmp = y / (a / -z);
	} else if (y <= 8.5e+273) {
		tmp = t_1;
	} else {
		tmp = z * (y / -a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (t / a)
    if (y <= (-7.8d+157)) then
        tmp = (z * -y) / a
    else if (y <= (-9.2d+51)) then
        tmp = t * (y / a)
    else if (y <= (-1.72d-40)) then
        tmp = y * (z / -a)
    else if (y <= 2.1d-44) then
        tmp = x
    else if (y <= 6.7d+65) then
        tmp = t_1
    else if (y <= 1.9d+130) then
        tmp = y / (a / -z)
    else if (y <= 8.5d+273) then
        tmp = t_1
    else
        tmp = z * (y / -a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double tmp;
	if (y <= -7.8e+157) {
		tmp = (z * -y) / a;
	} else if (y <= -9.2e+51) {
		tmp = t * (y / a);
	} else if (y <= -1.72e-40) {
		tmp = y * (z / -a);
	} else if (y <= 2.1e-44) {
		tmp = x;
	} else if (y <= 6.7e+65) {
		tmp = t_1;
	} else if (y <= 1.9e+130) {
		tmp = y / (a / -z);
	} else if (y <= 8.5e+273) {
		tmp = t_1;
	} else {
		tmp = z * (y / -a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / a)
	tmp = 0
	if y <= -7.8e+157:
		tmp = (z * -y) / a
	elif y <= -9.2e+51:
		tmp = t * (y / a)
	elif y <= -1.72e-40:
		tmp = y * (z / -a)
	elif y <= 2.1e-44:
		tmp = x
	elif y <= 6.7e+65:
		tmp = t_1
	elif y <= 1.9e+130:
		tmp = y / (a / -z)
	elif y <= 8.5e+273:
		tmp = t_1
	else:
		tmp = z * (y / -a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / a))
	tmp = 0.0
	if (y <= -7.8e+157)
		tmp = Float64(Float64(z * Float64(-y)) / a);
	elseif (y <= -9.2e+51)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -1.72e-40)
		tmp = Float64(y * Float64(z / Float64(-a)));
	elseif (y <= 2.1e-44)
		tmp = x;
	elseif (y <= 6.7e+65)
		tmp = t_1;
	elseif (y <= 1.9e+130)
		tmp = Float64(y / Float64(a / Float64(-z)));
	elseif (y <= 8.5e+273)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y / Float64(-a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / a);
	tmp = 0.0;
	if (y <= -7.8e+157)
		tmp = (z * -y) / a;
	elseif (y <= -9.2e+51)
		tmp = t * (y / a);
	elseif (y <= -1.72e-40)
		tmp = y * (z / -a);
	elseif (y <= 2.1e-44)
		tmp = x;
	elseif (y <= 6.7e+65)
		tmp = t_1;
	elseif (y <= 1.9e+130)
		tmp = y / (a / -z);
	elseif (y <= 8.5e+273)
		tmp = t_1;
	else
		tmp = z * (y / -a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+157], N[(N[(z * (-y)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, -9.2e+51], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.72e-40], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-44], x, If[LessEqual[y, 6.7e+65], t$95$1, If[LessEqual[y, 1.9e+130], N[(y / N[(a / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+273], t$95$1, N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;y \leq 6.7 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\
\;\;\;\;\frac{y}{\frac{a}{-z}}\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 87.8%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative87.8%

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

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

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

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

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

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

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

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

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

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

    if -7.79999999999999941e157 < y < -9.2000000000000002e51

    1. Initial program 85.5%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative85.5%

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

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

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

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

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

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

    if -9.2000000000000002e51 < y < -1.7199999999999999e-40

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

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

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

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

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

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

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

    if -1.7199999999999999e-40 < y < 2.10000000000000001e-44

    1. Initial program 99.9%

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

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

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

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

    if 2.10000000000000001e-44 < y < 6.6999999999999997e65 or 1.9000000000000001e130 < y < 8.5000000000000002e273

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if 6.6999999999999997e65 < y < 1.9000000000000001e130

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{-a}} \]
      2. add-sqr-sqrt30.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      3. sqrt-unprod30.1%

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      6. add-sqr-sqrt1.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
      9. frac-2neg1.1%

        \[\leadsto \color{blue}{\frac{-y}{-\frac{a}{z}}} \]
      10. distribute-neg-frac21.1%

        \[\leadsto \frac{-y}{\color{blue}{\frac{a}{-z}}} \]
      11. add-sqr-sqrt1.0%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}} \]
      12. sqrt-unprod36.3%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}} \]
      13. sqr-neg36.3%

        \[\leadsto \frac{-y}{\frac{a}{\sqrt{\color{blue}{z \cdot z}}}} \]
      14. sqrt-unprod35.4%

        \[\leadsto \frac{-y}{\frac{a}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}} \]
      15. add-sqr-sqrt65.4%

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

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

    if 8.5000000000000002e273 < y

    1. Initial program 68.6%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative68.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+157}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{+51}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.72 \cdot 10^{-40}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.7 \cdot 10^{+65}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+130}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+273}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 48.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{-a}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+53}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{+65} \lor \neg \left(y \leq 1.8 \cdot 10^{+130}\right):\\ \;\;\;\;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)))))
   (if (<= y -1.4e+158)
     t_1
     (if (<= y -1.55e+53)
       (* t (/ y a))
       (if (<= y -8.5e-39)
         t_1
         (if (<= y 2.9e-44)
           x
           (if (or (<= y 7.7e+65) (not (<= y 1.8e+130)))
             (* y (/ t a))
             t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / -a);
	double tmp;
	if (y <= -1.4e+158) {
		tmp = t_1;
	} else if (y <= -1.55e+53) {
		tmp = t * (y / a);
	} else if (y <= -8.5e-39) {
		tmp = t_1;
	} else if (y <= 2.9e-44) {
		tmp = x;
	} else if ((y <= 7.7e+65) || !(y <= 1.8e+130)) {
		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) :: tmp
    t_1 = y * (z / -a)
    if (y <= (-1.4d+158)) then
        tmp = t_1
    else if (y <= (-1.55d+53)) then
        tmp = t * (y / a)
    else if (y <= (-8.5d-39)) then
        tmp = t_1
    else if (y <= 2.9d-44) then
        tmp = x
    else if ((y <= 7.7d+65) .or. (.not. (y <= 1.8d+130))) 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 tmp;
	if (y <= -1.4e+158) {
		tmp = t_1;
	} else if (y <= -1.55e+53) {
		tmp = t * (y / a);
	} else if (y <= -8.5e-39) {
		tmp = t_1;
	} else if (y <= 2.9e-44) {
		tmp = x;
	} else if ((y <= 7.7e+65) || !(y <= 1.8e+130)) {
		tmp = y * (t / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / -a)
	tmp = 0
	if y <= -1.4e+158:
		tmp = t_1
	elif y <= -1.55e+53:
		tmp = t * (y / a)
	elif y <= -8.5e-39:
		tmp = t_1
	elif y <= 2.9e-44:
		tmp = x
	elif (y <= 7.7e+65) or not (y <= 1.8e+130):
		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)))
	tmp = 0.0
	if (y <= -1.4e+158)
		tmp = t_1;
	elseif (y <= -1.55e+53)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -8.5e-39)
		tmp = t_1;
	elseif (y <= 2.9e-44)
		tmp = x;
	elseif ((y <= 7.7e+65) || !(y <= 1.8e+130))
		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);
	tmp = 0.0;
	if (y <= -1.4e+158)
		tmp = t_1;
	elseif (y <= -1.55e+53)
		tmp = t * (y / a);
	elseif (y <= -8.5e-39)
		tmp = t_1;
	elseif (y <= 2.9e-44)
		tmp = x;
	elseif ((y <= 7.7e+65) || ~((y <= 1.8e+130)))
		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]}, If[LessEqual[y, -1.4e+158], t$95$1, If[LessEqual[y, -1.55e+53], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.5e-39], t$95$1, If[LessEqual[y, 2.9e-44], x, If[Or[LessEqual[y, 7.7e+65], N[Not[LessEqual[y, 1.8e+130]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -8.5 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 7.7 \cdot 10^{+65} \lor \neg \left(y \leq 1.8 \cdot 10^{+130}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.40000000000000001e158 or -1.5500000000000001e53 < y < -8.5000000000000005e-39 or 7.70000000000000038e65 < y < 1.8000000000000001e130

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

    if -1.40000000000000001e158 < y < -1.5500000000000001e53

    1. Initial program 85.5%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative85.5%

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

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

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

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

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

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

    if -8.5000000000000005e-39 < y < 2.9000000000000001e-44

    1. Initial program 99.9%

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

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

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

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

    if 2.9000000000000001e-44 < y < 7.70000000000000038e65 or 1.8000000000000001e130 < y

    1. Initial program 89.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+158}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+53}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-39}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{+65} \lor \neg \left(y \leq 1.8 \cdot 10^{+130}\right):\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-45} \lor \neg \left(y \leq 1.35 \cdot 10^{-139}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9e-45 or 1.3499999999999999e-139 < y

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9e-45 < y < 1.3499999999999999e-139

    1. Initial program 99.9%

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

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

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

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

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

Alternative 7: 77.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-36} \lor \neg \left(y \leq 1.35 \cdot 10^{+29}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8000000000000001e-36 or 1.35e29 < y

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000001e-36 < y < 1.35e29

    1. Initial program 99.9%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Step-by-step derivation
      1. sub-neg99.9%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{-a}, x\right)} \]
      6. distribute-frac-neg288.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{-\frac{z - t}{a}}, x\right) \]
      7. distribute-neg-frac88.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{-\left(z - t\right)}{a}}, x\right) \]
      8. sub-neg88.9%

        \[\leadsto \mathsf{fma}\left(y, \frac{-\color{blue}{\left(z + \left(-t\right)\right)}}{a}, x\right) \]
      9. distribute-neg-in88.9%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}}{a}, x\right) \]
      10. remove-double-neg88.9%

        \[\leadsto \mathsf{fma}\left(y, \frac{\left(-z\right) + \color{blue}{t}}{a}, x\right) \]
      11. +-commutative88.9%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{t + \left(-z\right)}}{a}, x\right) \]
      12. sub-neg88.9%

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

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

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

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

Alternative 8: 50.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-37} \lor \neg \left(y \leq 2.3 \cdot 10^{-44}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.09999999999999993e-37 or 2.29999999999999998e-44 < y

    1. Initial program 88.8%

      \[x - \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative88.8%

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

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

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

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

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

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

    if -3.09999999999999993e-37 < y < 2.29999999999999998e-44

    1. Initial program 99.9%

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

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

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

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

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

Alternative 9: 93.0% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 38.5% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.9% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024096 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, 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)))