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

Percentage Accurate: 85.7% → 88.3%
Time: 7.7s
Alternatives: 22
Speedup: 1.1×

Specification

?
\[\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 \]
(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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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]
\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

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 22 alternatives:

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

Initial Program: 85.7% accurate, 1.0× speedup?

\[\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 \]
(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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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]
\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

Alternative 1: 88.3% accurate, 0.9× speedup?

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -2.9e274

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if -2.9e274 < j

    1. Initial program 85.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. Applied rewrites89.4%

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

Alternative 2: 88.1% accurate, 1.1× speedup?

\[c \cdot b - \mathsf{fma}\left(\mathsf{fma}\left(4, a, -18 \cdot \left(\left(y \cdot x\right) \cdot z\right)\right), t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (* c b)
  (fma
   (fma 4.0 a (* -18.0 (* (* y x) z)))
   t
   (fma (* i 4.0) x (* k (* 27.0 j))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (c * b) - fma(fma(4.0, a, (-18.0 * ((y * x) * z))), t, fma((i * 4.0), x, (k * (27.0 * j))));
}
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(c * b) - fma(fma(4.0, a, Float64(-18.0 * Float64(Float64(y * x) * z))), t, fma(Float64(i * 4.0), x, Float64(k * Float64(27.0 * j)))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * a + N[(-18.0 * N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(i * 4.0), $MachinePrecision] * x + N[(k * N[(27.0 * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
c \cdot b - \mathsf{fma}\left(\mathsf{fma}\left(4, a, -18 \cdot \left(\left(y \cdot x\right) \cdot z\right)\right), t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)
Derivation
  1. Initial program 85.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. Applied rewrites88.3%

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

Alternative 3: 83.0% accurate, 0.9× speedup?

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

\mathbf{elif}\;i \leq 3.5 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4 \cdot a, t, t\_1\right)\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -7.99999999999999982e102

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

    if -7.99999999999999982e102 < i < 3.5000000000000002e-17

    1. Initial program 85.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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      10. lower-*.f6473.5

        \[\leadsto \mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    4. Applied rewrites73.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000002e-17 < i

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

        \[\leadsto \color{blue}{c \cdot b - \mathsf{fma}\left(4 \cdot a, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)} \]
      2. sub-flipN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(\mathsf{neg}\left(\mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)\right) - \left(4 \cdot a\right) \cdot t}\right) \]
    7. Applied rewrites77.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27 \cdot k, j, -4 \cdot \left(x \cdot i\right)\right) - t \cdot \left(a \cdot 4\right)\right)} \]
    8. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \mathsf{fma}\left(x \cdot -4, i, \color{blue}{\left(j \cdot k\right)} \cdot -27 - t \cdot \left(a \cdot 4\right)\right)\right) \]
      17. lower-*.f6477.8

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

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

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

Alternative 4: 78.7% accurate, 1.2× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.6999999999999997e134 or 1.22e120 < z

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

    if -6.6999999999999997e134 < z < 1.22e120

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

        \[\leadsto \color{blue}{c \cdot b - \mathsf{fma}\left(4 \cdot a, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)} \]
      2. sub-flipN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(\mathsf{neg}\left(\mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)\right) - \left(4 \cdot a\right) \cdot t}\right) \]
    7. Applied rewrites77.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27 \cdot k, j, -4 \cdot \left(x \cdot i\right)\right) - t \cdot \left(a \cdot 4\right)\right)} \]
    8. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \mathsf{fma}\left(x \cdot -4, i, \color{blue}{\left(j \cdot k\right)} \cdot -27 - t \cdot \left(a \cdot 4\right)\right)\right) \]
      17. lower-*.f6477.8

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

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

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

