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

Percentage Accurate: 85.9% → 92.3%
Time: 6.6s
Alternatives: 20
Speedup: 0.8×

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 20 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.9% 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: 92.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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)} \]

    if -4.3e-190 < t < 3.09999999999999976e-57

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites87.8%

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

    if 3.09999999999999976e-57 < t

    1. Initial program 85.9%

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)}{t}\right) - \color{blue}{-4 \cdot a}\right)\right) \]
    4. Applied rewrites77.3%

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

Alternative 2: 92.1% accurate, 0.8× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3e-190 or 4.99999999999999968e-50 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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)} \]

    if -4.3e-190 < t < 4.99999999999999968e-50

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites87.8%

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

Alternative 3: 89.9% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := -27 \cdot \mathsf{max}\left(j, k\right)\\ t_2 := \mathsf{fma}\left(t\_1, \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)\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{-188}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, \mathsf{min}\left(j, k\right), \mathsf{fma}\left(i \cdot x, -4, b \cdot c\right)\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 (fmax j k)))
        (t_2
         (fma
          t_1
          (fmin j k)
          (fma
           (* i x)
           -4.0
           (fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* c b))))))
   (if (<= t -5.2e-188)
     t_2
     (if (<= t 6e-208) (fma t_1 (fmin j k) (fma (* i x) -4.0 (* b c))) 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 * fmax(j, k);
	double t_2 = fma(t_1, fmin(j, k), fma((i * x), -4.0, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, (c * b))));
	double tmp;
	if (t <= -5.2e-188) {
		tmp = t_2;
	} else if (t <= 6e-208) {
		tmp = fma(t_1, fmin(j, k), fma((i * x), -4.0, (b * c)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-27.0 * fmax(j, k))
	t_2 = fma(t_1, 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))))
	tmp = 0.0
	if (t <= -5.2e-188)
		tmp = t_2;
	elseif (t <= 6e-208)
		tmp = fma(t_1, fmin(j, k), fma(Float64(i * x), -4.0, Float64(b * c)));
	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[Max[j, k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * 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]}, If[LessEqual[t, -5.2e-188], t$95$2, If[LessEqual[t, 6e-208], N[(t$95$1 * N[Min[j, k], $MachinePrecision] + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := -27 \cdot \mathsf{max}\left(j, k\right)\\
t_2 := \mathsf{fma}\left(t\_1, \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)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{-188}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \mathsf{min}\left(j, k\right), \mathsf{fma}\left(i \cdot x, -4, b \cdot c\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.2000000000000001e-188 or 5.99999999999999972e-208 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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)} \]

    if -5.2000000000000001e-188 < t < 5.99999999999999972e-208

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

Alternative 4: 80.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.15999999999999996e-80

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

    if -1.15999999999999996e-80 < t < 9.5000000000000003e-197

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

    if 9.5000000000000003e-197 < t < 3e192

    1. Initial program 85.9%

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

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    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(i \cdot x\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(i \cdot x\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(i \cdot x\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(i \cdot \color{blue}{x}\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(i \cdot x\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(i \cdot x\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}{i \cdot x}, 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, i \cdot \color{blue}{x}, 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, i \cdot x, 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, i \cdot x, 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, i \cdot x, 27 \cdot \left(j \cdot k\right)\right)} \]

    if 3e192 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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. Step-by-step derivation
      1. lift-*.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. mul-1-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites42.5%

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

Alternative 5: 76.8% accurate, 1.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27, t\_1, t\_2\right)\\


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

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

    if -1.15999999999999996e-80 < t < 2.05e180

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

    if 2.05e180 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27, j \cdot k, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) \]
      7. lower-*.f6458.4%

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

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

Alternative 6: 71.9% accurate, 1.2× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.20000000000000028e207 or 3e192 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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. Step-by-step derivation
      1. lift-*.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. mul-1-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites42.5%

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

    if -7.20000000000000028e207 < t < -8.5000000000000002e90

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\leadsto \color{blue}{b \cdot c - \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 b \cdot c - \color{blue}{\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)} \]
      2. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5000000000000002e90 < t < 3e192

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

Alternative 7: 70.6% accurate, 1.2× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.20000000000000028e207 or 3e192 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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. Step-by-step derivation
      1. lift-*.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. mul-1-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites42.5%

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

    if -7.20000000000000028e207 < t < -8.5000000000000002e90

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

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

    if -8.5000000000000002e90 < t < 3e192

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

