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

Percentage Accurate: 93.2% → 97.6%
Time: 13.6s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 93.2% 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.6% accurate, 1.0× speedup?

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

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

    \[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. Add Preprocessing
  5. Taylor expanded in y around 0 91.8%

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

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

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

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

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

Alternative 2: 50.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -1.9 \cdot 10^{+128}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq -5.3 \cdot 10^{+14} \lor \neg \left(y \leq -2.4 \cdot 10^{-45}\right) \land y \leq 6500000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.25000000000000009e206 or -5.3e14 < y < -2.3999999999999999e-45 or 6.5e9 < y

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg57.5%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg57.5%

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

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

    if -2.25000000000000009e206 < y < -1.89999999999999995e128

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr69.4%

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

    if -1.89999999999999995e128 < y < -5.3e14 or -2.3999999999999999e-45 < y < 6.5e9

    1. Initial program 97.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+206}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+128}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq -5.3 \cdot 10^{+14} \lor \neg \left(y \leq -2.4 \cdot 10^{-45}\right) \land y \leq 6500000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq -19500000000000 \lor \neg \left(y \leq -2.05 \cdot 10^{-45}\right) \land y \leq 42000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.29999999999999994e206

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{-z}}} \]
    10. Simplified66.9%

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

    if -1.29999999999999994e206 < y < -7.4999999999999996e127

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr69.4%

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

    if -7.4999999999999996e127 < y < -1.95e13 or -2.05e-45 < y < 4.2e7

    1. Initial program 97.1%

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

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

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

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

    if -1.95e13 < y < -2.05e-45 or 4.2e7 < y

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg55.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+206}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+127}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq -19500000000000 \lor \neg \left(y \leq -2.05 \cdot 10^{-45}\right) \land y \leq 42000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -2.35 \cdot 10^{+14} \lor \neg \left(y \leq -7 \cdot 10^{-46}\right) \land y \leq 38000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.95e206

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{-z}}} \]
    10. Simplified66.9%

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

    if -2.95e206 < y < -2.70000000000000001e128

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr69.4%

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

    if -2.70000000000000001e128 < y < -2.35e14 or -7.0000000000000004e-46 < y < 3.8e7

    1. Initial program 97.1%

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

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

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

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

    if -2.35e14 < y < -7.0000000000000004e-46 or 3.8e7 < y

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg55.4%

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

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt26.4%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      2. sqrt-unprod22.1%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      3. sqr-neg22.1%

        \[\leadsto z \cdot \frac{y}{\sqrt{\color{blue}{a \cdot a}}} \]
      4. sqrt-unprod2.5%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. add-sqr-sqrt4.2%

        \[\leadsto z \cdot \frac{y}{\color{blue}{a}} \]
      6. clear-num4.2%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
      8. frac-2neg4.2%

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{y}}} \]
      9. distribute-frac-neg4.2%

        \[\leadsto \frac{-z}{\color{blue}{\frac{-a}{y}}} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{y}} \]
      11. sqrt-unprod26.1%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{y}} \]
      12. sqr-neg26.1%

        \[\leadsto \frac{-z}{\frac{\sqrt{\color{blue}{a \cdot a}}}{y}} \]
      13. sqrt-unprod28.9%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{y}} \]
      14. add-sqr-sqrt56.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{+206}:\\ \;\;\;\;\frac{y}{\frac{a}{-z}}\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+128}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq -2.35 \cdot 10^{+14} \lor \neg \left(y \leq -7 \cdot 10^{-46}\right) \land y \leq 38000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127} \lor \neg \left(y \leq -7.2 \cdot 10^{+115}\right) \land \left(y \leq -1.85 \cdot 10^{-128} \lor \neg \left(y \leq 3.2 \cdot 10^{-50}\right)\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.0000000000000004e127 or -7.2000000000000001e115 < y < -1.85e-128 or 3.2e-50 < y

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000004e127 < y < -7.2000000000000001e115 or -1.85e-128 < y < 3.2e-50

    1. Initial program 98.8%

      \[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. Add Preprocessing
    5. Taylor expanded in x around inf 70.2%

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

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

Alternative 6: 84.0% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.0999999999999997e-39

    1. Initial program 90.0%

      \[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. Add Preprocessing
    5. Taylor expanded in z around 0 74.8%

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

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity74.8%

        \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
      4. +-commutative74.8%

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

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

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

    if -3.0999999999999997e-39 < t < 2.64999999999999993e57

    1. Initial program 91.9%

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

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

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

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

    if 2.64999999999999993e57 < t

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

Alternative 7: 76.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.19999999999999933e25 or 6.9999999999999996e-56 < x

    1. Initial program 91.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity74.0%

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

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

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

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

    if -8.19999999999999933e25 < x < 6.9999999999999996e-56

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 83.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5e7 or 1.19999999999999991e91 < z

    1. Initial program 88.1%

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

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

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

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

    if -6.5e7 < z < 1.19999999999999991e91

    1. Initial program 95.1%

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

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

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

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

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity80.0%

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

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

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

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

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

Alternative 9: 50.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+127} \lor \neg \left(y \leq 320000000\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.0000000000000004e127 or 3.2e8 < y

    1. Initial program 83.9%

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

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

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

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

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

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

    if -5.0000000000000004e127 < y < 3.2e8

    1. Initial program 97.4%

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

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

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

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

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

Alternative 10: 50.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+128} \lor \neg \left(y \leq 2500000000\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9e128 or 2.5e9 < y

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

    if -2.9e128 < y < 2.5e9

    1. Initial program 97.4%

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

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

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

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

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

Alternative 11: 97.5% accurate, 1.0× speedup?

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

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

    \[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. Add Preprocessing
  5. Final simplification97.4%

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

Alternative 12: 39.5% accurate, 9.0× speedup?

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

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

    \[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. Add Preprocessing
  5. Taylor expanded in x around inf 39.1%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification39.1%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.1% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024014 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :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)))