Alternative 5: 78.5% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := c \cdot b - t \cdot \mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right)\\ \mathbf{if}\;z \leq -6.7 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27 \cdot \mathsf{max}\left(j, k\right), \mathsf{min}\left(j, k\right), -4 \cdot \left(x \cdot i\right)\right) - t \cdot \left(a \cdot 4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (- (* c b) (* t (fma -18.0 (* x (* y z)) (* 4.0 a))))))
   (if (<= z -6.7e+134)
     t_1
     (if (<= z 2.3e+104)
       (fma
        c
        b
        (-
         (fma (* -27.0 (fmax j k)) (fmin j k) (* -4.0 (* x i)))
         (* t (* a 4.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 = (c * b) - (t * fma(-18.0, (x * (y * z)), (4.0 * a)));
	double tmp;
	if (z <= -6.7e+134) {
		tmp = t_1;
	} else if (z <= 2.3e+104) {
		tmp = fma(c, b, (fma((-27.0 * fmax(j, k)), fmin(j, k), (-4.0 * (x * i))) - (t * (a * 4.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(c * b) - Float64(t * fma(-18.0, Float64(x * Float64(y * z)), Float64(4.0 * a))))
	tmp = 0.0
	if (z <= -6.7e+134)
		tmp = t_1;
	elseif (z <= 2.3e+104)
		tmp = fma(c, b, Float64(fma(Float64(-27.0 * fmax(j, k)), fmin(j, k), Float64(-4.0 * Float64(x * i))) - Float64(t * Float64(a * 4.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[(N[(c * b), $MachinePrecision] - N[(t * N[(-18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.7e+134], t$95$1, If[LessEqual[z, 2.3e+104], N[(c * b + N[(N[(N[(-27.0 * N[Max[j, k], $MachinePrecision]), $MachinePrecision] * N[Min[j, k], $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := c \cdot b - t \cdot \mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right)\\
\mathbf{if}\;z \leq -6.7 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(-27 \cdot \mathsf{max}\left(j, k\right), \mathsf{min}\left(j, k\right), -4 \cdot \left(x \cdot i\right)\right) - t \cdot \left(a \cdot 4\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.6999999999999997e134 or 2.29999999999999985e104 < z

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

    if -6.6999999999999997e134 < z < 2.29999999999999985e104

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

        \[\leadsto \color{blue}{c \cdot b - \mathsf{fma}\left(4 \cdot a, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)} \]
      2. sub-flipN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(\mathsf{neg}\left(\mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right)\right) - \left(4 \cdot a\right) \cdot t}\right) \]
    7. Applied rewrites77.7%

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

Alternative 6: 76.1% accurate, 1.4× speedup?

\[\begin{array}{l} t_1 := c \cdot b - t \cdot \mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right)\\ \mathbf{if}\;t \leq -7.8 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-25}:\\ \;\;\;\;b \cdot c - \mathsf{fma}\left(4 \cdot x, i, \left(j \cdot k\right) \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (- (* c b) (* t (fma -18.0 (* x (* y z)) (* 4.0 a))))))
   (if (<= t -7.8e+49)
     t_1
     (if (<= t 8e-25) (- (* b c) (fma (* 4.0 x) i (* (* 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 = (c * b) - (t * fma(-18.0, (x * (y * z)), (4.0 * a)));
	double tmp;
	if (t <= -7.8e+49) {
		tmp = t_1;
	} else if (t <= 8e-25) {
		tmp = (b * c) - fma((4.0 * x), i, ((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(Float64(c * b) - Float64(t * fma(-18.0, Float64(x * Float64(y * z)), Float64(4.0 * a))))
	tmp = 0.0
	if (t <= -7.8e+49)
		tmp = t_1;
	elseif (t <= 8e-25)
		tmp = Float64(Float64(b * c) - fma(Float64(4.0 * x), i, Float64(Float64(j * 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[(N[(c * b), $MachinePrecision] - N[(t * N[(-18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+49], t$95$1, If[LessEqual[t, 8e-25], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * x), $MachinePrecision] * i + N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := c \cdot b - t \cdot \mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right)\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.8000000000000002e49 or 8.00000000000000031e-25 < t

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

    if -7.8000000000000002e49 < t < 8.00000000000000031e-25

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, 27 \cdot \left(j \cdot k\right)\right) \]
      8. lower-*.f6461.7

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, \left(j \cdot k\right) \cdot 27\right) \]
      11. lower-*.f6461.7

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, \left(j \cdot k\right) \cdot 27\right) \]
    6. Applied rewrites61.7%

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

Alternative 7: 72.9% accurate, 1.4× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.8000000000000002e49

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) \]
      7. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(-4 \cdot a + \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(\left(y \cdot x\right) \cdot z\right)\right) \]
      17. fp-cancel-sub-sign-invN/A

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

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(\left(x \cdot y\right) \cdot z\right)\right) \]
      19. associate-*r*N/A

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    7. Applied rewrites43.2%

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

    if -7.8000000000000002e49 < t < 8.99999999999999982e-33

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, 27 \cdot \left(j \cdot k\right)\right) \]
      8. lower-*.f6461.7

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, \left(j \cdot k\right) \cdot 27\right) \]
      11. lower-*.f6461.7

        \[\leadsto b \cdot c - \mathsf{fma}\left(4 \cdot x, i, \left(j \cdot k\right) \cdot 27\right) \]
    6. Applied rewrites61.7%

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

    if 8.99999999999999982e-33 < t < 1.1499999999999999e149

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

    if 1.1499999999999999e149 < t

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

Alternative 8: 72.9% accurate, 1.4× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.8000000000000002e49

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) \]
      7. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(-4 \cdot a + \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(\left(y \cdot x\right) \cdot z\right)\right) \]
      17. fp-cancel-sub-sign-invN/A

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

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(\left(x \cdot y\right) \cdot z\right)\right) \]
      19. associate-*r*N/A

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    7. Applied rewrites43.2%

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

    if -7.8000000000000002e49 < t < 8.99999999999999982e-33

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

    if 8.99999999999999982e-33 < t < 1.1499999999999999e149

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

    if 1.1499999999999999e149 < t

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

Alternative 9: 70.8% accurate, 1.6× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.19999999999999986e184 or 6.6e94 < x

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto x \cdot \left(18 \cdot \left(\left(t \cdot y\right) \cdot z\right) + -4 \cdot i\right) \]
      7. associate-*r*N/A

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
      13. lower-*.f6443.9

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
    7. Applied rewrites43.9%

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

    if -5.19999999999999986e184 < x < 6.6e94

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

Alternative 10: 56.4% accurate, 0.8× speedup?

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

\mathbf{elif}\;b \cdot c \leq -1 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-317}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right)\\

\mathbf{elif}\;b \cdot c \leq 10^{-235}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq 10000000000000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(x \cdot y\right), -18, a \cdot 4\right) \cdot \left(-t\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\


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

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

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

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

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

        \[\leadsto c \cdot b - -18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
      4. lower-*.f6443.8

        \[\leadsto c \cdot b - -18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot \color{blue}{z}\right)\right)\right) \]
    8. Applied rewrites43.8%

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

    if -5e51 < (*.f64 b c) < -1e-209 or -5.00000017e-317 < (*.f64 b c) < 9.9999999999999996e-236

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6441.7

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites41.7%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. distribute-neg-inN/A

        \[\leadsto \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) \]
      6. lift-*.f64N/A

        \[\leadsto \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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(a \cdot t\right) \cdot 4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(\mathsf{neg}\left(4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      17. metadata-eval41.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites41.7%

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

    if -1e-209 < (*.f64 b c) < -5.00000017e-317

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto x \cdot \left(18 \cdot \left(\left(t \cdot y\right) \cdot z\right) + -4 \cdot i\right) \]
      7. associate-*r*N/A

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
      13. lower-*.f6443.9

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
    7. Applied rewrites43.9%

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

    if 9.9999999999999996e-236 < (*.f64 b c) < 1e13

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) \]
      7. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(-4 \cdot a + \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(\left(y \cdot x\right) \cdot z\right)\right) \]
      17. fp-cancel-sub-sign-invN/A

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

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(\left(x \cdot y\right) \cdot z\right)\right) \]
      19. associate-*r*N/A

        \[\leadsto t \cdot \left(-4 \cdot a - -18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    7. Applied rewrites43.2%

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

    if 1e13 < (*.f64 b c)

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

Alternative 11: 56.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \cdot c \leq -1 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-317}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right)\\

\mathbf{elif}\;b \cdot c \leq 10^{-235}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq 10000000000000:\\
\;\;\;\;\mathsf{fma}\left(\left(18 \cdot x\right) \cdot y, z, -4 \cdot a\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\


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

    1. Initial program 85.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. Applied rewrites88.3%

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

      \[\leadsto c \cdot b - \mathsf{fma}\left(\color{blue}{4 \cdot a}, t, \mathsf{fma}\left(i \cdot 4, x, k \cdot \left(27 \cdot j\right)\right)\right) \]
    4. Step-by-step derivation
      1. lower-*.f6477.3

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

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

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

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

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

        \[\leadsto c \cdot b - -18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
      4. lower-*.f6443.8

        \[\leadsto c \cdot b - -18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot \color{blue}{z}\right)\right)\right) \]
    8. Applied rewrites43.8%

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

    if -5e51 < (*.f64 b c) < -1e-209 or -5.00000017e-317 < (*.f64 b c) < 9.9999999999999996e-236

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6441.7

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites41.7%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. distribute-neg-inN/A

        \[\leadsto \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) \]
      6. lift-*.f64N/A

        \[\leadsto \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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(a \cdot t\right) \cdot 4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(\mathsf{neg}\left(4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      17. metadata-eval41.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites41.7%

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

    if -1e-209 < (*.f64 b c) < -5.00000017e-317

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto x \cdot \left(18 \cdot \left(\left(t \cdot y\right) \cdot z\right) + -4 \cdot i\right) \]
      7. associate-*r*N/A

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
      13. lower-*.f6443.9

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
    7. Applied rewrites43.9%

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

    if 9.9999999999999996e-236 < (*.f64 b c) < 1e13

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

    if 1e13 < (*.f64 b c)

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

Alternative 12: 54.4% accurate, 1.2× speedup?

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

\mathbf{elif}\;x \leq -1.42 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-224}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right)\\

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

\mathbf{elif}\;x \leq 16000000:\\
\;\;\;\;t\_1\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.19999999999999986e184 or 1.6e7 < x

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto x \cdot \left(18 \cdot \left(\left(t \cdot y\right) \cdot z\right) + -4 \cdot i\right) \]
      7. associate-*r*N/A

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
      13. lower-*.f6443.9

        \[\leadsto x \cdot \mathsf{fma}\left(18 \cdot \left(y \cdot t\right), z, i \cdot -4\right) \]
    7. Applied rewrites43.9%

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

    if -5.19999999999999986e184 < x < -1.4200000000000001e-9 or 7.00000000000000058e-136 < x < 1.6e7

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if -1.4200000000000001e-9 < x < -1.14999999999999994e-224

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6441.7

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites41.7%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. distribute-neg-inN/A

        \[\leadsto \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) \]
      6. lift-*.f64N/A

        \[\leadsto \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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(a \cdot t\right) \cdot 4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(\mathsf{neg}\left(4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      17. metadata-eval41.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites41.7%

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

    if -1.14999999999999994e-224 < x < 7.00000000000000058e-136

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

      \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 13: 54.4% accurate, 1.2× speedup?

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

\mathbf{elif}\;x \leq -1.42 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-224}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right)\\

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

\mathbf{elif}\;x \leq 16000000:\\
\;\;\;\;t\_1\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.19999999999999986e184 or 1.6e7 < x

    1. Initial program 85.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. Applied rewrites88.3%

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

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

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

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

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

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

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

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

    if -5.19999999999999986e184 < x < -1.4200000000000001e-9 or 7.00000000000000058e-136 < x < 1.6e7

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if -1.4200000000000001e-9 < x < -1.14999999999999994e-224

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6441.7

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites41.7%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. distribute-neg-inN/A

        \[\leadsto \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) \]
      6. lift-*.f64N/A

        \[\leadsto \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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(a \cdot t\right) \cdot 4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(\mathsf{neg}\left(4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      17. metadata-eval41.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites41.7%

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

    if -1.14999999999999994e-224 < x < 7.00000000000000058e-136

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

      \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 14: 53.7% accurate, 1.5× speedup?

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-261}:\\
\;\;\;\;b \cdot c - t\_1\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+86}:\\
\;\;\;\;-1 \cdot \mathsf{fma}\left(4, i \cdot x, t\_1\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.50000000000000059e88 or 2.5999999999999998e86 < z

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Applied rewrites41.0%

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

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

    if -9.50000000000000059e88 < z < 3.7000000000000002e-261

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if 3.7000000000000002e-261 < z < 2.5999999999999998e86

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto -1 \cdot \left(4 \cdot \left(i \cdot x\right) + \color{blue}{27 \cdot \left(j \cdot k\right)}\right) \]
      2. lower-fma.f64N/A

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, i \cdot \color{blue}{x}, 27 \cdot \left(j \cdot k\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6442.8

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites42.8%

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

Alternative 15: 51.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\mathsf{max}\left(j, k\right) \leq 1.7 \cdot 10^{-21}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;\mathsf{max}\left(j, k\right) \leq 5.7 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, b \cdot c\right)\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if k < -1.9999999999999999e61 or 5.70000000000000033e112 < k

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if -1.9999999999999999e61 < k < 4.89999999999999993e-67

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot \color{blue}{x}\right) \]
      2. lower-*.f6441.9

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot x\right) \]
    7. Applied rewrites41.9%

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

    if 4.89999999999999993e-67 < k < 1.7e-21

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot \color{blue}{z}\right)\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
    7. Applied rewrites26.3%

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

    if 1.7e-21 < k < 5.70000000000000033e112

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

      \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 16: 50.9% accurate, 1.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\


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

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot \color{blue}{x}\right) \]
      2. lower-*.f6441.9

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot x\right) \]
    7. Applied rewrites41.9%

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

    if -4.49999999999999959e59 < (*.f64 b c) < 2.2000000000000001e-14

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6441.7

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites41.7%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. distribute-neg-inN/A

        \[\leadsto \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) \]
      6. lift-*.f64N/A

        \[\leadsto \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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(a \cdot t\right) \cdot 4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(\mathsf{neg}\left(4\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      17. metadata-eval41.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites41.7%

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

    if 2.2000000000000001e-14 < (*.f64 b c)

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

Alternative 17: 50.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;\mathsf{max}\left(j, k\right) \leq 5.7 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot a, -4, b \cdot c\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < -1.9999999999999999e61 or 5.70000000000000033e112 < k

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

    if -1.9999999999999999e61 < k < 1.65000000000000003e-44

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, i \cdot x, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot \color{blue}{x}\right) \]
      2. lower-*.f6441.9

        \[\leadsto b \cdot c - 4 \cdot \left(i \cdot x\right) \]
    7. Applied rewrites41.9%

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

    if 1.65000000000000003e-44 < k < 5.70000000000000033e112

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

      \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 50.3% accurate, 2.2× speedup?

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

\mathbf{elif}\;a \leq 3.1 \cdot 10^{+33}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.59999999999999985e120 or 3.1e33 < a

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

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

    if -4.59999999999999985e120 < a < 3.1e33

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. lower-*.f6444.4

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.4%

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

Alternative 19: 49.9% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(-27 \cdot \mathsf{min}\left(j, k\right)\right) \cdot \mathsf{max}\left(j, k\right)\\


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

    1. Initial program 85.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. Taylor expanded in j around inf

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.6%

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

    if -4.99999999999999981e225 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e270

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot c + -4 \cdot \left(a \cdot t\right) \]
      6. associate-*l*N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      7. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      8. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(-4 \cdot a\right) \cdot t \]
      9. +-commutativeN/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot \color{blue}{c} \]
      10. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      12. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + b \cdot c \]
      15. lower-fma.f6440.7

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
      18. lower-*.f6440.7

        \[\leadsto \mathsf{fma}\left(t \cdot a, -4, b \cdot c\right) \]
    9. Applied rewrites40.7%

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

    if 1e270 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.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. Taylor expanded in j around inf

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.6%

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

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      2. lift-*.f64N/A

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites24.5%

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

