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

Percentage Accurate: 93.7% → 95.3%
Time: 10.3s
Alternatives: 15
Speedup: 0.6×

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.7% 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: 95.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.9e-122

    1. Initial program 98.1%

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

    if 1.9e-122 < z

    1. Initial program 93.4%

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

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

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

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

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

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

Alternative 2: 50.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{-y}{a}\\ t_2 := \frac{z \cdot y}{a}\\ \mathbf{if}\;a \leq -1.3 \cdot 10^{+104}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -3.6 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.82 \cdot 10^{-183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{-64}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 360:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+32}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y) a))) (t_2 (/ (* z y) a)))
   (if (<= a -1.3e+104)
     x
     (if (<= a -1.5e+25)
       (* y (/ z a))
       (if (<= a -3.6e-42)
         x
         (if (<= a -1.82e-183)
           t_1
           (if (<= a 5.1e-64)
             t_2
             (if (<= a 360.0)
               x
               (if (<= a 1.9e+32) t_2 (if (<= a 1e+57) t_1 x))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (-y / a);
	double t_2 = (z * y) / a;
	double tmp;
	if (a <= -1.3e+104) {
		tmp = x;
	} else if (a <= -1.5e+25) {
		tmp = y * (z / a);
	} else if (a <= -3.6e-42) {
		tmp = x;
	} else if (a <= -1.82e-183) {
		tmp = t_1;
	} else if (a <= 5.1e-64) {
		tmp = t_2;
	} else if (a <= 360.0) {
		tmp = x;
	} else if (a <= 1.9e+32) {
		tmp = t_2;
	} else if (a <= 1e+57) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (-y / a)
    t_2 = (z * y) / a
    if (a <= (-1.3d+104)) then
        tmp = x
    else if (a <= (-1.5d+25)) then
        tmp = y * (z / a)
    else if (a <= (-3.6d-42)) then
        tmp = x
    else if (a <= (-1.82d-183)) then
        tmp = t_1
    else if (a <= 5.1d-64) then
        tmp = t_2
    else if (a <= 360.0d0) then
        tmp = x
    else if (a <= 1.9d+32) then
        tmp = t_2
    else if (a <= 1d+57) then
        tmp = t_1
    else
        tmp = x
    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 t_2 = (z * y) / a;
	double tmp;
	if (a <= -1.3e+104) {
		tmp = x;
	} else if (a <= -1.5e+25) {
		tmp = y * (z / a);
	} else if (a <= -3.6e-42) {
		tmp = x;
	} else if (a <= -1.82e-183) {
		tmp = t_1;
	} else if (a <= 5.1e-64) {
		tmp = t_2;
	} else if (a <= 360.0) {
		tmp = x;
	} else if (a <= 1.9e+32) {
		tmp = t_2;
	} else if (a <= 1e+57) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (-y / a)
	t_2 = (z * y) / a
	tmp = 0
	if a <= -1.3e+104:
		tmp = x
	elif a <= -1.5e+25:
		tmp = y * (z / a)
	elif a <= -3.6e-42:
		tmp = x
	elif a <= -1.82e-183:
		tmp = t_1
	elif a <= 5.1e-64:
		tmp = t_2
	elif a <= 360.0:
		tmp = x
	elif a <= 1.9e+32:
		tmp = t_2
	elif a <= 1e+57:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(-y) / a))
	t_2 = Float64(Float64(z * y) / a)
	tmp = 0.0
	if (a <= -1.3e+104)
		tmp = x;
	elseif (a <= -1.5e+25)
		tmp = Float64(y * Float64(z / a));
	elseif (a <= -3.6e-42)
		tmp = x;
	elseif (a <= -1.82e-183)
		tmp = t_1;
	elseif (a <= 5.1e-64)
		tmp = t_2;
	elseif (a <= 360.0)
		tmp = x;
	elseif (a <= 1.9e+32)
		tmp = t_2;
	elseif (a <= 1e+57)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (-y / a);
	t_2 = (z * y) / a;
	tmp = 0.0;
	if (a <= -1.3e+104)
		tmp = x;
	elseif (a <= -1.5e+25)
		tmp = y * (z / a);
	elseif (a <= -3.6e-42)
		tmp = x;
	elseif (a <= -1.82e-183)
		tmp = t_1;
	elseif (a <= 5.1e-64)
		tmp = t_2;
	elseif (a <= 360.0)
		tmp = x;
	elseif (a <= 1.9e+32)
		tmp = t_2;
	elseif (a <= 1e+57)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1.3e+104], x, If[LessEqual[a, -1.5e+25], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.6e-42], x, If[LessEqual[a, -1.82e-183], t$95$1, If[LessEqual[a, 5.1e-64], t$95$2, If[LessEqual[a, 360.0], x, If[LessEqual[a, 1.9e+32], t$95$2, If[LessEqual[a, 1e+57], t$95$1, x]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq -3.6 \cdot 10^{-42}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -1.82 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 5.1 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 360:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 10^{+57}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.3e104 or -1.50000000000000003e25 < a < -3.6000000000000002e-42 or 5.09999999999999984e-64 < a < 360 or 1.00000000000000005e57 < a

    1. Initial program 93.5%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 71.3%

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

    if -1.3e104 < a < -1.50000000000000003e25

    1. Initial program 86.6%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 66.4%

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

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

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

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

    if -3.6000000000000002e-42 < a < -1.82e-183 or 1.9000000000000002e32 < a < 1.00000000000000005e57

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{t \cdot y}}{a} \]
      4. add-sqr-sqrt12.8%

        \[\leadsto -\frac{t \cdot y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. sqrt-unprod14.1%

        \[\leadsto -\frac{t \cdot y}{\color{blue}{\sqrt{a \cdot a}}} \]
      6. sqr-neg14.1%

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \left(\frac{1}{-a} \cdot y\right)} \]
      12. add-sqr-sqrt1.3%

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

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

        \[\leadsto -t \cdot \left(\frac{1}{\sqrt{\color{blue}{a \cdot a}}} \cdot y\right) \]
      15. sqrt-unprod12.7%

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

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{a}} \cdot y\right) \]
      17. associate-/r/67.1%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      18. clear-num67.2%

        \[\leadsto -t \cdot \color{blue}{\frac{y}{a}} \]
    8. Applied egg-rr67.2%

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

    if -1.82e-183 < a < 5.09999999999999984e-64 or 360 < a < 1.9000000000000002e32

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 91.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+104}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -3.6 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.82 \cdot 10^{-183}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{-64}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;a \leq 360:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+32}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;a \leq 10^{+57}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+105} \lor \neg \left(a \leq -2.05 \cdot 10^{+25} \lor \neg \left(a \leq -1.65 \cdot 10^{-31}\right) \land \left(a \leq 3.6 \cdot 10^{-64} \lor \neg \left(a \leq 54\right) \land a \leq 8 \cdot 10^{+31}\right)\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.00000000000000046e105 or -2.04999999999999983e25 < a < -1.65e-31 or 3.5999999999999998e-64 < a < 54 or 7.9999999999999997e31 < a

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.7%

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

    if -5.00000000000000046e105 < a < -2.04999999999999983e25 or -1.65e-31 < a < 3.5999999999999998e-64 or 54 < a < 7.9999999999999997e31

    1. Initial program 98.5%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 87.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{+105} \lor \neg \left(a \leq -2.05 \cdot 10^{+25} \lor \neg \left(a \leq -1.65 \cdot 10^{-31}\right) \land \left(a \leq 3.6 \cdot 10^{-64} \lor \neg \left(a \leq 54\right) \land a \leq 8 \cdot 10^{+31}\right)\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 49.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+104}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq -2 \cdot 10^{-31}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq 160 \lor \neg \left(a \leq 5.2 \cdot 10^{+31}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.1e104 or -1.6500000000000001e25 < a < -2e-31 or 5.99999999999999959e-63 < a < 160 or 5.2e31 < a

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.7%

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

    if -1.1e104 < a < -1.6500000000000001e25

    1. Initial program 86.6%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 66.4%

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

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

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

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

    if -2e-31 < a < 5.99999999999999959e-63

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(\frac{1}{a} \cdot y\right)} \]
      4. associate-/r/61.9%

        \[\leadsto x + z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      5. clear-num62.0%

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

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

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

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

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

    if 160 < a < 5.2e31

    1. Initial program 99.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.1 \cdot 10^{+104}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 160 \lor \neg \left(a \leq 5.2 \cdot 10^{+31}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{a}\\ \mathbf{if}\;a \leq -1.36 \cdot 10^{+104}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.9 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 76 \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ z a))))
   (if (<= a -1.36e+104)
     x
     (if (<= a -2.6e+25)
       t_1
       (if (<= a -1.9e-31)
         x
         (if (<= a 5.3e-63)
           (/ z (/ a y))
           (if (or (<= a 76.0) (not (<= a 3.2e+31))) x t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (a <= -1.36e+104) {
		tmp = x;
	} else if (a <= -2.6e+25) {
		tmp = t_1;
	} else if (a <= -1.9e-31) {
		tmp = x;
	} else if (a <= 5.3e-63) {
		tmp = z / (a / y);
	} else if ((a <= 76.0) || !(a <= 3.2e+31)) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / a)
    if (a <= (-1.36d+104)) then
        tmp = x
    else if (a <= (-2.6d+25)) then
        tmp = t_1
    else if (a <= (-1.9d-31)) then
        tmp = x
    else if (a <= 5.3d-63) then
        tmp = z / (a / y)
    else if ((a <= 76.0d0) .or. (.not. (a <= 3.2d+31))) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (a <= -1.36e+104) {
		tmp = x;
	} else if (a <= -2.6e+25) {
		tmp = t_1;
	} else if (a <= -1.9e-31) {
		tmp = x;
	} else if (a <= 5.3e-63) {
		tmp = z / (a / y);
	} else if ((a <= 76.0) || !(a <= 3.2e+31)) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / a)
	tmp = 0
	if a <= -1.36e+104:
		tmp = x
	elif a <= -2.6e+25:
		tmp = t_1
	elif a <= -1.9e-31:
		tmp = x
	elif a <= 5.3e-63:
		tmp = z / (a / y)
	elif (a <= 76.0) or not (a <= 3.2e+31):
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / a))
	tmp = 0.0
	if (a <= -1.36e+104)
		tmp = x;
	elseif (a <= -2.6e+25)
		tmp = t_1;
	elseif (a <= -1.9e-31)
		tmp = x;
	elseif (a <= 5.3e-63)
		tmp = Float64(z / Float64(a / y));
	elseif ((a <= 76.0) || !(a <= 3.2e+31))
		tmp = x;
	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 (a <= -1.36e+104)
		tmp = x;
	elseif (a <= -2.6e+25)
		tmp = t_1;
	elseif (a <= -1.9e-31)
		tmp = x;
	elseif (a <= 5.3e-63)
		tmp = z / (a / y);
	elseif ((a <= 76.0) || ~((a <= 3.2e+31)))
		tmp = x;
	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[a, -1.36e+104], x, If[LessEqual[a, -2.6e+25], t$95$1, If[LessEqual[a, -1.9e-31], x, If[LessEqual[a, 5.3e-63], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 76.0], N[Not[LessEqual[a, 3.2e+31]], $MachinePrecision]], x, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.6 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.9 \cdot 10^{-31}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq 76 \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3599999999999999e104 or -2.5999999999999998e25 < a < -1.9e-31 or 5.30000000000000034e-63 < a < 76 or 3.2000000000000001e31 < a

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.7%

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

    if -1.3599999999999999e104 < a < -2.5999999999999998e25 or 76 < a < 3.2000000000000001e31

    1. Initial program 91.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 79.4%

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

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

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

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

    if -1.9e-31 < a < 5.30000000000000034e-63

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(\frac{1}{a} \cdot y\right)} \]
      4. associate-/r/61.9%

        \[\leadsto x + z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      5. clear-num62.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.36 \cdot 10^{+104}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -1.9 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 76 \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{a}\\ \mathbf{if}\;a \leq -8.6 \cdot 10^{+107}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.72 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -8.6 \cdot 10^{-32}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-63}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 106 \lor \neg \left(a \leq 3.4 \cdot 10^{+28}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ z a))))
   (if (<= a -8.6e+107)
     x
     (if (<= a -1.72e+25)
       t_1
       (if (<= a -8.6e-32)
         x
         (if (<= a 3.3e-63)
           (* z (/ y a))
           (if (or (<= a 106.0) (not (<= a 3.4e+28))) x t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (a <= -8.6e+107) {
		tmp = x;
	} else if (a <= -1.72e+25) {
		tmp = t_1;
	} else if (a <= -8.6e-32) {
		tmp = x;
	} else if (a <= 3.3e-63) {
		tmp = z * (y / a);
	} else if ((a <= 106.0) || !(a <= 3.4e+28)) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / a)
    if (a <= (-8.6d+107)) then
        tmp = x
    else if (a <= (-1.72d+25)) then
        tmp = t_1
    else if (a <= (-8.6d-32)) then
        tmp = x
    else if (a <= 3.3d-63) then
        tmp = z * (y / a)
    else if ((a <= 106.0d0) .or. (.not. (a <= 3.4d+28))) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / a);
	double tmp;
	if (a <= -8.6e+107) {
		tmp = x;
	} else if (a <= -1.72e+25) {
		tmp = t_1;
	} else if (a <= -8.6e-32) {
		tmp = x;
	} else if (a <= 3.3e-63) {
		tmp = z * (y / a);
	} else if ((a <= 106.0) || !(a <= 3.4e+28)) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / a)
	tmp = 0
	if a <= -8.6e+107:
		tmp = x
	elif a <= -1.72e+25:
		tmp = t_1
	elif a <= -8.6e-32:
		tmp = x
	elif a <= 3.3e-63:
		tmp = z * (y / a)
	elif (a <= 106.0) or not (a <= 3.4e+28):
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / a))
	tmp = 0.0
	if (a <= -8.6e+107)
		tmp = x;
	elseif (a <= -1.72e+25)
		tmp = t_1;
	elseif (a <= -8.6e-32)
		tmp = x;
	elseif (a <= 3.3e-63)
		tmp = Float64(z * Float64(y / a));
	elseif ((a <= 106.0) || !(a <= 3.4e+28))
		tmp = x;
	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 (a <= -8.6e+107)
		tmp = x;
	elseif (a <= -1.72e+25)
		tmp = t_1;
	elseif (a <= -8.6e-32)
		tmp = x;
	elseif (a <= 3.3e-63)
		tmp = z * (y / a);
	elseif ((a <= 106.0) || ~((a <= 3.4e+28)))
		tmp = x;
	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[a, -8.6e+107], x, If[LessEqual[a, -1.72e+25], t$95$1, If[LessEqual[a, -8.6e-32], x, If[LessEqual[a, 3.3e-63], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 106.0], N[Not[LessEqual[a, 3.4e+28]], $MachinePrecision]], x, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.72 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -8.6 \cdot 10^{-32}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq 106 \lor \neg \left(a \leq 3.4 \cdot 10^{+28}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.5999999999999999e107 or -1.71999999999999995e25 < a < -8.5999999999999998e-32 or 3.29999999999999994e-63 < a < 106 or 3.4e28 < a

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.7%

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

    if -8.5999999999999999e107 < a < -1.71999999999999995e25 or 106 < a < 3.4e28

    1. Initial program 91.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 79.4%

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

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

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

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

    if -8.5999999999999998e-32 < a < 3.29999999999999994e-63

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 89.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(\frac{1}{a} \cdot y\right)} \]
      4. associate-/r/61.9%

        \[\leadsto x + z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      5. clear-num62.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.6 \cdot 10^{+107}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.72 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -8.6 \cdot 10^{-32}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{-63}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 106 \lor \neg \left(a \leq 3.4 \cdot 10^{+28}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-103}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-231}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.0999999999999998e68

    1. Initial program 95.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 78.2%

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

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

    if -3.0999999999999998e68 < z < -1.01999999999999998e-103 or -1.14999999999999989e-159 < z < -1.25000000000000006e-231 or 2.30000000000000011e-191 < z < 2.8999999999999999e139

    1. Initial program 96.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 55.5%

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

    if -1.01999999999999998e-103 < z < -1.14999999999999989e-159

    1. Initial program 93.3%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 77.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-t}{a}} \]
      6. distribute-neg-frac59.2%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot t}{-a}} \]
      2. distribute-frac-neg259.1%

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

        \[\leadsto -\frac{\color{blue}{t \cdot y}}{a} \]
      4. add-sqr-sqrt37.2%

        \[\leadsto -\frac{t \cdot y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. sqrt-unprod43.4%

        \[\leadsto -\frac{t \cdot y}{\color{blue}{\sqrt{a \cdot a}}} \]
      6. sqr-neg43.4%

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

        \[\leadsto -\frac{t \cdot y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      8. add-sqr-sqrt0.7%

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

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

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

        \[\leadsto -\color{blue}{t \cdot \left(\frac{1}{-a} \cdot y\right)} \]
      12. add-sqr-sqrt0.1%

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

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

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

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

        \[\leadsto -t \cdot \left(\frac{1}{\color{blue}{a}} \cdot y\right) \]
      17. associate-/r/79.2%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      18. clear-num79.2%

        \[\leadsto -t \cdot \color{blue}{\frac{y}{a}} \]
    8. Applied egg-rr79.2%

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

    if -1.25000000000000006e-231 < z < 2.30000000000000011e-191

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 70.0%

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

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

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

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

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

    if 2.8999999999999999e139 < z

    1. Initial program 93.0%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 72.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(\frac{1}{a} \cdot y\right)} \]
      4. associate-/r/93.1%

        \[\leadsto x + z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      5. clear-num93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+68}:\\ \;\;\;\;\frac{z \cdot y}{a}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-159}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-231}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-191}:\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+139}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -2.0000000000000001e96

    1. Initial program 91.5%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 90.1%

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

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

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

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

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

    if -2.0000000000000001e96 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.00000000000000009e150

    1. Initial program 99.9%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 89.3%

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

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

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

    if 5.00000000000000009e150 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.2%

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

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

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

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

