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

Percentage Accurate: 93.2% → 99.5%
Time: 10.8s
Alternatives: 11
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 11 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.3× speedup?

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

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

\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)) < -5e258 or 2e164 < (*.f64 y (-.f64 z t))

    1. Initial program 79.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

    if -5e258 < (*.f64 y (-.f64 z t)) < 2e164

    1. Initial program 99.4%

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

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

Alternative 2: 85.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+25} \lor \neg \left(z \leq 8.5 \cdot 10^{-11}\right):\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.00000000000000018e25 or 8.50000000000000037e-11 < z

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z + \left(-t\right)}}{\frac{a}{y}} + x \]
      4. add-sqr-sqrt47.6%

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

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

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

        \[\leadsto \frac{z + \color{blue}{\sqrt{t} \cdot \sqrt{t}}}{\frac{a}{y}} + x \]
      8. add-sqr-sqrt84.2%

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

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

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

    if -2.00000000000000018e25 < z < 8.50000000000000037e-11

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 76.6% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(-y\right)}{a}} \]
      2. distribute-rgt-neg-out64.1%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-neg-frac64.1%

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

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

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

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

    if -4.4000000000000003e120 < t < 6.19999999999999978e181

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z + \color{blue}{\sqrt{t} \cdot \sqrt{t}}}{\frac{a}{y}} + x \]
      8. add-sqr-sqrt79.0%

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

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

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

    if 6.19999999999999978e181 < t

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. *-commutative72.8%

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

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

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

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

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

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

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

Alternative 4: 76.6% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(-y\right)}{a}} \]
      2. distribute-rgt-neg-out64.1%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-neg-frac64.1%

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

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

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

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

    if -2.2000000000000001e119 < t < 1.39999999999999992e181

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.39999999999999992e181 < t

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. *-commutative72.8%

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

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

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

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

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

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

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

Alternative 5: 73.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(-y\right)}{a}} \]
      2. distribute-rgt-neg-out64.1%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-neg-frac64.1%

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

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

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

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

    if -1.80000000000000001e119 < t < 6.00000000000000024e181

    1. Initial program 92.6%

      \[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 76.4%

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

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

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

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

    if 6.00000000000000024e181 < t

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. *-commutative72.8%

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

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

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

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

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

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

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

Alternative 6: 73.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(-y\right)}{a}} \]
      2. distribute-rgt-neg-out64.1%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-neg-frac64.1%

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

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

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

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

    if -7.20000000000000003e119 < t < 3.4000000000000002e152

    1. Initial program 93.3%

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

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

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

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

    if 3.4000000000000002e152 < t

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 49.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+29} \lor \neg \left(y \leq 1.15 \cdot 10^{+110}\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 < -2.9999999999999999e29 or 1.15e110 < y

    1. Initial program 81.5%

      \[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. Taylor expanded in z around 0 54.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. *-commutative40.8%

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

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

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

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

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

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

    if -2.9999999999999999e29 < y < 1.15e110

    1. Initial program 98.8%

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

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

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

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

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

Alternative 8: 48.8% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(-y\right)}{a}} \]
      2. distribute-rgt-neg-out64.1%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-neg-frac64.1%

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

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

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

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

    if -1.80000000000000008e120 < t < 1.00000000000000007e-37

    1. Initial program 93.0%

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

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

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

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

    if 1.00000000000000007e-37 < t

    1. Initial program 88.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 z around 0 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 93.1% 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*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. Add Preprocessing

Alternative 11: 38.9% 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*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 x around inf 37.2%

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

Developer Target 1: 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 2024151 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))

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