Alternative 20: 37.7% accurate, 2.2× speedup?

\[\begin{array}{l} \mathbf{if}\;b \cdot c \leq -4.5 \cdot 10^{+59}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 8.6 \cdot 10^{+151}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -4.5e+59)
   (* b c)
   (if (<= (* b c) 8.6e+151) (* -27.0 (* j k)) (* 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) <= -4.5e+59) {
		tmp = b * c;
	} else if ((b * c) <= 8.6e+151) {
		tmp = -27.0 * (j * k);
	} else {
		tmp = b * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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) <= (-4.5d+59)) then
        tmp = b * c
    else if ((b * c) <= 8.6d+151) then
        tmp = (-27.0d0) * (j * k)
    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) <= -4.5e+59) {
		tmp = b * c;
	} else if ((b * c) <= 8.6e+151) {
		tmp = -27.0 * (j * k);
	} else {
		tmp = b * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -4.5e+59:
		tmp = b * c
	elif (b * c) <= 8.6e+151:
		tmp = -27.0 * (j * k)
	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) <= -4.5e+59)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 8.6e+151)
		tmp = Float64(-27.0 * Float64(j * k));
	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) <= -4.5e+59)
		tmp = b * c;
	elseif ((b * c) <= 8.6e+151)
		tmp = -27.0 * (j * k);
	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], -4.5e+59], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8.6e+151], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4.5 \cdot 10^{+59}:\\
