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

Percentage Accurate: 90.9% → 95.9%
Time: 7.7s
Alternatives: 11
Speedup: 0.4×

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 11 alternatives:

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

Initial Program: 90.9% 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: 95.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;z \cdot \left(x \cdot \frac{y}{z \cdot a} - \frac{t}{a}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+270}:\\ \;\;\;\;\frac{t\_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{y}{z} - t\right) \cdot \frac{z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (<= t_1 (- INFINITY))
     (* z (- (* x (/ y (* z a))) (/ t a)))
     (if (<= t_1 1e+270) (/ t_1 a) (* (- (* x (/ y z)) t) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = z * ((x * (y / (z * a))) - (t / a));
	} else if (t_1 <= 1e+270) {
		tmp = t_1 / a;
	} else {
		tmp = ((x * (y / z)) - t) * (z / a);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = z * ((x * (y / (z * a))) - (t / a));
	} else if (t_1 <= 1e+270) {
		tmp = t_1 / a;
	} else {
		tmp = ((x * (y / z)) - t) * (z / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x * y) - (z * t)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = z * ((x * (y / (z * a))) - (t / a))
	elif t_1 <= 1e+270:
		tmp = t_1 / a
	else:
		tmp = ((x * (y / z)) - t) * (z / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(z * Float64(Float64(x * Float64(y / Float64(z * a))) - Float64(t / a)));
	elseif (t_1 <= 1e+270)
		tmp = Float64(t_1 / a);
	else
		tmp = Float64(Float64(Float64(x * Float64(y / z)) - t) * Float64(z / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = z * ((x * (y / (z * a))) - (t / a));
	elseif (t_1 <= 1e+270)
		tmp = t_1 / a;
	else
		tmp = ((x * (y / z)) - t) * (z / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(N[(x * N[(y / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+270], N[(t$95$1 / a), $MachinePrecision], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 10^{+270}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 55.4%

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e270

    1. Initial program 98.5%

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

    if 1e270 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot \frac{y}{z} - \color{blue}{t \cdot 1}\right) \cdot z}{a} \]
      12. cancel-sign-sub-inv81.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, -t \cdot 1\right)} \cdot z}{a} \]
      15. associate-/l*95.1%

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

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

Alternative 2: 75.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot t}{-a}\\ t_2 := \frac{-t}{\frac{a}{z}}\\ \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-125}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;z \cdot t \leq 10^{+233}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* z t) (- a))) (t_2 (/ (- t) (/ a z))))
   (if (<= (* z t) (- INFINITY))
     t_2
     (if (<= (* z t) -2e-53)
       t_1
       (if (<= (* z t) 2e-125)
         (/ (* x y) a)
         (if (<= (* z t) 1e+233) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z * t) / -a;
	double t_2 = -t / (a / z);
	double tmp;
	if ((z * t) <= -((double) INFINITY)) {
		tmp = t_2;
	} else if ((z * t) <= -2e-53) {
		tmp = t_1;
	} else if ((z * t) <= 2e-125) {
		tmp = (x * y) / a;
	} else if ((z * t) <= 1e+233) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z * t) / -a;
	double t_2 = -t / (a / z);
	double tmp;
	if ((z * t) <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if ((z * t) <= -2e-53) {
		tmp = t_1;
	} else if ((z * t) <= 2e-125) {
		tmp = (x * y) / a;
	} else if ((z * t) <= 1e+233) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z * t) / -a
	t_2 = -t / (a / z)
	tmp = 0
	if (z * t) <= -math.inf:
		tmp = t_2
	elif (z * t) <= -2e-53:
		tmp = t_1
	elif (z * t) <= 2e-125:
		tmp = (x * y) / a
	elif (z * t) <= 1e+233:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z * t) / Float64(-a))
	t_2 = Float64(Float64(-t) / Float64(a / z))
	tmp = 0.0
	if (Float64(z * t) <= Float64(-Inf))
		tmp = t_2;
	elseif (Float64(z * t) <= -2e-53)
		tmp = t_1;
	elseif (Float64(z * t) <= 2e-125)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(z * t) <= 1e+233)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z * t) / -a;
	t_2 = -t / (a / z);
	tmp = 0.0;
	if ((z * t) <= -Inf)
		tmp = t_2;
	elseif ((z * t) <= -2e-53)
		tmp = t_1;
	elseif ((z * t) <= 2e-125)
		tmp = (x * y) / a;
	elseif ((z * t) <= 1e+233)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] / (-a)), $MachinePrecision]}, Block[{t$95$2 = N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], t$95$2, If[LessEqual[N[(z * t), $MachinePrecision], -2e-53], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e-125], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+233], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z \cdot t}{-a}\\
