Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I

Percentage Accurate: 91.2% → 94.5%
Time: 9.5s
Alternatives: 10
Speedup: 0.6×

Specification

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

\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 94.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+180}:\\
\;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\

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

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


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

    1. Initial program 73.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv73.8%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      7. distribute-rgt-neg-in73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in73.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in73.8%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.2%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num99.7%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr99.8%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified99.9%

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

    if -4.9999999999999996e180 < (*.f64 x y) < 4.9999999999999996e158

    1. Initial program 96.3%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing

    if 4.9999999999999996e158 < (*.f64 x y)

    1. Initial program 81.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*84.6%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      10. *-commutative84.6%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      12. metadata-eval84.6%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 85.4%

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

      \[\leadsto y \cdot \color{blue}{\frac{-4.5 \cdot \frac{t \cdot z}{y} + 0.5 \cdot x}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

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

Alternative 2: 92.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+180}:\\ \;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (* x y) -5e+180)
   (* (* y 0.5) (/ x a))
   (/ (fma x y (* z (* t -9.0))) (* a 2.0))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -5e+180) {
		tmp = (y * 0.5) * (x / a);
	} else {
		tmp = fma(x, y, (z * (t * -9.0))) / (a * 2.0);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (Float64(x * y) <= -5e+180)
		tmp = Float64(Float64(y * 0.5) * Float64(x / a));
	else
		tmp = Float64(fma(x, y, Float64(z * Float64(t * -9.0))) / Float64(a * 2.0));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+180], N[(N[(y * 0.5), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+180}:\\
\;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\

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


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

    1. Initial program 73.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv73.8%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      7. distribute-rgt-neg-in73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in73.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in73.8%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.2%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num99.7%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr99.8%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified99.9%

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

    if -4.9999999999999996e180 < (*.f64 x y)

    1. Initial program 93.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*94.4%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      12. metadata-eval94.4%

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

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

Alternative 3: 74.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 87.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv87.8%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*87.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.9%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified74.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num74.3%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv74.9%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr74.9%

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

    if -2.00000000000000001e-41 < (*.f64 x y) < 1e-30

    1. Initial program 98.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*98.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 84.6%

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

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

    1. Initial program 86.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*87.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.4%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified65.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*65.7%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num65.0%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv65.7%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr65.7%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative68.9%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*68.9%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified68.9%

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

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

Alternative 4: 66.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+192}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{+70} \lor \neg \left(z \leq 2.7 \cdot 10^{-47}\right):\\
\;\;\;\;\left(t \cdot -4.5\right) \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1e192

    1. Initial program 89.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv89.7%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      10. *-commutative89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      12. metadata-eval89.7%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 79.1%

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

        \[\leadsto \color{blue}{\frac{-4.5 \cdot \left(t \cdot z\right)}{a}} \]
      2. associate-*r*79.1%

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

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

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

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

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

    if -1.1e192 < z < -3.50000000000000002e70 or 2.6999999999999998e-47 < z

    1. Initial program 88.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv88.7%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*89.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in89.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in89.8%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 65.5%

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

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

        \[\leadsto \color{blue}{\frac{-9}{2} \cdot \frac{t \cdot z}{a}} \]
      3. metadata-eval65.5%

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

        \[\leadsto -4.5 \cdot \color{blue}{\left(t \cdot \frac{z}{a}\right)} \]
      5. associate-*r*70.6%

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

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

    if -3.50000000000000002e70 < z < 2.6999999999999998e-47

    1. Initial program 94.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*94.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 70.2%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified71.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*71.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num71.0%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv71.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr71.8%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative68.7%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*68.7%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified68.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+192}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+70} \lor \neg \left(z \leq 2.7 \cdot 10^{-47}\right):\\ \;\;\;\;\left(t \cdot -4.5\right) \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 87.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv87.8%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*87.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.9%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified74.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num74.3%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv74.9%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr74.9%

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

    if -2.00000000000000001e-41 < (*.f64 x y) < 1e-30

    1. Initial program 98.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*98.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 84.6%

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

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

    1. Initial program 86.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*87.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.4%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified65.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*65.7%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num65.0%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv65.7%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr65.7%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative68.9%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*68.9%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified68.9%

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

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