Alternative 8: 70.4% accurate, 1.1× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.70000000000000004e131 or 2.05e180 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27, j \cdot k, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) \]
      7. lower-*.f6458.4%

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

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

    if -2.70000000000000004e131 < t < 2.05e180

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

Alternative 9: 69.7% accurate, 1.3× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.65000000000000005e192 or 3e192 < t

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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. Step-by-step derivation
      1. lift-*.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. mul-1-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites42.5%

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

    if -1.65000000000000005e192 < t < 3e192

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in t around 0

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

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

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

Alternative 10: 59.3% accurate, 1.3× 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 -1.85 \cdot 10^{-75}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-274}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-127}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+14}:\\ \;\;\;\;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 -1.85e-75)
     t_2
     (if (<= x 3.9e-274)
       t_1
       (if (<= x 9e-127)
         (fma (* a -4.0) t (* b c))
         (if (<= x 1.5e+14) 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 <= -1.85e-75) {
		tmp = t_2;
	} else if (x <= 3.9e-274) {
		tmp = t_1;
	} else if (x <= 9e-127) {
		tmp = fma((a * -4.0), t, (b * c));
	} else if (x <= 1.5e+14) {
		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 <= -1.85e-75)
		tmp = t_2;
	elseif (x <= 3.9e-274)
		tmp = t_1;
	elseif (x <= 9e-127)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	elseif (x <= 1.5e+14)
		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, -1.85e-75], t$95$2, If[LessEqual[x, 3.9e-274], t$95$1, If[LessEqual[x, 9e-127], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+14], 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 -1.85 \cdot 10^{-75}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3.9 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.85000000000000012e-75 or 1.5e14 < x

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

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

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

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

    if -1.85000000000000012e-75 < x < 3.89999999999999985e-274 or 8.9999999999999998e-127 < x < 1.5e14

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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 - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if 3.89999999999999985e-274 < x < 8.9999999999999998e-127

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6441.6%

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

      \[\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 \color{blue}{t}\right) \]
      6. +-commutativeN/A

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      10. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right) \]
      12. lower-*.f6441.9%

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

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

Alternative 11: 54.4% accurate, 1.1× speedup?

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+82}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

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

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


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

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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 - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if -4.99999999999999995e131 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999996e81

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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)} \]
    8. Taylor expanded in x around inf

      \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    9. 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-*.f6425.8%

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
    10. Applied rewrites25.8%

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

    if -9.9999999999999996e81 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e61

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6441.6%

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

      \[\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 \color{blue}{t}\right) \]
      6. +-commutativeN/A

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      10. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right) \]
      12. lower-*.f6441.9%

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

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

