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

Percentage Accurate: 91.3% → 96.7%
Time: 9.7s
Alternatives: 8
Speedup: 0.5×

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 8 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.3% 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: 96.7% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+226}:\\
\;\;\;\;\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)\\

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

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


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

    1. Initial program 71.4%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    6. Step-by-step derivation
      1. fma-def71.2%

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

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

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

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

    if -5.0000000000000005e226 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.0000000000000004e286

    1. Initial program 97.5%

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

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

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

    if 5.0000000000000004e286 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 56.4%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    6. Step-by-step derivation
      1. fma-def53.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)} \]
    8. Step-by-step derivation
      1. fma-udef91.4%

        \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}} + 0.5 \cdot \frac{x}{\frac{a}{y}}} \]
      2. associate-/r/94.2%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}} \cdot 0.5} + -4.5 \cdot \left(\frac{t}{a} \cdot z\right) \]
      5. div-inv94.2%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\frac{a}{y}}\right)} \cdot 0.5 + -4.5 \cdot \left(\frac{t}{a} \cdot z\right) \]
      6. clear-num94.2%

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

        \[\leadsto \color{blue}{x \cdot \left(\frac{y}{a} \cdot 0.5\right)} + -4.5 \cdot \left(\frac{t}{a} \cdot z\right) \]
      8. associate-/r/91.3%

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

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{\frac{t}{\frac{a}{z}} \cdot -4.5} \]
      10. div-inv91.3%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{\left(t \cdot \frac{1}{\frac{a}{z}}\right)} \cdot -4.5 \]
      11. clear-num91.3%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \left(t \cdot \color{blue}{\frac{z}{a}}\right) \cdot -4.5 \]
      12. associate-*l*91.3%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{t \cdot \left(\frac{z}{a} \cdot -4.5\right)} \]
    9. Applied egg-rr91.3%

      \[\leadsto \color{blue}{x \cdot \left(\frac{y}{a} \cdot 0.5\right) + t \cdot \left(\frac{z}{a} \cdot -4.5\right)} \]
    10. Step-by-step derivation
      1. *-commutative91.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y \cdot \frac{0.5}{a}, x, \color{blue}{\left(-4.5 \cdot \frac{z}{a}\right)} \cdot t\right) \]
      7. associate-*r/94.0%

        \[\leadsto \mathsf{fma}\left(y \cdot \frac{0.5}{a}, x, \color{blue}{\frac{-4.5 \cdot z}{a}} \cdot t\right) \]
      8. associate-/r/96.9%

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

        \[\leadsto \mathsf{fma}\left(y \cdot \frac{0.5}{a}, x, \color{blue}{\frac{-4.5}{\frac{\frac{a}{t}}{z}}}\right) \]
      10. associate-/r/96.8%

        \[\leadsto \mathsf{fma}\left(y \cdot \frac{0.5}{a}, x, \color{blue}{\frac{-4.5}{\frac{a}{t}} \cdot z}\right) \]
    11. Applied egg-rr96.8%

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

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

Alternative 2: 95.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+226} \lor \neg \left(t_1 \leq 4 \cdot 10^{+117}\right):\\ \;\;\;\;\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* z 9.0) t))))
   (if (or (<= t_1 -5e+226) (not (<= t_1 4e+117)))
     (fma -4.5 (/ t (/ a z)) (* 0.5 (/ x (/ a y))))
     (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - ((z * 9.0) * t);
	double tmp;
	if ((t_1 <= -5e+226) || !(t_1 <= 4e+117)) {
		tmp = fma(-4.5, (t / (a / z)), (0.5 * (x / (a / y))));
	} else {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t))
	tmp = 0.0
	if ((t_1 <= -5e+226) || !(t_1 <= 4e+117))
		tmp = fma(-4.5, Float64(t / Float64(a / z)), Float64(0.5 * Float64(x / Float64(a / y))));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+226], N[Not[LessEqual[t$95$1, 4e+117]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+226} \lor \neg \left(t_1 \leq 4 \cdot 10^{+117}\right):\\
\;\;\;\;\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -5.0000000000000005e226 or 4.0000000000000002e117 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 73.3%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    6. Step-by-step derivation
      1. fma-def72.3%

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

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

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

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

    if -5.0000000000000005e226 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 4.0000000000000002e117

    1. Initial program 97.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq -5 \cdot 10^{+226} \lor \neg \left(x \cdot y - \left(z \cdot 9\right) \cdot t \leq 4 \cdot 10^{+117}\right):\\ \;\;\;\;\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 96.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+261}\right):\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right) + t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\

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


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

    1. Initial program 60.1%

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{x \cdot y}{a}} \]
    6. Step-by-step derivation
      1. fma-def58.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)} \]
    8. Step-by-step derivation
      1. fma-udef93.1%

        \[\leadsto \color{blue}{-4.5 \cdot \frac{t}{\frac{a}{z}} + 0.5 \cdot \frac{x}{\frac{a}{y}}} \]
      2. associate-/r/93.1%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\frac{a}{y}}\right)} \cdot 0.5 + -4.5 \cdot \left(\frac{t}{a} \cdot z\right) \]
      6. clear-num93.1%

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

        \[\leadsto \color{blue}{x \cdot \left(\frac{y}{a} \cdot 0.5\right)} + -4.5 \cdot \left(\frac{t}{a} \cdot z\right) \]
      8. associate-/r/93.1%

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

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{\frac{t}{\frac{a}{z}} \cdot -4.5} \]
      10. div-inv93.1%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{\left(t \cdot \frac{1}{\frac{a}{z}}\right)} \cdot -4.5 \]
      11. clear-num93.1%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \left(t \cdot \color{blue}{\frac{z}{a}}\right) \cdot -4.5 \]
      12. associate-*l*93.1%

        \[\leadsto x \cdot \left(\frac{y}{a} \cdot 0.5\right) + \color{blue}{t \cdot \left(\frac{z}{a} \cdot -4.5\right)} \]
    9. Applied egg-rr93.1%

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.0000000000000001e261

    1. Initial program 97.6%

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

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

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

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

