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

Percentage Accurate: 93.8% → 99.1%
Time: 10.6s
Alternatives: 14
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.8% 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.1% accurate, 0.3× speedup?

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

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

\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)) < -5.00000000000000008e115 or 1.00000000000000006e258 < (*.f64 y (-.f64 z t))

    1. Initial program 77.9%

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

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

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

    if -5.00000000000000008e115 < (*.f64 y (-.f64 z t)) < 1.00000000000000006e258

    1. Initial program 99.9%

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

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

Alternative 2: 48.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a}\\ \mathbf{if}\;t \leq -6.5 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-49}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-193}:\\ \;\;\;\;\frac{y \cdot z}{-a}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-271}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 11:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y a))))
   (if (<= t -6.5e+137)
     t_1
     (if (<= t -8.5e-49)
       x
       (if (<= t -7.2e-193)
         (/ (* y z) (- a))
         (if (<= t 3.6e-271)
           x
           (if (<= t 11.0) (* z (/ y (- a))) (if (<= t 1.02e+117) x t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / a);
	double tmp;
	if (t <= -6.5e+137) {
		tmp = t_1;
	} else if (t <= -8.5e-49) {
		tmp = x;
	} else if (t <= -7.2e-193) {
		tmp = (y * z) / -a;
	} else if (t <= 3.6e-271) {
		tmp = x;
	} else if (t <= 11.0) {
		tmp = z * (y / -a);
	} else if (t <= 1.02e+117) {
		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 = t * (y / a)
    if (t <= (-6.5d+137)) then
        tmp = t_1
    else if (t <= (-8.5d-49)) then
        tmp = x
    else if (t <= (-7.2d-193)) then
        tmp = (y * z) / -a
    else if (t <= 3.6d-271) then
        tmp = x
    else if (t <= 11.0d0) then
        tmp = z * (y / -a)
    else if (t <= 1.02d+117) 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 = t * (y / a);
	double tmp;
	if (t <= -6.5e+137) {
		tmp = t_1;
	} else if (t <= -8.5e-49) {
		tmp = x;
	} else if (t <= -7.2e-193) {
		tmp = (y * z) / -a;
	} else if (t <= 3.6e-271) {
		tmp = x;
	} else if (t <= 11.0) {
		tmp = z * (y / -a);
	} else if (t <= 1.02e+117) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / a)
	tmp = 0
	if t <= -6.5e+137:
		tmp = t_1
	elif t <= -8.5e-49:
		tmp = x
	elif t <= -7.2e-193:
		tmp = (y * z) / -a
	elif t <= 3.6e-271:
		tmp = x
	elif t <= 11.0:
		tmp = z * (y / -a)
	elif t <= 1.02e+117:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (t <= -6.5e+137)
		tmp = t_1;
	elseif (t <= -8.5e-49)
		tmp = x;
	elseif (t <= -7.2e-193)
		tmp = Float64(Float64(y * z) / Float64(-a));
	elseif (t <= 3.6e-271)
		tmp = x;
	elseif (t <= 11.0)
		tmp = Float64(z * Float64(y / Float64(-a)));
	elseif (t <= 1.02e+117)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / a);
	tmp = 0.0;
	if (t <= -6.5e+137)
		tmp = t_1;
	elseif (t <= -8.5e-49)
		tmp = x;
	elseif (t <= -7.2e-193)
		tmp = (y * z) / -a;
	elseif (t <= 3.6e-271)
		tmp = x;
	elseif (t <= 11.0)
		tmp = z * (y / -a);
	elseif (t <= 1.02e+117)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+137], t$95$1, If[LessEqual[t, -8.5e-49], x, If[LessEqual[t, -7.2e-193], N[(N[(y * z), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[t, 3.6e-271], x, If[LessEqual[t, 11.0], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+117], x, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -8.5 \cdot 10^{-49}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-271}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 11:\\
\;\;\;\;z \cdot \frac{y}{-a}\\

\mathbf{elif}\;t \leq 1.02 \cdot 10^{+117}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.5000000000000002e137 or 1.02e117 < t

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

    if -6.5000000000000002e137 < t < -8.50000000000000069e-49 or -7.1999999999999998e-193 < t < 3.5999999999999998e-271 or 11 < t < 1.02e117

    1. Initial program 91.9%

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

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

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

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

    if -8.50000000000000069e-49 < t < -7.1999999999999998e-193

    1. Initial program 99.8%

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

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    7. Taylor expanded in z around inf 62.6%

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

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

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

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

      \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{z}{a}} \]
    10. Step-by-step derivation
      1. distribute-lft-neg-out50.4%

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

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

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

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

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

    if 3.5999999999999998e-271 < t < 11

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+137}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-49}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-193}:\\ \;\;\;\;\frac{y \cdot z}{-a}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-271}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 11:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{-a}\\ t_2 := t \cdot \frac{y}{a}\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{+141}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-49}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-195}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-271}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 42:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (/ y (- a)))) (t_2 (* t (/ y a))))
   (if (<= t -5.2e+141)
     t_2
     (if (<= t -9e-49)
       x
       (if (<= t -6e-195)
         t_1
         (if (<= t 2.5e-271)
           x
           (if (<= t 42.0) t_1 (if (<= t 1.2e+117) x t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (t <= -5.2e+141) {
		tmp = t_2;
	} else if (t <= -9e-49) {
		tmp = x;
	} else if (t <= -6e-195) {
		tmp = t_1;
	} else if (t <= 2.5e-271) {
		tmp = x;
	} else if (t <= 42.0) {
		tmp = t_1;
	} else if (t <= 1.2e+117) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * (y / -a)
    t_2 = t * (y / a)
    if (t <= (-5.2d+141)) then
        tmp = t_2
    else if (t <= (-9d-49)) then
        tmp = x
    else if (t <= (-6d-195)) then
        tmp = t_1
    else if (t <= 2.5d-271) then
        tmp = x
    else if (t <= 42.0d0) then
        tmp = t_1
    else if (t <= 1.2d+117) then
        tmp = x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (t <= -5.2e+141) {
		tmp = t_2;
	} else if (t <= -9e-49) {
		tmp = x;
	} else if (t <= -6e-195) {
		tmp = t_1;
	} else if (t <= 2.5e-271) {
		tmp = x;
	} else if (t <= 42.0) {
		tmp = t_1;
	} else if (t <= 1.2e+117) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (y / -a)
	t_2 = t * (y / a)
	tmp = 0
	if t <= -5.2e+141:
		tmp = t_2
	elif t <= -9e-49:
		tmp = x
	elif t <= -6e-195:
		tmp = t_1
	elif t <= 2.5e-271:
		tmp = x
	elif t <= 42.0:
		tmp = t_1
	elif t <= 1.2e+117:
		tmp = x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(y / Float64(-a)))
	t_2 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (t <= -5.2e+141)
		tmp = t_2;
	elseif (t <= -9e-49)
		tmp = x;
	elseif (t <= -6e-195)
		tmp = t_1;
	elseif (t <= 2.5e-271)
		tmp = x;
	elseif (t <= 42.0)
		tmp = t_1;
	elseif (t <= 1.2e+117)
		tmp = x;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (y / -a);
	t_2 = t * (y / a);
	tmp = 0.0;
	if (t <= -5.2e+141)
		tmp = t_2;
	elseif (t <= -9e-49)
		tmp = x;
	elseif (t <= -6e-195)
		tmp = t_1;
	elseif (t <= 2.5e-271)
		tmp = x;
	elseif (t <= 42.0)
		tmp = t_1;
	elseif (t <= 1.2e+117)
		tmp = x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+141], t$95$2, If[LessEqual[t, -9e-49], x, If[LessEqual[t, -6e-195], t$95$1, If[LessEqual[t, 2.5e-271], x, If[LessEqual[t, 42.0], t$95$1, If[LessEqual[t, 1.2e+117], x, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -9 \cdot 10^{-49}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -6 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-271}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 42:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{+117}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.1999999999999999e141 or 1.1999999999999999e117 < t

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

    if -5.1999999999999999e141 < t < -9.0000000000000004e-49 or -6e-195 < t < 2.5000000000000001e-271 or 42 < t < 1.1999999999999999e117

    1. Initial program 91.9%

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

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

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

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

    if -9.0000000000000004e-49 < t < -6e-195 or 2.5000000000000001e-271 < t < 42

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+141}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-49}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-195}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-271}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 42:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{-a}\\ t_2 := t \cdot \frac{y}{a}\\ \mathbf{if}\;t \leq -8.8 \cdot 10^{+139}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-192}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 30:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ z (- a)))) (t_2 (* t (/ y a))))
   (if (<= t -8.8e+139)
     t_2
     (if (<= t -1e-48)
       x
       (if (<= t -2.3e-192)
         t_1
         (if (<= t 3.7e-179)
           x
           (if (<= t 30.0) t_1 (if (<= t 1.02e+117) x t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (t <= -8.8e+139) {
		tmp = t_2;
	} else if (t <= -1e-48) {
		tmp = x;
	} else if (t <= -2.3e-192) {
		tmp = t_1;
	} else if (t <= 3.7e-179) {
		tmp = x;
	} else if (t <= 30.0) {
		tmp = t_1;
	} else if (t <= 1.02e+117) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (z / -a)
    t_2 = t * (y / a)
    if (t <= (-8.8d+139)) then
        tmp = t_2
    else if (t <= (-1d-48)) then
        tmp = x
    else if (t <= (-2.3d-192)) then
        tmp = t_1
    else if (t <= 3.7d-179) then
        tmp = x
    else if (t <= 30.0d0) then
        tmp = t_1
    else if (t <= 1.02d+117) then
        tmp = x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (z / -a);
	double t_2 = t * (y / a);
	double tmp;
	if (t <= -8.8e+139) {
		tmp = t_2;
	} else if (t <= -1e-48) {
		tmp = x;
	} else if (t <= -2.3e-192) {
		tmp = t_1;
	} else if (t <= 3.7e-179) {
		tmp = x;
	} else if (t <= 30.0) {
		tmp = t_1;
	} else if (t <= 1.02e+117) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / -a)
	t_2 = t * (y / a)
	tmp = 0
	if t <= -8.8e+139:
		tmp = t_2
	elif t <= -1e-48:
		tmp = x
	elif t <= -2.3e-192:
		tmp = t_1
	elif t <= 3.7e-179:
		tmp = x
	elif t <= 30.0:
		tmp = t_1
	elif t <= 1.02e+117:
		tmp = x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / Float64(-a)))
	t_2 = Float64(t * Float64(y / a))
	tmp = 0.0
	if (t <= -8.8e+139)
		tmp = t_2;
	elseif (t <= -1e-48)
		tmp = x;
	elseif (t <= -2.3e-192)
		tmp = t_1;
	elseif (t <= 3.7e-179)
		tmp = x;
	elseif (t <= 30.0)
		tmp = t_1;
	elseif (t <= 1.02e+117)
		tmp = x;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (z / -a);
	t_2 = t * (y / a);
	tmp = 0.0;
	if (t <= -8.8e+139)
		tmp = t_2;
	elseif (t <= -1e-48)
		tmp = x;
	elseif (t <= -2.3e-192)
		tmp = t_1;
	elseif (t <= 3.7e-179)
		tmp = x;
	elseif (t <= 30.0)
		tmp = t_1;
	elseif (t <= 1.02e+117)
		tmp = x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+139], t$95$2, If[LessEqual[t, -1e-48], x, If[LessEqual[t, -2.3e-192], t$95$1, If[LessEqual[t, 3.7e-179], x, If[LessEqual[t, 30.0], t$95$1, If[LessEqual[t, 1.02e+117], x, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1 \cdot 10^{-48}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.7 \cdot 10^{-179}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 30:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.02 \cdot 10^{+117}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.7999999999999998e139 or 1.02e117 < t

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

    if -8.7999999999999998e139 < t < -9.9999999999999997e-49 or -2.30000000000000018e-192 < t < 3.6999999999999999e-179 or 30 < t < 1.02e117

    1. Initial program 93.0%

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

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

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

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

    if -9.9999999999999997e-49 < t < -2.30000000000000018e-192 or 3.6999999999999999e-179 < t < 30

    1. Initial program 97.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 inf 62.8%

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

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

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

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

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

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

Alternative 5: 81.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -0.019 \lor \neg \left(z \leq 2.6 \cdot 10^{-10}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8e199

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      12. distribute-rgt-out--59.2%

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

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

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{y \cdot \frac{z}{a}} \]
      15. associate-*r/68.5%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{\frac{y \cdot z}{a}} \]
      16. associate-*r/68.5%

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      18. *-commutative78.4%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      19. distribute-rgt-out--89.1%

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

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

    if -3.8e199 < z < -0.0189999999999999995 or 2.59999999999999981e-10 < z

    1. Initial program 91.5%

      \[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 81.8%

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

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

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

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

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

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

    if -0.0189999999999999995 < z < 2.59999999999999981e-10

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-8} \lor \neg \left(z \leq 1.85 \cdot 10^{-10}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.20000000000000007e199

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      12. distribute-rgt-out--59.2%

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

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

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{y \cdot \frac{z}{a}} \]
      15. associate-*r/68.5%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{\frac{y \cdot z}{a}} \]
      16. associate-*r/68.5%

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      18. *-commutative78.4%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      19. distribute-rgt-out--89.1%

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

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

    if -1.20000000000000007e199 < z < -4.9999999999999998e-8 or 1.85000000000000007e-10 < z

    1. Initial program 91.5%

      \[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 81.8%

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

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

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

    if -4.9999999999999998e-8 < z < 1.85000000000000007e-10

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+42} \lor \neg \left(x \leq 4.1 \cdot 10^{-85}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7999999999999999e42 or 4.09999999999999994e-85 < x

    1. Initial program 93.0%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. associate-*l/82.0%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    9. Simplified82.0%

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

    if -2.7999999999999999e42 < x < 4.09999999999999994e-85

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      12. distribute-rgt-out--77.1%

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

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

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{y \cdot \frac{z}{a}} \]
      15. associate-*r/76.2%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{\frac{y \cdot z}{a}} \]
      16. associate-*r/76.2%

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      19. distribute-rgt-out--84.1%

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

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

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

Alternative 8: 67.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-39} \lor \neg \left(y \leq 5 \cdot 10^{-199}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.50000000000000014e-39 or 4.9999999999999996e-199 < y

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      12. distribute-rgt-out--70.0%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a}} - \frac{z}{a} \cdot y \]
      14. *-commutative63.6%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{y \cdot \frac{z}{a}} \]
      15. associate-*r/62.5%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{\frac{y \cdot z}{a}} \]
      16. associate-*r/63.5%

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      19. distribute-rgt-out--75.0%

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

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

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

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

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

    if -1.50000000000000014e-39 < y < 4.9999999999999996e-199

    1. Initial program 99.9%

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

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

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

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

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

