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

Percentage Accurate: 92.7% → 99.0%
Time: 10.0s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 92.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: 99.0% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (-.f64 z t)) < -inf.0 or 1e108 < (*.f64 y (-.f64 z t))

    1. Initial program 85.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. Step-by-step derivation
      1. clear-num99.8%

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

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

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

    if -inf.0 < (*.f64 y (-.f64 z t)) < 1e108

    1. Initial program 99.3%

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

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

Alternative 2: 74.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{t}{a}\\ \mathbf{if}\;z \leq -5.3 \cdot 10^{+141}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{+57}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+125}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ t a)))))
   (if (<= z -5.3e+141)
     (/ (- z) (/ a y))
     (if (<= z -3.2e+86)
       t_1
       (if (<= z -5.3e+57)
         (* (/ z a) (- y))
         (if (<= z 3.6e+125) t_1 (* (- z) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (t / a));
	double tmp;
	if (z <= -5.3e+141) {
		tmp = -z / (a / y);
	} else if (z <= -3.2e+86) {
		tmp = t_1;
	} else if (z <= -5.3e+57) {
		tmp = (z / a) * -y;
	} else if (z <= 3.6e+125) {
		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 = x + (y * (t / a))
    if (z <= (-5.3d+141)) then
        tmp = -z / (a / y)
    else if (z <= (-3.2d+86)) then
        tmp = t_1
    else if (z <= (-5.3d+57)) then
        tmp = (z / a) * -y
    else if (z <= 3.6d+125) 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 = x + (y * (t / a));
	double tmp;
	if (z <= -5.3e+141) {
		tmp = -z / (a / y);
	} else if (z <= -3.2e+86) {
		tmp = t_1;
	} else if (z <= -5.3e+57) {
		tmp = (z / a) * -y;
	} else if (z <= 3.6e+125) {
		tmp = t_1;
	} else {
		tmp = -z * (y / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (t / a))
	tmp = 0
	if z <= -5.3e+141:
		tmp = -z / (a / y)
	elif z <= -3.2e+86:
		tmp = t_1
	elif z <= -5.3e+57:
		tmp = (z / a) * -y
	elif z <= 3.6e+125:
		tmp = t_1
	else:
		tmp = -z * (y / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(t / a)))
	tmp = 0.0
	if (z <= -5.3e+141)
		tmp = Float64(Float64(-z) / Float64(a / y));
	elseif (z <= -3.2e+86)
		tmp = t_1;
	elseif (z <= -5.3e+57)
		tmp = Float64(Float64(z / a) * Float64(-y));
	elseif (z <= 3.6e+125)
		tmp = t_1;
	else
		tmp = Float64(Float64(-z) * Float64(y / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (t / a));
	tmp = 0.0;
	if (z <= -5.3e+141)
		tmp = -z / (a / y);
	elseif (z <= -3.2e+86)
		tmp = t_1;
	elseif (z <= -5.3e+57)
		tmp = (z / a) * -y;
	elseif (z <= 3.6e+125)
		tmp = t_1;
	else
		tmp = -z * (y / a);
	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[z, -5.3e+141], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e+86], t$95$1, If[LessEqual[z, -5.3e+57], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[z, 3.6e+125], t$95$1, N[((-z) * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.3e141

    1. Initial program 94.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/94.0%

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

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 66.3%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-158.4%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{a} \]
    12. Simplified58.4%

      \[\leadsto \color{blue}{y \cdot \frac{-z}{a}} \]
    13. Step-by-step derivation
      1. distribute-frac-neg58.4%

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

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
      4. /-rgt-identity58.4%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{1}} \cdot y \]
      5. associate-/r/58.3%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{\frac{1}{y}}} \]
      6. associate-/l/66.4%

        \[\leadsto -\color{blue}{\frac{z}{\frac{1}{y} \cdot a}} \]
      7. distribute-neg-frac266.4%

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

        \[\leadsto \frac{z}{-\color{blue}{\frac{1 \cdot a}{y}}} \]
      9. *-un-lft-identity66.5%

        \[\leadsto \frac{z}{-\frac{\color{blue}{a}}{y}} \]
    14. Applied egg-rr66.5%

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

    if -5.3e141 < z < -3.2e86 or -5.29999999999999986e57 < z < 3.6000000000000003e125

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e86 < z < -5.29999999999999986e57

    1. Initial program 72.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/85.7%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    9. Applied egg-rr85.7%

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 58.1%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-185.7%

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

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

    if 3.6000000000000003e125 < z

    1. Initial program 89.4%

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

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

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

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

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

      \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    8. Taylor expanded in x around 0 60.5%

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

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

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

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

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

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

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

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

Alternative 3: 75.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.39999999999999974e142

    1. Initial program 94.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/94.0%

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

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 66.3%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-158.4%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{a} \]
    12. Simplified58.4%

      \[\leadsto \color{blue}{y \cdot \frac{-z}{a}} \]
    13. Step-by-step derivation
      1. distribute-frac-neg58.4%

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

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
      4. /-rgt-identity58.4%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{1}} \cdot y \]
      5. associate-/r/58.3%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{\frac{1}{y}}} \]
      6. associate-/l/66.4%

        \[\leadsto -\color{blue}{\frac{z}{\frac{1}{y} \cdot a}} \]
      7. distribute-neg-frac266.4%

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

        \[\leadsto \frac{z}{-\color{blue}{\frac{1 \cdot a}{y}}} \]
      9. *-un-lft-identity66.5%

        \[\leadsto \frac{z}{-\frac{\color{blue}{a}}{y}} \]
    14. Applied egg-rr66.5%

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

    if -4.39999999999999974e142 < z < -1.6999999999999999e86 or -1.5000000000000001e58 < z < 2.60000000000000003e125

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e86 < z < -1.5000000000000001e58

    1. Initial program 72.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/85.7%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    9. Applied egg-rr85.7%

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 58.1%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-185.7%

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

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

    if 2.60000000000000003e125 < z

    1. Initial program 89.4%

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

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

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

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

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

      \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    8. Taylor expanded in x around 0 60.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+142}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+86}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+125}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.8% accurate, 0.3× speedup?

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

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

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

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

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

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


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

    1. Initial program 94.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/94.0%

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

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 66.3%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-158.4%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{a} \]
    12. Simplified58.4%

      \[\leadsto \color{blue}{y \cdot \frac{-z}{a}} \]
    13. Step-by-step derivation
      1. distribute-frac-neg58.4%

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

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
      4. /-rgt-identity58.4%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{1}} \cdot y \]
      5. associate-/r/58.3%

        \[\leadsto -\color{blue}{\frac{\frac{z}{a}}{\frac{1}{y}}} \]
      6. associate-/l/66.4%

        \[\leadsto -\color{blue}{\frac{z}{\frac{1}{y} \cdot a}} \]
      7. distribute-neg-frac266.4%

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

        \[\leadsto \frac{z}{-\color{blue}{\frac{1 \cdot a}{y}}} \]
      9. *-un-lft-identity66.5%

        \[\leadsto \frac{z}{-\frac{\color{blue}{a}}{y}} \]
    14. Applied egg-rr66.5%

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

    if -5.4000000000000002e141 < z < -1.80000000000000003e86

    1. Initial program 78.3%

      \[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 0 68.2%

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

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

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

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

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

      \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000003e86 < z < -1.5199999999999999e58

    1. Initial program 72.4%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/85.7%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    9. Applied egg-rr85.7%

      \[\leadsto x - \color{blue}{\frac{z}{\frac{a}{y}}} \]
    10. Taylor expanded in x around 0 58.1%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{a}} \]
      6. neg-mul-185.7%

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

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

    if -1.5199999999999999e58 < z < 3.3999999999999999e125

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

    if 3.3999999999999999e125 < z

    1. Initial program 89.4%

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

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

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

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

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

      \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    8. Taylor expanded in x around 0 60.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+141}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+86}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{+58}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+125}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 82.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+22} \lor \neg \left(t \leq 7.2 \cdot 10^{-12}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.90000000000000021e22 or 7.2e-12 < t

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

    if -3.90000000000000021e22 < t < 7.2e-12

    1. Initial program 95.6%

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

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

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

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

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

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

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

Alternative 6: 83.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+23} \lor \neg \left(t \leq 9.5 \cdot 10^{-13}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.19999999999999992e23 or 9.49999999999999991e-13 < t

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

    if -8.19999999999999992e23 < t < 9.49999999999999991e-13

    1. Initial program 95.6%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/91.8%

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

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

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

Alternative 7: 86.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+23} \lor \neg \left(t \leq 2.15 \cdot 10^{-12}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.6000000000000001e23 or 2.14999999999999993e-12 < t

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

    if -4.6000000000000001e23 < t < 2.14999999999999993e-12

    1. Initial program 95.6%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot y} \]
      2. associate-/r/91.8%

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

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

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

Alternative 8: 50.9% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.45e20 or 5.2000000000000003e-40 < a

    1. Initial program 91.6%

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

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

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

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

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

      \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
    8. Taylor expanded in x around inf 63.0%

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

    if -1.45e20 < a < 5.2000000000000003e-40

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-40}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 93.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.09999999999999975e90

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

    if -7.09999999999999975e90 < t

    1. Initial program 95.0%

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

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

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

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

Alternative 10: 93.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.62e91

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

    if -1.62e91 < t

    1. Initial program 95.0%

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

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

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

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

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

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

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

Alternative 11: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

    \[\leadsto x - \color{blue}{\frac{y \cdot \left(z - t\right)}{a}} \]
  6. Step-by-step derivation
    1. *-lft-identity95.0%

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

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

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

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

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

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

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

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

Alternative 12: 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 95.0%

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

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

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

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

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

    \[\leadsto x - \color{blue}{y \cdot \frac{z}{a}} \]
  8. Taylor expanded in x around inf 42.8%

    \[\leadsto \color{blue}{x} \]
  9. Final simplification42.8%

    \[\leadsto x \]
  10. Add Preprocessing

Developer target: 99.1% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024055 
(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)))