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

Percentage Accurate: 85.6% → 91.1%
Time: 14.1s
Alternatives: 15
Speedup: 0.6×

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) y) z) t) (* (* a 4) t)) (* b c))
  (* (* x 4) i))
 (* (* j 27) 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), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $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 15 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.6% 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) y) z) t) (* (* a 4) t)) (* b c))
  (* (* x 4) i))
 (* (* j 27) 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), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27), $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: 91.1% accurate, 0.5× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(c \cdot b - \left(\left(a \cdot 4\right) \cdot t - \color{blue}{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t}\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      12. distribute-rgt-out--N/A

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

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

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

      \[\leadsto \left(\color{blue}{\left(c \cdot b - \left(4 \cdot a - z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right) \cdot t\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.0% accurate, 0.6× speedup?

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

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


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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;y \leq 499999999999999972787615493521408:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - t\_2\right) - t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - t\_2\right) - t\_1\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.1999999999999999e-56

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\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(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      9. lower-*.f6474.3%

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

      \[\leadsto \left(\left(18 \cdot \left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]

    if -5.1999999999999999e-56 < y < 4.9999999999999997e32

    1. Initial program 85.6%

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

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

        \[\leadsto \left(\left(-4 \cdot \color{blue}{\left(a \cdot t\right)} + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6476.9%

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

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

    if 4.9999999999999997e32 < y

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\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(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      9. lower-*.f6474.3%

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(y \cdot \left(\left(t \cdot x\right) \cdot z\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      10. lower-*.f6472.8%

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

      \[\leadsto \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 81.8% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := \left(x \cdot 4\right) \cdot i\\ t_3 := \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - t\_2\right) - t\_1\\ \mathbf{if}\;y \leq \frac{-2845706385096283}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 499999999999999972787615493521408:\\ \;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - t\_2\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1 (* (* j 27) k))
       (t_2 (* (* x 4) i))
       (t_3 (- (- (+ (* 18 (* (* y t) (* z x))) (* b c)) t_2) t_1)))
  (if (<=
       y
       -2845706385096283/237142198758023568227473377297792835283496928595231875152809132048206089502588928)
    t_3
    (if (<= y 499999999999999972787615493521408)
      (- (- (+ (* -4 (* a t)) (* b c)) t_2) t_1)
      t_3))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double t_2 = (x * 4.0) * i;
	double t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
	double tmp;
	if (y <= -1.2e-65) {
		tmp = t_3;
	} else if (y <= 5e+32) {
		tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = (j * 27.0d0) * k
    t_2 = (x * 4.0d0) * i
    t_3 = (((18.0d0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1
    if (y <= (-1.2d-65)) then
        tmp = t_3
    else if (y <= 5d+32) then
        tmp = ((((-4.0d0) * (a * t)) + (b * c)) - t_2) - t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double t_2 = (x * 4.0) * i;
	double t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
	double tmp;
	if (y <= -1.2e-65) {
		tmp = t_3;
	} else if (y <= 5e+32) {
		tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * 27.0) * k
	t_2 = (x * 4.0) * i
	t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1
	tmp = 0
	if y <= -1.2e-65:
		tmp = t_3
	elif y <= 5e+32:
		tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	t_2 = Float64(Float64(x * 4.0) * i)
	t_3 = Float64(Float64(Float64(Float64(18.0 * Float64(Float64(y * t) * Float64(z * x))) + Float64(b * c)) - t_2) - t_1)
	tmp = 0.0
	if (y <= -1.2e-65)
		tmp = t_3;
	elseif (y <= 5e+32)
		tmp = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - t_2) - t_1);
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * 27.0) * k;
	t_2 = (x * 4.0) * i;
	t_3 = (((18.0 * ((y * t) * (z * x))) + (b * c)) - t_2) - t_1;
	tmp = 0.0;
	if (y <= -1.2e-65)
		tmp = t_3;
	elseif (y <= 5e+32)
		tmp = (((-4.0 * (a * t)) + (b * c)) - t_2) - t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(18 * N[(N[(y * t), $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[y, -2845706385096283/237142198758023568227473377297792835283496928595231875152809132048206089502588928], t$95$3, If[LessEqual[y, 499999999999999972787615493521408], N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(x \cdot 4\right) \cdot i\\
t_3 := \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - t\_2\right) - t\_1\\
\mathbf{if}\;y \leq \frac{-2845706385096283}{237142198758023568227473377297792835283496928595231875152809132048206089502588928}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 499999999999999972787615493521408:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - t\_2\right) - t\_1\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.2000000000000001e-65 or 4.9999999999999997e32 < y

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\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(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      9. lower-*.f6474.3%

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(y \cdot \left(\left(t \cdot x\right) \cdot z\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      10. lower-*.f6472.8%

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

      \[\leadsto \left(\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(z \cdot x\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]

    if -1.2000000000000001e-65 < y < 4.9999999999999997e32

    1. Initial program 85.6%

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

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

        \[\leadsto \left(\left(-4 \cdot \color{blue}{\left(a \cdot t\right)} + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6476.9%

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

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

Alternative 5: 81.1% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := \left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\ \mathbf{if}\;i \leq \frac{-5699856385590521}{2923003274661805836407369665432566039311865085952}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;i \leq 165000000000000006632430067329163597803683840:\\ \;\;\;\;\left(c \cdot b - t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1 (* (* j 27) k))
       (t_2 (- (- (+ (* -4 (* a t)) (* b c)) (* (* x 4) i)) t_1)))
  (if (<=
       i
       -5699856385590521/2923003274661805836407369665432566039311865085952)
    t_2
    (if (<= i 165000000000000006632430067329163597803683840)
      (- (- (* c b) (* t (- (* -18 (* x (* y z))) (* -4 a)))) t_1)
      t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
	double tmp;
	if (i <= -1.95e-33) {
		tmp = t_2;
	} else if (i <= 1.65e+44) {
		tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1;
	} else {
		tmp = t_2;
	}
	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 = (j * 27.0d0) * k
    t_2 = ((((-4.0d0) * (a * t)) + (b * c)) - ((x * 4.0d0) * i)) - t_1
    if (i <= (-1.95d-33)) then
        tmp = t_2
    else if (i <= 1.65d+44) then
        tmp = ((c * b) - (t * (((-18.0d0) * (x * (y * z))) - ((-4.0d0) * a)))) - t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
	double tmp;
	if (i <= -1.95e-33) {
		tmp = t_2;
	} else if (i <= 1.65e+44) {
		tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * 27.0) * k
	t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1
	tmp = 0
	if i <= -1.95e-33:
		tmp = t_2
	elif i <= 1.65e+44:
		tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	t_2 = Float64(Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1)
	tmp = 0.0
	if (i <= -1.95e-33)
		tmp = t_2;
	elseif (i <= 1.65e+44)
		tmp = Float64(Float64(Float64(c * b) - Float64(t * Float64(Float64(-18.0 * Float64(x * Float64(y * z))) - Float64(-4.0 * a)))) - t_1);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * 27.0) * k;
	t_2 = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
	tmp = 0.0;
	if (i <= -1.95e-33)
		tmp = t_2;
	elseif (i <= 1.65e+44)
		tmp = ((c * b) - (t * ((-18.0 * (x * (y * z))) - (-4.0 * a)))) - t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[i, -5699856385590521/2923003274661805836407369665432566039311865085952], t$95$2, If[LessEqual[i, 165000000000000006632430067329163597803683840], N[(N[(N[(c * b), $MachinePrecision] - N[(t * N[(N[(-18 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-4 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{if}\;i \leq \frac{-5699856385590521}{2923003274661805836407369665432566039311865085952}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;i \leq 165000000000000006632430067329163597803683840:\\
\;\;\;\;\left(c \cdot b - t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) - t\_1\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.9499999999999999e-33 or 1.6500000000000001e44 < i

    1. Initial program 85.6%

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

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

        \[\leadsto \left(\left(-4 \cdot \color{blue}{\left(a \cdot t\right)} + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6476.9%

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

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

    if -1.9499999999999999e-33 < i < 1.6500000000000001e44

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(c \cdot b - t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. lower-*.f6475.3%

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

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

Alternative 6: 77.2% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;z \leq -2149999999999999983215760153657234083458312685028243658712690827188642584106117192746173589162156737740730956670518817363394711836001371787940231885473955640210060285460453435891311503029604697813901201313619575978480932794055418723306624184382819241285638963855745875968:\\ \;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\ \mathbf{elif}\;z \leq 265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144:\\ \;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1 (* (* j 27) k)))
  (if (<=
       z
       -2149999999999999983215760153657234083458312685028243658712690827188642584106117192746173589162156737740730956670518817363394711836001371787940231885473955640210060285460453435891311503029604697813901201313619575978480932794055418723306624184382819241285638963855745875968)
    (* (- (* -4 a) (* (* (* z y) x) -18)) t)
    (if (<=
         z
         265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144)
      (- (- (+ (* -4 (* a t)) (* b c)) (* (* x 4) i)) t_1)
      (- (* x (- (* 18 (* t (* y z))) (* 4 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 = (j * 27.0) * k;
	double tmp;
	if (z <= -2.15e+270) {
		tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
	} else if (z <= 2.65e+95) {
		tmp = (((-4.0 * (a * t)) + (b * c)) - ((x * 4.0) * i)) - t_1;
	} else {
		tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;z \leq 265000000000000009063349824290444205526937045929817852706150376195619110587156230233275072774144:\\
\;\;\;\;\left(\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.15e270

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e270 < z < 2.6500000000000001e95

    1. Initial program 85.6%

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

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

        \[\leadsto \left(\left(-4 \cdot \color{blue}{\left(a \cdot t\right)} + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6476.9%

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

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

    if 2.6500000000000001e95 < z

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

Alternative 7: 75.1% accurate, 1.3× speedup?

\[\begin{array}{l} t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq \frac{-3754664711579725}{4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5000000000000000000000:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1
        (- (* x (- (* 18 (* t (* y z))) (* 4 i))) (* (* j 27) k))))
  (if (<=
       x
       -3754664711579725/4171849679533027504677776769862406473833407270227837441302815640277772901915313574263597826048)
    t_1
    (if (<= x 5000000000000000000000)
      (- (* b c) (+ (* 4 (* a t)) (* 27 (* j k))))
      t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - ((j * 27.0) * k);
	double tmp;
	if (x <= -9e-79) {
		tmp = t_1;
	} else if (x <= 5e+21) {
		tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;x \leq 5000000000000000000000:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.0000000000000006e-79 or 5e21 < x

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

    if -9.0000000000000006e-79 < x < 5e21

    1. Initial program 85.6%

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

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

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

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

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

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

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

        \[\leadsto b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      7. lower-*.f6461.8%

        \[\leadsto b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot \color{blue}{k}\right)\right) \]
    4. Applied rewrites61.8%

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

Alternative 8: 72.7% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;t \leq 309999999999999986587086119803813888:\\
\;\;\;\;\left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1500000000000001e53 or 3.0999999999999999e35 < t

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1500000000000001e53 < t < 3.0999999999999999e35

    1. Initial program 85.6%

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

      \[\leadsto \left(\color{blue}{b \cdot c} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    3. Step-by-step derivation
      1. lower-*.f6460.9%

        \[\leadsto \left(b \cdot \color{blue}{c} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied rewrites60.9%

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

Alternative 9: 64.5% accurate, 0.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq 500000000000000026252380127602210124352234290554079577457927057755901228994454097893185687540223932021852221916441939088471261617680215287822396092393353491424193600463287901868915116897394045029684476617485399972540559519483820440037326371390071247289629394410028421419057834736098193432729700270080:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-4 \cdot a - \left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (if (<=
     (-
      (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c))
      (* (* x 4) i))
     500000000000000026252380127602210124352234290554079577457927057755901228994454097893185687540223932021852221916441939088471261617680215287822396092393353491424193600463287901868915116897394045029684476617485399972540559519483820440037326371390071247289629394410028421419057834736098193432729700270080)
  (- (* b c) (+ (* 4 (* a t)) (* 27 (* j k))))
  (* (- (* -4 a) (* (* (* z y) x) -18)) 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 ((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= 5e+299) {
		tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
	} else {
		tmp = ((-4.0 * a) - (((z * y) * x) * -18.0)) * t;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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


\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

    1. Initial program 85.6%

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

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

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

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

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

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

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

        \[\leadsto b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      7. lower-*.f6461.8%

        \[\leadsto b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot \color{blue}{k}\right)\right) \]
    4. Applied rewrites61.8%

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\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. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.9% accurate, 1.7× speedup?

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

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

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

\mathbf{elif}\;t \leq 309999999999999986587086119803813888:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - \left(j \cdot 27\right) \cdot k\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1500000000000001e53 or 3.0999999999999999e35 < t

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1500000000000001e53 < t < 3.0999999999999999e35

    1. Initial program 85.6%

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

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

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

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

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

Alternative 11: 44.7% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;t \leq 2899999999999999847417951577157133841358248453603328:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - \left(j \cdot 27\right) \cdot k\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.6999999999999998e235 or 2.8999999999999998e51 < t

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6999999999999998e235 < t < 2.8999999999999998e51

    1. Initial program 85.6%

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

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

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

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

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

Alternative 12: 32.7% accurate, 0.2× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\ \;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\ \mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot \mathsf{max}\left(j, k\right)\right) \cdot \mathsf{min}\left(j, k\right)\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (if (<=
     (fmin j k)
     -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
  (* -27 (* (fmin j k) (fmax j k)))
  (if (<=
       (fmin j k)
       8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
    (* -4 (* a t))
    (* (* -27 (fmax j k)) (fmin j k)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (fmin(j, k) <= -1.15e+128) {
		tmp = -27.0 * (fmin(j, k) * fmax(j, k));
	} else if (fmin(j, k) <= 2.45e-54) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * fmax(j, k)) * fmin(j, k);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if (fmin(j, k) <= (-1.15d+128)) then
        tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
    else if (fmin(j, k) <= 2.45d-54) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = ((-27.0d0) * fmax(j, k)) * fmin(j, k)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (fmin(j, k) <= -1.15e+128) {
		tmp = -27.0 * (fmin(j, k) * fmax(j, k));
	} else if (fmin(j, k) <= 2.45e-54) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * fmax(j, k)) * fmin(j, k);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if fmin(j, k) <= -1.15e+128:
		tmp = -27.0 * (fmin(j, k) * fmax(j, k))
	elif fmin(j, k) <= 2.45e-54:
		tmp = -4.0 * (a * t)
	else:
		tmp = (-27.0 * fmax(j, k)) * fmin(j, k)
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (fmin(j, k) <= -1.15e+128)
		tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k)));
	elseif (fmin(j, k) <= 2.45e-54)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = Float64(Float64(-27.0 * fmax(j, k)) * fmin(j, k));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if (min(j, k) <= -1.15e+128)
		tmp = -27.0 * (min(j, k) * max(j, k));
	elseif (min(j, k) <= 2.45e-54)
		tmp = -4.0 * (a * t);
	else
		tmp = (-27.0 * max(j, k)) * min(j, k);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], N[(-27 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27 * N[Max[j, k], $MachinePrecision]), $MachinePrecision] * N[Min[j, k], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\

\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -1.15e128

    1. Initial program 85.6%

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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4500000000000001e-54 < j

    1. Initial program 85.6%

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

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

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

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

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

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

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

Alternative 13: 32.7% accurate, 0.2× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\ \;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\ \mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot \mathsf{min}\left(j, k\right)\right) \cdot \mathsf{max}\left(j, k\right)\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (if (<=
     (fmin j k)
     -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
  (* -27 (* (fmin j k) (fmax j k)))
  (if (<=
       (fmin j k)
       8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
    (* -4 (* a t))
    (* (* -27 (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 (fmin(j, k) <= -1.15e+128) {
		tmp = -27.0 * (fmin(j, k) * fmax(j, k));
	} else if (fmin(j, k) <= 2.45e-54) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * fmin(j, k)) * fmax(j, k);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if (fmin(j, k) <= (-1.15d+128)) then
        tmp = (-27.0d0) * (fmin(j, k) * fmax(j, k))
    else if (fmin(j, k) <= 2.45d-54) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = ((-27.0d0) * fmin(j, k)) * fmax(j, k)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (fmin(j, k) <= -1.15e+128) {
		tmp = -27.0 * (fmin(j, k) * fmax(j, k));
	} else if (fmin(j, k) <= 2.45e-54) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * fmin(j, k)) * fmax(j, k);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if fmin(j, k) <= -1.15e+128:
		tmp = -27.0 * (fmin(j, k) * fmax(j, k))
	elif fmin(j, k) <= 2.45e-54:
		tmp = -4.0 * (a * t)
	else:
		tmp = (-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 (fmin(j, k) <= -1.15e+128)
		tmp = Float64(-27.0 * Float64(fmin(j, k) * fmax(j, k)));
	elseif (fmin(j, k) <= 2.45e-54)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = Float64(Float64(-27.0 * fmin(j, k)) * fmax(j, k));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if (min(j, k) <= -1.15e+128)
		tmp = -27.0 * (min(j, k) * max(j, k));
	elseif (min(j, k) <= 2.45e-54)
		tmp = -4.0 * (a * t);
	else
		tmp = (-27.0 * min(j, k)) * max(j, k);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], N[(-27 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27 * N[Min[j, k], $MachinePrecision]), $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;-27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\

\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -1.15e128

    1. Initial program 85.6%

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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4500000000000001e-54 < j

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(27 \cdot j\right)\right) \cdot k \]
      11. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(27\right)\right) \cdot j\right) \cdot k \]
      12. metadata-evalN/A

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
      13. 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} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 32.6% accurate, 0.2× speedup?

\[\begin{array}{l} t_1 := -27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\ \mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\ \;\;\;\;-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 (* (fmin j k) (fmax j k)))))
  (if (<=
       (fmin j k)
       -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264)
    t_1
    (if (<=
         (fmin j k)
         8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648)
      (* -4 (* 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 tmp;
	if (fmin(j, k) <= -1.15e+128) {
		tmp = t_1;
	} else if (fmin(j, k) <= 2.45e-54) {
		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) :: tmp
    t_1 = (-27.0d0) * (fmin(j, k) * fmax(j, k))
    if (fmin(j, k) <= (-1.15d+128)) then
        tmp = t_1
    else if (fmin(j, k) <= 2.45d-54) 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 tmp;
	if (fmin(j, k) <= -1.15e+128) {
		tmp = t_1;
	} else if (fmin(j, k) <= 2.45e-54) {
		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))
	tmp = 0
	if fmin(j, k) <= -1.15e+128:
		tmp = t_1
	elif fmin(j, k) <= 2.45e-54:
		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(fmin(j, k) * fmax(j, k)))
	tmp = 0.0
	if (fmin(j, k) <= -1.15e+128)
		tmp = t_1;
	elseif (fmin(j, k) <= 2.45e-54)
		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));
	tmp = 0.0;
	if (min(j, k) <= -1.15e+128)
		tmp = t_1;
	elseif (min(j, k) <= 2.45e-54)
		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 * N[(N[Min[j, k], $MachinePrecision] * N[Max[j, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[j, k], $MachinePrecision], -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264], t$95$1, If[LessEqual[N[Min[j, k], $MachinePrecision], 8454639274818441/3450873173395281893717377931138512726225554486085193277581262111899648], N[(-4 * N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -27 \cdot \left(\mathsf{min}\left(j, k\right) \cdot \mathsf{max}\left(j, k\right)\right)\\
\mathbf{if}\;\mathsf{min}\left(j, k\right) \leq -114999999999999999025435576357973090723901817951402480419738826442664890985813929140494059756805989646939487445455432908762251264:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\mathsf{min}\left(j, k\right) \leq \frac{8454639274818441}{3450873173395281893717377931138512726225554486085193277581262111899648}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -1.15e128 or 2.4500000000000001e-54 < j

    1. Initial program 85.6%

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

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 21.7% accurate, 6.2× speedup?

\[-4 \cdot \left(a \cdot t\right) \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (* -4 (* 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 * N[(a * t), $MachinePrecision]), $MachinePrecision]
-4 \cdot \left(a \cdot t\right)
Derivation
  1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2025271 -o generate:evaluate
(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) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))