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

Percentage Accurate: 85.4% → 92.4%
Time: 6.5s
Alternatives: 18
Speedup: 1.0×

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

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

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

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

Alternative 1: 92.4% accurate, 0.8× speedup?

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

\mathbf{elif}\;x \leq 9.6 \cdot 10^{+83}:\\
\;\;\;\;\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 \mathsf{min}\left(j, k\right), \mathsf{max}\left(j, k\right), \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.0000000000000001e-112

    1. Initial program 85.4%

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

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

    if -3.0000000000000001e-112 < x < 9.5999999999999996e83

    1. Initial program 85.4%

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

      \[\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 9.5999999999999996e83 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.3% accurate, 0.8× speedup?

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

\mathbf{elif}\;x \leq 9.6 \cdot 10^{+83}:\\
\;\;\;\;\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 \mathsf{min}\left(j, k\right), \mathsf{max}\left(j, k\right), \left(-4 \cdot x\right) \cdot i\right)\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e188 or 9.5999999999999996e83 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e188 < x < 9.5999999999999996e83

    1. Initial program 85.4%

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

      \[\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. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 91.3% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \left(x \cdot 4\right) \cdot i\\ t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\ t_3 := \left(a \cdot 4\right) \cdot t\\ \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t\_3\right) + b \cdot c\right) - t\_1\right) - t\_2 \leq \infty:\\ \;\;\;\;\left(\left(\left(\left(\left(z \cdot \left(18 \cdot x\right)\right) \cdot y\right) \cdot t - t\_3\right) + b \cdot c\right) - t\_1\right) - t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* x 4.0) i))
        (t_2 (* (* (fmin j k) 27.0) (fmax j k)))
        (t_3 (* (* a 4.0) t)))
   (if (<=
        (- (- (+ (- (* (* (* (* x 18.0) y) z) t) t_3) (* b c)) t_1) t_2)
        INFINITY)
     (- (- (+ (- (* (* (* z (* 18.0 x)) y) t) t_3) (* b c)) t_1) t_2)
     (* x (fma -4.0 i (* 18.0 (* t (* y z))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (x * 4.0) * i;
	double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
	double t_3 = (a * 4.0) * t;
	double tmp;
	if (((((((((x * 18.0) * y) * z) * t) - t_3) + (b * c)) - t_1) - t_2) <= ((double) INFINITY)) {
		tmp = ((((((z * (18.0 * x)) * y) * t) - t_3) + (b * c)) - t_1) - t_2;
	} else {
		tmp = x * fma(-4.0, i, (18.0 * (t * (y * z))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(x * 4.0) * i)
	t_2 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k))
	t_3 = Float64(Float64(a * 4.0) * t)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - t_3) + Float64(b * c)) - t_1) - t_2) <= Inf)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * Float64(18.0 * x)) * y) * t) - t_3) + Float64(b * c)) - t_1) - t_2);
	else
		tmp = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - t$95$3), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(z * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] * t), $MachinePrecision] - t$95$3), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \left(x \cdot 4\right) \cdot i\\
