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

Percentage Accurate: 84.9% → 91.4%
Time: 28.1s
Alternatives: 18
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 18 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: 84.9% 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: 91.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right), t, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right) - t\_1\\ \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 27.0) k)))
   (if (<=
        (-
         (-
          (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
          (* (* x 4.0) i))
         t_1)
        INFINITY)
     (-
      (fma
       (* z (* x (* 18.0 y)))
       t
       (fma t (* a -4.0) (fma b c (* -4.0 (* x i)))))
      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 * 27.0) * k;
	double tmp;
	if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
		tmp = fma((z * (x * (18.0 * y))), t, fma(t, (a * -4.0), fma(b, c, (-4.0 * (x * i))))) - 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(Float64(j * 27.0) * k)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1) <= Inf)
		tmp = Float64(fma(Float64(z * Float64(x * Float64(18.0 * y))), t, fma(t, Float64(a * -4.0), fma(b, c, Float64(-4.0 * Float64(x * i))))) - 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[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(z * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right), t, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right) - t\_1\\

\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 (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 97.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{\_.f64}\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(j, 27\right)}, k\right)\right) \]
      2. sub-negN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \left(\left(\mathsf{neg}\left(t \cdot \left(a \cdot 4\right)\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \left(t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \left(\mathsf{neg}\left(a \cdot 4\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(4\right)\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      14. metadata-evalN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, -4\right), \left(b \cdot c + \left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      16. accelerator-lowering-fma.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, -4\right), \mathsf{fma.f64}\left(b, c, \left(\mathsf{neg}\left(\left(4 \cdot x\right) \cdot i\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right), z\right), t, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, -4\right), \mathsf{fma.f64}\left(b, c, \left(\mathsf{neg}\left(4 \cdot \left(x \cdot i\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
    4. Applied egg-rr97.1%

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

    if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k))

    1. Initial program 0.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 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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(y \cdot z\right), 18\right)\right)\right)\right) \]
      10. *-lowering-*.f6459.6%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), 18\right)\right)\right)\right) \]
    5. Simplified59.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right), t, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\ \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 2: 89.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, t\_1\right)\right) - \left(j \cdot 27\right) \cdot k\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.49999999999999994e80

    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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr92.2%

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

    if 7.49999999999999994e80 < z

    1. Initial program 85.5%

      \[\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. associate--l+N/A

        \[\leadsto \mathsf{\_.f64}\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(j, 27\right)}, k\right)\right) \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \left(\left(\mathsf{neg}\left(t \cdot \left(a \cdot 4\right)\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \left(t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \mathsf{fma.f64}\left(t, \left(\mathsf{neg}\left(a \cdot 4\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \mathsf{fma.f64}\left(t, \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(4\right)\right)\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(18, y\right)\right)\right), z, \mathsf{fma.f64}\left(t, \mathsf{*.f64}\left(a, -4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
    4. Applied egg-rr90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.9%

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

Alternative 3: 52.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+123}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;b \cdot c \leq -1:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, t\_1\right)\\ \mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-102}:\\ \;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\ \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 (<= (* b c) -1e+123)
     (fma b c (* -4.0 (* x i)))
     (if (<= (* b c) -1.0)
       (fma (* j k) -27.0 t_1)
       (if (<= (* b c) -5e-102)
         (* t (* (* x y) (* 18.0 z)))
         (if (<= (* b c) 2e+71) (* -4.0 (fma a t (* x i))) (fma 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 ((b * c) <= -1e+123) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if ((b * c) <= -1.0) {
		tmp = fma((j * k), -27.0, t_1);
	} else if ((b * c) <= -5e-102) {
		tmp = t * ((x * y) * (18.0 * z));
	} else if ((b * c) <= 2e+71) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = fma(b, c, 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(b * c) <= -1e+123)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (Float64(b * c) <= -1.0)
		tmp = fma(Float64(j * k), -27.0, t_1);
	elseif (Float64(b * c) <= -5e-102)
		tmp = Float64(t * Float64(Float64(x * y) * Float64(18.0 * z)));
	elseif (Float64(b * c) <= 2e+71)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = fma(b, c, 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[(b * c), $MachinePrecision], -1e+123], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.0], N[(N[(j * k), $MachinePrecision] * -27.0 + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -5e-102], N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+71], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;b \cdot c \leq -1:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, t\_1\right)\\

\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-102}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\

\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 b c) < -9.99999999999999978e122

    1. Initial program 75.9%

      \[\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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6478.5%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified78.5%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6471.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    8. Simplified71.1%

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

    if -9.99999999999999978e122 < (*.f64 b c) < -1

    1. Initial program 94.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr94.0%

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \color{blue}{\left(-4 \cdot \left(a \cdot t\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \left(a \cdot t\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \left(t \cdot a\right)\right)\right) \]
      3. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(t, a\right)\right)\right) \]
    7. Simplified77.0%

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

    if -1 < (*.f64 b c) < -5.00000000000000026e-102

    1. Initial program 86.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr86.7%

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

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

        \[\leadsto \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot \color{blue}{18} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right) \cdot 18 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(t \cdot x\right) \cdot \left(18 \cdot \color{blue}{\left(y \cdot z\right)}\right) \]
      5. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \left(\color{blue}{18} \cdot \left(y \cdot z\right)\right)\right) \]
      8. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \left(z \cdot \color{blue}{\left(18 \cdot y\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(z, \color{blue}{\left(18 \cdot y\right)}\right)\right) \]
      11. *-lowering-*.f6454.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(18, \color{blue}{y}\right)\right)\right) \]
    7. Simplified54.5%

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

        \[\leadsto \left(t \cdot x\right) \cdot \left(\color{blue}{z} \cdot \left(18 \cdot y\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto t \cdot \left(x \cdot \left(z \cdot \left(y \cdot \color{blue}{18}\right)\right)\right) \]
      4. associate-*r*N/A

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

        \[\leadsto t \cdot \left(x \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \]
      6. associate-*l*N/A

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

        \[\leadsto t \cdot \left(\left(\left(x \cdot y\right) \cdot z\right) \cdot 18\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \left(18 \cdot \left(\left(x \cdot y\right) \cdot z\right)\right) \cdot \color{blue}{t} \]
      10. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), t\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(18 \cdot x\right) \cdot \left(y \cdot z\right)\right), t\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right), t\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(x \cdot 18\right), \left(y \cdot z\right)\right), t\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), \left(y \cdot z\right)\right), t\right) \]
      16. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), \mathsf{*.f64}\left(y, z\right)\right), t\right) \]
    9. Applied egg-rr61.0%

      \[\leadsto \color{blue}{\left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), t\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(18 \cdot \left(z \cdot y\right)\right)\right), t\right) \]
      3. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(y \cdot \left(18 \cdot z\right)\right)\right), t\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right), t\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(x \cdot y\right), \left(18 \cdot z\right)\right), t\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(18 \cdot z\right)\right), t\right) \]
      8. *-lowering-*.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(18, z\right)\right), t\right) \]
    11. Applied egg-rr65.4%

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

    if -5.00000000000000026e-102 < (*.f64 b c) < 2.0000000000000001e71

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6475.6%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified75.6%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6455.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified55.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified54.3%

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

    if 2.0000000000000001e71 < (*.f64 b c)

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified90.7%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(t \cdot a\right)\right)\right) \]
      3. *-lowering-*.f6476.0%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(t, a\right)\right)\right) \]
    8. Simplified76.0%

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

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