t_2 := \frac{-t}{\frac{a}{z}}\\
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-125}:\\
\;\;\;\;\frac{x \cdot y}{a}\\

\mathbf{elif}\;z \cdot t \leq 10^{+233}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -inf.0 or 9.99999999999999974e232 < (*.f64 z t)

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a} \]
      3. remove-double-neg76.5%

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

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

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

        \[\leadsto \color{blue}{\frac{z}{-a} \cdot t} \]
      7. add-sqr-sqrt41.4%

        \[\leadsto \frac{z}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      8. sqrt-unprod42.1%

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

        \[\leadsto \frac{z}{\sqrt{\color{blue}{a \cdot a}}} \cdot t \]
      10. sqrt-unprod3.9%

        \[\leadsto \frac{z}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \cdot t \]
      11. add-sqr-sqrt4.2%

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

      \[\leadsto \color{blue}{\frac{z}{a} \cdot t} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt2.2%

        \[\leadsto \color{blue}{\sqrt{\frac{z}{a} \cdot t} \cdot \sqrt{\frac{z}{a} \cdot t}} \]
      2. sqrt-unprod34.7%

        \[\leadsto \color{blue}{\sqrt{\left(\frac{z}{a} \cdot t\right) \cdot \left(\frac{z}{a} \cdot t\right)}} \]
      3. *-commutative34.7%

        \[\leadsto \sqrt{\color{blue}{\left(t \cdot \frac{z}{a}\right)} \cdot \left(\frac{z}{a} \cdot t\right)} \]
      4. clear-num34.7%

        \[\leadsto \sqrt{\left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right) \cdot \left(\frac{z}{a} \cdot t\right)} \]
      5. div-inv34.7%

        \[\leadsto \sqrt{\color{blue}{\frac{t}{\frac{a}{z}}} \cdot \left(\frac{z}{a} \cdot t\right)} \]
      6. *-commutative34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)}} \]
      7. clear-num34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right)} \]
      8. div-inv34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\frac{t}{\frac{a}{z}}}} \]
      9. *-un-lft-identity34.7%

        \[\leadsto \sqrt{\color{blue}{\left(1 \cdot \frac{t}{\frac{a}{z}}\right)} \cdot \frac{t}{\frac{a}{z}}} \]
      10. associate-*l*34.7%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \left(\frac{t}{\frac{a}{z}} \cdot \frac{t}{\frac{a}{z}}\right)}} \]
      11. metadata-eval34.7%

        \[\leadsto \sqrt{\color{blue}{\left(-1 \cdot -1\right)} \cdot \left(\frac{t}{\frac{a}{z}} \cdot \frac{t}{\frac{a}{z}}\right)} \]
      12. swap-sqr34.7%

        \[\leadsto \sqrt{\color{blue}{\left(-1 \cdot \frac{t}{\frac{a}{z}}\right) \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)}} \]
      13. clear-num34.7%

        \[\leadsto \sqrt{\left(-1 \cdot \color{blue}{\frac{1}{\frac{\frac{a}{z}}{t}}}\right) \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)} \]
      14. div-inv34.7%

        \[\leadsto \sqrt{\color{blue}{\frac{-1}{\frac{\frac{a}{z}}{t}}} \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)} \]
      15. clear-num34.7%

        \[\leadsto \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}} \cdot \left(-1 \cdot \color{blue}{\frac{1}{\frac{\frac{a}{z}}{t}}}\right)} \]
      16. div-inv34.7%

        \[\leadsto \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}} \cdot \color{blue}{\frac{-1}{\frac{\frac{a}{z}}{t}}}} \]
      17. sqrt-unprod41.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}}} \cdot \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}}}} \]
      18. add-sqr-sqrt94.1%

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

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

    if -inf.0 < (*.f64 z t) < -2.00000000000000006e-53 or 2.00000000000000002e-125 < (*.f64 z t) < 9.99999999999999974e232

    1. Initial program 98.1%

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

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

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

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

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

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

    if -2.00000000000000006e-53 < (*.f64 z t) < 2.00000000000000002e-125

    1. Initial program 93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-53}:\\ \;\;\;\;\frac{z \cdot t}{-a}\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-125}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;z \cdot t \leq 10^{+233}:\\ \;\;\;\;\frac{z \cdot t}{-a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y \cdot \left(\frac{x}{a} - t \cdot \frac{z}{y \cdot a}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+270}:\\ \;\;\;\;\frac{t\_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{y}{z} - t\right) \cdot \frac{z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (<= t_1 (- INFINITY))
     (* y (- (/ x a) (* t (/ z (* y a)))))
     (if (<= t_1 1e+270) (/ t_1 a) (* (- (* x (/ y z)) t) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y * ((x / a) - (t * (z / (y * a))));
	} else if (t_1 <= 1e+270) {
		tmp = t_1 / a;
	} else {
		tmp = ((x * (y / z)) - t) * (z / a);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = y * ((x / a) - (t * (z / (y * a))));
	} else if (t_1 <= 1e+270) {
		tmp = t_1 / a;
	} else {
		tmp = ((x * (y / z)) - t) * (z / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x * y) - (z * t)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = y * ((x / a) - (t * (z / (y * a))))
	elif t_1 <= 1e+270:
		tmp = t_1 / a
	else:
		tmp = ((x * (y / z)) - t) * (z / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y * Float64(Float64(x / a) - Float64(t * Float64(z / Float64(y * a)))));
	elseif (t_1 <= 1e+270)
		tmp = Float64(t_1 / a);
	else
		tmp = Float64(Float64(Float64(x * Float64(y / z)) - t) * Float64(z / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = y * ((x / a) - (t * (z / (y * a))));
	elseif (t_1 <= 1e+270)
		tmp = t_1 / a;
	else
		tmp = ((x * (y / z)) - t) * (z / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(x / a), $MachinePrecision] - N[(t * N[(z / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+270], N[(t$95$1 / a), $MachinePrecision], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 10^{+270}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 55.4%

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

      \[\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. +-commutative69.8%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e270

    1. Initial program 98.5%

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

    if 1e270 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot \frac{y}{z} - \color{blue}{t \cdot 1}\right) \cdot z}{a} \]
      12. cancel-sign-sub-inv81.0%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, -t \cdot 1\right)} \cdot z}{a} \]
      15. associate-/l*95.1%

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

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

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

Alternative 4: 95.8% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -inf.0 or 2.00000000000000003e184 < (*.f64 z t)

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\color{blue}{x \cdot \frac{y}{z}} - t\right) \cdot z}{a} \]
      11. *-rgt-identity82.9%

        \[\leadsto \frac{\left(x \cdot \frac{y}{z} - \color{blue}{t \cdot 1}\right) \cdot z}{a} \]
      12. cancel-sign-sub-inv82.9%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, -t \cdot 1\right)} \cdot z}{a} \]
      15. associate-/l*99.9%

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

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

    if -inf.0 < (*.f64 z t) < 2.00000000000000003e184

    1. Initial program 95.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification96.6%

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

