Data.Colour.Matrix:inverse from colour-2.3.3, B

Percentage Accurate: 91.4% → 94.3%
Time: 8.9s
Alternatives: 12
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y - z \cdot t}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) - (z * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a):
	return ((x * y) - (z * t)) / a
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * 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[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 91.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y - z \cdot t}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) - (z * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a):
	return ((x * y) - (z * t)) / a
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * 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[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}

Alternative 1: 94.3% accurate, 0.1× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 6.3 \cdot 10^{+106}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m} - \frac{t}{\frac{a\_m}{z}}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 6.3e+106)
    (/ (fma x y (* z (- t))) a_m)
    (- (* x (/ y a_m)) (/ t (/ a_m z))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 6.3e+106) {
		tmp = fma(x, y, (z * -t)) / a_m;
	} else {
		tmp = (x * (y / a_m)) - (t / (a_m / z));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 6.3e+106)
		tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a_m);
	else
		tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(t / Float64(a_m / z)));
	end
	return Float64(a_s * tmp)
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 6.3e+106], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 6.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.29999999999999974e106

    1. Initial program 94.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub91.6%

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

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot t}}{a} \]
      5. fma-neg94.4%

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

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

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

    if 6.29999999999999974e106 < a

    1. Initial program 74.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{a} - \color{blue}{\left(-t\right) \cdot \frac{z}{a}} \]
      11. clear-num55.0%

        \[\leadsto x \cdot \frac{y}{a} - \left(-t\right) \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      12. un-div-inv55.0%

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

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

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

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

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

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

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

Alternative 2: 71.6% accurate, 0.3× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{a\_m}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot y}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1}{\frac{\frac{a\_m}{t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= (* x y) -5e+145)
    (/ x (/ a_m y))
    (if (<= (* x y) -2e+57)
      (/ (* z (- t)) a_m)
      (if (<= (* x y) -2e-32)
        (/ (* x y) a_m)
        (if (<= (* x y) 5e-30) (/ -1.0 (/ (/ a_m t) z)) (* x (/ y a_m))))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = (z * -t) / a_m;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = -1.0 / ((a_m / t) / z);
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if ((x * y) <= (-5d+145)) then
        tmp = x / (a_m / y)
    else if ((x * y) <= (-2d+57)) then
        tmp = (z * -t) / a_m
    else if ((x * y) <= (-2d-32)) then
        tmp = (x * y) / a_m
    else if ((x * y) <= 5d-30) then
        tmp = (-1.0d0) / ((a_m / t) / z)
    else
        tmp = x * (y / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = (z * -t) / a_m;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = -1.0 / ((a_m / t) / z);
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (x * y) <= -5e+145:
		tmp = x / (a_m / y)
	elif (x * y) <= -2e+57:
		tmp = (z * -t) / a_m
	elif (x * y) <= -2e-32:
		tmp = (x * y) / a_m
	elif (x * y) <= 5e-30:
		tmp = -1.0 / ((a_m / t) / z)
	else:
		tmp = x * (y / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (Float64(x * y) <= -5e+145)
		tmp = Float64(x / Float64(a_m / y));
	elseif (Float64(x * y) <= -2e+57)
		tmp = Float64(Float64(z * Float64(-t)) / a_m);
	elseif (Float64(x * y) <= -2e-32)
		tmp = Float64(Float64(x * y) / a_m);
	elseif (Float64(x * y) <= 5e-30)
		tmp = Float64(-1.0 / Float64(Float64(a_m / t) / z));
	else
		tmp = Float64(x * Float64(y / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((x * y) <= -5e+145)
		tmp = x / (a_m / y);
	elseif ((x * y) <= -2e+57)
		tmp = (z * -t) / a_m;
	elseif ((x * y) <= -2e-32)
		tmp = (x * y) / a_m;
	elseif ((x * y) <= 5e-30)
		tmp = -1.0 / ((a_m / t) / z);
	else
		tmp = x * (y / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], N[(N[(z * (-t)), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], N[(-1.0 / N[(N[(a$95$m / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\frac{\frac{a\_m}{t}}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -4.99999999999999967e145

    1. Initial program 88.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 72.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified83.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Applied egg-rr83.5%

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

    if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 77.3%

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot t\right) \cdot z}}{a} \]
      2. mul-1-neg77.3%

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

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

    if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.3%

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

    if -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30

    1. Initial program 93.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 82.9%

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot t\right) \cdot z}}{a} \]
      2. mul-1-neg82.9%

        \[\leadsto \frac{\color{blue}{\left(-t\right)} \cdot z}{a} \]
    5. Simplified82.9%

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

        \[\leadsto \frac{\color{blue}{z \cdot \left(-t\right)}}{a} \]
      2. distribute-rgt-neg-out82.9%

        \[\leadsto \frac{\color{blue}{-z \cdot t}}{a} \]
      3. distribute-neg-frac82.9%

        \[\leadsto \color{blue}{-\frac{z \cdot t}{a}} \]
      4. associate-*r/79.2%

        \[\leadsto -\color{blue}{z \cdot \frac{t}{a}} \]
      5. *-commutative79.2%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-z\right)} \]
    7. Applied egg-rr79.2%

      \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-z\right)} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out79.2%

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

        \[\leadsto -\color{blue}{\frac{t \cdot z}{a}} \]
      3. clear-num82.4%

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{t \cdot z}}} \]
      5. metadata-eval82.4%

        \[\leadsto \frac{\color{blue}{-1}}{\frac{a}{t \cdot z}} \]
      6. associate-/r*79.8%

        \[\leadsto \frac{-1}{\color{blue}{\frac{\frac{a}{t}}{z}}} \]
    9. Applied egg-rr79.8%

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

    if 4.99999999999999972e-30 < (*.f64 x y)

    1. Initial program 84.8%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 73.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified76.3%

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

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