\;\;\;\;b \cdot c\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -4.49999999999999959e59 or 8.59999999999999965e151 < (*.f64 b c)

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

      \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

      \[\leadsto b \cdot c \]
    9. Step-by-step derivation
      1. lower-*.f6423.6

        \[\leadsto b \cdot c \]
    10. Applied rewrites23.6%

      \[\leadsto b \cdot c \]

    if -4.49999999999999959e59 < (*.f64 b c) < 8.59999999999999965e151

    1. Initial program 85.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. Taylor expanded in j around inf

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.6%

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

Alternative 21: 34.2% accurate, 2.2× speedup?

\[\begin{array}{l} \mathbf{if}\;b \cdot c \leq -4.5 \cdot 10^{+59}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 2.2 \cdot 10^{-14}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -4.5e+59)
   (* b c)
   (if (<= (* b c) 2.2e-14) (* -4.0 (* a t)) (* 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) <= -4.5e+59) {
		tmp = b * c;
	} else if ((b * c) <= 2.2e-14) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = b * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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) <= (-4.5d+59)) then
        tmp = b * c
    else if ((b * c) <= 2.2d-14) then
        tmp = (-4.0d0) * (a * t)
    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) <= -4.5e+59) {
		tmp = b * c;
	} else if ((b * c) <= 2.2e-14) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = b * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -4.5e+59:
		tmp = b * c
	elif (b * c) <= 2.2e-14:
		tmp = -4.0 * (a * t)
	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) <= -4.5e+59)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 2.2e-14)
		tmp = Float64(-4.0 * Float64(a * t));
	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) <= -4.5e+59)
		tmp = b * c;
	elseif ((b * c) <= 2.2e-14)
		tmp = -4.0 * (a * t);
	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], -4.5e+59], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.2e-14], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4.5 \cdot 10^{+59}:\\