Alternative 5: 95.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq 10^{+233}\right):\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= (* z t) (- INFINITY)) (not (<= (* z t) 1e+233)))
   (/ (- t) (/ a z))
   (/ (- (* x y) (* z t)) a)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((z * t) <= -((double) INFINITY)) || !((z * t) <= 1e+233)) {
		tmp = -t / (a / z);
	} else {
		tmp = ((x * y) - (z * t)) / a;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((z * t) <= -Double.POSITIVE_INFINITY) || !((z * t) <= 1e+233)) {
		tmp = -t / (a / z);
	} else {
		tmp = ((x * y) - (z * t)) / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if ((z * t) <= -math.inf) or not ((z * t) <= 1e+233):
		tmp = -t / (a / z)
	else:
		tmp = ((x * y) - (z * t)) / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((Float64(z * t) <= Float64(-Inf)) || !(Float64(z * t) <= 1e+233))
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (((z * t) <= -Inf) || ~(((z * t) <= 1e+233)))
		tmp = -t / (a / z);
	else
		tmp = ((x * y) - (z * t)) / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+233]], $MachinePrecision]], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq 10^{+233}\right):\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -inf.0 or 9.99999999999999974e232 < (*.f64 z t)

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a} \]
      3. remove-double-neg76.5%

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

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

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

        \[\leadsto \color{blue}{\frac{z}{-a} \cdot t} \]
      7. add-sqr-sqrt41.4%

        \[\leadsto \frac{z}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \cdot t \]
      8. sqrt-unprod42.1%

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

        \[\leadsto \frac{z}{\sqrt{\color{blue}{a \cdot a}}} \cdot t \]
      10. sqrt-unprod3.9%

        \[\leadsto \frac{z}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \cdot t \]
      11. add-sqr-sqrt4.2%

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

      \[\leadsto \color{blue}{\frac{z}{a} \cdot t} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt2.2%

        \[\leadsto \color{blue}{\sqrt{\frac{z}{a} \cdot t} \cdot \sqrt{\frac{z}{a} \cdot t}} \]
      2. sqrt-unprod34.7%

        \[\leadsto \color{blue}{\sqrt{\left(\frac{z}{a} \cdot t\right) \cdot \left(\frac{z}{a} \cdot t\right)}} \]
      3. *-commutative34.7%

        \[\leadsto \sqrt{\color{blue}{\left(t \cdot \frac{z}{a}\right)} \cdot \left(\frac{z}{a} \cdot t\right)} \]
      4. clear-num34.7%

        \[\leadsto \sqrt{\left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right) \cdot \left(\frac{z}{a} \cdot t\right)} \]
      5. div-inv34.7%

        \[\leadsto \sqrt{\color{blue}{\frac{t}{\frac{a}{z}}} \cdot \left(\frac{z}{a} \cdot t\right)} \]
      6. *-commutative34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)}} \]
      7. clear-num34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right)} \]
      8. div-inv34.7%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\frac{t}{\frac{a}{z}}}} \]
      9. *-un-lft-identity34.7%

        \[\leadsto \sqrt{\color{blue}{\left(1 \cdot \frac{t}{\frac{a}{z}}\right)} \cdot \frac{t}{\frac{a}{z}}} \]
      10. associate-*l*34.7%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \left(\frac{t}{\frac{a}{z}} \cdot \frac{t}{\frac{a}{z}}\right)}} \]
      11. metadata-eval34.7%

        \[\leadsto \sqrt{\color{blue}{\left(-1 \cdot -1\right)} \cdot \left(\frac{t}{\frac{a}{z}} \cdot \frac{t}{\frac{a}{z}}\right)} \]
      12. swap-sqr34.7%

        \[\leadsto \sqrt{\color{blue}{\left(-1 \cdot \frac{t}{\frac{a}{z}}\right) \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)}} \]
      13. clear-num34.7%

        \[\leadsto \sqrt{\left(-1 \cdot \color{blue}{\frac{1}{\frac{\frac{a}{z}}{t}}}\right) \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)} \]
      14. div-inv34.7%

        \[\leadsto \sqrt{\color{blue}{\frac{-1}{\frac{\frac{a}{z}}{t}}} \cdot \left(-1 \cdot \frac{t}{\frac{a}{z}}\right)} \]
      15. clear-num34.7%

        \[\leadsto \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}} \cdot \left(-1 \cdot \color{blue}{\frac{1}{\frac{\frac{a}{z}}{t}}}\right)} \]
      16. div-inv34.7%

        \[\leadsto \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}} \cdot \color{blue}{\frac{-1}{\frac{\frac{a}{z}}{t}}}} \]
      17. sqrt-unprod41.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}}} \cdot \sqrt{\frac{-1}{\frac{\frac{a}{z}}{t}}}} \]
      18. add-sqr-sqrt94.1%

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

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

    if -inf.0 < (*.f64 z t) < 9.99999999999999974e232

    1. Initial program 95.8%

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

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