Alternative 4: 72.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-224}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.00000000000000007e-17 or 3.99999999999999983e-268 < (*.f64 x y) < 4.9999999999999999e-224

    1. Initial program 86.5%

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified77.0%

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

    if -1.00000000000000007e-17 < (*.f64 x y) < 3.99999999999999983e-268

    1. Initial program 91.0%

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

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

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

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

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

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

    if 4.9999999999999999e-224 < (*.f64 x y) < 1e30

    1. Initial program 92.8%

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

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

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

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

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

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

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

    if 1e30 < (*.f64 x y)

    1. Initial program 74.2%

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified75.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    9. Applied egg-rr77.1%

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

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

Alternative 5: 64.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq 3.9 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\

\mathbf{elif}\;t \leq 2 \cdot 10^{+170}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\

\mathbf{elif}\;t \leq 8.1 \cdot 10^{+192}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.59999999999999996e-75

    1. Initial program 82.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \left(\frac{t}{a} \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)} \]
      2. clear-num62.6%

        \[\leadsto -4.5 \cdot \left(z \cdot \color{blue}{\frac{1}{\frac{a}{t}}}\right) \]
      3. un-div-inv63.8%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
    9. Applied egg-rr63.8%

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

    if -5.59999999999999996e-75 < t < 3.9000000000000002e86

    1. Initial program 90.9%

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

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

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

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

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

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

    if 3.9000000000000002e86 < t < 2.00000000000000007e170

    1. Initial program 87.2%

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

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

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

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

    if 2.00000000000000007e170 < t < 8.10000000000000019e192

    1. Initial program 68.6%

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified67.0%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    9. Applied egg-rr67.0%

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

    if 8.10000000000000019e192 < t

    1. Initial program 77.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{-75}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+170}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;t \leq 8.1 \cdot 10^{+192}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 94.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.99999999999999993e306 or 1.0000000000000001e276 < (*.f64 x y)

    1. Initial program 54.4%

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{x}{\frac{a}{y}}} \]
    7. Simplified92.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{a} \cdot y\right)} \]
    9. Applied egg-rr92.4%

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

    if -4.99999999999999993e306 < (*.f64 x y) < 1.0000000000000001e276

    1. Initial program 92.8%

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

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

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

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

Alternative 7: 65.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-75}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+87}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -6.2e-75)
   (* -4.5 (/ z (/ a t)))
   (if (<= t 1.3e+87) (* 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 (t <= -6.2e-75) {
		tmp = -4.5 * (z / (a / t));
	} else if (t <= 1.3e+87) {
		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 (t <= (-6.2d-75)) then
        tmp = (-4.5d0) * (z / (a / t))
    else if (t <= 1.3d+87) 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 (t <= -6.2e-75) {
		tmp = -4.5 * (z / (a / t));
	} else if (t <= 1.3e+87) {
		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 t <= -6.2e-75:
		tmp = -4.5 * (z / (a / t))
	elif t <= 1.3e+87:
		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 (t <= -6.2e-75)
		tmp = Float64(-4.5 * Float64(z / Float64(a / t)));
	elseif (t <= 1.3e+87)
		tmp = Float64(0.5 * Float64(x * Float64(y / a)));
	else
		tmp = Float64(-4.5 * Float64(z * Float64(t / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -6.2e-75)
		tmp = -4.5 * (z / (a / t));
	elseif (t <= 1.3e+87)
		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[LessEqual[t, -6.2e-75], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+87], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+87}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.20000000000000013e-75

    1. Initial program 82.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-4.5 \cdot \left(\frac{t}{a} \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto -4.5 \cdot \color{blue}{\left(z \cdot \frac{t}{a}\right)} \]
      2. clear-num62.6%

        \[\leadsto -4.5 \cdot \left(z \cdot \color{blue}{\frac{1}{\frac{a}{t}}}\right) \]
      3. un-div-inv63.8%

        \[\leadsto -4.5 \cdot \color{blue}{\frac{z}{\frac{a}{t}}} \]
    9. Applied egg-rr63.8%

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

    if -6.20000000000000013e-75 < t < 1.29999999999999999e87

    1. Initial program 90.9%

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

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

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

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

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

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

    if 1.29999999999999999e87 < t

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

Alternative 8: 51.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

Developer target: 93.8% 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 2024018 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
  :precision binary64

  :herbie-target
  (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)))))

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