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

Percentage Accurate: 93.1% → 99.5%
Time: 11.9s
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.1% 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: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z - t\right) \cdot y\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+208}\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 (* (- z t) y)))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+208)))
     (+ x (/ y (/ a (- z t))))
     (+ x (/ t_1 a)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) * y;
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+208)) {
		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 = (z - t) * y;
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+208)) {
		tmp = x + (y / (a / (z - t)));
	} else {
		tmp = x + (t_1 / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) * y
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e+208):
		tmp = x + (y / (a / (z - t)))
	else:
		tmp = x + (t_1 / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) * y)
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+208))
		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 = (z - t) * y;
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e+208)))
		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[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+208]], $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 := \left(z - t\right) \cdot y\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+208}\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 2e208 < (*.f64 y (-.f64 z t))

    1. Initial program 71.0%

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

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

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

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

    1. Initial program 99.6%

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

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

Alternative 2: 48.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \frac{-t}{a}\\
\mathbf{if}\;t \leq -8.6 \cdot 10^{+136}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.8 \cdot 10^{-245}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-128}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -8.5999999999999997e136 or 2.54999999999999984e-12 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in61.8%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{t}{a}} \]
    12. Simplified61.8%

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

    if -8.5999999999999997e136 < t < 1.8e-245 or 1.6999999999999999e-172 < t < 5.19999999999999961e-128

    1. Initial program 97.3%

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

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

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

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

    if 1.8e-245 < t < 1.6999999999999999e-172

    1. Initial program 85.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
    5. Taylor expanded in t around 0 85.4%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified92.6%

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

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

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

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

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

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

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

    if 5.19999999999999961e-128 < t < 2.54999999999999984e-12

    1. Initial program 89.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified83.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+136}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-245}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-172}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-12}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 1.9 \cdot 10^{-245}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-124}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -2.6999999999999998e139

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot y} \]
      3. *-commutative74.9%

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in74.9%

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

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

    if -2.6999999999999998e139 < t < 1.9e-245 or 8e-176 < t < 5.8000000000000004e-124

    1. Initial program 97.3%

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

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

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

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

    if 1.9e-245 < t < 8e-176

    1. Initial program 85.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
    5. Taylor expanded in t around 0 85.4%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified92.6%

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

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

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

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

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

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

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

    if 5.8000000000000004e-124 < t < 1.8e-12

    1. Initial program 89.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified83.0%

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

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

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

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

    if 1.8e-12 < t

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in57.4%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{t}{a}} \]
    12. Simplified57.4%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt24.0%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      5. sqr-neg26.3%

        \[\leadsto \frac{-\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      6. sqrt-unprod2.2%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt3.3%

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

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt1.2%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg25.2%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt54.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+139}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-245}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-176}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-124}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-12}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 49.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-248}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 1.45 \cdot 10^{-124}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -6.4999999999999998e136

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot y} \]
      3. *-commutative74.9%

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in74.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt21.5%

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

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

        \[\leadsto \frac{-\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      6. sqrt-unprod0.8%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt1.3%

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

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt0.4%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg40.5%

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      12. sqrt-unprod41.5%

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt63.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{-a}{t}}} \]
    16. Simplified74.9%

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

    if -6.4999999999999998e136 < t < 6.7999999999999996e-248 or 2.5e-175 < t < 1.4500000000000001e-124

    1. Initial program 97.3%

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

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

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

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

    if 6.7999999999999996e-248 < t < 2.5e-175

    1. Initial program 85.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
    5. Taylor expanded in t around 0 85.4%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified92.6%

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

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

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

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

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

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

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

    if 1.4500000000000001e-124 < t < 3.1500000000000001e-12

    1. Initial program 89.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified83.0%

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

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

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

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

    if 3.1500000000000001e-12 < t

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in57.4%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{t}{a}} \]
    12. Simplified57.4%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt24.0%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      5. sqr-neg26.3%

        \[\leadsto \frac{-\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      6. sqrt-unprod2.2%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt3.3%

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

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt1.2%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg25.2%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt54.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+136}:\\ \;\;\;\;\frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-248}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-124}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.15 \cdot 10^{-12}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 44000000000 \lor \neg \left(t \leq 7.2 \cdot 10^{+75}\right) \land t \leq 1.45 \cdot 10^{+112}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\

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


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

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in73.8%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{t}{a}} \]
    12. Simplified73.8%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt22.4%

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

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

        \[\leadsto \frac{-\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      6. sqrt-unprod0.9%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt1.3%

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

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt0.4%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg37.9%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt61.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{-a}{t}}} \]
    16. Simplified73.8%

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

    if -9.7999999999999998e151 < t < 4.4e10 or 7.2e75 < t < 1.4500000000000001e112

    1. Initial program 95.2%

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

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

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

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

    if 4.4e10 < t < 7.2e75 or 1.4500000000000001e112 < t

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in63.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt27.1%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      5. sqr-neg27.8%

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

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt1.6%

        \[\leadsto \frac{-\color{blue}{y} \cdot t}{-a} \]
      8. distribute-lft-neg-out1.6%

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt1.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot t}{-a} \]
      10. sqrt-unprod26.3%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg26.3%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt60.3%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{-a} \cdot t} \]
    16. Simplified66.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+151}:\\ \;\;\;\;\frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 44000000000 \lor \neg \left(t \leq 7.2 \cdot 10^{+75}\right) \land t \leq 1.45 \cdot 10^{+112}:\\ \;\;\;\;x + \frac{z \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \frac{y}{a}\\ t_2 := \frac{y}{\frac{-a}{t}}\\ \mathbf{if}\;t \leq -2.55 \cdot 10^{+151}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 46000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+112}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* z (/ y a)))) (t_2 (/ y (/ (- a) t))))
   (if (<= t -2.55e+151)
     t_2
     (if (<= t 46000000000.0)
       t_1
       (if (<= t 1.7e+47) t_2 (if (<= t 1.56e+112) t_1 (* t (/ y (- a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z * (y / a));
	double t_2 = y / (-a / t);
	double tmp;
	if (t <= -2.55e+151) {
		tmp = t_2;
	} else if (t <= 46000000000.0) {
		tmp = t_1;
	} else if (t <= 1.7e+47) {
		tmp = t_2;
	} else if (t <= 1.56e+112) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (z * (y / a))
    t_2 = y / (-a / t)
    if (t <= (-2.55d+151)) then
        tmp = t_2
    else if (t <= 46000000000.0d0) then
        tmp = t_1
    else if (t <= 1.7d+47) then
        tmp = t_2
    else if (t <= 1.56d+112) then
        tmp = t_1
    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 t_1 = x + (z * (y / a));
	double t_2 = y / (-a / t);
	double tmp;
	if (t <= -2.55e+151) {
		tmp = t_2;
	} else if (t <= 46000000000.0) {
		tmp = t_1;
	} else if (t <= 1.7e+47) {
		tmp = t_2;
	} else if (t <= 1.56e+112) {
		tmp = t_1;
	} else {
		tmp = t * (y / -a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (z * (y / a))
	t_2 = y / (-a / t)
	tmp = 0
	if t <= -2.55e+151:
		tmp = t_2
	elif t <= 46000000000.0:
		tmp = t_1
	elif t <= 1.7e+47:
		tmp = t_2
	elif t <= 1.56e+112:
		tmp = t_1
	else:
		tmp = t * (y / -a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(z * Float64(y / a)))
	t_2 = Float64(y / Float64(Float64(-a) / t))
	tmp = 0.0
	if (t <= -2.55e+151)
		tmp = t_2;
	elseif (t <= 46000000000.0)
		tmp = t_1;
	elseif (t <= 1.7e+47)
		tmp = t_2;
	elseif (t <= 1.56e+112)
		tmp = t_1;
	else
		tmp = Float64(t * Float64(y / Float64(-a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (z * (y / a));
	t_2 = y / (-a / t);
	tmp = 0.0;
	if (t <= -2.55e+151)
		tmp = t_2;
	elseif (t <= 46000000000.0)
		tmp = t_1;
	elseif (t <= 1.7e+47)
		tmp = t_2;
	elseif (t <= 1.56e+112)
		tmp = t_1;
	else
		tmp = t * (y / -a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.55e+151], t$95$2, If[LessEqual[t, 46000000000.0], t$95$1, If[LessEqual[t, 1.7e+47], t$95$2, If[LessEqual[t, 1.56e+112], t$95$1, N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
t_2 := \frac{y}{\frac{-a}{t}}\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{+151}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 46000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{+47}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.56 \cdot 10^{+112}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.54999999999999998e151 or 4.6e10 < t < 1.6999999999999999e47

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot y} \]
      3. *-commutative73.1%

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in73.1%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{t}{a}} \]
    12. Simplified73.1%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt22.5%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot t}{-a} \]
      4. sqrt-unprod23.1%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      5. sqr-neg23.1%

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

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt1.2%

        \[\leadsto \frac{-\color{blue}{y} \cdot t}{-a} \]
      8. distribute-lft-neg-out1.2%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg32.9%

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}} \cdot t}{-a} \]
      12. sqrt-unprod36.3%

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt58.9%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{-a}{t}}} \]
    16. Simplified73.2%

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

    if -2.54999999999999998e151 < t < 4.6e10 or 1.6999999999999999e47 < t < 1.55999999999999992e112

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

    if 1.55999999999999992e112 < t

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-in63.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-y\right) \cdot t}{-a}} \]
      3. add-sqr-sqrt27.2%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot t}{-a} \]
      4. sqrt-unprod28.1%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      5. sqr-neg28.1%

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

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      7. add-sqr-sqrt1.7%

        \[\leadsto \frac{-\color{blue}{y} \cdot t}{-a} \]
      8. distribute-lft-neg-out1.7%

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      9. add-sqr-sqrt1.0%

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot t}{-a} \]
      11. sqr-neg28.5%

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot t}{-a} \]
      13. add-sqr-sqrt63.4%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{-a} \cdot t} \]
    16. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.55 \cdot 10^{+151}:\\ \;\;\;\;\frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 46000000000:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+112}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 50.5% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq -1.56 \cdot 10^{-21}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.5000000000000008e112 or -5e45 < a < -1.55999999999999999e-21 or 1.40000000000000005e-67 < a

    1. Initial program 87.1%

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

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

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

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

    if -9.5000000000000008e112 < a < -5e45

    1. Initial program 84.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified58.8%

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

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

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

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

    if -1.55999999999999999e-21 < a < 1.40000000000000005e-67

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{+112}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5 \cdot 10^{+45}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -1.56 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-67}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+118} \lor \neg \left(t \leq 4.1 \cdot 10^{-13}\right):\\
\;\;\;\;x - y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.2e118 or 4.1000000000000002e-13 < t

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e118 < t < 4.1000000000000002e-13

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

Alternative 9: 85.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+118} \lor \neg \left(t \leq 4.6 \cdot 10^{-12}\right):\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.05e118 or 4.59999999999999979e-12 < t

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e118 < t < 4.59999999999999979e-12

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

Alternative 10: 85.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+118} \lor \neg \left(t \leq 2.35 \cdot 10^{-12}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.09999999999999993e118 or 2.34999999999999988e-12 < t

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

    if -1.09999999999999993e118 < t < 2.34999999999999988e-12

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

Alternative 11: 49.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+72} \lor \neg \left(y \leq 3.7 \cdot 10^{+96}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.24999999999999998e72 or 3.69999999999999991e96 < y

    1. Initial program 82.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{a}, x\right)} \]
    7. Simplified65.1%

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

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

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

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

    if -1.24999999999999998e72 < y < 3.69999999999999991e96

    1. Initial program 97.8%

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

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

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

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

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

Alternative 12: 93.5% 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 91.9%

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

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

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

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

Alternative 13: 97.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 14: 39.8% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.1% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024019 
(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)))