Alternative 6: 72.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.5 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -3.5e59

    1. Initial program 84.7%

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

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

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

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

    if -3.5e59 < (*.f64 x y) < 5.00000000000000027e31

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

    if 5.00000000000000027e31 < (*.f64 x y)

    1. Initial program 90.5%

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

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

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

Alternative 7: 72.1% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.0000000000000004e-16

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

    if -5.0000000000000004e-16 < (*.f64 x y) < 5.00000000000000027e31

    1. Initial program 93.7%

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

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

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

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

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

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

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

    if 5.00000000000000027e31 < (*.f64 x y)

    1. Initial program 90.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-16}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+31}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 51.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+117}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

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


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

    1. Initial program 79.1%

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

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

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

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

    if -2.0000000000000001e117 < (*.f64 x y)

    1. Initial program 93.5%

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

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

Alternative 9: 51.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 94.8%

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

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

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

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

    if -6.5000000000000004e-171 < z

    1. Initial program 88.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{a}} \]
    9. Step-by-step derivation
      1. clear-num46.2%

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

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

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

Alternative 10: 51.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 94.8%

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

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

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

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

    if -2.0499999999999999e-169 < z

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

Alternative 11: 51.3% accurate, 1.8× speedup?

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

\\
x \cdot \frac{y}{a}
\end{array}
Derivation
  1. Initial program 91.4%

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

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

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

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

Developer Target 1: 91.3% 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 2024123 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -246868496869954800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6309831121978371/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z)))))

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