Alternative 4: 69.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+165}:\\
\;\;\;\;b \cdot c - t\_1\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999997e165

    1. Initial program 77.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 b around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(b \cdot c\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, c\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(j, 27\right)}, k\right)\right) \]
    5. Simplified70.0%

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

    if -4.9999999999999997e165 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000007e154

    1. Initial program 89.9%

      \[\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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6476.8%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified76.8%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6470.3%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified70.3%

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

    if 2.00000000000000007e154 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 80.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr79.9%

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6474.7%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    7. Simplified74.7%

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

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

Alternative 5: 87.5% accurate, 1.2× speedup?

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

\\
\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 86.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. sub-negN/A

      \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
    3. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

      \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

      \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
    6. accelerator-lowering-fma.f64N/A

      \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
    9. associate--l+N/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    10. distribute-rgt-out--N/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    11. accelerator-lowering-fma.f64N/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
  4. Applied egg-rr90.0%

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

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

Alternative 6: 54.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \cdot c \leq 10^{-130}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\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 (fma b c (* -4.0 (* t a)))))
   (if (<= (* b c) -2e+215)
     t_1
     (if (<= (* b c) 1e-130)
       (fma (* j k) -27.0 (* -4.0 (* x i)))
       (if (<= (* b c) 2e+71) (* -4.0 (fma a t (* x i))) 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 = fma(b, c, (-4.0 * (t * a)));
	double tmp;
	if ((b * c) <= -2e+215) {
		tmp = t_1;
	} else if ((b * c) <= 1e-130) {
		tmp = fma((j * k), -27.0, (-4.0 * (x * i)));
	} else if ((b * c) <= 2e+71) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(-4.0 * Float64(t * a)))
	tmp = 0.0
	if (Float64(b * c) <= -2e+215)
		tmp = t_1;
	elseif (Float64(b * c) <= 1e-130)
		tmp = fma(Float64(j * k), -27.0, Float64(-4.0 * Float64(x * i)));
	elseif (Float64(b * c) <= 2e+71)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2e+215], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1e-130], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+71], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq 10^{-130}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -1.99999999999999981e215 or 2.0000000000000001e71 < (*.f64 b c)

    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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6486.7%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified86.7%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(t \cdot a\right)\right)\right) \]
      3. *-lowering-*.f6475.8%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(t, a\right)\right)\right) \]
    8. Simplified75.8%

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

    if -1.99999999999999981e215 < (*.f64 b c) < 1.0000000000000001e-130

    1. Initial program 89.9%

      \[\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. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr91.3%

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6453.5%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    7. Simplified53.5%

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

    if 1.0000000000000001e-130 < (*.f64 b c) < 2.0000000000000001e71

    1. Initial program 84.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified77.0%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6459.3%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified59.3%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6456.6%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified56.6%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.6%

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

Alternative 7: 52.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-102}:\\ \;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -1.0)
   (- (* b c) (* (* j 27.0) k))
   (if (<= (* b c) -5e-102)
     (* t (* (* x y) (* 18.0 z)))
     (if (<= (* b c) 2e+71)
       (* -4.0 (fma a t (* x i)))
       (fma b c (* -4.0 (* t a)))))))
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) <= -1.0) {
		tmp = (b * c) - ((j * 27.0) * k);
	} else if ((b * c) <= -5e-102) {
		tmp = t * ((x * y) * (18.0 * z));
	} else if ((b * c) <= 2e+71) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = fma(b, c, (-4.0 * (t * a)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -1.0)
		tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k));
	elseif (Float64(b * c) <= -5e-102)
		tmp = Float64(t * Float64(Float64(x * y) * Float64(18.0 * z)));
	elseif (Float64(b * c) <= 2e+71)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = fma(b, c, Float64(-4.0 * Float64(t * a)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.0], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -5e-102], N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+71], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\

