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

Percentage Accurate: 85.4% → 89.0%
Time: 6.6s
Alternatives: 16
Speedup: 0.9×

Specification

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

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

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

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

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

Alternative 1: 89.0% 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}:\\ \;\;\;\;-4 \cdot \left(i \cdot x\right) - t\_2\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1 (* (* x 4.0) i)) (t_2 (* (* j 27.0) k)))
  (if (<=
       (-
        (-
         (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
         t_1)
        t_2)
       INFINITY)
    (-
     (- (- (* c b) (* (- (* 4.0 a) (* z (* y (* 18.0 x)))) t)) t_1)
     t_2)
    (- (* -4.0 (* i x)) 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 = (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 * (i * x)) - t_2;
	}
	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 * (i * x)) - t_2;
	}
	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 * (i * x)) - t_2
	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(-4.0 * Float64(i * x)) - t_2);
	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 * (i * x)) - t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], Infinity], N[(N[(N[(N[(c * b), $MachinePrecision] - N[(N[(N[(4.0 * a), $MachinePrecision] - N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision] - t$95$2), $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}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right) - t\_2\\


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

    1. Initial program 85.4%

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

        \[\leadsto \left(\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(\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 \]
      11. 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 \]
      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.2%

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

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

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

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

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

      \[\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 2: 87.9% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 85.4%

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

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

      \[\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 1e306 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(-1 \cdot \left(b \cdot c\right)\right) \]
    7. Applied rewrites23.5%

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

Alternative 3: 82.9% accurate, 1.1× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.3e-27 or 0.0034499999999999999 < i

    1. Initial program 85.4%

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

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

    if -4.3e-27 < i < 0.0034499999999999999

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

Alternative 4: 79.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;x \leq 1.85 \cdot 10^{+198}:\\
\;\;\;\;\left(\left(-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\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.0000000000000001e201 or 1.8499999999999999e198 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e201 < x < 1.8499999999999999e198

    1. Initial program 85.4%

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

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

Alternative 5: 70.8% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := 27 \cdot \left(j \cdot k\right)\\ \mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t\_1\\ \mathbf{elif}\;i \leq -1.25 \cdot 10^{-290}:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + t\_2\right)\\ \mathbf{elif}\;i \leq 0.0062:\\ \;\;\;\;\left(18 \cdot \left(\left(\left(x \cdot t\right) \cdot y\right) \cdot z\right) + b \cdot c\right) - t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - \left(x \cdot 4\right) \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.0) k)) (t_2 (* 27.0 (* j k))))
  (if (<= i -2.6e+66)
    (- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_1)
    (if (<= i -1.25e-290)
      (- (* b c) (+ (* 4.0 (* a t)) t_2))
      (if (<= i 0.0062)
        (- (+ (* 18.0 (* (* (* x t) y) z)) (* b c)) t_2)
        (- (- (* b c) (* (* x 4.0) 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 t_2 = 27.0 * (j * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
	} else if (i <= -1.25e-290) {
		tmp = (b * c) - ((4.0 * (a * t)) + t_2);
	} else if (i <= 0.0062) {
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_2;
	} else {
		tmp = ((b * c) - ((x * 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) :: t_2
    real(8) :: tmp
    t_1 = (j * 27.0d0) * k
    t_2 = 27.0d0 * (j * k)
    if (i <= (-2.6d+66)) then
        tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_1
    else if (i <= (-1.25d-290)) then
        tmp = (b * c) - ((4.0d0 * (a * t)) + t_2)
    else if (i <= 0.0062d0) then
        tmp = ((18.0d0 * (((x * t) * y) * z)) + (b * c)) - t_2
    else
        tmp = ((b * c) - ((x * 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 t_2 = 27.0 * (j * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
	} else if (i <= -1.25e-290) {
		tmp = (b * c) - ((4.0 * (a * t)) + t_2);
	} else if (i <= 0.0062) {
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_2;
	} else {
		tmp = ((b * c) - ((x * 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
	t_2 = 27.0 * (j * k)
	tmp = 0
	if i <= -2.6e+66:
		tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1
	elif i <= -1.25e-290:
		tmp = (b * c) - ((4.0 * (a * t)) + t_2)
	elif i <= 0.0062:
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_2
	else:
		tmp = ((b * c) - ((x * 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)
	t_2 = Float64(27.0 * Float64(j * k))
	tmp = 0.0
	if (i <= -2.6e+66)
		tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_1);
	elseif (i <= -1.25e-290)
		tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(a * t)) + t_2));
	elseif (i <= 0.0062)
		tmp = Float64(Float64(Float64(18.0 * Float64(Float64(Float64(x * t) * y) * z)) + Float64(b * c)) - t_2);
	else
		tmp = Float64(Float64(Float64(b * c) - Float64(Float64(x * 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;
	t_2 = 27.0 * (j * k);
	tmp = 0.0;
	if (i <= -2.6e+66)
		tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
	elseif (i <= -1.25e-290)
		tmp = (b * c) - ((4.0 * (a * t)) + t_2);
	elseif (i <= 0.0062)
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_2;
	else
		tmp = ((b * c) - ((x * 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.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.6e+66], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[i, -1.25e-290], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.0062], N[(N[(N[(18.0 * N[(N[(N[(x * t), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t\_1\\

\mathbf{elif}\;i \leq -1.25 \cdot 10^{-290}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + t\_2\right)\\

\mathbf{elif}\;i \leq 0.0062:\\
\;\;\;\;\left(18 \cdot \left(\left(\left(x \cdot t\right) \cdot y\right) \cdot z\right) + b \cdot c\right) - t\_2\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -2.6000000000000001e66

    1. Initial program 85.4%

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

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

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

    if -2.6000000000000001e66 < i < -1.25e-290

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

    if -1.25e-290 < i < 0.0061999999999999998

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(\left(\left(x \cdot t\right) \cdot y\right) \cdot z\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
    9. Applied rewrites63.2%

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

    if 0.0061999999999999998 < i

    1. Initial program 85.4%

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

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

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

Alternative 6: 68.9% accurate, 1.2× speedup?

\[\begin{array}{l} t_1 := -1 \cdot \left(x \cdot \left(-18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - -4 \cdot i\right)\right)\\ t_2 := \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{+198}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-133}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-44}:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{+197}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t a b c i j k)
  :precision binary64
  (let* ((t_1 (* -1.0 (* x (- (* -18.0 (* t (* y z))) (* -4.0 i)))))
       (t_2 (- (- (* b c) (* (* x 4.0) i)) (* (* j 27.0) k))))
  (if (<= x -1.45e+198)
    t_1
    (if (<= x -5.8e-133)
      t_2
      (if (<= x 3e-44)
        (- (* b c) (+ (* 4.0 (* a t)) (* 27.0 (* j k))))
        (if (<= x 2.35e+197) 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 = -1.0 * (x * ((-18.0 * (t * (y * z))) - (-4.0 * i)));
	double t_2 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (x <= -1.45e+198) {
		tmp = t_1;
	} else if (x <= -5.8e-133) {
		tmp = t_2;
	} else if (x <= 3e-44) {
		tmp = (b * c) - ((4.0 * (a * t)) + (27.0 * (j * k)));
	} else if (x <= 2.35e+197) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;x \leq -5.8 \cdot 10^{-133}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 2.35 \cdot 10^{+197}:\\
\;\;\;\;t\_2\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.45e198 or 2.35e197 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e198 < x < -5.7999999999999997e-133 or 3.0000000000000002e-44 < x < 2.35e197

    1. Initial program 85.4%

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

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

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

    if -5.7999999999999997e-133 < x < 3.0000000000000002e-44

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

Alternative 7: 68.3% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := 27 \cdot \left(j \cdot k\right)\\ t_2 := \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;i \leq -1.25 \cdot 10^{-290}:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + t\_1\right)\\ \mathbf{elif}\;i \leq 0.0062:\\ \;\;\;\;\left(18 \cdot \left(\left(\left(x \cdot t\right) \cdot y\right) \cdot z\right) + b \cdot c\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 (* 27.0 (* j k)))
       (t_2 (- (- (* b c) (* (* x 4.0) i)) (* (* j 27.0) k))))
  (if (<= i -2.6e+66)
    t_2
    (if (<= i -1.25e-290)
      (- (* b c) (+ (* 4.0 (* a t)) t_1))
      (if (<= i 0.0062)
        (- (+ (* 18.0 (* (* (* x t) y) z)) (* b c)) t_1)
        t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = 27.0 * (j * k);
	double t_2 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = t_2;
	} else if (i <= -1.25e-290) {
		tmp = (b * c) - ((4.0 * (a * t)) + t_1);
	} else if (i <= 0.0062) {
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - 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 = 27.0d0 * (j * k)
    t_2 = ((b * c) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
    if (i <= (-2.6d+66)) then
        tmp = t_2
    else if (i <= (-1.25d-290)) then
        tmp = (b * c) - ((4.0d0 * (a * t)) + t_1)
    else if (i <= 0.0062d0) then
        tmp = ((18.0d0 * (((x * t) * y) * z)) + (b * c)) - 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 = 27.0 * (j * k);
	double t_2 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = t_2;
	} else if (i <= -1.25e-290) {
		tmp = (b * c) - ((4.0 * (a * t)) + t_1);
	} else if (i <= 0.0062) {
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = 27.0 * (j * k)
	t_2 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k)
	tmp = 0
	if i <= -2.6e+66:
		tmp = t_2
	elif i <= -1.25e-290:
		tmp = (b * c) - ((4.0 * (a * t)) + t_1)
	elif i <= 0.0062:
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(27.0 * Float64(j * k))
	t_2 = Float64(Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
	tmp = 0.0
	if (i <= -2.6e+66)
		tmp = t_2;
	elseif (i <= -1.25e-290)
		tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(a * t)) + t_1));
	elseif (i <= 0.0062)
		tmp = Float64(Float64(Float64(18.0 * Float64(Float64(Float64(x * t) * y) * z)) + Float64(b * c)) - 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 = 27.0 * (j * k);
	t_2 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	tmp = 0.0;
	if (i <= -2.6e+66)
		tmp = t_2;
	elseif (i <= -1.25e-290)
		tmp = (b * c) - ((4.0 * (a * t)) + t_1);
	elseif (i <= 0.0062)
		tmp = ((18.0 * (((x * t) * y) * z)) + (b * c)) - 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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.6e+66], t$95$2, If[LessEqual[i, -1.25e-290], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.0062], N[(N[(N[(18.0 * N[(N[(N[(x * t), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\

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

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.6000000000000001e66 or 0.0061999999999999998 < i

    1. Initial program 85.4%

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

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

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

    if -2.6000000000000001e66 < i < -1.25e-290

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

    if -1.25e-290 < i < 0.0061999999999999998

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(\left(\left(x \cdot t\right) \cdot y\right) \cdot z\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
    9. Applied rewrites63.2%

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

Alternative 8: 68.2% accurate, 1.5× speedup?

\[\begin{array}{l} t_1 := \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2.5 \cdot 10^{+30}:\\ \;\;\;\;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 (- (- (* b c) (* (* x 4.0) i)) (* (* j 27.0) k))))
  (if (<= i -2.6e+66)
    t_1
    (if (<= i 2.5e+30)
      (- (* b c) (+ (* 4.0 (* a t)) (* 27.0 (* j k))))
      t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = t_1;
	} else if (i <= 2.5e+30) {
		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 = ((b * c) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
    if (i <= (-2.6d+66)) then
        tmp = t_1
    else if (i <= 2.5d+30) 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 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (i <= -2.6e+66) {
		tmp = t_1;
	} else if (i <= 2.5e+30) {
		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 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k)
	tmp = 0
	if i <= -2.6e+66:
		tmp = t_1
	elif i <= 2.5e+30:
		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(Float64(b * c) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
	tmp = 0.0
	if (i <= -2.6e+66)
		tmp = t_1;
	elseif (i <= 2.5e+30)
		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 = ((b * c) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	tmp = 0.0;
	if (i <= -2.6e+66)
		tmp = t_1;
	elseif (i <= 2.5e+30)
		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[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.6e+66], t$95$1, If[LessEqual[i, 2.5e+30], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;i \leq -2.6 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq 2.5 \cdot 10^{+30}:\\
\;\;\;\;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 i < -2.6000000000000001e66 or 2.4999999999999999e30 < i

    1. Initial program 85.4%

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

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

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

    if -2.6000000000000001e66 < i < 2.4999999999999999e30

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

      \[\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 9: 64.1% accurate, 1.5× speedup?

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

\mathbf{elif}\;i \leq 3.3 \cdot 10^{+167}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\\

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


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

    1. Initial program 85.4%

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

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

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

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

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

    if -1.2e214 < i < 3.3000000000000002e167

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

    if 3.3000000000000002e167 < i

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.7% accurate, 1.4× speedup?

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

\mathbf{elif}\;t \leq -1.4 \cdot 10^{-219}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

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

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.5000000000000002e104 or 5.7999999999999998e-83 < t

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(c \cdot b - \left(-18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \left(4 \cdot \left(\color{blue}{a} \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      13. lower-*.f6473.9%

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

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

        \[\leadsto \left(c \cdot b - \left(-18 \cdot t\right) \cdot \left(\left(y \cdot z\right) \cdot x\right)\right) - \left(4 \cdot \left(a \cdot \color{blue}{t}\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      16. lower-*.f6473.9%

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

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

        \[\leadsto \left(c \cdot b - \left(-18 \cdot t\right) \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      19. lift-*.f6473.9%

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000002e104 < t < -1.4e-219

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

    if -1.4e-219 < t < 5.7999999999999998e-83

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 51.5% accurate, 1.9× speedup?

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

\mathbf{elif}\;i \leq 1.65 \cdot 10^{+26}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

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


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

    1. Initial program 85.4%

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

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

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

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

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

    if -2.6000000000000001e66 < i < 1.65e26

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

    if 1.65e26 < i

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 51.5% accurate, 1.9× speedup?

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

\mathbf{elif}\;i \leq 1.65 \cdot 10^{+26}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -2.6000000000000001e66 or 1.65e26 < i

    1. Initial program 85.4%

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

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

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

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

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

    if -2.6000000000000001e66 < i < 1.65e26

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

Alternative 13: 48.1% accurate, 2.2× speedup?

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

\mathbf{elif}\;a \leq 6.4 \cdot 10^{+140}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.8e221 or 6.4000000000000002e140 < a

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

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

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

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

    if -1.8e221 < a < 6.4000000000000002e140

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
      12. lower-*.f6474.0%

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

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

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

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

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

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

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

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

Alternative 14: 35.8% accurate, 1.1× speedup?

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

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

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+73}:\\
\;\;\;\;-1 \cdot \left(-1 \cdot \left(b \cdot c\right)\right)\\

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


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

    1. Initial program 85.4%

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

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

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

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

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

    if -4.0000000000000002e207 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.0000000000000001e-61

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

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

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

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

    if -2.0000000000000001e-61 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e73

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(-1 \cdot \left(b \cdot c\right)\right) \]
    7. Applied rewrites23.5%

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

Alternative 15: 34.9% accurate, 1.6× speedup?

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

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

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

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

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

    1. Initial program 85.4%

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

        \[\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.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 \]
    5. 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)} \]
    6. 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-*.f6460.9%

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

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

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

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

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

Alternative 16: 21.5% 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.0 (* a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return -4.0 * (a * t);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

      \[\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.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 \]
  5. 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)} \]
  6. 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-*.f6460.9%

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

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

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

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

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

Reproduce

?
herbie shell --seed 2025258 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))