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

Percentage Accurate: 92.7% → 95.6%
Time: 14.5s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.7% 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: 95.6% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999998e255

    1. Initial program 97.3%

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

    if 1.99999999999999998e255 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 67.9%

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

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

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

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

Alternative 2: 63.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+170}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{+155} \lor \neg \left(x \leq -5.4 \cdot 10^{+72}\right) \land \left(x \leq -1.2 \cdot 10^{-73} \lor \neg \left(x \leq -6 \cdot 10^{-114}\right) \land x \leq 1.85 \cdot 10^{-14}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -5.5e+170)
   x
   (if (or (<= x -1.5e+155)
           (and (not (<= x -5.4e+72))
                (or (<= x -1.2e-73)
                    (and (not (<= x -6e-114)) (<= x 1.85e-14)))))
     (* y (/ (- z t) a))
     x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -5.5e+170) {
		tmp = x;
	} else if ((x <= -1.5e+155) || (!(x <= -5.4e+72) && ((x <= -1.2e-73) || (!(x <= -6e-114) && (x <= 1.85e-14))))) {
		tmp = y * ((z - 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 <= (-5.5d+170)) then
        tmp = x
    else if ((x <= (-1.5d+155)) .or. (.not. (x <= (-5.4d+72))) .and. (x <= (-1.2d-73)) .or. (.not. (x <= (-6d-114))) .and. (x <= 1.85d-14)) then
        tmp = y * ((z - 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 <= -5.5e+170) {
		tmp = x;
	} else if ((x <= -1.5e+155) || (!(x <= -5.4e+72) && ((x <= -1.2e-73) || (!(x <= -6e-114) && (x <= 1.85e-14))))) {
		tmp = y * ((z - t) / a);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -5.5e+170:
		tmp = x
	elif (x <= -1.5e+155) or (not (x <= -5.4e+72) and ((x <= -1.2e-73) or (not (x <= -6e-114) and (x <= 1.85e-14)))):
		tmp = y * ((z - t) / a)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -5.5e+170)
		tmp = x;
	elseif ((x <= -1.5e+155) || (!(x <= -5.4e+72) && ((x <= -1.2e-73) || (!(x <= -6e-114) && (x <= 1.85e-14)))))
		tmp = Float64(y * Float64(Float64(z - t) / a));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -5.5e+170)
		tmp = x;
	elseif ((x <= -1.5e+155) || (~((x <= -5.4e+72)) && ((x <= -1.2e-73) || (~((x <= -6e-114)) && (x <= 1.85e-14)))))
		tmp = y * ((z - t) / a);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.5e+170], x, If[Or[LessEqual[x, -1.5e+155], And[N[Not[LessEqual[x, -5.4e+72]], $MachinePrecision], Or[LessEqual[x, -1.2e-73], And[N[Not[LessEqual[x, -6e-114]], $MachinePrecision], LessEqual[x, 1.85e-14]]]]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.5 \cdot 10^{+155} \lor \neg \left(x \leq -5.4 \cdot 10^{+72}\right) \land \left(x \leq -1.2 \cdot 10^{-73} \lor \neg \left(x \leq -6 \cdot 10^{-114}\right) \land x \leq 1.85 \cdot 10^{-14}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4999999999999999e170 or -1.5000000000000001e155 < x < -5.4000000000000001e72 or -1.20000000000000003e-73 < x < -6.0000000000000003e-114 or 1.85000000000000001e-14 < x

    1. Initial program 94.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 74.1%

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

    if -5.4999999999999999e170 < x < -1.5000000000000001e155 or -5.4000000000000001e72 < x < -1.20000000000000003e-73 or -6.0000000000000003e-114 < x < 1.85000000000000001e-14

    1. Initial program 91.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 72.7%

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    7. Simplified74.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+170}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{+155} \lor \neg \left(x \leq -5.4 \cdot 10^{+72}\right) \land \left(x \leq -1.2 \cdot 10^{-73} \lor \neg \left(x \leq -6 \cdot 10^{-114}\right) \land x \leq 1.85 \cdot 10^{-14}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-238}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-240}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.7:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y a) (- t))))
   (if (<= z -9.5e+77)
     (/ y (/ a z))
     (if (<= z -7e-102)
       x
       (if (<= z -7.2e-238)
         t_1
         (if (<= z 3.4e-240) x (if (<= z 2.7) t_1 (* (/ y a) z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -t;
	double tmp;
	if (z <= -9.5e+77) {
		tmp = y / (a / z);
	} else if (z <= -7e-102) {
		tmp = x;
	} else if (z <= -7.2e-238) {
		tmp = t_1;
	} else if (z <= 3.4e-240) {
		tmp = x;
	} else if (z <= 2.7) {
		tmp = t_1;
	} else {
		tmp = (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) :: t_1
    real(8) :: tmp
    t_1 = (y / a) * -t
    if (z <= (-9.5d+77)) then
        tmp = y / (a / z)
    else if (z <= (-7d-102)) then
        tmp = x
    else if (z <= (-7.2d-238)) then
        tmp = t_1
    else if (z <= 3.4d-240) then
        tmp = x
    else if (z <= 2.7d0) then
        tmp = t_1
    else
        tmp = (y / a) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / a) * -t;
	double tmp;
	if (z <= -9.5e+77) {
		tmp = y / (a / z);
	} else if (z <= -7e-102) {
		tmp = x;
	} else if (z <= -7.2e-238) {
		tmp = t_1;
	} else if (z <= 3.4e-240) {
		tmp = x;
	} else if (z <= 2.7) {
		tmp = t_1;
	} else {
		tmp = (y / a) * z;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / a) * -t
	tmp = 0
	if z <= -9.5e+77:
		tmp = y / (a / z)
	elif z <= -7e-102:
		tmp = x
	elif z <= -7.2e-238:
		tmp = t_1
	elif z <= 3.4e-240:
		tmp = x
	elif z <= 2.7:
		tmp = t_1
	else:
		tmp = (y / a) * z
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / a) * Float64(-t))
	tmp = 0.0
	if (z <= -9.5e+77)
		tmp = Float64(y / Float64(a / z));
	elseif (z <= -7e-102)
		tmp = x;
	elseif (z <= -7.2e-238)
		tmp = t_1;
	elseif (z <= 3.4e-240)
		tmp = x;
	elseif (z <= 2.7)
		tmp = t_1;
	else
		tmp = Float64(Float64(y / a) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / a) * -t;
	tmp = 0.0;
	if (z <= -9.5e+77)
		tmp = y / (a / z);
	elseif (z <= -7e-102)
		tmp = x;
	elseif (z <= -7.2e-238)
		tmp = t_1;
	elseif (z <= 3.4e-240)
		tmp = x;
	elseif (z <= 2.7)
		tmp = t_1;
	else
		tmp = (y / a) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[z, -9.5e+77], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-102], x, If[LessEqual[z, -7.2e-238], t$95$1, If[LessEqual[z, 3.4e-240], x, If[LessEqual[z, 2.7], t$95$1, N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-102}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-240}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.7:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.4999999999999998e77

    1. Initial program 92.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 52.5%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified55.1%

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

    if -9.4999999999999998e77 < z < -6.99999999999999973e-102 or -7.20000000000000021e-238 < z < 3.3999999999999999e-240

    1. Initial program 97.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 68.6%

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

    if -6.99999999999999973e-102 < z < -7.20000000000000021e-238 or 3.3999999999999999e-240 < z < 2.7000000000000002

    1. Initial program 89.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 48.1%

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

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

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

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

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

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

    if 2.7000000000000002 < z

    1. Initial program 93.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 53.5%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified49.9%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr56.3%

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

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

Alternative 4: 49.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+78}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-102}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-240}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 0.054:\\
\;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.1500000000000001e78

    1. Initial program 92.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 52.5%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified55.1%

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

    if -1.1500000000000001e78 < z < -2.80000000000000013e-102 or -5.29999999999999968e-238 < z < 9.0000000000000003e-240

    1. Initial program 97.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 68.6%

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

    if -2.80000000000000013e-102 < z < -5.29999999999999968e-238

    1. Initial program 92.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 54.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000003e-240 < z < 0.0539999999999999994

    1. Initial program 87.9%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 43.9%

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

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

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

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

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

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

    if 0.0539999999999999994 < z

    1. Initial program 93.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 53.5%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified49.9%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr56.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-238}:\\ \;\;\;\;\frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-240}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.054:\\ \;\;\;\;\frac{y}{a} \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 46.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-53}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -4.5 \cdot 10^{-72} \lor \neg \left(x \leq -1.55 \cdot 10^{-116}\right) \land x \leq 2.9 \cdot 10^{-101}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3000000000000001e-53 or -4.5e-72 < x < -1.55000000000000009e-116 or 2.9e-101 < x

    1. Initial program 91.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 59.9%

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

    if -2.3000000000000001e-53 < x < -4.5e-72 or -1.55000000000000009e-116 < x < 2.9e-101

    1. Initial program 94.9%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 49.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{-53}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-72} \lor \neg \left(x \leq -1.55 \cdot 10^{-116}\right) \land x \leq 2.9 \cdot 10^{-101}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 47.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-52}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-116}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.19999999999999976e-52 or -1.50000000000000016e-67 < x < -7.5000000000000004e-116 or 5.3000000000000003e-101 < x

    1. Initial program 91.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 59.9%

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

    if -7.19999999999999976e-52 < x < -1.50000000000000016e-67

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 83.8%

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

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

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

    if -7.5000000000000004e-116 < x < 5.3000000000000003e-101

    1. Initial program 94.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 47.2%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-52}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-67}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-116}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{-101}:\\ \;\;\;\;\frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 47.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-48}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-116}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.65e-48 or -4.8e-67 < x < -4.79999999999999986e-116 or 5.05000000000000013e-101 < x

    1. Initial program 91.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 59.9%

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

    if -1.65e-48 < x < -4.8e-67

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 83.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified83.8%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr83.5%

      \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    10. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} \]
      2. clear-num83.5%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    11. Applied egg-rr83.8%

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

    if -4.79999999999999986e-116 < x < 5.05000000000000013e-101

    1. Initial program 94.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 47.2%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-116}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.05 \cdot 10^{-101}:\\ \;\;\;\;\frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 46.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-114}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-101}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -1.9e-48)
   x
   (if (<= x -1.15e-70)
     (/ z (/ a y))
     (if (<= x -4.3e-114) x (if (<= x 2.35e-101) (/ (* y z) a) x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.9e-48) {
		tmp = x;
	} else if (x <= -1.15e-70) {
		tmp = z / (a / y);
	} else if (x <= -4.3e-114) {
		tmp = x;
	} else if (x <= 2.35e-101) {
		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.9d-48)) then
        tmp = x
    else if (x <= (-1.15d-70)) then
        tmp = z / (a / y)
    else if (x <= (-4.3d-114)) then
        tmp = x
    else if (x <= 2.35d-101) 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.9e-48) {
		tmp = x;
	} else if (x <= -1.15e-70) {
		tmp = z / (a / y);
	} else if (x <= -4.3e-114) {
		tmp = x;
	} else if (x <= 2.35e-101) {
		tmp = (y * z) / a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -1.9e-48:
		tmp = x
	elif x <= -1.15e-70:
		tmp = z / (a / y)
	elif x <= -4.3e-114:
		tmp = x
	elif x <= 2.35e-101:
		tmp = (y * z) / a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.9e-48)
		tmp = x;
	elseif (x <= -1.15e-70)
		tmp = Float64(z / Float64(a / y));
	elseif (x <= -4.3e-114)
		tmp = x;
	elseif (x <= 2.35e-101)
		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.9e-48)
		tmp = x;
	elseif (x <= -1.15e-70)
		tmp = z / (a / y);
	elseif (x <= -4.3e-114)
		tmp = x;
	elseif (x <= 2.35e-101)
		tmp = (y * z) / a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.9e-48], x, If[LessEqual[x, -1.15e-70], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.3e-114], x, If[LessEqual[x, 2.35e-101], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-48}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;x \leq -4.3 \cdot 10^{-114}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.90000000000000001e-48 or -1.15e-70 < x < -4.3e-114 or 2.35e-101 < x

    1. Initial program 91.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 59.9%

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

    if -1.90000000000000001e-48 < x < -1.15e-70

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 83.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    7. Simplified83.8%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr83.5%

      \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    10. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} \]
      2. clear-num83.5%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
    11. Applied egg-rr83.8%

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

    if -4.3e-114 < x < 2.35e-101

    1. Initial program 94.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 47.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-114}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-101}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 91.7% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -2e110

    1. Initial program 93.2%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around -inf 87.9%

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

    if -2e110 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 92.8%

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

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

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