\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-102}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\

\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -1

    1. Initial program 81.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 \mathsf{\_.f64}\left(\color{blue}{\left(b \cdot c\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, c\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(j, 27\right)}, k\right)\right) \]
    5. Simplified60.9%

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

    if -1 < (*.f64 b c) < -5.00000000000000026e-102

    1. Initial program 86.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr86.7%

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

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

        \[\leadsto \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot \color{blue}{18} \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right) \cdot 18 \]
      3. associate-*l*N/A

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

        \[\leadsto \left(t \cdot x\right) \cdot \left(18 \cdot \color{blue}{\left(y \cdot z\right)}\right) \]
      5. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \left(\color{blue}{18} \cdot \left(y \cdot z\right)\right)\right) \]
      8. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \left(z \cdot \color{blue}{\left(18 \cdot y\right)}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(z, \color{blue}{\left(18 \cdot y\right)}\right)\right) \]
      11. *-lowering-*.f6454.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(18, \color{blue}{y}\right)\right)\right) \]
    7. Simplified54.5%

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

        \[\leadsto \left(t \cdot x\right) \cdot \left(\color{blue}{z} \cdot \left(18 \cdot y\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto t \cdot \left(x \cdot \left(z \cdot \left(y \cdot \color{blue}{18}\right)\right)\right) \]
      4. associate-*r*N/A

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

        \[\leadsto t \cdot \left(x \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \]
      6. associate-*l*N/A

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

        \[\leadsto t \cdot \left(\left(\left(x \cdot y\right) \cdot z\right) \cdot 18\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \left(18 \cdot \left(\left(x \cdot y\right) \cdot z\right)\right) \cdot \color{blue}{t} \]
      10. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), t\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(18 \cdot x\right) \cdot \left(y \cdot z\right)\right), t\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right), t\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(x \cdot 18\right), \left(y \cdot z\right)\right), t\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), \left(y \cdot z\right)\right), t\right) \]
      16. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), \mathsf{*.f64}\left(y, z\right)\right), t\right) \]
    9. Applied egg-rr61.0%

      \[\leadsto \color{blue}{\left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), t\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(18 \cdot \left(z \cdot y\right)\right)\right), t\right) \]
      3. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(y \cdot \left(18 \cdot z\right)\right)\right), t\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right), t\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(x \cdot y\right), \left(18 \cdot z\right)\right), t\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(18 \cdot z\right)\right), t\right) \]
      8. *-lowering-*.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(18, z\right)\right), t\right) \]
    11. Applied egg-rr65.4%

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

    if -5.00000000000000026e-102 < (*.f64 b c) < 2.0000000000000001e71

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6475.6%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified75.6%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6455.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified55.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified54.3%

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

    if 2.0000000000000001e71 < (*.f64 b c)

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified90.7%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(t \cdot a\right)\right)\right) \]
      3. *-lowering-*.f6476.0%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(t, a\right)\right)\right) \]
    8. Simplified76.0%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(t \cdot a\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.0%

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

Alternative 8: 73.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;x \leq -1.65 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\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 (fma -4.0 i (* t (* 18.0 (* y z)))))))
   (if (<= x -1.65e+116)
     t_1
     (if (<= x -1.5e+23)
       (fma b c (* -4.0 (fma i x (* t a))))
       (if (<= x 4.4e+58)
         (fma b c (fma -4.0 (* t a) (* j (* k -27.0))))
         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 * fma(-4.0, i, (t * (18.0 * (y * z))));
	double tmp;
	if (x <= -1.65e+116) {
		tmp = t_1;
	} else if (x <= -1.5e+23) {
		tmp = fma(b, c, (-4.0 * fma(i, x, (t * a))));
	} else if (x <= 4.4e+58) {
		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))))
	tmp = 0.0
	if (x <= -1.65e+116)
		tmp = t_1;
	elseif (x <= -1.5e+23)
		tmp = fma(b, c, Float64(-4.0 * fma(i, x, Float64(t * a))));
	elseif (x <= 4.4e+58)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
	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[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+116], t$95$1, If[LessEqual[x, -1.5e+23], N[(b * c + N[(-4.0 * N[(i * x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e+58], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.5 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6499999999999999e116 or 4.4000000000000001e58 < x

    1. Initial program 74.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(y \cdot z\right), 18\right)\right)\right)\right) \]
      10. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), 18\right)\right)\right)\right) \]
    5. Simplified77.0%

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

    if -1.6499999999999999e116 < x < -1.5e23

    1. Initial program 84.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6483.8%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified83.8%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6474.4%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified74.4%

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

    if -1.5e23 < x < 4.4000000000000001e58

    1. Initial program 95.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 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 b \cdot c + \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\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)\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\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)\right) \]
      5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      15. *-lowering-*.f6479.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified79.1%

      \[\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 3 regimes into one program.
  4. Final simplification77.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+58}:\\ \;\;\;\;\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 9: 36.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.35 \cdot 10^{+125}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq -6.5 \cdot 10^{-109}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{+134}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\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) -1.35e+125)
   (* b c)
   (if (<= (* b c) -6.5e-109)
     (* (* j k) -27.0)
     (if (<= (* b c) 3.6e+134) (* -4.0 (* x i)) (* 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) <= -1.35e+125) {
		tmp = b * c;
	} else if ((b * c) <= -6.5e-109) {
		tmp = (j * k) * -27.0;
	} else if ((b * c) <= 3.6e+134) {
		tmp = -4.0 * (x * i);
	} 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) <= (-1.35d+125)) then
        tmp = b * c
    else if ((b * c) <= (-6.5d-109)) then
        tmp = (j * k) * (-27.0d0)
    else if ((b * c) <= 3.6d+134) then
        tmp = (-4.0d0) * (x * i)
    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) <= -1.35e+125) {
		tmp = b * c;
	} else if ((b * c) <= -6.5e-109) {
		tmp = (j * k) * -27.0;
	} else if ((b * c) <= 3.6e+134) {
		tmp = -4.0 * (x * i);
	} else {
		tmp = b * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -1.35e+125:
		tmp = b * c
	elif (b * c) <= -6.5e-109:
		tmp = (j * k) * -27.0
	elif (b * c) <= 3.6e+134:
		tmp = -4.0 * (x * i)
	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) <= -1.35e+125)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= -6.5e-109)
		tmp = Float64(Float64(j * k) * -27.0);
	elseif (Float64(b * c) <= 3.6e+134)
		tmp = Float64(-4.0 * Float64(x * i));
	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) <= -1.35e+125)
		tmp = b * c;
	elseif ((b * c) <= -6.5e-109)
		tmp = (j * k) * -27.0;
	elseif ((b * c) <= 3.6e+134)
		tmp = -4.0 * (x * i);
	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], -1.35e+125], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.5e-109], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.6e+134], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{+134}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -1.3499999999999999e125 or 3.59999999999999988e134 < (*.f64 b c)

    1. Initial program 80.9%

      \[\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. *-lowering-*.f6466.8%

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{c}\right) \]
    5. Simplified66.8%

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

    if -1.3499999999999999e125 < (*.f64 b c) < -6.49999999999999959e-109

    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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr91.7%

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

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

        \[\leadsto \mathsf{*.f64}\left(-27, \color{blue}{\left(j \cdot k\right)}\right) \]
      2. *-lowering-*.f6440.7%

        \[\leadsto \mathsf{*.f64}\left(-27, \mathsf{*.f64}\left(j, \color{blue}{k}\right)\right) \]
    7. Simplified40.7%

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

    if -6.49999999999999959e-109 < (*.f64 b c) < 3.59999999999999988e134

    1. Initial program 89.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 i around inf

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(i \cdot x\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-4, \left(x \cdot \color{blue}{i}\right)\right) \]
      3. *-lowering-*.f6431.1%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(x, \color{blue}{i}\right)\right) \]
    5. Simplified31.1%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.35 \cdot 10^{+125}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq -6.5 \cdot 10^{-109}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{+134}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 37.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.2 \cdot 10^{+126}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 9 \cdot 10^{-131}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;b \cdot c \leq 4.4 \cdot 10^{+48}:\\ \;\;\;\;-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) -2.2e+126)
   (* b c)
   (if (<= (* b c) 9e-131)
     (* (* j k) -27.0)
     (if (<= (* b c) 4.4e+48) (* -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) <= -2.2e+126) {
		tmp = b * c;
	} else if ((b * c) <= 9e-131) {
		tmp = (j * k) * -27.0;
	} else if ((b * c) <= 4.4e+48) {
		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) <= (-2.2d+126)) then
        tmp = b * c
    else if ((b * c) <= 9d-131) then
        tmp = (j * k) * (-27.0d0)
    else if ((b * c) <= 4.4d+48) 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) <= -2.2e+126) {
		tmp = b * c;
	} else if ((b * c) <= 9e-131) {
		tmp = (j * k) * -27.0;
	} else if ((b * c) <= 4.4e+48) {
		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) <= -2.2e+126:
		tmp = b * c
	elif (b * c) <= 9e-131:
		tmp = (j * k) * -27.0
	elif (b * c) <= 4.4e+48:
		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) <= -2.2e+126)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 9e-131)
		tmp = Float64(Float64(j * k) * -27.0);
	elseif (Float64(b * c) <= 4.4e+48)
		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) <= -2.2e+126)
		tmp = b * c;
	elseif ((b * c) <= 9e-131)
		tmp = (j * k) * -27.0;
	elseif ((b * c) <= 4.4e+48)
		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], -2.2e+126], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 9e-131], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.4e+48], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \cdot c \leq 4.4 \cdot 10^{+48}:\\
