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

Percentage Accurate: 92.9% → 99.6%
Time: 9.5s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

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

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

\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+261} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+273}\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)) < -1.9999999999999999e261 or 4.99999999999999961e273 < (*.f64 y (-.f64 z t))

    1. Initial program 72.1%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.9%

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

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

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

    if -1.9999999999999999e261 < (*.f64 y (-.f64 z t)) < 4.99999999999999961e273

    1. Initial program 99.2%

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

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

Alternative 2: 75.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq -2.3 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.99999999999999983e218 or -1.85000000000000002e146 < t < -2.2999999999999999e108 or 1.05e114 < t

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt47.6%

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt13.5%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt5.6%

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

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

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod45.4%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt91.1%

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

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

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

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

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

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

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

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

    if -4.99999999999999983e218 < t < -1.85000000000000002e146

    1. Initial program 99.7%

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

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

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

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

    if -2.2999999999999999e108 < t < 1.8000000000000001e-184

    1. Initial program 94.5%

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

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

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

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

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

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

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

    if 1.8000000000000001e-184 < t < 1.05e114

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+218}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq -1.85 \cdot 10^{+146}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{+108}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-184}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+114}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.3% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq -1.05 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.99999999999999983e218 or -2.4000000000000002e146 < t < -1.05000000000000005e108 or 7.5000000000000001e113 < t

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt47.6%

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt13.5%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt5.6%

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

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

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod45.4%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt91.1%

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

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

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

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

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

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

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

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

    if -4.99999999999999983e218 < t < -2.4000000000000002e146

    1. Initial program 99.7%

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

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

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

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

    if -1.05000000000000005e108 < t < 6.99999999999999962e-184

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999962e-184 < t < 7.5000000000000001e113

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+218}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{+146}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{+108}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-184}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+113}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq -2.7 \cdot 10^{+106} \lor \neg \left(t \leq 5.8 \cdot 10^{+113}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.99999999999999983e218 or -2.3e146 < t < -2.70000000000000006e106 or 5.79999999999999968e113 < t

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt47.6%

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt13.5%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt5.6%

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

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

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod45.4%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt91.1%

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

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

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

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

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

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

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

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

    if -4.99999999999999983e218 < t < -2.3e146

    1. Initial program 99.7%

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

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

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

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

    if -2.70000000000000006e106 < t < 5.79999999999999968e113

    1. Initial program 94.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+218}:\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{+146}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{+106} \lor \neg \left(t \leq 5.8 \cdot 10^{+113}\right):\\ \;\;\;\;t \cdot \frac{-y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.89999999999999998e219 or 1e114 < t

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt47.5%

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{a \cdot a}}} \cdot t \]
      4. sqr-neg44.2%

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt14.5%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt6.0%

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

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{t}} \]
      10. sqr-neg44.0%

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod46.9%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt92.2%

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

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

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

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

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

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

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

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

    if -1.89999999999999998e219 < t < 1e114

    1. Initial program 93.9%

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

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

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

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

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

Alternative 6: 85.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+43} \lor \neg \left(t \leq 1.3 \cdot 10^{+90}\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.2e+43) (not (<= t 1.3e+90)))
   (- 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.2e+43) || !(t <= 1.3e+90)) {
		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.2d+43)) .or. (.not. (t <= 1.3d+90))) 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.2e+43) || !(t <= 1.3e+90)) {
		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.2e+43) or not (t <= 1.3e+90):
		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.2e+43) || !(t <= 1.3e+90))
		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.2e+43) || ~((t <= 1.3e+90)))
		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.2e+43], N[Not[LessEqual[t, 1.3e+90]], $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.2 \cdot 10^{+43} \lor \neg \left(t \leq 1.3 \cdot 10^{+90}\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.20000000000000012e43 or 1.2999999999999999e90 < t

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000012e43 < t < 1.2999999999999999e90

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 50.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4499999999999999e75 or 11.800000000000001 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt32.3%

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{a \cdot a}}} \cdot t \]
      4. sqr-neg38.5%

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt20.1%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt8.5%

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

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

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod31.5%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt61.2%

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e75 < y < 11.800000000000001

    1. Initial program 98.2%

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

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

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

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

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

Alternative 8: 50.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 9:\\
\;\;\;\;x\\

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


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

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt36.1%

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt13.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt5.9%

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

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

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

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt59.6%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{a}}{t}} \]
    12. Applied egg-rr59.6%

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

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

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

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

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

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

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

    if -2.65000000000000008e76 < y < 9

    1. Initial program 98.2%

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

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

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

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

    if 9 < y

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    10. Simplified61.1%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{a}} \]
    11. Step-by-step derivation
      1. *-commutative61.1%

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      2. add-sqr-sqrt29.2%

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \cdot t \]
      3. sqrt-unprod41.1%

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{a \cdot a}}} \cdot t \]
      4. sqr-neg41.1%

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

        \[\leadsto x - \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      6. add-sqr-sqrt25.3%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{-a}{t}}} \]
      8. add-sqr-sqrt10.6%

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

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

        \[\leadsto x - \frac{y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      11. sqrt-unprod30.5%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      12. add-sqr-sqrt62.5%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 97.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.00000000000000003e159

    1. Initial program 80.5%

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

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

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

    if -5.00000000000000003e159 < y

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

Alternative 10: 97.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.19999999999999985e159

    1. Initial program 80.5%

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

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

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

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

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

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

    if -3.19999999999999985e159 < y

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

Alternative 11: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 12: 38.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.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification34.8%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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