\;\;\;\;b \cdot c\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -4.49999999999999959e59 or 2.2000000000000001e-14 < (*.f64 b c)

    1. Initial program 85.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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6460.4

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites40.7%

      \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

      \[\leadsto b \cdot c \]
    9. Step-by-step derivation
      1. lower-*.f6423.6

        \[\leadsto b \cdot c \]
    10. Applied rewrites23.6%

      \[\leadsto b \cdot c \]

    if -4.49999999999999959e59 < (*.f64 b c) < 2.2000000000000001e-14

    1. Initial program 85.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. Taylor expanded in t around -inf

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.4

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites20.6%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 22: 23.6% accurate, 11.1× speedup?

\[b \cdot c \]
(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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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]
b \cdot c
Derivation
  1. Initial program 85.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. 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)} \]
  3. Step-by-step derivation
    1. lower--.f64N/A

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

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

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

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

      \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    6. lower-*.f6460.4

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

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

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    2. lower-*.f64N/A

      \[\leadsto b \cdot c - 4 \cdot \left(\color{blue}{a} \cdot t\right) \]
    3. lower-*.f64N/A

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

      \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
  7. Applied rewrites40.7%

    \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(a \cdot t\right)} \]
  8. Taylor expanded in t around 0

    \[\leadsto b \cdot c \]
  9. Step-by-step derivation
    1. lower-*.f6423.6

      \[\leadsto b \cdot c \]
  10. Applied rewrites23.6%

    \[\leadsto b \cdot c \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025181 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))