Alternative 10: 85.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+23} \lor \neg \left(z \leq 0.0065\right):\\
\;\;\;\;x + \frac{y}{a} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e23 or 0.0064999999999999997 < z

    1. Initial program 93.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 82.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr86.9%

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

    if -4.8e23 < z < 0.0064999999999999997

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

Alternative 11: 78.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+96} \lor \neg \left(t \leq 1.15 \cdot 10^{+121}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.19999999999999996e96 or 1.1499999999999999e121 < t

    1. Initial program 88.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 72.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{a} - \frac{t}{a}\right)} \]
    6. Step-by-step derivation
      1. div-sub74.8%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    7. Simplified74.8%

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

    if -8.19999999999999996e96 < t < 1.1499999999999999e121

    1. Initial program 94.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 80.1%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr84.2%

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

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

Alternative 12: 84.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+23} \lor \neg \left(z \leq 0.72\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 -3.5e+23) (not (<= z 0.72)))
   (+ x (* (/ y a) z))
   (- x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -3.5e+23) || !(z <= 0.72)) {
		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 <= (-3.5d+23)) .or. (.not. (z <= 0.72d0))) 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 <= -3.5e+23) || !(z <= 0.72)) {
		tmp = x + ((y / a) * z);
	} else {
		tmp = x - (y * (t / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -3.5e+23) or not (z <= 0.72):
		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 <= -3.5e+23) || !(z <= 0.72))
		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 <= -3.5e+23) || ~((z <= 0.72)))
		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, -3.5e+23], N[Not[LessEqual[z, 0.72]], $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 -3.5 \cdot 10^{+23} \lor \neg \left(z \leq 0.72\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 < -3.5000000000000002e23 or 0.71999999999999997 < z

    1. Initial program 93.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 82.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} \]
    9. Applied egg-rr86.9%

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

    if -3.5000000000000002e23 < z < 0.71999999999999997

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t}{a} \cdot y} \]
      5. *-commutative87.6%

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

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

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

Alternative 13: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 14: 38.8% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 42.2%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification42.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.3% 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 2024031 
(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)))