Alternative 12: 54.0% accurate, 1.6× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -3.5999999999999998e107 or 9.59999999999999942e187 < (*.f64 b c)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6441.6%

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

      \[\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 \color{blue}{t}\right) \]
      6. +-commutativeN/A

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      10. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right) \]
      12. lower-*.f6441.9%

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

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

    if -3.5999999999999998e107 < (*.f64 b c) < 9.59999999999999942e187

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6440.5%

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

      \[\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. lift-fma.f64N/A

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

        \[\leadsto -1 \cdot \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(\color{blue}{j} \cdot k\right)\right) \]
      4. distribute-rgt-inN/A

        \[\leadsto \left(4 \cdot \left(a \cdot t\right)\right) \cdot -1 + \left(27 \cdot \left(j \cdot k\right)\right) \cdot \color{blue}{-1} \]
      5. *-commutativeN/A

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

        \[\leadsto \left(4 \cdot \left(a \cdot t\right)\right) \cdot -1 + -1 \cdot \left(27 \cdot \left(j \cdot \color{blue}{k}\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \left(4 \cdot \left(a \cdot t\right)\right) \cdot -1 + \left(-1 \cdot 27\right) \cdot \left(j \cdot \color{blue}{k}\right) \]
      8. metadata-evalN/A

        \[\leadsto \left(4 \cdot \left(a \cdot t\right)\right) \cdot -1 + -27 \cdot \left(j \cdot k\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(4 \cdot \left(a \cdot t\right)\right) \cdot -1 + -27 \cdot \left(j \cdot k\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(a \cdot t\right) \cdot 4\right) \cdot -1 + -27 \cdot \left(j \cdot k\right) \]
      11. associate-*l*N/A

        \[\leadsto \left(a \cdot t\right) \cdot \left(4 \cdot -1\right) + -27 \cdot \left(\color{blue}{j} \cdot k\right) \]
      12. metadata-evalN/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 + -27 \cdot \left(j \cdot k\right) \]
      13. lower-fma.f64N/A

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

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

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

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

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

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

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

Alternative 13: 53.0% accurate, 1.4× speedup?

\[\begin{array}{l} t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+125}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+61}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, 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 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+125)
     t_1
     (if (<= t_2 2e+61) (fma (* a -4.0) t (* 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 * (j * k));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+125) {
		tmp = t_1;
	} else if (t_2 <= 2e+61) {
		tmp = fma((a * -4.0), t, (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(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+125)
		tmp = t_1;
	elseif (t_2 <= 2e+61)
		tmp = fma(Float64(a * -4.0), t, 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[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+125], t$95$1, If[LessEqual[t$95$2, 2e+61], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999998e125 or 1.9999999999999999e61 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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 - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if -1.9999999999999998e125 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e61

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6441.6%

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

      \[\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 \color{blue}{t}\right) \]
      6. +-commutativeN/A

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      10. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right) \]
      12. lower-*.f6441.9%

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

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

Alternative 14: 52.5% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := \left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\ t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+232}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, 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 (* (* (fmax j k) -27.0) (fmin j k)))
        (t_2 (* (* (fmin j k) 27.0) (fmax j k))))
   (if (<= t_2 -2e+232)
     t_1
     (if (<= t_2 5e+153) (fma (* a -4.0) t (* 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 = (fmax(j, k) * -27.0) * fmin(j, k);
	double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
	double tmp;
	if (t_2 <= -2e+232) {
		tmp = t_1;
	} else if (t_2 <= 5e+153) {
		tmp = fma((a * -4.0), t, (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(fmax(j, k) * -27.0) * fmin(j, k))
	t_2 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k))
	tmp = 0.0
	if (t_2 <= -2e+232)
		tmp = t_1;
	elseif (t_2 <= 5e+153)
		tmp = fma(Float64(a * -4.0), t, 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[(N[Max[j, k], $MachinePrecision] * -27.0), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+232], t$95$1, If[LessEqual[t$95$2, 5e+153], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\
t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+232}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000011e232 or 5.00000000000000018e153 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

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

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      6. lower-*.f6423.3%

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      8. *-commutativeN/A

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
      9. lower-*.f6423.3%

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
    6. Applied rewrites23.3%

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

    if -2.00000000000000011e232 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000018e153

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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.3%

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

      \[\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-*.f6441.6%

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

      \[\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 \color{blue}{t}\right) \]
      6. +-commutativeN/A

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

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

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

        \[\leadsto \left(-4 \cdot a\right) \cdot t + b \cdot c \]
      10. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right) \]
      12. lower-*.f6441.9%

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

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

Alternative 15: 36.6% accurate, 1.7× speedup?

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

\mathbf{elif}\;b \cdot c \leq 9.6 \cdot 10^{+187}:\\
\;\;\;\;\left(\mathsf{max}\left(j, k\right) \cdot -27\right) \cdot \mathsf{min}\left(j, k\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -3.5999999999999998e107 or 9.59999999999999942e187 < (*.f64 b c)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Applied rewrites89.3%

      \[\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. Taylor expanded in z around -inf

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(-1 \cdot \left(b \cdot \color{blue}{c}\right)\right) \]
      2. lower-*.f6424.3%

        \[\leadsto -1 \cdot \left(-1 \cdot \left(b \cdot c\right)\right) \]
    8. Applied rewrites24.3%

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

    if -3.5999999999999998e107 < (*.f64 b c) < 9.59999999999999942e187

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

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

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      6. lower-*.f6423.3%

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      8. *-commutativeN/A

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
      9. lower-*.f6423.3%

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
    6. Applied rewrites23.3%

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

Alternative 16: 35.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;t\_2 \leq 10^{+68}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999996e130 or 9.99999999999999953e67 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

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

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      6. lower-*.f6423.3%

        \[\leadsto \left(-27 \cdot k\right) \cdot \color{blue}{j} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
      8. *-commutativeN/A

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
      9. lower-*.f6423.3%

        \[\leadsto \left(k \cdot -27\right) \cdot j \]
    6. Applied rewrites23.3%

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

    if -4.9999999999999996e130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999953e67

    1. Initial program 85.9%

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} \]
      2. lower-*.f6422.0%

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) \]
    4. Applied rewrites22.0%

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 35.1% accurate, 1.7× speedup?

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

\mathbf{elif}\;t\_1 \leq 10^{+68}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\

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


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

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

        \[\leadsto \left(j \cdot -27\right) \cdot k \]
      6. lower-*.f6423.3%

        \[\leadsto \left(j \cdot -27\right) \cdot k \]
    6. Applied rewrites23.3%

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

    if -4.9999999999999996e130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999953e67

    1. Initial program 85.9%

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} \]
      2. lower-*.f6422.0%

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) \]
    4. Applied rewrites22.0%

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]

    if 9.99999999999999953e67 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