Alternative 9: 83.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0064:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\

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

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


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

    1. Initial program 93.3%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{z \cdot \left(y \cdot \frac{1}{a}\right)} \]
      2. div-inv89.1%

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

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

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

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

    if -0.00640000000000000031 < z < 1.35e-10

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e-10 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

Alternative 10: 67.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+143}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.5999999999999999e143 or 2.4e-14 < x

    1. Initial program 92.7%

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

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

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

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

    if -3.5999999999999999e143 < x < 2.4e-14

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      12. distribute-rgt-out--73.4%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a}} - \frac{z}{a} \cdot y \]
      14. *-commutative70.2%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{y \cdot \frac{z}{a}} \]
      15. associate-*r/72.5%

        \[\leadsto \frac{t \cdot y}{a} - \color{blue}{\frac{y \cdot z}{a}} \]
      16. associate-*r/73.7%

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      19. distribute-rgt-out--81.4%

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

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

Alternative 11: 48.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{+143}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{-24}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.40000000000000033e143 or 1.24999999999999995e-24 < x

    1. Initial program 92.7%

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

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

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

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

    if -6.40000000000000033e143 < x < 1.24999999999999995e-24

    1. Initial program 90.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    9. Applied egg-rr46.0%

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

Alternative 12: 93.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 13: 93.2% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 14: 40.6% 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 91.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. 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 2024085 
(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)))