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

Percentage Accurate: 91.4% → 93.2%
Time: 9.9s
Alternatives: 11
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 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: 91.4% accurate, 1.0× speedup?

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

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

Alternative 1: 93.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;t \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 (<= (* z t) (- INFINITY)) (* 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)) {
		tmp = 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) {
		tmp = 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:
		tmp = 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))
		tmp = Float64(t * Float64(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)
		tmp = t * (-z / a);
	else
		tmp = ((x * y) - (z * t)) / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(t * 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:\\
\;\;\;\;t \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

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

    1. Initial program 96.1%

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

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

Alternative 2: 91.8% accurate, 0.1× speedup?

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

\\
\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}
\end{array}
Derivation
  1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

Alternative 3: 71.9% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -1.9999999999999999e87 or -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58

    1. Initial program 92.3%

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

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

    if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27

    1. Initial program 95.9%

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

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

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

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

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

    if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70

    1. Initial program 100.0%

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

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

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

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

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

    if 2.00000000000000015e70 < (*.f64 x y)

    1. Initial program 91.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+59}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ 1.0 (/ a (* x y)))))
   (if (<= (* x y) -2e+87)
     (/ (* x y) a)
     (if (<= (* x y) -4e+55)
       (/ (- z) (/ a t))
       (if (<= (* x y) -2e+35)
         t_1
         (if (<= (* x y) 5e-27)
           (- (/ (* z t) a))
           (if (<= (* x y) 1e+59)
             t_1
             (if (<= (* x y) 2e+70) (/ (- t) (/ a z)) (/ x (/ a y))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 1.0 / (a / (x * y));
	double tmp;
	if ((x * y) <= -2e+87) {
		tmp = (x * y) / a;
	} else if ((x * y) <= -4e+55) {
		tmp = -z / (a / t);
	} else if ((x * y) <= -2e+35) {
		tmp = t_1;
	} else if ((x * y) <= 5e-27) {
		tmp = -((z * t) / a);
	} else if ((x * y) <= 1e+59) {
		tmp = t_1;
	} else if ((x * y) <= 2e+70) {
		tmp = -t / (a / z);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 / (a / (x * y))
    if ((x * y) <= (-2d+87)) then
        tmp = (x * y) / a
    else if ((x * y) <= (-4d+55)) then
        tmp = -z / (a / t)
    else if ((x * y) <= (-2d+35)) then
        tmp = t_1
    else if ((x * y) <= 5d-27) then
        tmp = -((z * t) / a)
    else if ((x * y) <= 1d+59) then
        tmp = t_1
    else if ((x * y) <= 2d+70) then
        tmp = -t / (a / z)
    else
        tmp = x / (a / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 1.0 / (a / (x * y));
	double tmp;
	if ((x * y) <= -2e+87) {
		tmp = (x * y) / a;
	} else if ((x * y) <= -4e+55) {
		tmp = -z / (a / t);
	} else if ((x * y) <= -2e+35) {
		tmp = t_1;
	} else if ((x * y) <= 5e-27) {
		tmp = -((z * t) / a);
	} else if ((x * y) <= 1e+59) {
		tmp = t_1;
	} else if ((x * y) <= 2e+70) {
		tmp = -t / (a / z);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 1.0 / (a / (x * y))
	tmp = 0
	if (x * y) <= -2e+87:
		tmp = (x * y) / a
	elif (x * y) <= -4e+55:
		tmp = -z / (a / t)
	elif (x * y) <= -2e+35:
		tmp = t_1
	elif (x * y) <= 5e-27:
		tmp = -((z * t) / a)
	elif (x * y) <= 1e+59:
		tmp = t_1
	elif (x * y) <= 2e+70:
		tmp = -t / (a / z)
	else:
		tmp = x / (a / y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(1.0 / Float64(a / Float64(x * y)))
	tmp = 0.0
	if (Float64(x * y) <= -2e+87)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= -4e+55)
		tmp = Float64(Float64(-z) / Float64(a / t));
	elseif (Float64(x * y) <= -2e+35)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-27)
		tmp = Float64(-Float64(Float64(z * t) / a));
	elseif (Float64(x * y) <= 1e+59)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e+70)
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = Float64(x / Float64(a / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = 1.0 / (a / (x * y));
	tmp = 0.0;
	if ((x * y) <= -2e+87)
		tmp = (x * y) / a;
	elseif ((x * y) <= -4e+55)
		tmp = -z / (a / t);
	elseif ((x * y) <= -2e+35)
		tmp = t_1;
	elseif ((x * y) <= 5e-27)
		tmp = -((z * t) / a);
	elseif ((x * y) <= 1e+59)
		tmp = t_1;
	elseif ((x * y) <= 2e+70)
		tmp = -t / (a / z);
	else
		tmp = x / (a / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], (-N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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


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

    1. Initial program 91.1%

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

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

    if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58

    1. Initial program 95.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y}}} \]
    7. Applied egg-rr71.3%

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

    if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27

    1. Initial program 95.9%

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

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

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

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

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

    if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70

    1. Initial program 100.0%

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

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

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

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

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

    if 2.00000000000000015e70 < (*.f64 x y)

    1. Initial program 91.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\ \;\;\;\;\frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+59}:\\ \;\;\;\;\frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{x}{\frac{1}{y}}\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ 1.0 (/ a (* x y)))))
   (if (<= (* x y) -2e+87)
     (* (/ 1.0 a) (/ x (/ 1.0 y)))
     (if (<= (* x y) -4e+55)
       (/ (- z) (/ a t))
       (if (<= (* x y) -2e+35)
         t_1
         (if (<= (* x y) 5e-27)
           (- (/ (* z t) a))
           (if (<= (* x y) 1e+59)
             t_1
             (if (<= (* x y) 2e+70) (/ (- t) (/ a z)) (/ x (/ a y))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = 1.0 / (a / (x * y));
	double tmp;
	if ((x * y) <= -2e+87) {
		tmp = (1.0 / a) * (x / (1.0 / y));
	} else if ((x * y) <= -4e+55) {
		tmp = -z / (a / t);
	} else if ((x * y) <= -2e+35) {
		tmp = t_1;
	} else if ((x * y) <= 5e-27) {
		tmp = -((z * t) / a);
	} else if ((x * y) <= 1e+59) {
		tmp = t_1;
	} else if ((x * y) <= 2e+70) {
		tmp = -t / (a / z);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 / (a / (x * y))
    if ((x * y) <= (-2d+87)) then
        tmp = (1.0d0 / a) * (x / (1.0d0 / y))
    else if ((x * y) <= (-4d+55)) then
        tmp = -z / (a / t)
    else if ((x * y) <= (-2d+35)) then
        tmp = t_1
    else if ((x * y) <= 5d-27) then
        tmp = -((z * t) / a)
    else if ((x * y) <= 1d+59) then
        tmp = t_1
    else if ((x * y) <= 2d+70) then
        tmp = -t / (a / z)
    else
        tmp = x / (a / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = 1.0 / (a / (x * y));
	double tmp;
	if ((x * y) <= -2e+87) {
		tmp = (1.0 / a) * (x / (1.0 / y));
	} else if ((x * y) <= -4e+55) {
		tmp = -z / (a / t);
	} else if ((x * y) <= -2e+35) {
		tmp = t_1;
	} else if ((x * y) <= 5e-27) {
		tmp = -((z * t) / a);
	} else if ((x * y) <= 1e+59) {
		tmp = t_1;
	} else if ((x * y) <= 2e+70) {
		tmp = -t / (a / z);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = 1.0 / (a / (x * y))
	tmp = 0
	if (x * y) <= -2e+87:
		tmp = (1.0 / a) * (x / (1.0 / y))
	elif (x * y) <= -4e+55:
		tmp = -z / (a / t)
	elif (x * y) <= -2e+35:
		tmp = t_1
	elif (x * y) <= 5e-27:
		tmp = -((z * t) / a)
	elif (x * y) <= 1e+59:
		tmp = t_1
	elif (x * y) <= 2e+70:
		tmp = -t / (a / z)
	else:
		tmp = x / (a / y)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(1.0 / Float64(a / Float64(x * y)))
	tmp = 0.0
	if (Float64(x * y) <= -2e+87)
		tmp = Float64(Float64(1.0 / a) * Float64(x / Float64(1.0 / y)));
	elseif (Float64(x * y) <= -4e+55)
		tmp = Float64(Float64(-z) / Float64(a / t));
	elseif (Float64(x * y) <= -2e+35)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-27)
		tmp = Float64(-Float64(Float64(z * t) / a));
	elseif (Float64(x * y) <= 1e+59)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e+70)
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = Float64(x / Float64(a / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = 1.0 / (a / (x * y));
	tmp = 0.0;
	if ((x * y) <= -2e+87)
		tmp = (1.0 / a) * (x / (1.0 / y));
	elseif ((x * y) <= -4e+55)
		tmp = -z / (a / t);
	elseif ((x * y) <= -2e+35)
		tmp = t_1;
	elseif ((x * y) <= 5e-27)
		tmp = -((z * t) / a);
	elseif ((x * y) <= 1e+59)
		tmp = t_1;
	elseif ((x * y) <= 2e+70)
		tmp = -t / (a / z);
	else
		tmp = x / (a / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[(N[(1.0 / a), $MachinePrecision] * N[(x / N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], (-N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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


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

    1. Initial program 91.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity79.1%

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

        \[\leadsto \frac{1 \cdot x}{\color{blue}{a \cdot \frac{1}{y}}} \]
      3. times-frac84.0%

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{x}{\frac{1}{y}}} \]
    9. Applied egg-rr84.0%

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

    if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58

    1. Initial program 95.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{x \cdot y}}} \]
    7. Applied egg-rr71.3%

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

    if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27

    1. Initial program 95.9%

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

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

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

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

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

    if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70

    1. Initial program 100.0%

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

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

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

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

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

    if 2.00000000000000015e70 < (*.f64 x y)

    1. Initial program 91.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{x}{\frac{1}{y}}\\ \mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\ \;\;\;\;\frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+59}:\\ \;\;\;\;\frac{1}{\frac{a}{x \cdot y}}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.8% accurate, 0.3× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.9999999999999999e87 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58

    1. Initial program 92.8%

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

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

    if -1.9999999999999999e87 < (*.f64 x y) < 5.0000000000000002e-27

    1. Initial program 95.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}} \]
    5. Taylor expanded in x around 0 75.3%

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

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

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

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

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

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

    if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70

    1. Initial program 100.0%

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

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

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

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

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

    if 2.00000000000000015e70 < (*.f64 x y)

    1. Initial program 91.1%

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

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

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

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

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

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

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

Alternative 7: 66.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2000000000000004e30 or 1.89999999999999987e-119 < z

    1. Initial program 92.3%

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

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

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

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

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

    if -7.2000000000000004e30 < z < 1.89999999999999987e-119

    1. Initial program 96.3%

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

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

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

Alternative 8: 50.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.95 \cdot 10^{-188}:\\
\;\;\;\;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 a < 1.94999999999999988e-188

    1. Initial program 93.1%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-commutative49.6%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot x} \]
    5. Applied egg-rr44.3%

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

    if 1.94999999999999988e-188 < a

    1. Initial program 95.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.95 \cdot 10^{-188}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.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 94.1%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
  6. Final simplification50.3%

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

Alternative 10: 51.0% 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 94.1%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot x} \]
  5. Applied egg-rr47.2%

    \[\leadsto \color{blue}{\frac{y}{a} \cdot x} \]
  6. Final simplification47.2%

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

Alternative 11: 51.0% accurate, 1.8× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
  8. Final simplification47.5%

    \[\leadsto \frac{x}{\frac{a}{y}} \]
  9. Add Preprocessing

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

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

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