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

Percentage Accurate: 93.3% → 97.4%
Time: 10.7s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 93.3% 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.4% 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 94.5%

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

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

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

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

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

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

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

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

Alternative 2: 48.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -2.4 \cdot 10^{-308}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.79999999999999993e124

    1. Initial program 89.9%

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

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

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

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

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

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

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

    if -1.79999999999999993e124 < t < -2.40000000000000008e-308

    1. Initial program 96.4%

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

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

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

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

    if -2.40000000000000008e-308 < t < 1.2000000000000001e41

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. associate-/r/58.3%

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

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

      \[\leadsto \color{blue}{\frac{-y}{\frac{a}{z}}} \]
    11. Taylor expanded in y around 0 55.6%

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

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

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

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

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

    if 1.2000000000000001e41 < t

    1. Initial program 94.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+124}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-308}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+41}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-307}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.7000000000000001e129

    1. Initial program 89.9%

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

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

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

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

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

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

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

    if -2.7000000000000001e129 < t < -2.2999999999999999e-307

    1. Initial program 96.4%

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

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

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

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

    if -2.2999999999999999e-307 < t < 1.8999999999999999e38

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

    if 1.8999999999999999e38 < t

    1. Initial program 94.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+129}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-307}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+38}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-8} \lor \neg \left(z \leq 2.2 \cdot 10^{-70}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8999999999999999e-8 or 2.1999999999999999e-70 < z

    1. Initial program 92.9%

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

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

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

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

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

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

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

    if -5.8999999999999999e-8 < z < 2.1999999999999999e-70

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \left(-\color{blue}{t \cdot \frac{y}{a}}\right) \]
      3. distribute-lft-neg-out94.2%

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

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

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

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

Alternative 5: 84.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-8} \lor \neg \left(z \leq 9.8 \cdot 10^{-71}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.6000000000000002e-8 or 9.7999999999999994e-71 < z

    1. Initial program 92.9%

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

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

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

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

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

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

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

    if -4.6000000000000002e-8 < z < 9.7999999999999994e-71

    1. Initial program 96.6%

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

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

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

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

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

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

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

Alternative 6: 77.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{+79} \lor \neg \left(y \leq 1.06 \cdot 10^{+99}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.6000000000000006e79 or 1.05999999999999999e99 < y

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{a} \]
      10. remove-double-neg85.7%

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

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

    if -8.6000000000000006e79 < y < 1.05999999999999999e99

    1. Initial program 98.7%

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

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

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

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

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

Alternative 7: 77.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+76} \lor \neg \left(y \leq 7.2 \cdot 10^{+98}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8e76 or 7.19999999999999962e98 < y

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{a} \]
      10. remove-double-neg85.7%

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

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

    if -4.8e76 < y < 7.19999999999999962e98

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

Alternative 8: 74.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+79} \lor \neg \left(y \leq 6.5 \cdot 10^{+96}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1500000000000002e79 or 6.5e96 < y

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{a} \]
      10. remove-double-neg85.7%

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

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

    if -2.1500000000000002e79 < y < 6.5e96

    1. Initial program 98.7%

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

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

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

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

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

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

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

Alternative 9: 68.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.50000000000000002e-43 or 2.6499999999999999e-124 < y

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{a} \]
      10. remove-double-neg76.6%

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

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

    if -1.50000000000000002e-43 < y < 2.6499999999999999e-124

    1. Initial program 99.0%

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

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

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

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

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

Alternative 10: 77.4% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{a} \]
      10. remove-double-neg75.6%

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

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

    if -3.7999999999999998e127 < t < 5.20000000000000014e45

    1. Initial program 95.2%

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

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

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

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

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

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

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

    if 5.20000000000000014e45 < t

    1. Initial program 94.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - z\right) \cdot y}{a}} \]
    7. Applied egg-rr77.2%

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

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

Alternative 11: 50.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+49} \lor \neg \left(y \leq 4.8 \cdot 10^{+77}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.74999999999999987e49 or 4.7999999999999997e77 < y

    1. Initial program 89.0%

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

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

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

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

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

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

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

    if -1.74999999999999987e49 < y < 4.7999999999999997e77

    1. Initial program 98.6%

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

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

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

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

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

Alternative 12: 50.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 4.4 \cdot 10^{+77}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.30000000000000004e44

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    10. Applied egg-rr54.3%

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

    if -2.30000000000000004e44 < y < 4.4000000000000001e77

    1. Initial program 98.6%

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

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

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

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

    if 4.4000000000000001e77 < y

    1. Initial program 84.9%

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

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

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

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

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

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

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

Alternative 13: 93.4% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 14: 40.3% 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 94.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer target: 99.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024111 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :precision binary64

  :alt
  (if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

  (- x (/ (* y (- z t)) a)))