Alternative 6: 92.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+180}:\\
\;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\

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


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

    1. Initial program 73.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv73.8%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      7. distribute-rgt-neg-in73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*73.8%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in73.8%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in73.8%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 77.2%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(x \cdot \frac{y}{a}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*99.7%

        \[\leadsto \color{blue}{\left(0.5 \cdot x\right) \cdot \frac{y}{a}} \]
      2. clear-num99.7%

        \[\leadsto \left(0.5 \cdot x\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      3. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot x}{\frac{a}{y}}} \]
    9. Applied egg-rr99.8%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{a}\right)} \cdot y \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{a}\right)} \]
      4. associate-*r*99.9%

        \[\leadsto \color{blue}{\left(y \cdot 0.5\right) \cdot \frac{x}{a}} \]
    11. Simplified99.9%

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

    if -4.9999999999999996e180 < (*.f64 x y)

    1. Initial program 93.9%

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification94.6%

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

Alternative 7: 66.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+81} \lor \neg \left(x \leq 3.6 \cdot 10^{-59}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.50000000000000083e81 or 3.6e-59 < x

    1. Initial program 83.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*84.2%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in84.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 61.8%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} \]
    7. Simplified69.1%

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

    if -9.50000000000000083e81 < x < 3.6e-59

    1. Initial program 99.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*99.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 69.6%

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

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

Alternative 8: 51.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+42}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

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


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

    1. Initial program 94.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv94.7%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*95.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 50.1%

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

    if 4.00000000000000018e42 < a

    1. Initial program 79.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv79.5%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*79.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 50.5%

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

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

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

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

Alternative 9: 51.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+192}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.50000000000000017e192

    1. Initial program 89.7%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
      4. cancel-sign-sub-inv89.7%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
      10. *-commutative89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in89.7%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
      12. metadata-eval89.7%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 79.1%

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

        \[\leadsto \color{blue}{\frac{-4.5 \cdot \left(t \cdot z\right)}{a}} \]
      2. associate-*r*79.1%

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

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

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

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

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

    if -2.50000000000000017e192 < z

    1. Initial program 91.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
      7. distribute-rgt-neg-in92.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
      8. associate-*r*92.3%

        \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
      9. distribute-lft-neg-in92.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
      11. distribute-rgt-neg-in92.3%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 46.7%

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

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

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

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

Alternative 10: 51.5% accurate, 1.9× speedup?

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

\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Derivation
  1. Initial program 91.6%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot x - \left(z \cdot 9\right) \cdot t}{a \cdot 2}} \]
    4. cancel-sign-sub-inv91.6%

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

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, \left(-z \cdot 9\right) \cdot t\right)}}{a \cdot 2} \]
    7. distribute-rgt-neg-in92.0%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{\left(z \cdot \left(-9\right)\right)} \cdot t\right)}{a \cdot 2} \]
    8. associate-*r*92.0%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, \color{blue}{z \cdot \left(\left(-9\right) \cdot t\right)}\right)}{a \cdot 2} \]
    9. distribute-lft-neg-in92.0%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(-9 \cdot t\right)}\right)}{a \cdot 2} \]
    10. *-commutative92.0%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(-\color{blue}{t \cdot 9}\right)\right)}{a \cdot 2} \]
    11. distribute-rgt-neg-in92.0%

      \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \color{blue}{\left(t \cdot \left(-9\right)\right)}\right)}{a \cdot 2} \]
    12. metadata-eval92.0%

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 50.2%

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

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

    \[\leadsto \color{blue}{-4.5 \cdot \left(t \cdot \frac{z}{a}\right)} \]
  8. Add Preprocessing

Developer Target 1: 93.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\

\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024137 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< a -209046455797670900000000000000000000000000000000000000000000000000000000000000000000000) (- (* 1/2 (/ (* y x) a)) (* 9/2 (/ t (/ a z)))) (if (< a 2144030707833976000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z (* 9 t))) (* a 2)) (- (* (/ y a) (* x 1/2)) (* (/ t a) (* z 9/2))))))

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