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

Percentage Accurate: 93.4% → 97.1%
Time: 11.6s
Alternatives: 11
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 11 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: 97.1% 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.1%

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

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

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

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

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

Alternative 2: 95.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z - t\right) \cdot y\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+276} \lor \neg \left(t_1 \leq \infty\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 -5e+276) (not (<= t_1 INFINITY)))
     (* 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 <= -5e+276) || !(t_1 <= ((double) INFINITY))) {
		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 <= -5e+276) || !(t_1 <= Double.POSITIVE_INFINITY)) {
		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 <= -5e+276) or not (t_1 <= math.inf):
		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 <= -5e+276) || !(t_1 <= Inf))
		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 <= -5e+276) || ~((t_1 <= Inf)))
		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, -5e+276], N[Not[LessEqual[t$95$1, Infinity]], $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 -5 \cdot 10^{+276} \lor \neg \left(t_1 \leq \infty\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)) < -5.00000000000000001e276 or +inf.0 < (*.f64 y (-.f64 z t))

    1. Initial program 58.3%

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

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

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

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

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

    if -5.00000000000000001e276 < (*.f64 y (-.f64 z t)) < +inf.0

    1. Initial program 96.1%

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

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

Alternative 3: 67.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.4 \cdot 10^{-194} \lor \neg \left(y \leq 6 \cdot 10^{-87} \lor \neg \left(y \leq 2.4 \cdot 10^{-29}\right) \land y \leq 7.6 \cdot 10^{-19}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.4000000000000005e-194 or 6.00000000000000033e-87 < y < 2.39999999999999992e-29 or 7.6e-19 < y

    1. Initial program 89.9%

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

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

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

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

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

    if -9.4000000000000005e-194 < y < 6.00000000000000033e-87 or 2.39999999999999992e-29 < y < 7.6e-19

    1. Initial program 98.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.4 \cdot 10^{-194} \lor \neg \left(y \leq 6 \cdot 10^{-87} \lor \neg \left(y \leq 2.4 \cdot 10^{-29}\right) \land y \leq 7.6 \cdot 10^{-19}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 47.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -9.4 \cdot 10^{-95} \lor \neg \left(a \leq -6.5 \cdot 10^{-131}\right) \land a \leq 0.00055:\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.00000000000000004e73 or -9.3999999999999995e-95 < a < -6.5000000000000002e-131 or 5.50000000000000033e-4 < a

    1. Initial program 86.8%

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

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

    if -7.00000000000000004e73 < a < -9.3999999999999995e-95 or -6.5000000000000002e-131 < a < 5.50000000000000033e-4

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{a} \cdot y} + x \]
      3. fma-def67.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{a}, y, x\right)} \]
    8. Applied egg-rr67.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{a}, y, x\right)} \]
    9. Taylor expanded in z around inf 58.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+73}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -9.4 \cdot 10^{-95} \lor \neg \left(a \leq -6.5 \cdot 10^{-131}\right) \land a \leq 0.00055:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 50.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 1.65 \cdot 10^{-247}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.2000000000000003e73 or 3.9e-10 < a

    1. Initial program 85.8%

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

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

    if -4.2000000000000003e73 < a < 1.64999999999999986e-247 or 2.7e-159 < a < 3.9e-10

    1. Initial program 98.1%

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

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

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

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

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

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

    if 1.64999999999999986e-247 < a < 2.7e-159

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.2 \cdot 10^{+73}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-247}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-159}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-10}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 84.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

    if -1.95000000000000011e-84 < z < 1.17999999999999999e-35

    1. Initial program 93.7%

      \[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/92.0%

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

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

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

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

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

    if 1.17999999999999999e-35 < z

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{-84}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{-35}:\\ \;\;\;\;x - t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \]

Alternative 7: 83.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

    if -2.0000000000000001e-84 < z < 9.99999999999999928e-35

    1. Initial program 93.7%

      \[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/92.0%

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

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

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

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

    if 9.99999999999999928e-35 < z

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

Alternative 8: 84.1% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

    if -2.0000000000000001e-84 < z < 3.60000000000000032e-36

    1. Initial program 93.7%

      \[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/92.0%

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

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

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

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

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

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

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

    if 3.60000000000000032e-36 < z

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-84}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-36}:\\ \;\;\;\;x - \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \]

Alternative 9: 50.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.0999999999999999e74 or 5.39999999999999961e-12 < a

    1. Initial program 85.8%

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

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

    if -2.0999999999999999e74 < a < 5.39999999999999961e-12

    1. Initial program 98.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+74}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-12}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 74.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.4 \cdot 10^{+184}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.39999999999999966e184

    1. Initial program 92.9%

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

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

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

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

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

    if 6.39999999999999966e184 < t

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\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-out74.8%

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    10. Simplified74.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.4 \cdot 10^{+184}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \end{array} \]

Alternative 11: 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 92.1%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification37.4%

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