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

Percentage Accurate: 93.3% → 98.8%
Time: 11.4s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 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: 98.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{t_1}{a}\\

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


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

    1. Initial program 71.4%

      \[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}{\frac{a}{z - t}}} \]
    3. Simplified99.9%

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

    if -inf.0 < (*.f64 y (-.f64 z t)) < 1.99999999999999989e72

    1. Initial program 99.9%

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

    if 1.99999999999999989e72 < (*.f64 y (-.f64 z t))

    1. Initial program 85.2%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

Alternative 2: 76.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{z}{\frac{a}{y}}\\ t_2 := t \cdot \left(-\frac{y}{a}\right)\\ \mathbf{if}\;t \leq -2.8 \cdot 10^{+161}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+226}:\\ \;\;\;\;\frac{y \cdot t}{-a}\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{+282}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ z (/ a y)))) (t_2 (* t (- (/ y a)))))
   (if (<= t -2.8e+161)
     t_2
     (if (<= t 4.5e+141)
       t_1
       (if (<= t 1.02e+226)
         (/ (* y t) (- a))
         (if (<= t 1.08e+282) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z / (a / y));
	double t_2 = t * -(y / a);
	double tmp;
	if (t <= -2.8e+161) {
		tmp = t_2;
	} else if (t <= 4.5e+141) {
		tmp = t_1;
	} else if (t <= 1.02e+226) {
		tmp = (y * t) / -a;
	} else if (t <= 1.08e+282) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x + (z / (a / y))
    t_2 = t * -(y / a)
    if (t <= (-2.8d+161)) then
        tmp = t_2
    else if (t <= 4.5d+141) then
        tmp = t_1
    else if (t <= 1.02d+226) then
        tmp = (y * t) / -a
    else if (t <= 1.08d+282) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z / (a / y));
	double t_2 = t * -(y / a);
	double tmp;
	if (t <= -2.8e+161) {
		tmp = t_2;
	} else if (t <= 4.5e+141) {
		tmp = t_1;
	} else if (t <= 1.02e+226) {
		tmp = (y * t) / -a;
	} else if (t <= 1.08e+282) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (z / (a / y))
	t_2 = t * -(y / a)
	tmp = 0
	if t <= -2.8e+161:
		tmp = t_2
	elif t <= 4.5e+141:
		tmp = t_1
	elif t <= 1.02e+226:
		tmp = (y * t) / -a
	elif t <= 1.08e+282:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(z / Float64(a / y)))
	t_2 = Float64(t * Float64(-Float64(y / a)))
	tmp = 0.0
	if (t <= -2.8e+161)
		tmp = t_2;
	elseif (t <= 4.5e+141)
		tmp = t_1;
	elseif (t <= 1.02e+226)
		tmp = Float64(Float64(y * t) / Float64(-a));
	elseif (t <= 1.08e+282)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (z / (a / y));
	t_2 = t * -(y / a);
	tmp = 0.0;
	if (t <= -2.8e+161)
		tmp = t_2;
	elseif (t <= 4.5e+141)
		tmp = t_1;
	elseif (t <= 1.02e+226)
		tmp = (y * t) / -a;
	elseif (t <= 1.08e+282)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * (-N[(y / a), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t, -2.8e+161], t$95$2, If[LessEqual[t, 4.5e+141], t$95$1, If[LessEqual[t, 1.02e+226], N[(N[(y * t), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[t, 1.08e+282], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{a}{y}}\\
t_2 := t \cdot \left(-\frac{y}{a}\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+161}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{+141}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.08 \cdot 10^{+282}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.80000000000000021e161 or 1.08000000000000004e282 < t

    1. Initial program 97.2%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000021e161 < t < 4.5000000000000002e141 or 1.02e226 < t < 1.08000000000000004e282

    1. Initial program 92.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified94.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef94.2%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
    6. Applied egg-rr94.2%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
    7. Taylor expanded in z around inf 77.2%

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

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

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

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

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

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

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

    if 4.5000000000000002e141 < t < 1.02e226

    1. Initial program 95.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef95.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    12. Simplified65.0%

      \[\leadsto \color{blue}{t \cdot \frac{-y}{a}} \]
    13. Step-by-step derivation
      1. frac-2neg65.0%

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      2. remove-double-neg65.0%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{-a}} \]
    14. Applied egg-rr66.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+161}:\\ \;\;\;\;t \cdot \left(-\frac{y}{a}\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+141}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+226}:\\ \;\;\;\;\frac{y \cdot t}{-a}\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{+282}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-\frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+229}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\

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


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

    1. Initial program 73.5%

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

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

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

    if -inf.0 < (*.f64 y (-.f64 z t)) < 2e229

    1. Initial program 99.9%

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

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

Alternative 4: 84.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+101} \lor \neg \left(t \leq 9.2 \cdot 10^{+68}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.39999999999999988e101 or 9.1999999999999999e68 < t

    1. Initial program 93.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified89.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef89.7%

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

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

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

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

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

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

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

    if -2.39999999999999988e101 < t < 9.1999999999999999e68

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

Alternative 5: 75.2% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 96.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e161 < t < 2.90000000000000007e141

    1. Initial program 91.9%

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

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

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

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

    if 2.90000000000000007e141 < t

    1. Initial program 95.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef97.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    11. Step-by-step derivation
      1. mul-1-neg61.0%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    12. Simplified60.9%

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      2. remove-double-neg60.9%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{-a}} \]
    14. Applied egg-rr61.0%

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

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

Alternative 6: 75.1% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 97.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified91.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e103 < t < 2.7000000000000001e141

    1. Initial program 91.7%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef94.7%

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a} + x} \]
    7. Taylor expanded in z around inf 79.1%

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

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

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

    if 2.7000000000000001e141 < t

    1. Initial program 95.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef97.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    11. Step-by-step derivation
      1. mul-1-neg61.0%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    12. Simplified60.9%

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      2. remove-double-neg60.9%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{-a}} \]
    14. Applied egg-rr61.0%

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

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

Alternative 7: 75.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 97.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified91.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000017e103 < t < 2.84999999999999999e141

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    7. Simplified82.6%

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

    if 2.84999999999999999e141 < t

    1. Initial program 95.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef97.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    11. Step-by-step derivation
      1. mul-1-neg61.0%

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    12. Simplified60.9%

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      2. remove-double-neg60.9%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{-a}} \]
    14. Applied egg-rr61.0%

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

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

Alternative 8: 48.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+60}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.25 \cdot 10^{+63}:\\
\;\;\;\;t \cdot \left(-\frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.49999999999999931e60 or 2.25000000000000008e63 < x

    1. Initial program 94.7%

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

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

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

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

    if -6.49999999999999931e60 < x < 2.25000000000000008e63

    1. Initial program 91.8%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    3. Simplified94.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-y}{a}} \]
    12. Simplified45.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+60}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{+63}:\\ \;\;\;\;t \cdot \left(-\frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 93.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 39.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 93.0%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification41.0%

    \[\leadsto x \]
  7. 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 2024021 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

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

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