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

Percentage Accurate: 91.7% → 95.1%
Time: 8.3s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 91.7% 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.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 61.5%

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

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

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

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

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

    if -1.00000000000000005e301 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000009e305

    1. Initial program 99.4%

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

    if 5.00000000000000009e305 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.2%

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

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

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

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

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

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

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

Alternative 2: 93.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;y \cdot \left(\frac{x}{a} - \frac{t}{a} \cdot \frac{z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t \cdot \left(-z\right)\right)}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* x y) (- INFINITY))
   (* y (- (/ x a) (* (/ t a) (/ z y))))
   (/ (fma x y (* t (- z))) a)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -((double) INFINITY)) {
		tmp = y * ((x / a) - ((t / a) * (z / y)));
	} else {
		tmp = fma(x, y, (t * -z)) / a;
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(x * y) <= Float64(-Inf))
		tmp = Float64(y * Float64(Float64(x / a) - Float64(Float64(t / a) * Float64(z / y))));
	else
		tmp = Float64(fma(x, y, Float64(t * Float64(-z))) / a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(N[(x / a), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(t * (-z)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 35.2%

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

      \[\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. +-commutative77.1%

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

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

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

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

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

    if -inf.0 < (*.f64 x y)

    1. Initial program 94.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification95.1%

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

Alternative 3: 74.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-40} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-20}\right):\\
\;\;\;\;y \cdot \frac{x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.99999999999999965e-40 or 1.99999999999999989e-20 < (*.f64 x y)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

    if -4.99999999999999965e-40 < (*.f64 x y) < 1.99999999999999989e-20

    1. Initial program 95.1%

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

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

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

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

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

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

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

Alternative 4: 73.5% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.99999999999999993e90 or 1.99999999999999989e-20 < (*.f64 x y)

    1. Initial program 82.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 82.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. +-commutative82.4%

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

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

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

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

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

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

    if -1.99999999999999993e90 < (*.f64 x y) < 1.99999999999999989e-20

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

Alternative 5: 73.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-40} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-20}\right):\\
\;\;\;\;y \cdot \frac{x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.99999999999999965e-40 or 1.99999999999999989e-20 < (*.f64 x y)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

    if -4.99999999999999965e-40 < (*.f64 x y) < 1.99999999999999989e-20

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

Alternative 6: 93.4% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 35.2%

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

      \[\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. +-commutative77.1%

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

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

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

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

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

    if -inf.0 < (*.f64 x y)

    1. Initial program 94.7%

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

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

Alternative 7: 93.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{a}\\

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


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

    1. Initial program 35.2%

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

      \[\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. +-commutative77.1%

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

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

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

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

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

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

    if -inf.0 < (*.f64 x y)

    1. Initial program 94.7%

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

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

Alternative 8: 52.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.2000000000000005e106

    1. Initial program 80.6%

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

      \[\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. +-commutative80.0%

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

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

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

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

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

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

    if -8.2000000000000005e106 < x

    1. Initial program 91.2%

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

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

Alternative 9: 51.8% accurate, 1.8× speedup?

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

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

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

    \[\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. +-commutative78.2%

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

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

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

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

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

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

Alternative 10: 51.8% 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 89.6%

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

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

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

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

Developer Target 1: 91.4% 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 2024163 
(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))