\;\;\;\;-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) < -2.19999999999999999e126 or 4.3999999999999999e48 < (*.f64 b c)

    1. Initial program 82.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. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{c}\right) \]
    5. Simplified60.5%

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

    if -2.19999999999999999e126 < (*.f64 b c) < 9.0000000000000004e-131

    1. Initial program 90.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr91.8%

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

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

        \[\leadsto \mathsf{*.f64}\left(-27, \color{blue}{\left(j \cdot k\right)}\right) \]
      2. *-lowering-*.f6429.6%

        \[\leadsto \mathsf{*.f64}\left(-27, \mathsf{*.f64}\left(j, \color{blue}{k}\right)\right) \]
    7. Simplified29.6%

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

    if 9.0000000000000004e-131 < (*.f64 b c) < 4.3999999999999999e48

    1. Initial program 83.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 a around inf

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t\right)}\right) \]
      2. *-lowering-*.f6437.1%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(a, \color{blue}{t}\right)\right) \]
    5. Simplified37.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.2 \cdot 10^{+126}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 9 \cdot 10^{-131}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;b \cdot c \leq 4.4 \cdot 10^{+48}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 72.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+69}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t -8.6e+69)
   (* t (fma -4.0 a (* 18.0 (* z (* x y)))))
   (if (<= t 3e+37)
     (fma b c (fma -4.0 (* x i) (* j (* k -27.0))))
     (* t (fma (* (* x 18.0) z) y (* a -4.0))))))
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 (t <= -8.6e+69) {
		tmp = t * fma(-4.0, a, (18.0 * (z * (x * y))));
	} else if (t <= 3e+37) {
		tmp = fma(b, c, fma(-4.0, (x * i), (j * (k * -27.0))));
	} else {
		tmp = t * fma(((x * 18.0) * z), y, (a * -4.0));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= -8.6e+69)
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(z * Float64(x * y)))));
	elseif (t <= 3e+37)
		tmp = fma(b, c, fma(-4.0, Float64(x * i), Float64(j * Float64(k * -27.0))));
	else
		tmp = Float64(t * fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -8.6e+69], N[(t * N[(-4.0 * a + N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+37], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\

\mathbf{elif}\;t \leq 3 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.59999999999999986e69

    1. Initial program 90.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 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. *-lowering-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(x, \left(y \cdot z\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6476.2%

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right)\right)\right)\right) \]
    5. Simplified76.2%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \left(\left(x \cdot y\right) \cdot z\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(\left(x \cdot y\right), z\right)\right)\right)\right) \]
      3. *-lowering-*.f6478.0%

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), z\right)\right)\right)\right) \]
    7. Applied egg-rr78.0%

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

    if -8.59999999999999986e69 < t < 3.00000000000000022e37

    1. Initial program 89.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 t around 0

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(x \cdot i\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \left(\left(j \cdot k\right) \cdot -27\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \left(j \cdot \left(k \cdot -27\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \mathsf{*.f64}\left(j, \left(-27 \cdot k\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      16. *-lowering-*.f6480.5%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{*.f64}\left(x, i\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified80.5%

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

    if 3.00000000000000022e37 < t

    1. Initial program 75.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 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. *-lowering-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(x, \left(y \cdot z\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6468.1%

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(-4, a, \mathsf{*.f64}\left(18, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right)\right)\right)\right) \]
    5. Simplified68.1%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(t, \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4 \cdot a}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(t, \left(\left(18 \cdot x\right) \cdot \left(z \cdot y\right) + -4 \cdot a\right)\right) \]
      4. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(\mathsf{*.f64}\left(\left(x \cdot 18\right), z\right), y, \left(-4 \cdot a\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), z\right), y, \left(-4 \cdot a\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), z\right), y, \left(a \cdot -4\right)\right)\right) \]
      10. *-lowering-*.f6471.6%

        \[\leadsto \mathsf{*.f64}\left(t, \mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 18\right), z\right), y, \mathsf{*.f64}\left(a, -4\right)\right)\right) \]
    7. Applied egg-rr71.6%

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

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

