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

Percentage Accurate: 85.4% → 89.7%
Time: 32.1s
Alternatives: 11
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

Alternative 1: 89.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), b \cdot c\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (fma
  (* k j)
  -27.0
  (fma x (* i -4.0) (fma t (fma x (* 18.0 (* y z)) (* -4.0 a)) (* b c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return fma((k * j), -27.0, fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (-4.0 * a)), (b * c))));
}
function code(x, y, z, t, a, b, c, i, j, k)
	return fma(Float64(k * j), -27.0, fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(-4.0 * a)), Float64(b * c))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(k * j), $MachinePrecision] * -27.0 + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), b \cdot c\right)\right)\right)
\end{array}
Derivation
  1. Initial program 82.8%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \color{blue}{\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k} \]
    2. sub-negN/A

      \[\leadsto \color{blue}{\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
    3. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(j \cdot 27\right) \cdot k}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    5. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(\mathsf{neg}\left(k \cdot \color{blue}{\left(j \cdot 27\right)}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    7. associate-*r*N/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(k \cdot j\right) \cdot 27}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    8. distribute-rgt-neg-inN/A

      \[\leadsto \color{blue}{\left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right)} + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    9. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot j, \mathsf{neg}\left(27\right), \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right)} \]
    10. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{k \cdot j}, \mathsf{neg}\left(27\right), \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    11. metadata-eval82.8

      \[\leadsto \mathsf{fma}\left(k \cdot j, \color{blue}{-27}, \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
    12. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i}\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) + \left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\right)}\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\right) + \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right)}\right) \]
  4. Applied rewrites92.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right)\right)\right)} \]
  5. Final simplification92.2%

    \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), b \cdot c\right)\right)\right) \]
  6. Add Preprocessing

Alternative 2: 83.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := j \cdot \left(k \cdot -27\right)\\ t_2 := \mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, t\_1\right)\right)\\ \mathbf{if}\;x \leq -5.9 \cdot 10^{-80}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.72 \cdot 10^{-28}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* j (* k -27.0)))
        (t_2 (fma x (fma -4.0 i (* t (* 18.0 (* y z)))) (fma b c t_1))))
   (if (<= x -5.9e-80)
     t_2
     (if (<= x 1.72e-28) (fma b c (fma -4.0 (* t a) t_1)) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = j * (k * -27.0);
	double t_2 = fma(x, fma(-4.0, i, (t * (18.0 * (y * z)))), fma(b, c, t_1));
	double tmp;
	if (x <= -5.9e-80) {
		tmp = t_2;
	} else if (x <= 1.72e-28) {
		tmp = fma(b, c, fma(-4.0, (t * a), t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(j * Float64(k * -27.0))
	t_2 = fma(x, fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))), fma(b, c, t_1))
	tmp = 0.0
	if (x <= -5.9e-80)
		tmp = t_2;
	elseif (x <= 1.72e-28)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), t_1));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.9e-80], t$95$2, If[LessEqual[x, 1.72e-28], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := \mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, t\_1\right)\right)\\
\mathbf{if}\;x \leq -5.9 \cdot 10^{-80}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 1.72 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9000000000000001e-80 or 1.7199999999999999e-28 < x

    1. Initial program 75.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites82.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]

    if -5.9000000000000001e-80 < x < 1.7199999999999999e-28

    1. Initial program 94.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6487.3

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites87.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.9 \cdot 10^{-80}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.72 \cdot 10^{-28}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 36.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -5.1e+67)
   (* b c)
   (if (<= (* b c) 5.6e-195)
     (* k (* j -27.0))
     (if (<= (* b c) 1.28e+166) (* -4.0 (* t a)) (* b c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -5.1e+67) {
		tmp = b * c;
	} else if ((b * c) <= 5.6e-195) {
		tmp = k * (j * -27.0);
	} else if ((b * c) <= 1.28e+166) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = b * c;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((b * c) <= (-5.1d+67)) then
        tmp = b * c
    else if ((b * c) <= 5.6d-195) then
        tmp = k * (j * (-27.0d0))
    else if ((b * c) <= 1.28d+166) then
        tmp = (-4.0d0) * (t * a)
    else
        tmp = b * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -5.1e+67) {
		tmp = b * c;
	} else if ((b * c) <= 5.6e-195) {
		tmp = k * (j * -27.0);
	} else if ((b * c) <= 1.28e+166) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = b * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -5.1e+67:
		tmp = b * c
	elif (b * c) <= 5.6e-195:
		tmp = k * (j * -27.0)
	elif (b * c) <= 1.28e+166:
		tmp = -4.0 * (t * a)
	else:
		tmp = b * c
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -5.1e+67)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 5.6e-195)
		tmp = Float64(k * Float64(j * -27.0));
	elseif (Float64(b * c) <= 1.28e+166)
		tmp = Float64(-4.0 * Float64(t * a));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if ((b * c) <= -5.1e+67)
		tmp = b * c;
	elseif ((b * c) <= 5.6e-195)
		tmp = k * (j * -27.0);
	elseif ((b * c) <= 1.28e+166)
		tmp = -4.0 * (t * a);
	else
		tmp = b * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -5.1e+67], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5.6e-195], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.28e+166], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\

\mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -5.1000000000000002e67 or 1.28e166 < (*.f64 b c)

    1. Initial program 72.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f6464.9

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites64.9%

      \[\leadsto \color{blue}{b \cdot c} \]

    if -5.1000000000000002e67 < (*.f64 b c) < 5.60000000000000007e-195

    1. Initial program 87.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f644.2

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites4.2%

      \[\leadsto \color{blue}{b \cdot c} \]
    6. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6437.3

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    8. Applied rewrites37.3%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. Applied rewrites37.3%

        \[\leadsto \left(j \cdot -27\right) \cdot \color{blue}{k} \]

      if 5.60000000000000007e-195 < (*.f64 b c) < 1.28e166

      1. Initial program 90.1%

        \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
        2. lower-*.f6440.5

          \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      5. Applied rewrites40.5%

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    10. Recombined 3 regimes into one program.
    11. Final simplification47.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
    12. Add Preprocessing

    Alternative 4: 36.7% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i j k)
     :precision binary64
     (if (<= (* b c) -5.1e+67)
       (* b c)
       (if (<= (* b c) 5.6e-195)
         (* -27.0 (* k j))
         (if (<= (* b c) 1.28e+166) (* -4.0 (* t a)) (* b c)))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
    	double tmp;
    	if ((b * c) <= -5.1e+67) {
    		tmp = b * c;
    	} else if ((b * c) <= 5.6e-195) {
    		tmp = -27.0 * (k * j);
    	} else if ((b * c) <= 1.28e+166) {
    		tmp = -4.0 * (t * a);
    	} else {
    		tmp = b * c;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t, a, b, c, i, j, k)
        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), intent (in) :: b
        real(8), intent (in) :: c
        real(8), intent (in) :: i
        real(8), intent (in) :: j
        real(8), intent (in) :: k
        real(8) :: tmp
        if ((b * c) <= (-5.1d+67)) then
            tmp = b * c
        else if ((b * c) <= 5.6d-195) then
            tmp = (-27.0d0) * (k * j)
        else if ((b * c) <= 1.28d+166) then
            tmp = (-4.0d0) * (t * a)
        else
            tmp = b * c
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
    	double tmp;
    	if ((b * c) <= -5.1e+67) {
    		tmp = b * c;
    	} else if ((b * c) <= 5.6e-195) {
    		tmp = -27.0 * (k * j);
    	} else if ((b * c) <= 1.28e+166) {
    		tmp = -4.0 * (t * a);
    	} else {
    		tmp = b * c;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i, j, k):
    	tmp = 0
    	if (b * c) <= -5.1e+67:
    		tmp = b * c
    	elif (b * c) <= 5.6e-195:
    		tmp = -27.0 * (k * j)
    	elif (b * c) <= 1.28e+166:
    		tmp = -4.0 * (t * a)
    	else:
    		tmp = b * c
    	return tmp
    
    function code(x, y, z, t, a, b, c, i, j, k)
    	tmp = 0.0
    	if (Float64(b * c) <= -5.1e+67)
    		tmp = Float64(b * c);
    	elseif (Float64(b * c) <= 5.6e-195)
    		tmp = Float64(-27.0 * Float64(k * j));
    	elseif (Float64(b * c) <= 1.28e+166)
    		tmp = Float64(-4.0 * Float64(t * a));
    	else
    		tmp = Float64(b * c);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
    	tmp = 0.0;
    	if ((b * c) <= -5.1e+67)
    		tmp = b * c;
    	elseif ((b * c) <= 5.6e-195)
    		tmp = -27.0 * (k * j);
    	elseif ((b * c) <= 1.28e+166)
    		tmp = -4.0 * (t * a);
    	else
    		tmp = b * c;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -5.1e+67], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5.6e-195], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.28e+166], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\
    \;\;\;\;b \cdot c\\
    
    \mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\
    \;\;\;\;-27 \cdot \left(k \cdot j\right)\\
    
    \mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\
    \;\;\;\;-4 \cdot \left(t \cdot a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;b \cdot c\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 b c) < -5.1000000000000002e67 or 1.28e166 < (*.f64 b c)

      1. Initial program 72.0%

        \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. Add Preprocessing
      3. Taylor expanded in b around inf

        \[\leadsto \color{blue}{b \cdot c} \]
      4. Step-by-step derivation
        1. lower-*.f6464.9

          \[\leadsto \color{blue}{b \cdot c} \]
      5. Applied rewrites64.9%

        \[\leadsto \color{blue}{b \cdot c} \]

      if -5.1000000000000002e67 < (*.f64 b c) < 5.60000000000000007e-195

      1. Initial program 87.6%

        \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. Add Preprocessing
      3. Taylor expanded in b around inf

        \[\leadsto \color{blue}{b \cdot c} \]
      4. Step-by-step derivation
        1. lower-*.f644.2

          \[\leadsto \color{blue}{b \cdot c} \]
      5. Applied rewrites4.2%

        \[\leadsto \color{blue}{b \cdot c} \]
      6. Taylor expanded in j around inf

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
        2. lower-*.f6437.3

          \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      8. Applied rewrites37.3%

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

      if 5.60000000000000007e-195 < (*.f64 b c) < 1.28e166

      1. Initial program 90.1%

        \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
        2. lower-*.f6440.5

          \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      5. Applied rewrites40.5%

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification47.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 5.6 \cdot 10^{-195}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;b \cdot c \leq 1.28 \cdot 10^{+166}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 70.3% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := j \cdot \left(k \cdot -27\right)\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, t\_1\right)\right)\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i j k)
     :precision binary64
     (let* ((t_1 (* j (* k -27.0))))
       (if (<= x -4.9e+138)
         (fma x (* i -4.0) (fma b c t_1))
         (if (<= x 8.5e+97)
           (fma b c (fma -4.0 (* t a) t_1))
           (* x (fma -4.0 i (* t (* 18.0 (* y z)))))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
    	double t_1 = j * (k * -27.0);
    	double tmp;
    	if (x <= -4.9e+138) {
    		tmp = fma(x, (i * -4.0), fma(b, c, t_1));
    	} else if (x <= 8.5e+97) {
    		tmp = fma(b, c, fma(-4.0, (t * a), t_1));
    	} else {
    		tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i, j, k)
    	t_1 = Float64(j * Float64(k * -27.0))
    	tmp = 0.0
    	if (x <= -4.9e+138)
    		tmp = fma(x, Float64(i * -4.0), fma(b, c, t_1));
    	elseif (x <= 8.5e+97)
    		tmp = fma(b, c, fma(-4.0, Float64(t * a), t_1));
    	else
    		tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+138], N[(x * N[(i * -4.0), $MachinePrecision] + N[(b * c + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e+97], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := j \cdot \left(k \cdot -27\right)\\
    \mathbf{if}\;x \leq -4.9 \cdot 10^{+138}:\\
    \;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, t\_1\right)\right)\\
    
    \mathbf{elif}\;x \leq 8.5 \cdot 10^{+97}:\\
    \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -4.89999999999999983e138

      1. Initial program 68.7%

        \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

          \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
        2. cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
        3. metadata-evalN/A

          \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
        4. +-commutativeN/A

          \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
        5. associate-+r+N/A

          \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
        6. associate--l+N/A

          \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
      5. Applied rewrites88.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
      6. Taylor expanded in i around inf

        \[\leadsto \mathsf{fma}\left(x, -4 \cdot \color{blue}{i}, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right) \]
      7. Step-by-step derivation
        1. Applied rewrites74.4%

          \[\leadsto \mathsf{fma}\left(x, i \cdot \color{blue}{-4}, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right) \]

        if -4.89999999999999983e138 < x < 8.4999999999999993e97

        1. Initial program 90.6%

          \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
        4. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
          3. distribute-neg-inN/A

            \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
          4. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
          6. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
          8. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
          9. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
          11. associate-*l*N/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
          13. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
          14. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
          15. lower-*.f6478.9

            \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
        5. Applied rewrites78.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]

        if 8.4999999999999993e97 < x

        1. Initial program 58.3%

          \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
          2. cancel-sign-sub-invN/A

            \[\leadsto x \cdot \color{blue}{\left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right)} \]
          3. metadata-evalN/A

            \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot i\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
          5. lower-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
          6. *-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 18}\right) \]
          7. associate-*l*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          8. lower-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          9. lower-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          10. lower-*.f6477.5

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) \]
        5. Applied rewrites77.5%

          \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification78.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 6: 48.8% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -4.7 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+163}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+230}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i j k)
       :precision binary64
       (let* ((t_1 (* x (* 18.0 (* y (* t z))))))
         (if (<= t -4.7e+27)
           t_1
           (if (<= t 1.42e+163)
             (fma (* j -27.0) k (* b c))
             (if (<= t 1.56e+230) (* -4.0 (* t a)) t_1)))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
      	double t_1 = x * (18.0 * (y * (t * z)));
      	double tmp;
      	if (t <= -4.7e+27) {
      		tmp = t_1;
      	} else if (t <= 1.42e+163) {
      		tmp = fma((j * -27.0), k, (b * c));
      	} else if (t <= 1.56e+230) {
      		tmp = -4.0 * (t * a);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c, i, j, k)
      	t_1 = Float64(x * Float64(18.0 * Float64(y * Float64(t * z))))
      	tmp = 0.0
      	if (t <= -4.7e+27)
      		tmp = t_1;
      	elseif (t <= 1.42e+163)
      		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
      	elseif (t <= 1.56e+230)
      		tmp = Float64(-4.0 * Float64(t * a));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.7e+27], t$95$1, If[LessEqual[t, 1.42e+163], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.56e+230], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\
      \mathbf{if}\;t \leq -4.7 \cdot 10^{+27}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 1.42 \cdot 10^{+163}:\\
      \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\
      
      \mathbf{elif}\;t \leq 1.56 \cdot 10^{+230}:\\
      \;\;\;\;-4 \cdot \left(t \cdot a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -4.69999999999999976e27 or 1.5599999999999999e230 < t

        1. Initial program 78.1%

          \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
          2. cancel-sign-sub-invN/A

            \[\leadsto x \cdot \color{blue}{\left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right)} \]
          3. metadata-evalN/A

            \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot i\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
          5. lower-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
          6. *-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 18}\right) \]
          7. associate-*l*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          8. lower-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          9. lower-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
          10. lower-*.f6454.2

            \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) \]
        5. Applied rewrites54.2%

          \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites54.2%

            \[\leadsto x \cdot \mathsf{fma}\left(t \cdot \left(y \cdot z\right), \color{blue}{18}, i \cdot -4\right) \]
          2. Taylor expanded in t around inf

            \[\leadsto x \cdot \left(18 \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) \]
          3. Step-by-step derivation
            1. Applied rewrites51.9%

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

            if -4.69999999999999976e27 < t < 1.4199999999999999e163

            1. Initial program 85.6%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            4. Step-by-step derivation
              1. lower-*.f6461.8

                \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            5. Applied rewrites61.8%

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            6. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{b \cdot c - \left(j \cdot 27\right) \cdot k} \]
              2. sub-negN/A

                \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
              3. +-commutativeN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + b \cdot c} \]
            7. Applied rewrites62.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]

            if 1.4199999999999999e163 < t < 1.5599999999999999e230

            1. Initial program 83.3%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in a around inf

              \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
              2. lower-*.f6464.0

                \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
            5. Applied rewrites64.0%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.7 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+163}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{+230}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\ \end{array} \]
          6. Add Preprocessing

          Alternative 7: 60.6% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -4.4 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+36}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i j k)
           :precision binary64
           (let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
             (if (<= t -4.4e+27)
               t_1
               (if (<= t 2.5e+36) (fma (* j -27.0) k (* b c)) t_1))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
          	double tmp;
          	if (t <= -4.4e+27) {
          		tmp = t_1;
          	} else if (t <= 2.5e+36) {
          		tmp = fma((j * -27.0), k, (b * c));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))))
          	tmp = 0.0
          	if (t <= -4.4e+27)
          		tmp = t_1;
          	elseif (t <= 2.5e+36)
          		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+27], t$95$1, If[LessEqual[t, 2.5e+36], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
          \mathbf{if}\;t \leq -4.4 \cdot 10^{+27}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \leq 2.5 \cdot 10^{+36}:\\
          \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -4.3999999999999997e27 or 2.49999999999999988e36 < t

            1. Initial program 79.4%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in t around inf

              \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
              2. cancel-sign-sub-invN/A

                \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
              3. metadata-evalN/A

                \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
              4. +-commutativeN/A

                \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
              5. lower-fma.f64N/A

                \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
              7. lower-*.f64N/A

                \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
              8. lower-*.f6469.9

                \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
            5. Applied rewrites69.9%

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

            if -4.3999999999999997e27 < t < 2.49999999999999988e36

            1. Initial program 87.0%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            4. Step-by-step derivation
              1. lower-*.f6469.5

                \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            5. Applied rewrites69.5%

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            6. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{b \cdot c - \left(j \cdot 27\right) \cdot k} \]
              2. sub-negN/A

                \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
              3. +-commutativeN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + b \cdot c} \]
            7. Applied rewrites69.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 8: 46.7% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \cdot 4 \leq -1 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot 4 \leq 5 \cdot 10^{+143}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i j k)
           :precision binary64
           (let* ((t_1 (* -4.0 (* t a))))
             (if (<= (* a 4.0) -1e+64)
               t_1
               (if (<= (* a 4.0) 5e+143) (fma (* j -27.0) k (* b c)) t_1))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double t_1 = -4.0 * (t * a);
          	double tmp;
          	if ((a * 4.0) <= -1e+64) {
          		tmp = t_1;
          	} else if ((a * 4.0) <= 5e+143) {
          		tmp = fma((j * -27.0), k, (b * c));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	t_1 = Float64(-4.0 * Float64(t * a))
          	tmp = 0.0
          	if (Float64(a * 4.0) <= -1e+64)
          		tmp = t_1;
          	elseif (Float64(a * 4.0) <= 5e+143)
          		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 4.0), $MachinePrecision], -1e+64], t$95$1, If[LessEqual[N[(a * 4.0), $MachinePrecision], 5e+143], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := -4 \cdot \left(t \cdot a\right)\\
          \mathbf{if}\;a \cdot 4 \leq -1 \cdot 10^{+64}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;a \cdot 4 \leq 5 \cdot 10^{+143}:\\
          \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 a #s(literal 4 binary64)) < -1.00000000000000002e64 or 5.00000000000000012e143 < (*.f64 a #s(literal 4 binary64))

            1. Initial program 77.6%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in a around inf

              \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
              2. lower-*.f6457.2

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

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

            if -1.00000000000000002e64 < (*.f64 a #s(literal 4 binary64)) < 5.00000000000000012e143

            1. Initial program 85.6%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            4. Step-by-step derivation
              1. lower-*.f6456.5

                \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            5. Applied rewrites56.5%

              \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
            6. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{b \cdot c - \left(j \cdot 27\right) \cdot k} \]
              2. sub-negN/A

                \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
              3. +-commutativeN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + b \cdot c} \]
            7. Applied rewrites56.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification56.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 4 \leq -1 \cdot 10^{+64}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;a \cdot 4 \leq 5 \cdot 10^{+143}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 9: 66.3% accurate, 2.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 8.5 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i j k)
           :precision binary64
           (if (<= x 8.5e+97)
             (fma b c (fma -4.0 (* t a) (* j (* k -27.0))))
             (* x (fma -4.0 i (* t (* 18.0 (* y z)))))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double tmp;
          	if (x <= 8.5e+97) {
          		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
          	} else {
          		tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	tmp = 0.0
          	if (x <= 8.5e+97)
          		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
          	else
          		tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 8.5e+97], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 8.5 \cdot 10^{+97}:\\
          \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 8.4999999999999993e97

            1. Initial program 87.1%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

              \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
            4. Step-by-step derivation
              1. sub-negN/A

                \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
              3. distribute-neg-inN/A

                \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
              4. distribute-lft-neg-inN/A

                \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
              5. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
              6. distribute-lft-neg-inN/A

                \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
              8. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
              9. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
              10. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
              11. associate-*l*N/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
              13. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
              14. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
              15. lower-*.f6474.2

                \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
            5. Applied rewrites74.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]

            if 8.4999999999999993e97 < x

            1. Initial program 58.3%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
              2. cancel-sign-sub-invN/A

                \[\leadsto x \cdot \color{blue}{\left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right)} \]
              3. metadata-evalN/A

                \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot i\right) \]
              4. +-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
              5. lower-fma.f64N/A

                \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
              6. *-commutativeN/A

                \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 18}\right) \]
              7. associate-*l*N/A

                \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
              8. lower-*.f64N/A

                \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
              9. lower-*.f64N/A

                \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
              10. lower-*.f6477.5

                \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) \]
            5. Applied rewrites77.5%

              \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification74.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8.5 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 10: 37.3% accurate, 2.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 1.18 \cdot 10^{+166}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i j k)
           :precision binary64
           (if (<= (* b c) -5.1e+67)
             (* b c)
             (if (<= (* b c) 1.18e+166) (* -27.0 (* k j)) (* b c))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double tmp;
          	if ((b * c) <= -5.1e+67) {
          		tmp = b * c;
          	} else if ((b * c) <= 1.18e+166) {
          		tmp = -27.0 * (k * j);
          	} else {
          		tmp = b * c;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t, a, b, c, i, j, k)
              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), intent (in) :: b
              real(8), intent (in) :: c
              real(8), intent (in) :: i
              real(8), intent (in) :: j
              real(8), intent (in) :: k
              real(8) :: tmp
              if ((b * c) <= (-5.1d+67)) then
                  tmp = b * c
              else if ((b * c) <= 1.18d+166) then
                  tmp = (-27.0d0) * (k * j)
              else
                  tmp = b * c
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double tmp;
          	if ((b * c) <= -5.1e+67) {
          		tmp = b * c;
          	} else if ((b * c) <= 1.18e+166) {
          		tmp = -27.0 * (k * j);
          	} else {
          		tmp = b * c;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b, c, i, j, k):
          	tmp = 0
          	if (b * c) <= -5.1e+67:
          		tmp = b * c
          	elif (b * c) <= 1.18e+166:
          		tmp = -27.0 * (k * j)
          	else:
          		tmp = b * c
          	return tmp
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	tmp = 0.0
          	if (Float64(b * c) <= -5.1e+67)
          		tmp = Float64(b * c);
          	elseif (Float64(b * c) <= 1.18e+166)
          		tmp = Float64(-27.0 * Float64(k * j));
          	else
          		tmp = Float64(b * c);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
          	tmp = 0.0;
          	if ((b * c) <= -5.1e+67)
          		tmp = b * c;
          	elseif ((b * c) <= 1.18e+166)
          		tmp = -27.0 * (k * j);
          	else
          		tmp = b * c;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -5.1e+67], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.18e+166], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\
          \;\;\;\;b \cdot c\\
          
          \mathbf{elif}\;b \cdot c \leq 1.18 \cdot 10^{+166}:\\
          \;\;\;\;-27 \cdot \left(k \cdot j\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;b \cdot c\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 b c) < -5.1000000000000002e67 or 1.17999999999999999e166 < (*.f64 b c)

            1. Initial program 72.0%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{b \cdot c} \]
            4. Step-by-step derivation
              1. lower-*.f6464.9

                \[\leadsto \color{blue}{b \cdot c} \]
            5. Applied rewrites64.9%

              \[\leadsto \color{blue}{b \cdot c} \]

            if -5.1000000000000002e67 < (*.f64 b c) < 1.17999999999999999e166

            1. Initial program 88.6%

              \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{b \cdot c} \]
            4. Step-by-step derivation
              1. lower-*.f646.4

                \[\leadsto \color{blue}{b \cdot c} \]
            5. Applied rewrites6.4%

              \[\leadsto \color{blue}{b \cdot c} \]
            6. Taylor expanded in j around inf

              \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
            7. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
              2. lower-*.f6432.0

                \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
            8. Applied rewrites32.0%

              \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification43.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5.1 \cdot 10^{+67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 1.18 \cdot 10^{+166}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
          5. Add Preprocessing

          Alternative 11: 23.6% accurate, 11.3× speedup?

          \[\begin{array}{l} \\ b \cdot c \end{array} \]
          (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	return b * c;
          }
          
          real(8) function code(x, y, z, t, a, b, c, i, j, k)
              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), intent (in) :: b
              real(8), intent (in) :: c
              real(8), intent (in) :: i
              real(8), intent (in) :: j
              real(8), intent (in) :: k
              code = b * c
          end function
          
          public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	return b * c;
          }
          
          def code(x, y, z, t, a, b, c, i, j, k):
          	return b * c
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	return Float64(b * c)
          end
          
          function tmp = code(x, y, z, t, a, b, c, i, j, k)
          	tmp = b * c;
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          b \cdot c
          \end{array}
          
          Derivation
          1. Initial program 82.8%

            \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
          2. Add Preprocessing
          3. Taylor expanded in b around inf

            \[\leadsto \color{blue}{b \cdot c} \]
          4. Step-by-step derivation
            1. lower-*.f6426.8

              \[\leadsto \color{blue}{b \cdot c} \]
          5. Applied rewrites26.8%

            \[\leadsto \color{blue}{b \cdot c} \]
          6. Add Preprocessing

          Developer Target 1: 89.4% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i j k)
           :precision binary64
           (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
                  (t_2
                   (-
                    (- (* (* 18.0 t) (* (* x y) z)) t_1)
                    (- (* (* k j) 27.0) (* c b)))))
             (if (< t -1.6210815397541398e-69)
               t_2
               (if (< t 165.68027943805222)
                 (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
                 t_2))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double t_1 = ((a * t) + (i * x)) * 4.0;
          	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
          	double tmp;
          	if (t < -1.6210815397541398e-69) {
          		tmp = t_2;
          	} else if (t < 165.68027943805222) {
          		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t, a, b, c, i, j, k)
              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), intent (in) :: b
              real(8), intent (in) :: c
              real(8), intent (in) :: i
              real(8), intent (in) :: j
              real(8), intent (in) :: k
              real(8) :: t_1
              real(8) :: t_2
              real(8) :: tmp
              t_1 = ((a * t) + (i * x)) * 4.0d0
              t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
              if (t < (-1.6210815397541398d-69)) then
                  tmp = t_2
              else if (t < 165.68027943805222d0) then
                  tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
              else
                  tmp = t_2
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
          	double t_1 = ((a * t) + (i * x)) * 4.0;
          	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
          	double tmp;
          	if (t < -1.6210815397541398e-69) {
          		tmp = t_2;
          	} else if (t < 165.68027943805222) {
          		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b, c, i, j, k):
          	t_1 = ((a * t) + (i * x)) * 4.0
          	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
          	tmp = 0
          	if t < -1.6210815397541398e-69:
          		tmp = t_2
          	elif t < 165.68027943805222:
          		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
          	else:
          		tmp = t_2
          	return tmp
          
          function code(x, y, z, t, a, b, c, i, j, k)
          	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
          	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
          	tmp = 0.0
          	if (t < -1.6210815397541398e-69)
          		tmp = t_2;
          	elseif (t < 165.68027943805222)
          		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
          	else
          		tmp = t_2;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
          	t_1 = ((a * t) + (i * x)) * 4.0;
          	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
          	tmp = 0.0;
          	if (t < -1.6210815397541398e-69)
          		tmp = t_2;
          	elseif (t < 165.68027943805222)
          		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
          	else
          		tmp = t_2;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
          t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
          \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;t < 165.68027943805222:\\
          \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_2\\
          
          
          \end{array}
          \end{array}
          

          Reproduce

          ?
          herbie shell --seed 2024220 
          (FPCore (x y z t a b c i j k)
            :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))
          
            (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))