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

Percentage Accurate: 93.0% → 97.2%
Time: 8.6s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 93.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.2% accurate, 1.0× speedup?

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

\\
x + \frac{y}{a} \cdot \left(z - t\right)
\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/97.8%

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

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

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

Alternative 2: 45.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 9 \cdot 10^{-303}:\\
\;\;\;\;\frac{y \cdot z}{a}\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\

\mathbf{elif}\;x \leq 6.6 \cdot 10^{+39}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.02e123 or 2.20000000000000009e-40 < x < 6.60000000000000042e39 or 4.20000000000000019e108 < x

    1. Initial program 94.8%

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

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

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

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

    if -1.02e123 < x < 9.0000000000000002e-303

    1. Initial program 90.5%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*96.8%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/97.0%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv96.9%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval96.2%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num96.4%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+47.9%

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

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

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

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

    if 9.0000000000000002e-303 < x < 2.20000000000000009e-40

    1. Initial program 89.4%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt65.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \frac{y}{a} \cdot \left(-t\right)\right)} \]
      3. distribute-rgt-neg-out65.3%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \color{blue}{-\frac{y}{a} \cdot t}\right) \]
      4. add-sqr-sqrt26.5%

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

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\sqrt{t \cdot t}}\right) \]
      6. sqr-neg25.5%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}}\right) \]
      7. sqrt-unprod8.1%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}\right) \]
      8. add-sqr-sqrt14.2%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(-t\right)}\right) \]
      9. *-commutative14.2%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\left(-t\right) \cdot \frac{y}{a}}\right) \]
      10. *-commutative14.2%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\frac{y}{a} \cdot \left(-t\right)}\right) \]
      11. fma-neg14.2%

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

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

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

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

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

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

        \[\leadsto x - \frac{y}{a} \cdot \color{blue}{t} \]
    8. Applied egg-rr65.3%

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

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

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

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

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

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

    if 6.60000000000000042e39 < x < 4.20000000000000019e108

    1. Initial program 79.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv81.4%

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*99.8%

        \[\leadsto x + \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} \]
    5. Applied egg-rr99.8%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/99.9%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv99.8%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{1}{\frac{1}{z - t}}} + x \]
      5. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval99.5%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+16.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+123}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-303}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-40}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+108}:\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 45.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \leq 1.7 \cdot 10^{-33} \lor \neg \left(x \leq 1400000000000\right) \land x \leq 4.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{y \cdot z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7500000000000001e124 or 1.7e-33 < x < 1.4e12 or 4.4999999999999997e106 < x

    1. Initial program 94.7%

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

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

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

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

    if -1.7500000000000001e124 < x < 1.7e-33 or 1.4e12 < x < 4.4999999999999997e106

    1. Initial program 89.2%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv91.8%

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*96.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/96.4%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{1}{\frac{1}{z - t}}} + x \]
      5. clear-num95.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval95.9%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num96.1%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+40.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+124}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-33} \lor \neg \left(x \leq 1400000000000\right) \land x \leq 4.5 \cdot 10^{+106}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 48.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{-t}{a}\\ \mathbf{if}\;t \leq -3200000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 10^{-78}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+30}:\\ \;\;\;\;\frac{y \cdot z}{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 -3200000.0)
     t_1
     (if (<= t 1e-78) x (if (<= t 1.5e+30) (/ (* y z) 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 <= -3200000.0) {
		tmp = t_1;
	} else if (t <= 1e-78) {
		tmp = x;
	} else if (t <= 1.5e+30) {
		tmp = (y * z) / 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 <= (-3200000.0d0)) then
        tmp = t_1
    else if (t <= 1d-78) then
        tmp = x
    else if (t <= 1.5d+30) then
        tmp = (y * z) / 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 <= -3200000.0) {
		tmp = t_1;
	} else if (t <= 1e-78) {
		tmp = x;
	} else if (t <= 1.5e+30) {
		tmp = (y * z) / a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (-t / a)
	tmp = 0
	if t <= -3200000.0:
		tmp = t_1
	elif t <= 1e-78:
		tmp = x
	elif t <= 1.5e+30:
		tmp = (y * z) / 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 <= -3200000.0)
		tmp = t_1;
	elseif (t <= 1e-78)
		tmp = x;
	elseif (t <= 1.5e+30)
		tmp = Float64(Float64(y * z) / 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 <= -3200000.0)
		tmp = t_1;
	elseif (t <= 1e-78)
		tmp = x;
	elseif (t <= 1.5e+30)
		tmp = (y * z) / 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, -3200000.0], t$95$1, If[LessEqual[t, 1e-78], x, If[LessEqual[t, 1.5e+30], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{-t}{a}\\
\mathbf{if}\;t \leq -3200000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 10^{-78}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{y \cdot z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.2e6 or 1.49999999999999989e30 < t

    1. Initial program 89.8%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt46.7%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \frac{y}{a} \cdot \left(-t\right)\right)} \]
      3. distribute-rgt-neg-out46.7%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \color{blue}{-\frac{y}{a} \cdot t}\right) \]
      4. add-sqr-sqrt20.7%

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

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\sqrt{t \cdot t}}\right) \]
      6. sqr-neg15.1%

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

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}\right) \]
      8. add-sqr-sqrt10.6%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(-t\right)}\right) \]
      9. *-commutative10.6%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\left(-t\right) \cdot \frac{y}{a}}\right) \]
      10. *-commutative10.6%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\frac{y}{a} \cdot \left(-t\right)}\right) \]
      11. fma-neg10.6%

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

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

        \[\leadsto x - \frac{y}{a} \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \]
      14. sqrt-unprod34.6%

        \[\leadsto x - \frac{y}{a} \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \]
      15. sqr-neg34.6%

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

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

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

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

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

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

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

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

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

    if -3.2e6 < t < 9.99999999999999999e-79

    1. Initial program 93.9%

      \[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}{a} \cdot \left(z - t\right)} \]
    3. Simplified97.8%

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

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

    if 9.99999999999999999e-79 < t < 1.49999999999999989e30

    1. Initial program 88.5%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*95.9%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/95.8%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv95.8%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{1}{\frac{1}{z - t}}} + x \]
      5. clear-num95.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval95.8%

        \[\leadsto \frac{\color{blue}{1}}{\frac{a}{y} \cdot \frac{1}{z - t}} + x \]
      8. div-inv95.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num95.8%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+31.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3200000:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \mathbf{elif}\;t \leq 10^{-78}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+30}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \end{array} \]