Alternative 12: 78.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+125}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= x -2.9e+125)
   (* x (fma -4.0 i (* t (* 18.0 (* y z)))))
   (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -27.0))))))
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 <= -2.9e+125) {
		tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
	} else {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -27.0))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (x <= -2.9e+125)
		tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))));
	else
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -27.0))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.9e+125], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\


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

    1. Initial program 79.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(y \cdot z\right), 18\right)\right)\right)\right) \]
      10. *-lowering-*.f6484.9%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{fma.f64}\left(-4, i, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, z\right), 18\right)\right)\right)\right) \]
    5. Simplified84.9%

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

    if -2.89999999999999993e125 < x

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6482.4%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified82.4%

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

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

Alternative 13: 52.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -2e+224)
   (fma b c (* -4.0 (* x i)))
   (if (<= (* b c) 2e+71)
     (* -4.0 (fma a t (* x i)))
     (fma b c (* -4.0 (* t a))))))
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) <= -2e+224) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if ((b * c) <= 2e+71) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = fma(b, c, (-4.0 * (t * a)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -2e+224)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (Float64(b * c) <= 2e+71)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = fma(b, c, Float64(-4.0 * Float64(t * a)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2e+224], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+71], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -1.99999999999999994e224

    1. Initial program 80.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6483.3%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified83.3%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6477.5%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    8. Simplified77.5%

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

    if -1.99999999999999994e224 < (*.f64 b c) < 2.0000000000000001e71

    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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6473.4%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified73.4%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6451.3%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified51.3%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6450.1%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified50.1%

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

    if 2.0000000000000001e71 < (*.f64 b c)

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified90.7%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(t \cdot a\right)\right)\right) \]
      3. *-lowering-*.f6476.0%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(t, a\right)\right)\right) \]
    8. Simplified76.0%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(t \cdot a\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+71}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+36}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\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 (fma b c (* -4.0 (* x i)))))
   (if (<= (* b c) -2e+224)
     t_1
     (if (<= (* b c) 5e+36) (* -4.0 (fma a t (* x i))) 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 = fma(b, c, (-4.0 * (x * i)));
	double tmp;
	if ((b * c) <= -2e+224) {
		tmp = t_1;
	} else if ((b * c) <= 5e+36) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(-4.0 * Float64(x * i)))
	tmp = 0.0
	if (Float64(b * c) <= -2e+224)
		tmp = t_1;
	elseif (Float64(b * c) <= 5e+36)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2e+224], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+36], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+36}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1.99999999999999994e224 or 4.99999999999999977e36 < (*.f64 b c)

    1. Initial program 85.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6487.6%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified87.6%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6474.9%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    8. Simplified74.9%

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

    if -1.99999999999999994e224 < (*.f64 b c) < 4.99999999999999977e36

    1. Initial program 87.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6472.8%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified72.8%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6451.0%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified51.0%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6449.8%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified49.8%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+224}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+36}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 50.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.22 \cdot 10^{+216}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 2.7 \cdot 10^{+135}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\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) -1.22e+216)
   (* b c)
   (if (<= (* b c) 2.7e+135) (* -4.0 (fma a t (* x i))) (* 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) <= -1.22e+216) {
		tmp = b * c;
	} else if ((b * c) <= 2.7e+135) {
		tmp = -4.0 * fma(a, t, (x * i));
	} 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) <= -1.22e+216)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 2.7e+135)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.22e+216], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.7e+135], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot c \leq 2.7 \cdot 10^{+135}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1.22e216 or 2.69999999999999985e135 < (*.f64 b c)

    1. Initial program 82.5%

      \[\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. *-lowering-*.f6471.5%

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{c}\right) \]
    5. Simplified71.5%

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

    if -1.22e216 < (*.f64 b c) < 2.69999999999999985e135

    1. Initial program 88.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6474.6%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified74.6%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6453.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified53.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6450.9%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified50.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.22 \cdot 10^{+216}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 2.7 \cdot 10^{+135}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 37.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+125}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 1.45 \cdot 10^{+70}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \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) -5e+125)
   (* b c)
   (if (<= (* b c) 1.45e+70) (* (* j k) -27.0) (* 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) <= -5e+125) {
		tmp = b * c;
	} else if ((b * c) <= 1.45e+70) {
		tmp = (j * k) * -27.0;
	} 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) <= (-5d+125)) then
        tmp = b * c
    else if ((b * c) <= 1.45d+70) then
        tmp = (j * k) * (-27.0d0)
    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) <= -5e+125) {
		tmp = b * c;
	} else if ((b * c) <= 1.45e+70) {
		tmp = (j * k) * -27.0;
	} else {
		tmp = b * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -5e+125:
		tmp = b * c
	elif (b * c) <= 1.45e+70:
		tmp = (j * k) * -27.0
	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) <= -5e+125)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 1.45e+70)
		tmp = Float64(Float64(j * k) * -27.0);
	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) <= -5e+125)
		tmp = b * c;
	elseif ((b * c) <= 1.45e+70)
		tmp = (j * k) * -27.0;
	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], -5e+125], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.45e+70], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -4.99999999999999962e125 or 1.4499999999999999e70 < (*.f64 b c)

    1. Initial program 82.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. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{c}\right) \]
    5. Simplified63.6%

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

    if -4.99999999999999962e125 < (*.f64 b c) < 1.4499999999999999e70

    1. Initial program 88.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. sub-negN/A

        \[\leadsto \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) + \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(k \cdot \left(j \cdot 27\right)\right)\right) + \left(\left(\color{blue}{\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. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(k \cdot j\right) \cdot 27\right)\right) + \left(\left(\color{blue}{\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. distribute-rgt-neg-inN/A

        \[\leadsto \left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right) + \left(\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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(k \cdot j\right), \color{blue}{\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)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), \left(\mathsf{neg}\left(\color{blue}{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)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \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)\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(k, j\right), -27, \mathsf{fma.f64}\left(t, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right), \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) \]
    4. Applied egg-rr90.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(-27, \color{blue}{\left(j \cdot k\right)}\right) \]
      2. *-lowering-*.f6428.1%

        \[\leadsto \mathsf{*.f64}\left(-27, \mathsf{*.f64}\left(j, \color{blue}{k}\right)\right) \]
    7. Simplified28.1%

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

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

Alternative 17: 51.5% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+28}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+35}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= x -1.8e+28)
   (* -4.0 (fma a t (* x i)))
   (if (<= x 1.05e+35)
     (- (* b c) (* (* j 27.0) k))
     (fma b c (* -4.0 (* x i))))))
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 <= -1.8e+28) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else if (x <= 1.05e+35) {
		tmp = (b * c) - ((j * 27.0) * k);
	} else {
		tmp = fma(b, c, (-4.0 * (x * i)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (x <= -1.8e+28)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	elseif (x <= 1.05e+35)
		tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k));
	else
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -1.8e+28], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+35], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+28}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+35}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.8e28

    1. Initial program 81.5%

      \[\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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6466.1%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified66.1%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(a \cdot t + i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(a \cdot t + i \cdot x\right)\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x + a \cdot t\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(a \cdot t\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \left(t \cdot a\right)\right)\right)\right) \]
      5. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(i, x, \mathsf{*.f64}\left(t, a\right)\right)\right)\right) \]
    8. Simplified60.9%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)}\right) \]
    9. Taylor expanded in b around 0

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

        \[\leadsto \mathsf{*.f64}\left(-4, \color{blue}{\left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, \color{blue}{t}, \left(i \cdot x\right)\right)\right) \]
      3. *-lowering-*.f6457.1%

        \[\leadsto \mathsf{*.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    11. Simplified57.1%

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

    if -1.8e28 < x < 1.0499999999999999e35

    1. Initial program 94.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 b around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(b \cdot c\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(j, 27\right), k\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, c\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(j, 27\right)}, k\right)\right) \]
    5. Simplified57.5%

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

    if 1.0499999999999999e35 < x

    1. Initial program 72.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 y around 0

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, \color{blue}{c}, \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)\right) \]
      3. associate-+r+N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right)\right) \]
      5. distribute-lft-outN/A

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \left(-4 \cdot \left(a \cdot t + i \cdot x\right) + -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \left(a \cdot t + i \cdot x\right), \left(-27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \left(j \cdot \left(-27 \cdot k\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \left(k \cdot -27\right)\right)\right)\right) \]
      19. *-lowering-*.f6474.6%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{fma.f64}\left(-4, \mathsf{fma.f64}\left(a, t, \mathsf{*.f64}\left(x, i\right)\right), \mathsf{*.f64}\left(j, \mathsf{*.f64}\left(k, -27\right)\right)\right)\right) \]
    5. Simplified74.6%

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

      \[\leadsto \mathsf{fma.f64}\left(b, c, \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \left(i \cdot x\right)\right)\right) \]
      2. *-lowering-*.f6462.9%

        \[\leadsto \mathsf{fma.f64}\left(b, c, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(i, x\right)\right)\right) \]
    8. Simplified62.9%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.4%

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

Alternative 18: 24.4% 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 86.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. *-lowering-*.f6422.7%

      \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{c}\right) \]
  5. Simplified22.7%

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

Developer Target 1: 89.2% 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 2024193 
(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)))