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

Percentage Accurate: 93.4% → 93.7%
Time: 10.9s
Alternatives: 13
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 13 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.4% 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: 93.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z t) < -2e143

    1. Initial program 98.5%

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

    if -2e143 < (-.f64 z t)

    1. Initial program 96.0%

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

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

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

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

Alternative 2: 49.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := -y \cdot \frac{t}{a}\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{-13}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-277}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{-80}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.7999999999999999e-13 or 5e-80 < a

    1. Initial program 95.0%

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

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

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

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

    if -1.7999999999999999e-13 < a < -1.70000000000000003e-130

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    7. Applied egg-rr74.1%

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

    if -1.70000000000000003e-130 < a < 4.1999999999999999e-277 or 1.35e-236 < a < 5e-80

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if 4.1999999999999999e-277 < a < 1.35e-236

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.8 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-130}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-277}:\\ \;\;\;\;-y \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-236}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-80}:\\ \;\;\;\;-y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 50.3% accurate, 0.6× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -6.4000000000000002e-12 or 5.2000000000000002e-80 < a

    1. Initial program 95.0%

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

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

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

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

    if -6.4000000000000002e-12 < a < -1.75e-130

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    7. Applied egg-rr74.1%

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

    if -1.75e-130 < a < 3.99999999999999988e-277

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999988e-277 < a < 6.99999999999999988e-236

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999988e-236 < a < 5.2000000000000002e-80

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.4 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-130}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{-277}:\\ \;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{-236}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-80}:\\ \;\;\;\;-y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 68.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-108} \lor \neg \left(y \leq 8 \cdot 10^{-114}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25e-108 or 8.0000000000000004e-114 < y

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-108 < y < 8.0000000000000004e-114

    1. Initial program 98.8%

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

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

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

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

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

Alternative 5: 78.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+120} \lor \neg \left(y \leq 44\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.01999999999999997e120 or 44 < y

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{z}{a} + \color{blue}{\left(-\frac{t}{a}\right)}\right) \cdot y \]
      5. sub-neg82.0%

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

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

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

    if -1.01999999999999997e120 < y < 44

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

Alternative 6: 77.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+120} \lor \neg \left(y \leq 230\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.1999999999999997e120 or 230 < y

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{z}{a} + \color{blue}{\left(-\frac{t}{a}\right)}\right) \cdot y \]
      5. sub-neg82.0%

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

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

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

    if -9.1999999999999997e120 < y < 230

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+52} \lor \neg \left(z \leq 8500000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8e52 or 8.5e9 < z

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

    if -1.8e52 < z < 8.5e9

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 86.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+54} \lor \neg \left(z \leq 14500000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8500000000000001e54 or 1.45e10 < z

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001e54 < z < 1.45e10

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 85.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+60} \lor \neg \left(z \leq 20000000000\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.50000000000000064e60 or 2e10 < z

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

    if -8.50000000000000064e60 < z < 2e10

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot t}{a}} \]
      2. mul-1-neg88.4%

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

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

        \[\leadsto x + \color{blue}{\left(-\frac{y}{a}\right) \cdot t} \]
      5. cancel-sign-sub-inv88.5%

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

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

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

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

Alternative 10: 50.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-13}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.5000000000000001e-13 or 9.59999999999999947e-154 < a

    1. Initial program 95.3%

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

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

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

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

    if -8.5000000000000001e-13 < a < 9.59999999999999947e-154

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{z}{a} + \color{blue}{\left(-\frac{t}{a}\right)}\right) \cdot y \]
      5. sub-neg79.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    10. Simplified54.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.5 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-154}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 50.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.54999999999999992e-11 or 2.50000000000000004e-156 < a

    1. Initial program 95.3%

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

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

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

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

    if -2.54999999999999992e-11 < a < 2.50000000000000004e-156

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.55 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-156}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 97.0% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 13: 39.9% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\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 2023174 
(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)))