Alternative 3: 72.7% accurate, 0.3× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_1 := \frac{z \cdot \left(-t\right)}{a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{a\_m}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot y}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m}\\ \end{array} \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (let* ((t_1 (/ (* z (- t)) a_m)))
   (*
    a_s
    (if (<= (* x y) -5e+145)
      (/ x (/ a_m y))
      (if (<= (* x y) -2e+57)
        t_1
        (if (<= (* x y) -2e-32)
          (/ (* x y) a_m)
          (if (<= (* x y) 5e-30) t_1 (* x (/ y a_m)))))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (z * -t) / a_m;
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = t_1;
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * -t) / a_m
    if ((x * y) <= (-5d+145)) then
        tmp = x / (a_m / y)
    else if ((x * y) <= (-2d+57)) then
        tmp = t_1
    else if ((x * y) <= (-2d-32)) then
        tmp = (x * y) / a_m
    else if ((x * y) <= 5d-30) then
        tmp = t_1
    else
        tmp = x * (y / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (z * -t) / a_m;
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = t_1;
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	t_1 = (z * -t) / a_m
	tmp = 0
	if (x * y) <= -5e+145:
		tmp = x / (a_m / y)
	elif (x * y) <= -2e+57:
		tmp = t_1
	elif (x * y) <= -2e-32:
		tmp = (x * y) / a_m
	elif (x * y) <= 5e-30:
		tmp = t_1
	else:
		tmp = x * (y / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	t_1 = Float64(Float64(z * Float64(-t)) / a_m)
	tmp = 0.0
	if (Float64(x * y) <= -5e+145)
		tmp = Float64(x / Float64(a_m / y));
	elseif (Float64(x * y) <= -2e+57)
		tmp = t_1;
	elseif (Float64(x * y) <= -2e-32)
		tmp = Float64(Float64(x * y) / a_m);
	elseif (Float64(x * y) <= 5e-30)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(y / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	t_1 = (z * -t) / a_m;
	tmp = 0.0;
	if ((x * y) <= -5e+145)
		tmp = x / (a_m / y);
	elseif ((x * y) <= -2e+57)
		tmp = t_1;
	elseif ((x * y) <= -2e-32)
		tmp = (x * y) / a_m;
	elseif ((x * y) <= 5e-30)
		tmp = t_1;
	else
		tmp = x * (y / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(z * (-t)), $MachinePrecision] / a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], t$95$1, N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

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

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.99999999999999967e145

    1. Initial program 88.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 72.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified83.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Applied egg-rr83.5%

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

    if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57 or -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30

    1. Initial program 94.1%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 82.4%

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot t\right) \cdot z}}{a} \]
      2. mul-1-neg82.4%

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

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

    if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.3%

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

    if 4.99999999999999972e-30 < (*.f64 x y)

    1. Initial program 84.8%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 73.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified76.3%

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

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