Alternative 18: 35.1% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+68}:\\ \;\;\;\;-4 \cdot \left(i \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+130) t_1 (if (<= t_2 1e+68) (* -4.0 (* i x)) 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 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+130) {
		tmp = t_1;
	} else if (t_2 <= 1e+68) {
		tmp = -4.0 * (i * x);
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-27.0d0) * (j * k)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-5d+130)) then
        tmp = t_1
    else if (t_2 <= 1d+68) then
        tmp = (-4.0d0) * (i * x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+130) {
		tmp = t_1;
	} else if (t_2 <= 1e+68) {
		tmp = -4.0 * (i * x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -5e+130:
		tmp = t_1
	elif t_2 <= 1e+68:
		tmp = -4.0 * (i * x)
	else:
		tmp = t_1
	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(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+130)
		tmp = t_1;
	elseif (t_2 <= 1e+68)
		tmp = Float64(-4.0 * Float64(i * x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -27.0 * (j * k);
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -5e+130)
		tmp = t_1;
	elseif (t_2 <= 1e+68)
		tmp = -4.0 * (i * x);
	else
		tmp = t_1;
	end
	tmp_2 = 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+130], t$95$1, If[LessEqual[t$95$2, 1e+68], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+68}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999996e130 or 9.99999999999999953e67 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

    if -4.9999999999999996e130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999953e67

    1. Initial program 85.9%

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} \]
      2. lower-*.f6422.0%

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) \]
    4. Applied rewrites22.0%

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 34.1% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+125}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+61}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+125) t_1 (if (<= t_2 2e+61) (* -4.0 (* a 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 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+125) {
		tmp = t_1;
	} else if (t_2 <= 2e+61) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-27.0d0) * (j * k)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-2d+125)) then
        tmp = t_1
    else if (t_2 <= 2d+61) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+125) {
		tmp = t_1;
	} else if (t_2 <= 2e+61) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -2e+125:
		tmp = t_1
	elif t_2 <= 2e+61:
		tmp = -4.0 * (a * t)
	else:
		tmp = t_1
	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(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+125)
		tmp = t_1;
	elseif (t_2 <= 2e+61)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -27.0 * (j * k);
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -2e+125)
		tmp = t_1;
	elseif (t_2 <= 2e+61)
		tmp = -4.0 * (a * t);
	else
		tmp = t_1;
	end
	tmp_2 = 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+125], t$95$1, If[LessEqual[t$95$2, 2e+61], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+61}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999998e125 or 1.9999999999999999e61 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6423.3%

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

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

    if -1.9999999999999998e125 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e61

    1. Initial program 85.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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-*.f6441.8%

        \[\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 rewrites41.8%

      \[\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 20: 20.6% accurate, 6.4× speedup?

\[-4 \cdot \left(a \cdot t\right) \]
(FPCore (x y z t a b c i j k) :precision binary64 (* -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) {
	return -4.0 * (a * t);
}
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 = (-4.0d0) * (a * t)
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 -4.0 * (a * t);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return -4.0 * (a * t)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(-4.0 * Float64(a * t))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = -4.0 * (a * t);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]
-4 \cdot \left(a \cdot t\right)
Derivation
  1. Initial program 85.9%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. 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-*.f6441.8%

      \[\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 rewrites41.8%

    \[\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)} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025188 
(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)))