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

Percentage Accurate: 92.8% → 97.7%
Time: 8.0s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 92.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.1999999999999999e-83

    1. Initial program 85.1%

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

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

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

    if -8.1999999999999999e-83 < y

    1. Initial program 95.5%

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

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(z - t\right)}{a}} \]
    5. Step-by-step derivation
      1. *-commutative95.5%

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    6. Simplified97.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-83}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\ \end{array} \]

Alternative 2: 51.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{-y}{a}\\ \mathbf{if}\;a \leq -4.4 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6.8 \cdot 10^{-224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.36 \cdot 10^{-165}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5500000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (/ (- y) a))))
   (if (<= a -4.4e-45)
     x
     (if (<= a 6.8e-224)
       t_1
       (if (<= a 1.36e-165)
         (/ (* y t) a)
         (if (<= a 6.5e-49) t_1 (if (<= a 5500000.0) (* t (/ y a)) x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (-y / a);
	double tmp;
	if (a <= -4.4e-45) {
		tmp = x;
	} else if (a <= 6.8e-224) {
		tmp = t_1;
	} else if (a <= 1.36e-165) {
		tmp = (y * t) / a;
	} else if (a <= 6.5e-49) {
		tmp = t_1;
	} else if (a <= 5500000.0) {
		tmp = t * (y / a);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (-y / a)
    if (a <= (-4.4d-45)) then
        tmp = x
    else if (a <= 6.8d-224) then
        tmp = t_1
    else if (a <= 1.36d-165) then
        tmp = (y * t) / a
    else if (a <= 6.5d-49) then
        tmp = t_1
    else if (a <= 5500000.0d0) then
        tmp = t * (y / a)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (-y / a);
	double tmp;
	if (a <= -4.4e-45) {
		tmp = x;
	} else if (a <= 6.8e-224) {
		tmp = t_1;
	} else if (a <= 1.36e-165) {
		tmp = (y * t) / a;
	} else if (a <= 6.5e-49) {
		tmp = t_1;
	} else if (a <= 5500000.0) {
		tmp = t * (y / a);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (-y / a)
	tmp = 0
	if a <= -4.4e-45:
		tmp = x
	elif a <= 6.8e-224:
		tmp = t_1
	elif a <= 1.36e-165:
		tmp = (y * t) / a
	elif a <= 6.5e-49:
		tmp = t_1
	elif a <= 5500000.0:
		tmp = t * (y / a)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(Float64(-y) / a))
	tmp = 0.0
	if (a <= -4.4e-45)
		tmp = x;
	elseif (a <= 6.8e-224)
		tmp = t_1;
	elseif (a <= 1.36e-165)
		tmp = Float64(Float64(y * t) / a);
	elseif (a <= 6.5e-49)
		tmp = t_1;
	elseif (a <= 5500000.0)
		tmp = Float64(t * Float64(y / a));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (-y / a);
	tmp = 0.0;
	if (a <= -4.4e-45)
		tmp = x;
	elseif (a <= 6.8e-224)
		tmp = t_1;
	elseif (a <= 1.36e-165)
		tmp = (y * t) / a;
	elseif (a <= 6.5e-49)
		tmp = t_1;
	elseif (a <= 5500000.0)
		tmp = t * (y / a);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.4e-45], x, If[LessEqual[a, 6.8e-224], t$95$1, If[LessEqual[a, 1.36e-165], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 6.5e-49], t$95$1, If[LessEqual[a, 5500000.0], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{a}\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{-45}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 6.8 \cdot 10^{-224}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.36 \cdot 10^{-165}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{-49}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 5500000:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.39999999999999987e-45 or 5.5e6 < a

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in97.6%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg97.6%

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

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

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

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

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

    if -4.39999999999999987e-45 < a < 6.79999999999999984e-224 or 1.3599999999999999e-165 < a < 6.49999999999999968e-49

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in95.1%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg95.1%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
    6. Simplified60.6%

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

    if 6.79999999999999984e-224 < a < 1.3599999999999999e-165

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in87.2%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg87.2%

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

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

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

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

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

    if 6.49999999999999968e-49 < a < 5.5e6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6.8 \cdot 10^{-224}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;a \leq 1.36 \cdot 10^{-165}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-49}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;a \leq 5500000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 51.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 2.65 \cdot 10^{-160}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

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

\mathbf{elif}\;a \leq 5800000:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -7.99999999999999982e38 or 5.8e6 < a

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in97.5%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg97.5%

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

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

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

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

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

    if -7.99999999999999982e38 < a < 4.50000000000000011e-226

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in94.6%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg94.6%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg57.7%

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{y}}} \]
      4. associate-/r/50.3%

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
    6. Simplified50.3%

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

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

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

    if 4.50000000000000011e-226 < a < 2.6500000000000001e-160

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in87.2%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg87.2%

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

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

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

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

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

    if 2.6500000000000001e-160 < a < 4.99999999999999968e-50

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg100.0%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
    6. Simplified66.0%

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

    if 4.99999999999999968e-50 < a < 5.8e6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+38}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 2.65 \cdot 10^{-160}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-50}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;a \leq 5800000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 50.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{-43}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 7.6 \cdot 10^{-224}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\

\mathbf{elif}\;a \leq 5.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{y \cdot t}{a}\\

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

\mathbf{elif}\;a \leq 6800000:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.05e-43 or 6.8e6 < a

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in97.6%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg97.6%

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

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

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

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

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

    if -1.05e-43 < a < 7.60000000000000005e-224

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in93.9%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg93.9%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. *-commutative61.6%

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{y}}} \]
      4. associate-/r/52.1%

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
    6. Simplified52.1%

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

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

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

    if 7.60000000000000005e-224 < a < 5.2000000000000001e-158

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in87.2%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg87.2%

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

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

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

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

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

    if 5.2000000000000001e-158 < a < 9.4999999999999993e-50

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg100.0%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
    6. Simplified66.0%

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

    if 9.4999999999999993e-50 < a < 6.8e6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{-224}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-158}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-50}:\\ \;\;\;\;z \cdot \frac{-y}{a}\\ \mathbf{elif}\;a \leq 6800000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 73.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+177} \lor \neg \left(z \leq 6 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.20000000000000005e177 or 6.0000000000000002e28 < z

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in96.6%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg96.6%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg60.8%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. *-commutative60.8%

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{y}}} \]
      4. associate-/r/57.6%

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot y} \]
    6. Simplified57.6%

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

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

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

    if -7.20000000000000005e177 < z < 6.0000000000000002e28

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in95.9%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg95.9%

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

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

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

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

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

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

Alternative 6: 81.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+39} \lor \neg \left(t \leq 2.2 \cdot 10^{-61}\right):\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3999999999999999e39 or 2.20000000000000009e-61 < t

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in99.2%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg99.2%

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

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

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

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

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

    if -3.3999999999999999e39 < t < 2.20000000000000009e-61

    1. Initial program 92.7%

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

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

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

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

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

Alternative 7: 97.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5e-95

    1. Initial program 85.9%

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

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

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

    if -4.5e-95 < y

    1. Initial program 95.4%

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

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

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

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

Alternative 8: 50.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-95}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 17000000:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.5e-95 or 1.7e7 < a

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in97.1%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg97.1%

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

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

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

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

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

    if -4.5e-95 < a < 1.7e7

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in95.0%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg95.0%

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified43.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-95}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 17000000:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 39.4% 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.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
    10. distribute-neg-in96.2%

      \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
    11. remove-double-neg96.2%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification39.4%

    \[\leadsto x \]

Developer target: 99.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023271 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :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)))