Alternative 4: 71.9% accurate, 0.3× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{a\_m}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot y}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\ \;\;\;\;z \cdot \frac{-t}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= (* x y) -5e+145)
    (/ x (/ a_m y))
    (if (<= (* x y) -2e+57)
      (* (- t) (/ z a_m))
      (if (<= (* x y) -2e-32)
        (/ (* x y) a_m)
        (if (<= (* x y) 5e-30) (* z (/ (- t) a_m)) (* x (/ y a_m))))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = -t * (z / a_m);
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = z * (-t / a_m);
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if ((x * y) <= (-5d+145)) then
        tmp = x / (a_m / y)
    else if ((x * y) <= (-2d+57)) then
        tmp = -t * (z / a_m)
    else if ((x * y) <= (-2d-32)) then
        tmp = (x * y) / a_m
    else if ((x * y) <= 5d-30) then
        tmp = z * (-t / a_m)
    else
        tmp = x * (y / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = -t * (z / a_m);
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-30) {
		tmp = z * (-t / a_m);
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (x * y) <= -5e+145:
		tmp = x / (a_m / y)
	elif (x * y) <= -2e+57:
		tmp = -t * (z / a_m)
	elif (x * y) <= -2e-32:
		tmp = (x * y) / a_m
	elif (x * y) <= 5e-30:
		tmp = z * (-t / a_m)
	else:
		tmp = x * (y / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (Float64(x * y) <= -5e+145)
		tmp = Float64(x / Float64(a_m / y));
	elseif (Float64(x * y) <= -2e+57)
		tmp = Float64(Float64(-t) * Float64(z / a_m));
	elseif (Float64(x * y) <= -2e-32)
		tmp = Float64(Float64(x * y) / a_m);
	elseif (Float64(x * y) <= 5e-30)
		tmp = Float64(z * Float64(Float64(-t) / a_m));
	else
		tmp = Float64(x * Float64(y / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((x * y) <= -5e+145)
		tmp = x / (a_m / y);
	elseif ((x * y) <= -2e+57)
		tmp = -t * (z / a_m);
	elseif ((x * y) <= -2e-32)
		tmp = (x * y) / a_m;
	elseif ((x * y) <= 5e-30)
		tmp = z * (-t / a_m);
	else
		tmp = x * (y / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], N[((-t) * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-30], N[(z * N[((-t) / a$95$m), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-30}:\\
\;\;\;\;z \cdot \frac{-t}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -4.99999999999999967e145

    1. Initial program 88.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 72.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified83.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Applied egg-rr83.5%

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

    if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 77.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    4. Step-by-step derivation
      1. mul-1-neg77.3%

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in77.0%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      4. distribute-neg-frac277.0%

        \[\leadsto t \cdot \color{blue}{\frac{z}{-a}} \]
    5. Simplified77.0%

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

    if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.3%

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

    if -2.00000000000000011e-32 < (*.f64 x y) < 4.99999999999999972e-30

    1. Initial program 93.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 82.9%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)} \]
      3. neg-mul-179.2%

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

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

        \[\leadsto z \cdot \color{blue}{\frac{-t}{a}} \]
    5. Simplified79.2%

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

    if 4.99999999999999972e-30 < (*.f64 x y)

    1. Initial program 84.8%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 73.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified76.3%

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

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

Alternative 5: 71.6% accurate, 0.3× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_1 := \left(-t\right) \cdot \frac{z}{a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\frac{a\_m}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot y}{a\_m}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-49}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m}\\ \end{array} \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (let* ((t_1 (* (- t) (/ z a_m))))
   (*
    a_s
    (if (<= (* x y) -5e+145)
      (/ x (/ a_m y))
      (if (<= (* x y) -2e+57)
        t_1
        (if (<= (* x y) -2e-32)
          (/ (* x y) a_m)
          (if (<= (* x y) 5e-49) t_1 (* x (/ y a_m)))))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = -t * (z / a_m);
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-49) {
		tmp = t_1;
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -t * (z / a_m)
    if ((x * y) <= (-5d+145)) then
        tmp = x / (a_m / y)
    else if ((x * y) <= (-2d+57)) then
        tmp = t_1
    else if ((x * y) <= (-2d-32)) then
        tmp = (x * y) / a_m
    else if ((x * y) <= 5d-49) then
        tmp = t_1
    else
        tmp = x * (y / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = -t * (z / a_m);
	double tmp;
	if ((x * y) <= -5e+145) {
		tmp = x / (a_m / y);
	} else if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= -2e-32) {
		tmp = (x * y) / a_m;
	} else if ((x * y) <= 5e-49) {
		tmp = t_1;
	} else {
		tmp = x * (y / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	t_1 = -t * (z / a_m)
	tmp = 0
	if (x * y) <= -5e+145:
		tmp = x / (a_m / y)
	elif (x * y) <= -2e+57:
		tmp = t_1
	elif (x * y) <= -2e-32:
		tmp = (x * y) / a_m
	elif (x * y) <= 5e-49:
		tmp = t_1
	else:
		tmp = x * (y / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	t_1 = Float64(Float64(-t) * Float64(z / a_m))
	tmp = 0.0
	if (Float64(x * y) <= -5e+145)
		tmp = Float64(x / Float64(a_m / y));
	elseif (Float64(x * y) <= -2e+57)
		tmp = t_1;
	elseif (Float64(x * y) <= -2e-32)
		tmp = Float64(Float64(x * y) / a_m);
	elseif (Float64(x * y) <= 5e-49)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(y / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	t_1 = -t * (z / a_m);
	tmp = 0.0;
	if ((x * y) <= -5e+145)
		tmp = x / (a_m / y);
	elseif ((x * y) <= -2e+57)
		tmp = t_1;
	elseif ((x * y) <= -2e-32)
		tmp = (x * y) / a_m;
	elseif ((x * y) <= 5e-49)
		tmp = t_1;
	else
		tmp = x * (y / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[((-t) * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -5e+145], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-32], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-49], t$95$1, N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

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

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.99999999999999967e145

    1. Initial program 88.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 72.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified83.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Applied egg-rr83.5%

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

    if -4.99999999999999967e145 < (*.f64 x y) < -2.0000000000000001e57 or -2.00000000000000011e-32 < (*.f64 x y) < 4.9999999999999999e-49

    1. Initial program 93.9%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 84.4%

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      4. distribute-neg-frac284.2%

        \[\leadsto t \cdot \color{blue}{\frac{z}{-a}} \]
    5. Simplified84.2%

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

    if -2.0000000000000001e57 < (*.f64 x y) < -2.00000000000000011e-32

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.3%

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

    if 4.9999999999999999e-49 < (*.f64 x y)

    1. Initial program 86.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 71.9%

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified74.3%

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

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

Alternative 6: 93.2% accurate, 0.5× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot t \leq 2 \cdot 10^{+274}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\frac{x \cdot y}{t} - z}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= (* z t) 2e+274)
    (/ (- (* x y) (* z t)) a_m)
    (* t (/ (- (/ (* x y) t) z) a_m)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((z * t) <= 2e+274) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = t * ((((x * y) / t) - z) / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if ((z * t) <= 2d+274) then
        tmp = ((x * y) - (z * t)) / a_m
    else
        tmp = t * ((((x * y) / t) - z) / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((z * t) <= 2e+274) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = t * ((((x * y) / t) - z) / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (z * t) <= 2e+274:
		tmp = ((x * y) - (z * t)) / a_m
	else:
		tmp = t * ((((x * y) / t) - z) / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (Float64(z * t) <= 2e+274)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m);
	else
		tmp = Float64(t * Float64(Float64(Float64(Float64(x * y) / t) - z) / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((z * t) <= 2e+274)
		tmp = ((x * y) - (z * t)) / a_m;
	else
		tmp = t * ((((x * y) / t) - z) / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(z * t), $MachinePrecision], 2e+274], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(t * N[(N[(N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision] - z), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot t \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < 1.99999999999999984e274

    1. Initial program 93.8%

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

    if 1.99999999999999984e274 < (*.f64 z t)

    1. Initial program 55.2%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 89.2%

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

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

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

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

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

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

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

Alternative 7: 94.0% accurate, 0.6× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 7.5 \cdot 10^{+106}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m} - \frac{t}{\frac{a\_m}{z}}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 7.5e+106)
    (/ (- (* x y) (* z t)) a_m)
    (- (* x (/ y a_m)) (/ t (/ a_m z))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 7.5e+106) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = (x * (y / a_m)) - (t / (a_m / z));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if (a_m <= 7.5d+106) then
        tmp = ((x * y) - (z * t)) / a_m
    else
        tmp = (x * (y / a_m)) - (t / (a_m / z))
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 7.5e+106) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = (x * (y / a_m)) - (t / (a_m / z));
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if a_m <= 7.5e+106:
		tmp = ((x * y) - (z * t)) / a_m
	else:
		tmp = (x * (y / a_m)) - (t / (a_m / z))
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 7.5e+106)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m);
	else
		tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(t / Float64(a_m / z)));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if (a_m <= 7.5e+106)
		tmp = ((x * y) - (z * t)) / a_m;
	else
		tmp = (x * (y / a_m)) - (t / (a_m / z));
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 7.5e+106], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 7.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 7.50000000000000058e106

    1. Initial program 94.4%

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

    if 7.50000000000000058e106 < a

    1. Initial program 74.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{a} - \color{blue}{\left(-t\right) \cdot \frac{z}{a}} \]
      11. clear-num55.0%

        \[\leadsto x \cdot \frac{y}{a} - \left(-t\right) \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      12. un-div-inv55.0%

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

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

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

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

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

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

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

Alternative 8: 95.3% accurate, 0.6× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a\_m} - z \cdot \frac{t}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 1.4e-5)
    (/ (- (* x y) (* z t)) a_m)
    (- (* x (/ y a_m)) (* z (/ t a_m))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 1.4e-5) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = (x * (y / a_m)) - (z * (t / a_m));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if (a_m <= 1.4d-5) then
        tmp = ((x * y) - (z * t)) / a_m
    else
        tmp = (x * (y / a_m)) - (z * (t / a_m))
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 1.4e-5) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = (x * (y / a_m)) - (z * (t / a_m));
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if a_m <= 1.4e-5:
		tmp = ((x * y) - (z * t)) / a_m
	else:
		tmp = (x * (y / a_m)) - (z * (t / a_m))
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 1.4e-5)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m);
	else
		tmp = Float64(Float64(x * Float64(y / a_m)) - Float64(z * Float64(t / a_m)));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if (a_m <= 1.4e-5)
		tmp = ((x * y) - (z * t)) / a_m;
	else
		tmp = (x * (y / a_m)) - (z * (t / a_m));
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 1.4e-5], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[(N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.39999999999999998e-5

    1. Initial program 93.8%

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

    if 1.39999999999999998e-5 < a

    1. Initial program 82.8%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub82.8%

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

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

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

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

Alternative 9: 93.3% accurate, 0.6× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;z \cdot t \leq 2 \cdot 10^{+274}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= (* z t) 2e+274) (/ (- (* x y) (* z t)) a_m) (* (- t) (/ z a_m)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((z * t) <= 2e+274) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = -t * (z / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if ((z * t) <= 2d+274) then
        tmp = ((x * y) - (z * t)) / a_m
    else
        tmp = -t * (z / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if ((z * t) <= 2e+274) {
		tmp = ((x * y) - (z * t)) / a_m;
	} else {
		tmp = -t * (z / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if (z * t) <= 2e+274:
		tmp = ((x * y) - (z * t)) / a_m
	else:
		tmp = -t * (z / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (Float64(z * t) <= 2e+274)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a_m);
	else
		tmp = Float64(Float64(-t) * Float64(z / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if ((z * t) <= 2e+274)
		tmp = ((x * y) - (z * t)) / a_m;
	else
		tmp = -t * (z / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(z * t), $MachinePrecision], 2e+274], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], N[((-t) * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot t \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < 1.99999999999999984e274

    1. Initial program 93.8%

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

    if 1.99999999999999984e274 < (*.f64 z t)

    1. Initial program 55.2%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 55.5%

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in94.4%

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

        \[\leadsto t \cdot \color{blue}{\frac{z}{-a}} \]
    5. Simplified94.4%

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

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

Alternative 10: 52.1% accurate, 0.9× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 1.35 \cdot 10^{+94}:\\ \;\;\;\;\frac{x \cdot y}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a\_m}{y}}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (* a_s (if (<= a_m 1.35e+94) (/ (* x y) a_m) (/ x (/ a_m y)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 1.35e+94) {
		tmp = (x * y) / a_m;
	} else {
		tmp = x / (a_m / y);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if (a_m <= 1.35d+94) then
        tmp = (x * y) / a_m
    else
        tmp = x / (a_m / y)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 1.35e+94) {
		tmp = (x * y) / a_m;
	} else {
		tmp = x / (a_m / y);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if a_m <= 1.35e+94:
		tmp = (x * y) / a_m
	else:
		tmp = x / (a_m / y)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 1.35e+94)
		tmp = Float64(Float64(x * y) / a_m);
	else
		tmp = Float64(x / Float64(a_m / y));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if (a_m <= 1.35e+94)
		tmp = (x * y) / a_m;
	else
		tmp = x / (a_m / y);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 1.35e+94], N[(N[(x * y), $MachinePrecision] / a$95$m), $MachinePrecision], N[(x / N[(a$95$m / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 1.35 \cdot 10^{+94}:\\
\;\;\;\;\frac{x \cdot y}{a\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a\_m}{y}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.3500000000000001e94

    1. Initial program 94.3%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 48.3%

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

    if 1.3500000000000001e94 < a

    1. Initial program 76.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 41.6%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    6. Step-by-step derivation
      1. clear-num54.0%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Applied egg-rr54.2%

      \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 51.8% accurate, 0.9× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{y}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a\_m}\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m)
 :precision binary64
 (* a_s (if (<= z -4.4e-184) (* x (/ y a_m)) (* y (/ x a_m)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (z <= -4.4e-184) {
		tmp = x * (y / a_m);
	} else {
		tmp = y * (x / a_m);
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    real(8) :: tmp
    if (z <= (-4.4d-184)) then
        tmp = x * (y / a_m)
    else
        tmp = y * (x / a_m)
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (z <= -4.4e-184) {
		tmp = x * (y / a_m);
	} else {
		tmp = y * (x / a_m);
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	tmp = 0
	if z <= -4.4e-184:
		tmp = x * (y / a_m)
	else:
		tmp = y * (x / a_m)
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (z <= -4.4e-184)
		tmp = Float64(x * Float64(y / a_m));
	else
		tmp = Float64(y * Float64(x / a_m));
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp_2 = code(a_s, x, y, z, t, a_m)
	tmp = 0.0;
	if (z <= -4.4e-184)
		tmp = x * (y / a_m);
	else
		tmp = y * (x / a_m);
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[z, -4.4e-184], N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-184}:\\
\;\;\;\;x \cdot \frac{y}{a\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.39999999999999984e-184

    1. Initial program 91.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 40.8%

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

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

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

    if -4.39999999999999984e-184 < z

    1. Initial program 90.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 77.4%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 51.7% accurate, 1.8× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \left(x \cdot \frac{y}{a\_m}\right) \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s x y z t a_m) :precision binary64 (* a_s (* x (/ y a_m))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	return a_s * (x * (y / a_m));
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
real(8) function code(a_s, x, y, z, t, a_m)
    real(8), intent (in) :: a_s
    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_m
    code = a_s * (x * (y / a_m))
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	return a_s * (x * (y / a_m));
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
def code(a_s, x, y, z, t, a_m):
	return a_s * (x * (y / a_m))
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, x, y, z, t, a_m)
	return Float64(a_s * Float64(x * Float64(y / a_m)))
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
function tmp = code(a_s, x, y, z, t, a_m)
	tmp = a_s * (x * (y / a_m));
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(x * N[(y / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \left(x \cdot \frac{y}{a\_m}\right)
\end{array}
Derivation
  1. Initial program 91.0%

    \[\frac{x \cdot y - z \cdot t}{a} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 47.1%

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
  6. Add Preprocessing

Developer target: 90.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024085 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :alt
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

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