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

Percentage Accurate: 92.9% → 97.3%
Time: 7.7s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 92.9% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a}\\
t_2 := \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{+75}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 79.8%

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -1.99999999999999985e75 or 1.00000000000000003e83 < (/.f64 (*.f64 y (-.f64 z t)) a) < 2e303

    1. Initial program 99.7%

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

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

    if -1.99999999999999985e75 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.00000000000000003e83

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{t}}} \]
    4. Simplified90.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(z - t\right) \cdot y}{a} \leq -\infty:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;\frac{\left(z - t\right) \cdot y}{a} \leq -2 \cdot 10^{+75}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\ \mathbf{elif}\;\frac{\left(z - t\right) \cdot y}{a} \leq 10^{+83}:\\ \;\;\;\;x - \frac{t \cdot y}{a}\\ \mathbf{elif}\;\frac{\left(z - t\right) \cdot y}{a} \leq 2 \cdot 10^{+303}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \end{array} \]

Alternative 3: 98.1% accurate, 0.4× 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 2 \cdot 10^{+286}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t_1}{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 2e+286)))
     (* y (/ (- z t) a))
     (+ x (/ t_1 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 <= 2e+286)) {
		tmp = y * ((z - t) / a);
	} else {
		tmp = x + (t_1 / 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 <= 2e+286)) {
		tmp = y * ((z - t) / a);
	} else {
		tmp = x + (t_1 / 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 <= 2e+286):
		tmp = y * ((z - t) / a)
	else:
		tmp = x + (t_1 / 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 <= 2e+286))
		tmp = Float64(y * Float64(Float64(z - t) / a));
	else
		tmp = Float64(x + Float64(t_1 / 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 <= 2e+286)))
		tmp = y * ((z - t) / a);
	else
		tmp = x + (t_1 / 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, 2e+286]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / 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 2 \cdot 10^{+286}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{t_1}{a}\\


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

    1. Initial program 71.1%

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

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

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

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

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

    if -inf.0 < (*.f64 y (-.f64 z t)) < 2.00000000000000007e286

    1. Initial program 99.9%

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

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

Alternative 4: 50.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-151}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+42}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.2e17 or 3.2999999999999999e42 < z

    1. Initial program 88.3%

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

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

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

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

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

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

    if -5.2e17 < z < -1.14999999999999998e-151 or 1.2800000000000001e-207 < z < 3.2999999999999999e42

    1. Initial program 96.8%

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

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

    if -1.14999999999999998e-151 < z < 1.2800000000000001e-207

    1. Initial program 96.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+17}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-151}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-207}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \end{array} \]

Alternative 5: 68.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9e-68 or 1.2999999999999999e-167 < y

    1. Initial program 89.8%

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

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

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

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

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

    if -2.9e-68 < y < 1.2999999999999999e-167

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{-68} \lor \neg \left(y \leq 1.3 \cdot 10^{-167}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 76.8% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.1499999999999999e92

    1. Initial program 86.6%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
    4. Applied egg-rr68.8%

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

    if -2.1499999999999999e92 < t < 1.02e256

    1. Initial program 94.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative45.0%

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

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

    if 1.02e256 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{+92}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+256}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\ \end{array} \]

Alternative 7: 76.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 86.6%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a} \cdot y} \]
    4. Applied egg-rr68.8%

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

    if -1.3e91 < t < 1.02e256

    1. Initial program 94.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative45.0%

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

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

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

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

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

    if 1.02e256 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+91}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+256}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\ \end{array} \]

Alternative 8: 83.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 89.1%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative61.0%

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

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

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

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

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

    if -1.16e-63 < z < 3.29999999999999973e-51

    1. Initial program 96.2%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{t}}} \]
    4. Simplified92.0%

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

    if 3.29999999999999973e-51 < z

    1. Initial program 92.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{-63}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-51}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \end{array} \]

Alternative 9: 52.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+15} \lor \neg \left(z \leq 4.2 \cdot 10^{+39}\right):\\
\;\;\;\;z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e15 or 4.1999999999999997e39 < z

    1. Initial program 88.3%

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

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

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

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

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

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

    if -1.05e15 < z < 4.1999999999999997e39

    1. Initial program 96.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+15} \lor \neg \left(z \leq 4.2 \cdot 10^{+39}\right):\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 39.8% accurate, 9.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification38.5%

    \[\leadsto x \]

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

  :herbie-target
  (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)))