t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
t_3 := \left(a \cdot 4\right) \cdot t\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t\_3\right) + b \cdot c\right) - t\_1\right) - t\_2 \leq \infty:\\
\;\;\;\;\left(\left(\left(\left(\left(z \cdot \left(18 \cdot x\right)\right) \cdot y\right) \cdot t - t\_3\right) + b \cdot c\right) - t\_1\right) - t\_2\\

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


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

    1. Initial program 85.4%

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

        \[\leadsto \left(\left(\left(\color{blue}{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 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. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot y\right)} \cdot 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 \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\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 \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(\left(\left(\left(x \cdot 18\right) \cdot \color{blue}{\left(z \cdot y\right)}\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 \]
      5. associate-*r*N/A

        \[\leadsto \left(\left(\left(\color{blue}{\left(\left(\left(x \cdot 18\right) \cdot z\right) \cdot y\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 \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\color{blue}{\left(\left(\left(x \cdot 18\right) \cdot z\right) \cdot y\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 \]
      7. *-commutativeN/A

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

        \[\leadsto \left(\left(\left(\left(\color{blue}{\left(z \cdot \left(x \cdot 18\right)\right)} \cdot y\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 \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\left(\left(z \cdot \color{blue}{\left(x \cdot 18\right)}\right) \cdot y\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 \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(\left(\left(\left(z \cdot \color{blue}{\left(18 \cdot x\right)}\right) \cdot y\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 \]
      11. lower-*.f6485.3%

        \[\leadsto \left(\left(\left(\left(\left(z \cdot \color{blue}{\left(18 \cdot x\right)}\right) \cdot y\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 \]
    3. Applied rewrites85.3%

      \[\leadsto \left(\left(\left(\color{blue}{\left(\left(z \cdot \left(18 \cdot x\right)\right) \cdot y\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 \]

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

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

Alternative 4: 90.9% accurate, 1.0× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e188 or 1.0500000000000001e84 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e188 < x < 1.0500000000000001e84

    1. Initial program 85.4%

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

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

Alternative 5: 79.6% accurate, 1.2× speedup?

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

    if 1.5199999999999999e43 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.3% accurate, 1.4× speedup?

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

    if 1.3e37 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      2. lower-*.f6461.3%

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

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

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + \color{blue}{\left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    9. Applied rewrites64.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b + \left(\color{blue}{\left(\mathsf{neg}\left(\left(27 \cdot j\right) \cdot k\right)\right)} + \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right) \]
    11. Applied rewrites63.3%

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

Alternative 7: 72.5% accurate, 1.3× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.6e124 or 6.5999999999999996e121 < x

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

    if -2.6e124 < x < -2.2000000000000001e-22

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18, t \cdot \left(x \cdot \left(y \cdot z\right)\right), b \cdot c\right) - 27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      2. lower-*.f6461.3%

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

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

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + \color{blue}{\left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    9. Applied rewrites64.0%

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

    if -2.2000000000000001e-22 < x < 6.5999999999999996e121

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around 0

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

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

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

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

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

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

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

Alternative 8: 72.5% accurate, 1.3× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.6e124 or 6.5999999999999996e121 < x

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

    if -2.6e124 < x < -2.2000000000000001e-22

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e-22 < x < 6.5999999999999996e121

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around 0

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

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

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

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

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

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

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

Alternative 9: 72.4% accurate, 1.6× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e117 or 6.5999999999999996e121 < x

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

    if -1.3e117 < x < 6.5999999999999996e121

    1. Initial program 85.4%

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

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

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

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

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

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

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

Alternative 10: 72.1% accurate, 1.6× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e117 or 6.5999999999999996e121 < x

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

    if -1.3e117 < x < 6.5999999999999996e121

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around 0

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

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

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

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

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

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

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

Alternative 11: 57.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+84}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(\left(z \cdot x\right) \cdot y\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.3e117 or 1.1499999999999999e84 < x

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in x around inf

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

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

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

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

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

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

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

    if -1.3e117 < x < 1.7999999999999998e-207

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7999999999999998e-207 < x < 1.1499999999999999e84

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 57.3% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05e-22 < t < -5.2999999999999999e-126

    1. Initial program 85.4%

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

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

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

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

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

    if -5.2999999999999999e-126 < t < 1.2e-50

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-50 < t

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 56.4% accurate, 1.5× speedup?

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

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.05e-22 or 1.2e-50 < t

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05e-22 < t < -5.2999999999999999e-126

    1. Initial program 85.4%

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

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

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

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

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

    if -5.2999999999999999e-126 < t < 1.2e-50

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 56.1% accurate, 0.5× speedup?

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

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

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


\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)) < -5.0000000000000003e299 or 1.0000000000000001e218 < (-.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 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

    if -5.0000000000000003e299 < (-.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.0000000000000001e218

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 46.5% accurate, 2.3× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.85e210 or 2.4999999999999999e48 < x

    1. Initial program 85.4%

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

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

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

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

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

    if -1.85e210 < x < 2.4999999999999999e48

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 34.5% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := \left(-27 \cdot \mathsf{min}\left(j, k\right)\right) \cdot \mathsf{max}\left(j, k\right)\\ t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+262}:\\ \;\;\;\;-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 (fmin j k)) (fmax j k)))
        (t_2 (* (* (fmin j k) 27.0) (fmax j k))))
   (if (<= t_2 -2e+122) t_1 (if (<= t_2 5e+262) (* -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 * fmin(j, k)) * fmax(j, k);
	double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
	double tmp;
	if (t_2 <= -2e+122) {
		tmp = t_1;
	} else if (t_2 <= 5e+262) {
		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) * fmin(j, k)) * fmax(j, k)
    t_2 = (fmin(j, k) * 27.0d0) * fmax(j, k)
    if (t_2 <= (-2d+122)) then
        tmp = t_1
    else if (t_2 <= 5d+262) 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 * fmin(j, k)) * fmax(j, k);
	double t_2 = (fmin(j, k) * 27.0) * fmax(j, k);
	double tmp;
	if (t_2 <= -2e+122) {
		tmp = t_1;
	} else if (t_2 <= 5e+262) {
		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 * fmin(j, k)) * fmax(j, k)
	t_2 = (fmin(j, k) * 27.0) * fmax(j, k)
	tmp = 0
	if t_2 <= -2e+122:
		tmp = t_1
	elif t_2 <= 5e+262:
		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(Float64(-27.0 * fmin(j, k)) * fmax(j, k))
	t_2 = Float64(Float64(fmin(j, k) * 27.0) * fmax(j, k))
	tmp = 0.0
	if (t_2 <= -2e+122)
		tmp = t_1;
	elseif (t_2 <= 5e+262)
		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 * min(j, k)) * max(j, k);
	t_2 = (min(j, k) * 27.0) * max(j, k);
	tmp = 0.0;
	if (t_2 <= -2e+122)
		tmp = t_1;
	elseif (t_2 <= 5e+262)
		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[(N[(-27.0 * N[Min[j, k], $MachinePrecision]), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[j, k], $MachinePrecision] * 27.0), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+122], t$95$1, If[LessEqual[t$95$2, 5e+262], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(-27 \cdot \mathsf{min}\left(j, k\right)\right) \cdot \mathsf{max}\left(j, k\right)\\
t_2 := \left(\mathsf{min}\left(j, k\right) \cdot 27\right) \cdot \mathsf{max}\left(j, k\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;-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) < -2e122 or 5.0000000000000001e262 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e122 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000001e262

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    8. Applied rewrites21.4%

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

Alternative 17: 33.9% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+221}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+122) t_1 (if (<= t_2 4e+221) (* -4.0 (* a t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+122) {
		tmp = t_1;
	} else if (t_2 <= 4e+221) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+221}:\\
\;\;\;\;-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) < -2e122 or 4.0000000000000002e221 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.4%

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

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

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

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

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

    if -2e122 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.0000000000000002e221

    1. Initial program 85.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    8. Applied rewrites21.4%

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

Alternative 18: 21.4% accurate, 6.4× speedup?

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t \cdot z\right) \cdot \left(y \cdot x\right), 18, \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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

      \[\leadsto -4 \cdot \left(a \cdot t\right) \]
  8. Applied rewrites21.4%

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

Reproduce

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