Alternative 9: 77.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-60} \lor \neg \left(a \leq 4.6 \cdot 10^{-116}\right) \land \left(a \leq 125 \lor \neg \left(a \leq 1.18 \cdot 10^{+57}\right)\right):\\
\;\;\;\;x + y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9500000000000001e-60 or 4.60000000000000003e-116 < a < 125 or 1.18e57 < a

    1. Initial program 93.6%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 81.1%

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

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

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

    if -1.9500000000000001e-60 < a < 4.60000000000000003e-116 or 125 < a < 1.18e57

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 93.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{-60} \lor \neg \left(a \leq 4.6 \cdot 10^{-116}\right) \land \left(a \leq 125 \lor \neg \left(a \leq 1.18 \cdot 10^{+57}\right)\right):\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.66 \cdot 10^{+153} \lor \neg \left(a \leq -1.35 \cdot 10^{+25}\right) \land \left(a \leq -0.00032 \lor \neg \left(a \leq 2.45 \cdot 10^{+59}\right)\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.66e153 or -1.35e25 < a < -3.20000000000000026e-4 or 2.45000000000000004e59 < a

    1. Initial program 93.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.1%

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

    if -1.66e153 < a < -1.35e25 or -3.20000000000000026e-4 < a < 2.45000000000000004e59

    1. Initial program 97.6%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 81.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.66 \cdot 10^{+153} \lor \neg \left(a \leq -1.35 \cdot 10^{+25}\right) \land \left(a \leq -0.00032 \lor \neg \left(a \leq 2.45 \cdot 10^{+59}\right)\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 82.3% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.59999999999999968e62 or 6.20000000000000006e84 < t

    1. Initial program 95.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 88.7%

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

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

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

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

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

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

    if -4.59999999999999968e62 < t < 8.40000000000000008e-130

    1. Initial program 98.1%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 91.4%

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

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

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

    if 8.40000000000000008e-130 < t < 6.20000000000000006e84

    1. Initial program 94.0%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.4%

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(\frac{1}{a} \cdot y\right)} \]
      4. associate-/r/88.1%

        \[\leadsto x + z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      5. clear-num88.2%

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

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

Alternative 12: 93.6% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < 5.00000000000000009e150

    1. Initial program 97.0%

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

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

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

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

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

    if 5.00000000000000009e150 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 93.7%

      \[x + \frac{y \cdot \left(z - t\right)}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.2%

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

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

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

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

Alternative 13: 95.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.99999999999999994e-160

    1. Initial program 98.0%

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

    if 4.99999999999999994e-160 < z

    1. Initial program 93.7%

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

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

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

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

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

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

Alternative 14: 96.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.25e-74

    1. Initial program 97.8%

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

    if 1.25e-74 < y

    1. Initial program 92.4%

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

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

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

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

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

Alternative 15: 38.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 96.2%

    \[x + \frac{y \cdot \left(z - t\right)}{a} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 39.2%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

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

  :alt
  (if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))

  (+ x (/ (* y (- z t)) a)))