Alternative 5: 74.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+164} \lor \neg \left(t \leq 6.5 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.10000000000000016e164 or 6.50000000000000046e155 < t

    1. Initial program 92.1%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv87.4%

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*96.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/96.6%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv96.5%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{1}{\frac{1}{z - t}}} + x \]
      5. clear-num96.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval96.4%

        \[\leadsto \frac{\color{blue}{1}}{\frac{a}{y} \cdot \frac{1}{z - t}} + x \]
      8. div-inv96.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num96.7%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+23.9%

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

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

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

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

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

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

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

    if -4.10000000000000016e164 < t < 6.50000000000000046e155

    1. Initial program 91.3%

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{z}}} \]
    5. Step-by-step derivation
      1. div-inv78.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{+164} \lor \neg \left(t \leq 6.5 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 6: 74.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.95 \cdot 10^{+164} \lor \neg \left(t \leq 8 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.95000000000000019e164 or 8.00000000000000006e155 < t

    1. Initial program 92.1%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv87.4%

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*96.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/96.6%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv96.5%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{1}{\frac{1}{z - t}}} + x \]
      5. clear-num96.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{a}{y} \cdot \frac{1}{z - t}}} + x \]
      7. metadata-eval96.4%

        \[\leadsto \frac{\color{blue}{1}}{\frac{a}{y} \cdot \frac{1}{z - t}} + x \]
      8. div-inv96.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num96.7%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+23.9%

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

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

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

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

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

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

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

    if -3.95000000000000019e164 < t < 8.00000000000000006e155

    1. Initial program 91.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.95 \cdot 10^{+164} \lor \neg \left(t \leq 8 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \end{array} \]

Alternative 7: 76.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+171} \lor \neg \left(t \leq 8 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3499999999999999e171 or 8.00000000000000006e155 < t

    1. Initial program 91.9%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*96.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}} + x} \]
      2. associate-/r/96.5%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{a}}{\frac{1}{z - t}}} + x \]
      4. div-inv96.4%

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

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

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

        \[\leadsto \frac{\color{blue}{1}}{\frac{a}{y} \cdot \frac{1}{z - t}} + x \]
      8. div-inv96.5%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{a}{y}}{z - t}}} + x \]
      9. clear-num96.6%

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a}{y}}} + x \]
      10. flip-+24.8%

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

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

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

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

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

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

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

    if -1.3499999999999999e171 < t < 8.00000000000000006e155

    1. Initial program 91.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{+171} \lor \neg \left(t \leq 8 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a} \cdot z\\ \end{array} \]

Alternative 8: 83.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-36} \lor \neg \left(z \leq 1.9 \cdot 10^{-40}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.40000000000000015e-36 or 1.8999999999999999e-40 < z

    1. Initial program 88.3%

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

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

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

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

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

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

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

    if -5.40000000000000015e-36 < z < 1.8999999999999999e-40

    1. Initial program 95.6%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
      2. div-inv98.2%

        \[\leadsto x + \frac{y}{\color{blue}{a \cdot \frac{1}{z - t}}} \]
      3. associate-/r*98.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{-36} \lor \neg \left(z \leq 1.9 \cdot 10^{-40}\right):\\ \;\;\;\;x + \frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 9: 85.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+26} \lor \neg \left(z \leq 1.9 \cdot 10^{-40}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.80000000000000012e26 or 1.8999999999999999e-40 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

    if -1.80000000000000012e26 < z < 1.8999999999999999e-40

    1. Initial program 95.1%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt59.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \sqrt{x}} + \frac{y}{a} \cdot \left(-t\right) \]
      2. fma-def59.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \frac{y}{a} \cdot \left(-t\right)\right)} \]
      3. distribute-rgt-neg-out59.4%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, \color{blue}{-\frac{y}{a} \cdot t}\right) \]
      4. add-sqr-sqrt24.9%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}\right) \]
      5. sqrt-unprod34.2%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\sqrt{t \cdot t}}\right) \]
      6. sqr-neg34.2%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}}\right) \]
      7. sqrt-unprod15.9%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}\right) \]
      8. add-sqr-sqrt28.7%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\frac{y}{a} \cdot \color{blue}{\left(-t\right)}\right) \]
      9. *-commutative28.7%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\left(-t\right) \cdot \frac{y}{a}}\right) \]
      10. *-commutative28.7%

        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \sqrt{x}, -\color{blue}{\frac{y}{a} \cdot \left(-t\right)}\right) \]
      11. fma-neg28.7%

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

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

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

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

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

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

        \[\leadsto x - \frac{y}{a} \cdot \color{blue}{t} \]
    8. Applied egg-rr93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+26} \lor \neg \left(z \leq 1.9 \cdot 10^{-40}\right):\\ \;\;\;\;x + \frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{a} \cdot t\\ \end{array} \]

Alternative 10: 39.1% 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/97.8%

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

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

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

    \[\leadsto x \]

Developer target: 99.1% accurate, 0.7× 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 2023262 
(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)))