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

Percentage Accurate: 84.7% → 93.3%
Time: 6.3s
Alternatives: 16
Speedup: 0.9×

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

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

Initial Program: 84.7% accurate, 1.0× speedup?

\[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (-
 (-
  (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
  (* (* x 4.0) i))
 (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

Alternative 1: 93.3% accurate, 0.9× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.5000000000000003e-75 or 4.0000000000000003e-31 < t

    1. Initial program 84.7%

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

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

    if -5.5000000000000003e-75 < t < 4.0000000000000003e-31

    1. Initial program 84.7%

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

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

Alternative 2: 91.7% accurate, 0.6× speedup?

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < +inf.0

    1. Initial program 84.7%

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

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

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

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 81.0% accurate, 1.2× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.8000000000000002e136

    1. Initial program 84.7%

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      5. lower-*.f64N/A

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      6. lower-*.f6458.6%

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

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

    if -2.8000000000000002e136 < x < 3.2000000000000002e252

    1. Initial program 84.7%

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

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

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

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

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

    if 3.2000000000000002e252 < x

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.2% accurate, 1.4× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.3000000000000002e130

    1. Initial program 84.7%

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

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

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

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

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

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      5. lower-*.f64N/A

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      6. lower-*.f6458.6%

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

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

    if -2.3000000000000002e130 < x < 1.1e109

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

    if 1.1e109 < x

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 72.4% accurate, 1.6× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3000000000000002e130 or 1.1e109 < x

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000002e130 < x < 1.1e109

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

Alternative 6: 58.3% accurate, 1.3× speedup?

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

\mathbf{elif}\;x \leq -2.15 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8e27 or 9e4 < x

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e27 < x < -2.15e-218 or 3.0999999999999999e-60 < x < 9e4

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    10. Applied rewrites45.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{b}, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      6. lower-neg.f6445.5%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right) \]
      9. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right) \]
      13. lower-*.f6445.4%

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

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

    if -2.15e-218 < x < 3.0999999999999999e-60

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.4% accurate, 1.5× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8e27 or 8.5000000000000002e96 < x

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i - -18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      10. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(i, -4, \left(\mathsf{neg}\left(-18\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(i, -4, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x \]
      15. lower-*.f6441.7%

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

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

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

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

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

    if -4.8e27 < x < -2.15e-218

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    10. Applied rewrites45.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{b}, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      6. lower-neg.f6445.5%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right) \]
      9. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right) \]
      13. lower-*.f6445.4%

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

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

    if -2.15e-218 < x < 8.5000000000000002e96

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 55.9% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

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

    if -2.0000000000000001e152 < (*.f64 b c) < -2.0000000000000001e-168

    1. Initial program 84.7%

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6441.6%

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied rewrites41.6%

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

    if -2.0000000000000001e-168 < (*.f64 b c) < 1.9999999999999999e87

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e87 < (*.f64 b c)

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    10. Applied rewrites45.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{b}, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      6. lower-neg.f6445.5%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right) \]
      9. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right) \]
      13. lower-*.f6445.4%

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

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

Alternative 9: 55.8% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

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

    if -1.9999999999999999e79 < (*.f64 b c) < 1.9999999999999999e87

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e87 < (*.f64 b c)

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    10. Applied rewrites45.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{b}, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      6. lower-neg.f6445.5%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right) \]
      9. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right) \]
      13. lower-*.f6445.4%

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

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

Alternative 10: 55.8% accurate, 1.4× speedup?

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;b \cdot c - 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) < -1e151 or 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

      \[\leadsto b \cdot c - 4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in t around 0

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    10. Applied rewrites45.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{b}, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      6. lower-neg.f6445.5%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right) \]
      9. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -\left(27 \cdot j\right) \cdot k\right) \]
      13. lower-*.f6445.4%

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

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

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

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

Alternative 11: 53.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 84.7%

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

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

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

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

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

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999998e131

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6442.1%

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

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

    if 1.9999999999999998e131 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

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

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.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-*l*N/A

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

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

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

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

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

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

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

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

Alternative 12: 35.7% accurate, 0.6× speedup?

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 84.7%

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

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

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

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

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

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e-235 or 5.0000000000000001e-170 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.2%

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

    if -4.9999999999999998e-235 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000001e-170

    1. Initial program 84.7%

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    5. Taylor expanded in x around -inf

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - -4 \cdot i\right)\right)} \]
    8. Taylor expanded in y around 0

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

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

        \[\leadsto -1 \cdot \left(4 \cdot \left(i \cdot x\right)\right) \]
    10. Applied rewrites20.9%

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

    if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

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

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.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-*l*N/A

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

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

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

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

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

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

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

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

Alternative 13: 35.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 84.7%

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

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

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

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

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

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.2%

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

    if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

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

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.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-*l*N/A

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

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

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

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

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

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

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

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

Alternative 14: 35.6% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+151}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+127}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot -27\right) \cdot k\\ \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 -1e+151)
    (* -27.0 (* j k))
    (if (<= t_1 2e+127) (* -4.0 (* a t)) (* (* j -27.0) k)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -1e+151) {
		tmp = -27.0 * (j * k);
	} else if (t_1 <= 2e+127) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (j * -27.0) * 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 <= (-1d+151)) then
        tmp = (-27.0d0) * (j * k)
    else if (t_1 <= 2d+127) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = (j * (-27.0d0)) * 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 <= -1e+151) {
		tmp = -27.0 * (j * k);
	} else if (t_1 <= 2e+127) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (j * -27.0) * 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 <= -1e+151:
		tmp = -27.0 * (j * k)
	elif t_1 <= 2e+127:
		tmp = -4.0 * (a * t)
	else:
		tmp = (j * -27.0) * 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 <= -1e+151)
		tmp = Float64(-27.0 * Float64(j * k));
	elseif (t_1 <= 2e+127)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = Float64(Float64(j * -27.0) * 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 <= -1e+151)
		tmp = -27.0 * (j * k);
	elseif (t_1 <= 2e+127)
		tmp = -4.0 * (a * t);
	else
		tmp = (j * -27.0) * 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, -1e+151], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+127], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

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

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


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

    1. Initial program 84.7%

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

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

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

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

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

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

      \[\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 inf

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.2%

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

    if 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

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

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

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

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.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-*l*N/A

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

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
      5. lower-*.f6424.2%

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

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

        \[\leadsto \left(j \cdot -27\right) \cdot k \]
      8. lower-*.f6424.2%

        \[\leadsto \left(j \cdot -27\right) \cdot k \]
    6. Applied rewrites24.2%

      \[\leadsto \left(j \cdot -27\right) \cdot \color{blue}{k} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 35.2% 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 -1 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\ \;\;\;\;-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 -1e+151) t_1 (if (<= t_2 2e+127) (* -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 <= -1e+151) {
		tmp = t_1;
	} else if (t_2 <= 2e+127) {
		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 <= (-1d+151)) then
        tmp = t_1
    else if (t_2 <= 2d+127) 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 <= -1e+151) {
		tmp = t_1;
	} else if (t_2 <= 2e+127) {
		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 <= -1e+151:
		tmp = t_1
	elif t_2 <= 2e+127:
		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 <= -1e+151)
		tmp = t_1;
	elseif (t_2 <= 2e+127)
		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 <= -1e+151)
		tmp = t_1;
	elseif (t_2 <= 2e+127)
		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, -1e+151], t$95$1, If[LessEqual[t$95$2, 2e+127], 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 -1 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;-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) < -1e151 or 1.9999999999999999e127 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      2. lower-*.f6424.3%

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
    4. Applied rewrites24.3%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -1e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e127

    1. Initial program 84.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot c - \left(\color{blue}{4 \cdot \left(a \cdot t\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot \color{blue}{t}, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.5%

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    4. Applied rewrites61.5%

      \[\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 inf

      \[\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-*.f6421.2%

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.2%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 21.2% accurate, 6.3× 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 84.7%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Taylor expanded in x around 0

    \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
  3. Step-by-step derivation
    1. lower--.f64N/A

      \[\leadsto b \cdot c - \color{blue}{\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    2. lower-*.f64N/A

      \[\leadsto b \cdot c - \left(\color{blue}{4 \cdot \left(a \cdot t\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
    3. lower-fma.f64N/A

      \[\leadsto b \cdot c - \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot \color{blue}{t}, 27 \cdot \left(j \cdot k\right)\right) \]
    5. lower-*.f64N/A

      \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    6. lower-*.f6461.5%

      \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
  4. Applied rewrites61.5%

    \[\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 inf

    \[\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-*.f6421.2%

      \[\leadsto -4 \cdot \left(a \cdot t\right) \]
  7. Applied rewrites21.2%

    \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025212 
(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)))