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

Percentage Accurate: 95.1% → 98.3%
Time: 3.5s
Alternatives: 10
Speedup: 0.1×

Specification

?
\[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
(FPCore (x y z t a b)
  :precision binary64
  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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)
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
    code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b

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 10 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: 95.1% accurate, 1.0× speedup?

\[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
(FPCore (x y z t a b)
  :precision binary64
  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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)
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
    code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b

Alternative 1: 98.3% accurate, 0.0× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_2 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\ t_4 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\ \mathbf{if}\;t\_3 \leq 2 \cdot 10^{-66}:\\ \;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\left(t\_3 \cdot t\_4\right) \cdot 9\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(t\_4 \cdot t\_1\right) \cdot 9\right) \cdot t\_3\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (fmin (fmin y z) t))
       (t_2 (fmax (fmin y z) t))
       (t_3 (fmin (fmax y z) t_2))
       (t_4 (fmax (fmax y z) t_2)))
  (if (<= t_3 2e-66)
    (- (- (+ x x) (* (* -27.0 a) b)) (* (* (* t_3 t_4) 9.0) t_1))
    (+ (- (* x 2.0) (* (* (* t_4 t_1) 9.0) t_3)) (* (* a 27.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fmin(fmin(y, z), t);
	double t_2 = fmax(fmin(y, z), t);
	double t_3 = fmin(fmax(y, z), t_2);
	double t_4 = fmax(fmax(y, z), t_2);
	double tmp;
	if (t_3 <= 2e-66) {
		tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1);
	} else {
		tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b);
	}
	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)
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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = fmin(fmin(y, z), t)
    t_2 = fmax(fmin(y, z), t)
    t_3 = fmin(fmax(y, z), t_2)
    t_4 = fmax(fmax(y, z), t_2)
    if (t_3 <= 2d-66) then
        tmp = ((x + x) - (((-27.0d0) * a) * b)) - (((t_3 * t_4) * 9.0d0) * t_1)
    else
        tmp = ((x * 2.0d0) - (((t_4 * t_1) * 9.0d0) * t_3)) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fmin(fmin(y, z), t);
	double t_2 = fmax(fmin(y, z), t);
	double t_3 = fmin(fmax(y, z), t_2);
	double t_4 = fmax(fmax(y, z), t_2);
	double tmp;
	if (t_3 <= 2e-66) {
		tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1);
	} else {
		tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = fmin(fmin(y, z), t)
	t_2 = fmax(fmin(y, z), t)
	t_3 = fmin(fmax(y, z), t_2)
	t_4 = fmax(fmax(y, z), t_2)
	tmp = 0
	if t_3 <= 2e-66:
		tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1)
	else:
		tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = fmin(fmin(y, z), t)
	t_2 = fmax(fmin(y, z), t)
	t_3 = fmin(fmax(y, z), t_2)
	t_4 = fmax(fmax(y, z), t_2)
	tmp = 0.0
	if (t_3 <= 2e-66)
		tmp = Float64(Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b)) - Float64(Float64(Float64(t_3 * t_4) * 9.0) * t_1));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(t_4 * t_1) * 9.0) * t_3)) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = min(min(y, z), t);
	t_2 = max(min(y, z), t);
	t_3 = min(max(y, z), t_2);
	t_4 = max(max(y, z), t_2);
	tmp = 0.0;
	if (t_3 <= 2e-66)
		tmp = ((x + x) - ((-27.0 * a) * b)) - (((t_3 * t_4) * 9.0) * t_1);
	else
		tmp = ((x * 2.0) - (((t_4 * t_1) * 9.0) * t_3)) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[y, z], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[y, z], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-66], N[(N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t$95$3 * t$95$4), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(t$95$4 * t$95$1), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_2\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-66}:\\
\;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\left(t\_3 \cdot t\_4\right) \cdot 9\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(t\_4 \cdot t\_1\right) \cdot 9\right) \cdot t\_3\right) + \left(a \cdot 27\right) \cdot b\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2e-66

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

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

    if 2e-66 < z

    1. Initial program 95.1%

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \left(t \cdot \color{blue}{\left(y \cdot 9\right)}\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      7. associate-*r*N/A

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(t \cdot y\right) \cdot 9\right)} \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      9. lower-*.f6494.0%

        \[\leadsto \left(x \cdot 2 - \left(\color{blue}{\left(t \cdot y\right)} \cdot 9\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
    3. Applied rewrites94.0%

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

Alternative 2: 98.1% accurate, 0.0× speedup?

\[\begin{array}{l} t_1 := \left(x + x\right) - \left(-27 \cdot a\right) \cdot b\\ t_2 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_3 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_4 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\ t_5 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\ \mathbf{if}\;t\_4 \leq 10000:\\ \;\;\;\;t\_1 - \left(\left(t\_4 \cdot t\_5\right) \cdot 9\right) \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1 - t\_5 \cdot \left(t\_4 \cdot \left(9 \cdot t\_2\right)\right)\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (- (+ x x) (* (* -27.0 a) b)))
       (t_2 (fmin (fmin y z) t))
       (t_3 (fmax (fmin y z) t))
       (t_4 (fmin (fmax y z) t_3))
       (t_5 (fmax (fmax y z) t_3)))
  (if (<= t_4 10000.0)
    (- t_1 (* (* (* t_4 t_5) 9.0) t_2))
    (- t_1 (* t_5 (* t_4 (* 9.0 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + x) - ((-27.0 * a) * b);
	double t_2 = fmin(fmin(y, z), t);
	double t_3 = fmax(fmin(y, z), t);
	double t_4 = fmin(fmax(y, z), t_3);
	double t_5 = fmax(fmax(y, z), t_3);
	double tmp;
	if (t_4 <= 10000.0) {
		tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2);
	} else {
		tmp = t_1 - (t_5 * (t_4 * (9.0 * 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)
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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: tmp
    t_1 = (x + x) - (((-27.0d0) * a) * b)
    t_2 = fmin(fmin(y, z), t)
    t_3 = fmax(fmin(y, z), t)
    t_4 = fmin(fmax(y, z), t_3)
    t_5 = fmax(fmax(y, z), t_3)
    if (t_4 <= 10000.0d0) then
        tmp = t_1 - (((t_4 * t_5) * 9.0d0) * t_2)
    else
        tmp = t_1 - (t_5 * (t_4 * (9.0d0 * 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 t_1 = (x + x) - ((-27.0 * a) * b);
	double t_2 = fmin(fmin(y, z), t);
	double t_3 = fmax(fmin(y, z), t);
	double t_4 = fmin(fmax(y, z), t_3);
	double t_5 = fmax(fmax(y, z), t_3);
	double tmp;
	if (t_4 <= 10000.0) {
		tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2);
	} else {
		tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + x) - ((-27.0 * a) * b)
	t_2 = fmin(fmin(y, z), t)
	t_3 = fmax(fmin(y, z), t)
	t_4 = fmin(fmax(y, z), t_3)
	t_5 = fmax(fmax(y, z), t_3)
	tmp = 0
	if t_4 <= 10000.0:
		tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2)
	else:
		tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b))
	t_2 = fmin(fmin(y, z), t)
	t_3 = fmax(fmin(y, z), t)
	t_4 = fmin(fmax(y, z), t_3)
	t_5 = fmax(fmax(y, z), t_3)
	tmp = 0.0
	if (t_4 <= 10000.0)
		tmp = Float64(t_1 - Float64(Float64(Float64(t_4 * t_5) * 9.0) * t_2));
	else
		tmp = Float64(t_1 - Float64(t_5 * Float64(t_4 * Float64(9.0 * t_2))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + x) - ((-27.0 * a) * b);
	t_2 = min(min(y, z), t);
	t_3 = max(min(y, z), t);
	t_4 = min(max(y, z), t_3);
	t_5 = max(max(y, z), t_3);
	tmp = 0.0;
	if (t_4 <= 10000.0)
		tmp = t_1 - (((t_4 * t_5) * 9.0) * t_2);
	else
		tmp = t_1 - (t_5 * (t_4 * (9.0 * t_2)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$4 = N[Min[N[Max[y, z], $MachinePrecision], t$95$3], $MachinePrecision]}, Block[{t$95$5 = N[Max[N[Max[y, z], $MachinePrecision], t$95$3], $MachinePrecision]}, If[LessEqual[t$95$4, 10000.0], N[(t$95$1 - N[(N[(N[(t$95$4 * t$95$5), $MachinePrecision] * 9.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t$95$5 * N[(t$95$4 * N[(9.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \left(x + x\right) - \left(-27 \cdot a\right) \cdot b\\
t_2 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_3 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_4 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\
t_5 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_3\right)\\
\mathbf{if}\;t\_4 \leq 10000:\\
\;\;\;\;t\_1 - \left(\left(t\_4 \cdot t\_5\right) \cdot 9\right) \cdot t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1 - t\_5 \cdot \left(t\_4 \cdot \left(9 \cdot t\_2\right)\right)\\


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

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

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

    if 1e4 < z

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

Alternative 3: 96.3% accurate, 0.1× speedup?

\[\begin{array}{l} \mathbf{if}\;\left(\mathsf{min}\left(y, t\right) \cdot 9\right) \cdot z \leq 2 \cdot 10^{+305}:\\ \;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \mathsf{max}\left(y, t\right) \cdot \left(z \cdot \left(9 \cdot \mathsf{min}\left(y, t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(\left(\mathsf{min}\left(y, t\right) \cdot \mathsf{max}\left(y, t\right)\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (if (<= (* (* (fmin y t) 9.0) z) 2e+305)
  (-
   (- (+ x x) (* (* -27.0 a) b))
   (* (fmax y t) (* z (* 9.0 (fmin y t)))))
  (+ (* -9.0 (* (* (fmin y t) (fmax y t)) z)) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((fmin(y, t) * 9.0) * z) <= 2e+305) {
		tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t))));
	} else {
		tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b);
	}
	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)
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) :: tmp
    if (((fmin(y, t) * 9.0d0) * z) <= 2d+305) then
        tmp = ((x + x) - (((-27.0d0) * a) * b)) - (fmax(y, t) * (z * (9.0d0 * fmin(y, t))))
    else
        tmp = ((-9.0d0) * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((fmin(y, t) * 9.0) * z) <= 2e+305) {
		tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t))));
	} else {
		tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if ((fmin(y, t) * 9.0) * z) <= 2e+305:
		tmp = ((x + x) - ((-27.0 * a) * b)) - (fmax(y, t) * (z * (9.0 * fmin(y, t))))
	else:
		tmp = (-9.0 * ((fmin(y, t) * fmax(y, t)) * z)) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(fmin(y, t) * 9.0) * z) <= 2e+305)
		tmp = Float64(Float64(Float64(x + x) - Float64(Float64(-27.0 * a) * b)) - Float64(fmax(y, t) * Float64(z * Float64(9.0 * fmin(y, t)))));
	else
		tmp = Float64(Float64(-9.0 * Float64(Float64(fmin(y, t) * fmax(y, t)) * z)) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (((min(y, t) * 9.0) * z) <= 2e+305)
		tmp = ((x + x) - ((-27.0 * a) * b)) - (max(y, t) * (z * (9.0 * min(y, t))));
	else
		tmp = (-9.0 * ((min(y, t) * max(y, t)) * z)) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[Min[y, t], $MachinePrecision] * 9.0), $MachinePrecision] * z), $MachinePrecision], 2e+305], N[(N[(N[(x + x), $MachinePrecision] - N[(N[(-27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[Max[y, t], $MachinePrecision] * N[(z * N[(9.0 * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(N[(N[Min[y, t], $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\mathsf{min}\left(y, t\right) \cdot 9\right) \cdot z \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \mathsf{max}\left(y, t\right) \cdot \left(z \cdot \left(9 \cdot \mathsf{min}\left(y, t\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(\mathsf{min}\left(y, t\right) \cdot \mathsf{max}\left(y, t\right)\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.9999999999999999e305

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

    if 1.9999999999999999e305 < (*.f64 (*.f64 y #s(literal 9 binary64)) z)

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in x around 0

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

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

        \[\leadsto -9 \cdot \left(t \cdot \color{blue}{\left(y \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      3. lower-*.f6466.4%

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
    4. Applied rewrites66.4%

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

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

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
      3. associate-*r*N/A

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

        \[\leadsto -9 \cdot \left(\left(t \cdot y\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      5. lower-*.f6465.6%

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

        \[\leadsto -9 \cdot \left(\left(t \cdot y\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      7. *-commutativeN/A

        \[\leadsto -9 \cdot \left(\left(y \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      8. lower-*.f6465.6%

        \[\leadsto -9 \cdot \left(\left(y \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
    6. Applied rewrites65.6%

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

Alternative 4: 84.5% accurate, 0.0× speedup?

\[\begin{array}{l} t_1 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\ t_4 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\ t_5 := \left(\left(t\_4 \cdot 9\right) \cdot t\_2\right) \cdot t\_3\\ t_6 := \left(a \cdot 27\right) \cdot b\\ \mathbf{if}\;t\_5 \leq -5 \cdot 10^{+31}:\\ \;\;\;\;-9 \cdot \left(t\_3 \cdot \left(t\_4 \cdot t\_2\right)\right) + t\_6\\ \mathbf{elif}\;t\_5 \leq 10^{-88}:\\ \;\;\;\;2 \cdot x + \left(27 \cdot b\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(\left(t\_4 \cdot t\_3\right) \cdot t\_2\right) + t\_6\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (fmax (fmin y z) t))
       (t_2 (fmin (fmax y z) t_1))
       (t_3 (fmax (fmax y z) t_1))
       (t_4 (fmin (fmin y z) t))
       (t_5 (* (* (* t_4 9.0) t_2) t_3))
       (t_6 (* (* a 27.0) b)))
  (if (<= t_5 -5e+31)
    (+ (* -9.0 (* t_3 (* t_4 t_2))) t_6)
    (if (<= t_5 1e-88)
      (+ (* 2.0 x) (* (* 27.0 b) a))
      (+ (* -9.0 (* (* t_4 t_3) t_2)) t_6)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fmax(fmin(y, z), t);
	double t_2 = fmin(fmax(y, z), t_1);
	double t_3 = fmax(fmax(y, z), t_1);
	double t_4 = fmin(fmin(y, z), t);
	double t_5 = ((t_4 * 9.0) * t_2) * t_3;
	double t_6 = (a * 27.0) * b;
	double tmp;
	if (t_5 <= -5e+31) {
		tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6;
	} else if (t_5 <= 1e-88) {
		tmp = (2.0 * x) + ((27.0 * b) * a);
	} else {
		tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6;
	}
	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)
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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: tmp
    t_1 = fmax(fmin(y, z), t)
    t_2 = fmin(fmax(y, z), t_1)
    t_3 = fmax(fmax(y, z), t_1)
    t_4 = fmin(fmin(y, z), t)
    t_5 = ((t_4 * 9.0d0) * t_2) * t_3
    t_6 = (a * 27.0d0) * b
    if (t_5 <= (-5d+31)) then
        tmp = ((-9.0d0) * (t_3 * (t_4 * t_2))) + t_6
    else if (t_5 <= 1d-88) then
        tmp = (2.0d0 * x) + ((27.0d0 * b) * a)
    else
        tmp = ((-9.0d0) * ((t_4 * t_3) * t_2)) + t_6
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fmax(fmin(y, z), t);
	double t_2 = fmin(fmax(y, z), t_1);
	double t_3 = fmax(fmax(y, z), t_1);
	double t_4 = fmin(fmin(y, z), t);
	double t_5 = ((t_4 * 9.0) * t_2) * t_3;
	double t_6 = (a * 27.0) * b;
	double tmp;
	if (t_5 <= -5e+31) {
		tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6;
	} else if (t_5 <= 1e-88) {
		tmp = (2.0 * x) + ((27.0 * b) * a);
	} else {
		tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = fmax(fmin(y, z), t)
	t_2 = fmin(fmax(y, z), t_1)
	t_3 = fmax(fmax(y, z), t_1)
	t_4 = fmin(fmin(y, z), t)
	t_5 = ((t_4 * 9.0) * t_2) * t_3
	t_6 = (a * 27.0) * b
	tmp = 0
	if t_5 <= -5e+31:
		tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6
	elif t_5 <= 1e-88:
		tmp = (2.0 * x) + ((27.0 * b) * a)
	else:
		tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6
	return tmp
function code(x, y, z, t, a, b)
	t_1 = fmax(fmin(y, z), t)
	t_2 = fmin(fmax(y, z), t_1)
	t_3 = fmax(fmax(y, z), t_1)
	t_4 = fmin(fmin(y, z), t)
	t_5 = Float64(Float64(Float64(t_4 * 9.0) * t_2) * t_3)
	t_6 = Float64(Float64(a * 27.0) * b)
	tmp = 0.0
	if (t_5 <= -5e+31)
		tmp = Float64(Float64(-9.0 * Float64(t_3 * Float64(t_4 * t_2))) + t_6);
	elseif (t_5 <= 1e-88)
		tmp = Float64(Float64(2.0 * x) + Float64(Float64(27.0 * b) * a));
	else
		tmp = Float64(Float64(-9.0 * Float64(Float64(t_4 * t_3) * t_2)) + t_6);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = max(min(y, z), t);
	t_2 = min(max(y, z), t_1);
	t_3 = max(max(y, z), t_1);
	t_4 = min(min(y, z), t);
	t_5 = ((t_4 * 9.0) * t_2) * t_3;
	t_6 = (a * 27.0) * b;
	tmp = 0.0;
	if (t_5 <= -5e+31)
		tmp = (-9.0 * (t_3 * (t_4 * t_2))) + t_6;
	elseif (t_5 <= 1e-88)
		tmp = (2.0 * x) + ((27.0 * b) * a);
	else
		tmp = (-9.0 * ((t_4 * t_3) * t_2)) + t_6;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Max[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[y, z], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[y, z], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[Min[N[Min[y, z], $MachinePrecision], t], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 * 9.0), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$5, -5e+31], N[(N[(-9.0 * N[(t$95$3 * N[(t$95$4 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision], If[LessEqual[t$95$5, 1e-88], N[(N[(2.0 * x), $MachinePrecision] + N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(N[(t$95$4 * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_2 := \mathsf{min}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(y, z\right), t\_1\right)\\
t_4 := \mathsf{min}\left(\mathsf{min}\left(y, z\right), t\right)\\
t_5 := \left(\left(t\_4 \cdot 9\right) \cdot t\_2\right) \cdot t\_3\\
t_6 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_5 \leq -5 \cdot 10^{+31}:\\
\;\;\;\;-9 \cdot \left(t\_3 \cdot \left(t\_4 \cdot t\_2\right)\right) + t\_6\\

\mathbf{elif}\;t\_5 \leq 10^{-88}:\\
\;\;\;\;2 \cdot x + \left(27 \cdot b\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(\left(t\_4 \cdot t\_3\right) \cdot t\_2\right) + t\_6\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -5.0000000000000003e31

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in x around 0

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

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

        \[\leadsto -9 \cdot \left(t \cdot \color{blue}{\left(y \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      3. lower-*.f6466.4%

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
    4. Applied rewrites66.4%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} + \left(a \cdot 27\right) \cdot b \]

    if -5.0000000000000003e31 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999993e-89

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0

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

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

        \[\leadsto 2 \cdot x + \color{blue}{27} \cdot \left(a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
      4. lower-*.f6464.3%

        \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
    4. Applied rewrites64.3%

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto 2 \cdot x + 27 \cdot \left(b \cdot \color{blue}{a}\right) \]
      4. associate-*r*N/A

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
      5. lower-*.f64N/A

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
      6. lower-*.f6464.2%

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot a \]
    6. Applied rewrites64.2%

      \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]

    if 9.9999999999999993e-89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in x around 0

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

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

        \[\leadsto -9 \cdot \left(t \cdot \color{blue}{\left(y \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      3. lower-*.f6466.4%

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
    4. Applied rewrites66.4%

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

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

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
      3. associate-*r*N/A

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

        \[\leadsto -9 \cdot \left(\left(t \cdot y\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      5. lower-*.f6465.6%

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

        \[\leadsto -9 \cdot \left(\left(t \cdot y\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      7. *-commutativeN/A

        \[\leadsto -9 \cdot \left(\left(y \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
      8. lower-*.f6465.6%

        \[\leadsto -9 \cdot \left(\left(y \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b \]
    6. Applied rewrites65.6%

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

Alternative 5: 83.7% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_2 \leq 10^{-88}:\\
\;\;\;\;2 \cdot x + \left(27 \cdot b\right) \cdot a\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -5.0000000000000003e31 or 9.9999999999999993e-89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in x around 0

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

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

        \[\leadsto -9 \cdot \left(t \cdot \color{blue}{\left(y \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      3. lower-*.f6466.4%

        \[\leadsto -9 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right) + \left(a \cdot 27\right) \cdot b \]
    4. Applied rewrites66.4%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} + \left(a \cdot 27\right) \cdot b \]

    if -5.0000000000000003e31 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999993e-89

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0

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

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

        \[\leadsto 2 \cdot x + \color{blue}{27} \cdot \left(a \cdot b\right) \]
      3. lower-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
      4. lower-*.f6464.3%

        \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
    4. Applied rewrites64.3%

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto 2 \cdot x + 27 \cdot \left(b \cdot \color{blue}{a}\right) \]
      4. associate-*r*N/A

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
      5. lower-*.f64N/A

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
      6. lower-*.f6464.2%

        \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot a \]
    6. Applied rewrites64.2%

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

Alternative 6: 64.3% accurate, 1.9× speedup?

\[2 \cdot x + \left(27 \cdot b\right) \cdot a \]
(FPCore (x y z t a b)
  :precision binary64
  (+ (* 2.0 x) (* (* 27.0 b) a)))
double code(double x, double y, double z, double t, double a, double b) {
	return (2.0 * x) + ((27.0 * b) * a);
}
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)
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
    code = (2.0d0 * x) + ((27.0d0 * b) * a)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (2.0 * x) + ((27.0 * b) * a);
}
def code(x, y, z, t, a, b):
	return (2.0 * x) + ((27.0 * b) * a)
function code(x, y, z, t, a, b)
	return Float64(Float64(2.0 * x) + Float64(Float64(27.0 * b) * a))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (2.0 * x) + ((27.0 * b) * a);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(2.0 * x), $MachinePrecision] + N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
2 \cdot x + \left(27 \cdot b\right) \cdot a
Derivation
  1. Initial program 95.1%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Taylor expanded in y around 0

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

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

      \[\leadsto 2 \cdot x + \color{blue}{27} \cdot \left(a \cdot b\right) \]
    3. lower-*.f64N/A

      \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
    4. lower-*.f6464.3%

      \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
  4. Applied rewrites64.3%

    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
    2. lift-*.f64N/A

      \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
    3. *-commutativeN/A

      \[\leadsto 2 \cdot x + 27 \cdot \left(b \cdot \color{blue}{a}\right) \]
    4. associate-*r*N/A

      \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
    5. lower-*.f64N/A

      \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
    6. lower-*.f6464.2%

      \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot a \]
  6. Applied rewrites64.2%

    \[\leadsto 2 \cdot x + \left(27 \cdot b\right) \cdot \color{blue}{a} \]
  7. Add Preprocessing

Alternative 7: 64.2% accurate, 0.2× speedup?

\[\left(x + x\right) - \mathsf{max}\left(a, b\right) \cdot \left(\mathsf{min}\left(a, b\right) \cdot -27\right) \]
(FPCore (x y z t a b)
  :precision binary64
  (- (+ x x) (* (fmax a b) (* (fmin a b) -27.0))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0));
}
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)
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
    code = (x + x) - (fmax(a, b) * (fmin(a, b) * (-27.0d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0));
}
def code(x, y, z, t, a, b):
	return (x + x) - (fmax(a, b) * (fmin(a, b) * -27.0))
function code(x, y, z, t, a, b)
	return Float64(Float64(x + x) - Float64(fmax(a, b) * Float64(fmin(a, b) * -27.0)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + x) - (max(a, b) * (min(a, b) * -27.0));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + x), $MachinePrecision] - N[(N[Max[a, b], $MachinePrecision] * N[(N[Min[a, b], $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + x\right) - \mathsf{max}\left(a, b\right) \cdot \left(\mathsf{min}\left(a, b\right) \cdot -27\right)
Derivation
  1. Initial program 95.1%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Taylor expanded in y around 0

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

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

      \[\leadsto 2 \cdot x + \color{blue}{27} \cdot \left(a \cdot b\right) \]
    3. lower-*.f64N/A

      \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
    4. lower-*.f6464.3%

      \[\leadsto 2 \cdot x + 27 \cdot \left(a \cdot \color{blue}{b}\right) \]
  4. Applied rewrites64.3%

    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
  5. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto 2 \cdot x + \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    2. lift-*.f64N/A

      \[\leadsto 2 \cdot x + 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
    3. fp-cancel-sign-sub-invN/A

      \[\leadsto 2 \cdot x - \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(a \cdot b\right)} \]
    4. lift-*.f64N/A

      \[\leadsto 2 \cdot x - \color{blue}{\left(\mathsf{neg}\left(27\right)\right)} \cdot \left(a \cdot b\right) \]
    5. count-2-revN/A

      \[\leadsto \left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(27\right)\right)} \cdot \left(a \cdot b\right) \]
    6. lift-+.f64N/A

      \[\leadsto \left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(27\right)\right)} \cdot \left(a \cdot b\right) \]
    7. metadata-evalN/A

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

      \[\leadsto \left(x + x\right) - -27 \cdot \left(a \cdot \color{blue}{b}\right) \]
    9. associate-*l*N/A

      \[\leadsto \left(x + x\right) - \left(-27 \cdot a\right) \cdot \color{blue}{b} \]
    10. lift-*.f64N/A

      \[\leadsto \left(x + x\right) - \left(-27 \cdot a\right) \cdot b \]
    11. lift-*.f64N/A

      \[\leadsto \left(x + x\right) - \left(-27 \cdot a\right) \cdot \color{blue}{b} \]
    12. lift--.f6464.3%

      \[\leadsto \left(x + x\right) - \color{blue}{\left(-27 \cdot a\right) \cdot b} \]
    13. lift-*.f64N/A

      \[\leadsto \left(x + x\right) - \left(-27 \cdot a\right) \cdot \color{blue}{b} \]
    14. *-commutativeN/A

      \[\leadsto \left(x + x\right) - b \cdot \color{blue}{\left(-27 \cdot a\right)} \]
    15. lower-*.f6464.3%

      \[\leadsto \left(x + x\right) - b \cdot \color{blue}{\left(-27 \cdot a\right)} \]
    16. lift-*.f64N/A

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

      \[\leadsto \left(x + x\right) - b \cdot \left(a \cdot \color{blue}{-27}\right) \]
    18. lower-*.f6464.3%

      \[\leadsto \left(x + x\right) - b \cdot \left(a \cdot \color{blue}{-27}\right) \]
  6. Applied rewrites64.3%

    \[\leadsto \color{blue}{\left(x + x\right) - b \cdot \left(a \cdot -27\right)} \]
  7. Add Preprocessing

Alternative 8: 52.8% accurate, 0.1× speedup?

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

\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;-1 \cdot \left(-2 \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\mathsf{max}\left(a, b\right) \cdot \left(-27 \cdot \mathsf{min}\left(a, b\right)\right)\right)\\


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

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
      3. lower--.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
      5. lower-/.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      11. lower-*.f6482.2%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
    8. Applied rewrites82.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    9. Taylor expanded in a around inf

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

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

        \[\leadsto -1 \cdot \left(-27 \cdot \left(a \cdot b\right)\right) \]
    11. Applied rewrites35.4%

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

    if -4.9999999999999996e80 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 10

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
      3. lower--.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
      5. lower-/.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      11. lower-*.f6482.2%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
    8. Applied rewrites82.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    9. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \left(-2 \cdot \color{blue}{x}\right) \]
    10. Step-by-step derivation
      1. lower-*.f6430.8%

        \[\leadsto -1 \cdot \left(-2 \cdot x\right) \]
    11. Applied rewrites30.8%

      \[\leadsto -1 \cdot \left(-2 \cdot \color{blue}{x}\right) \]

    if 10 < (*.f64 (*.f64 a #s(literal 27 binary64)) b)

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
      3. lower--.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
      5. lower-/.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      11. lower-*.f6482.2%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
    8. Applied rewrites82.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto -1 \cdot \left(b \cdot \left(-27 \cdot \color{blue}{a}\right)\right) \]
    10. Step-by-step derivation
      1. lower-*.f6435.4%

        \[\leadsto -1 \cdot \left(b \cdot \left(-27 \cdot a\right)\right) \]
    11. Applied rewrites35.4%

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

Alternative 9: 52.8% accurate, 0.8× speedup?

\[\begin{array}{l} t_1 := \left(a \cdot 27\right) \cdot b\\ t_2 := -1 \cdot \left(-27 \cdot \left(a \cdot b\right)\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+80}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;-1 \cdot \left(-2 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a b)
  :precision binary64
  (let* ((t_1 (* (* a 27.0) b)) (t_2 (* -1.0 (* -27.0 (* a b)))))
  (if (<= t_1 -5e+80) t_2 (if (<= t_1 10.0) (* -1.0 (* -2.0 x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a * 27.0) * b;
	double t_2 = -1.0 * (-27.0 * (a * b));
	double tmp;
	if (t_1 <= -5e+80) {
		tmp = t_2;
	} else if (t_1 <= 10.0) {
		tmp = -1.0 * (-2.0 * x);
	} 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)
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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * 27.0d0) * b
    t_2 = (-1.0d0) * ((-27.0d0) * (a * b))
    if (t_1 <= (-5d+80)) then
        tmp = t_2
    else if (t_1 <= 10.0d0) then
        tmp = (-1.0d0) * ((-2.0d0) * x)
    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 t_1 = (a * 27.0) * b;
	double t_2 = -1.0 * (-27.0 * (a * b));
	double tmp;
	if (t_1 <= -5e+80) {
		tmp = t_2;
	} else if (t_1 <= 10.0) {
		tmp = -1.0 * (-2.0 * x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (a * 27.0) * b
	t_2 = -1.0 * (-27.0 * (a * b))
	tmp = 0
	if t_1 <= -5e+80:
		tmp = t_2
	elif t_1 <= 10.0:
		tmp = -1.0 * (-2.0 * x)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a * 27.0) * b)
	t_2 = Float64(-1.0 * Float64(-27.0 * Float64(a * b)))
	tmp = 0.0
	if (t_1 <= -5e+80)
		tmp = t_2;
	elseif (t_1 <= 10.0)
		tmp = Float64(-1.0 * Float64(-2.0 * x));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (a * 27.0) * b;
	t_2 = -1.0 * (-27.0 * (a * b));
	tmp = 0.0;
	if (t_1 <= -5e+80)
		tmp = t_2;
	elseif (t_1 <= 10.0)
		tmp = -1.0 * (-2.0 * x);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+80], t$95$2, If[LessEqual[t$95$1, 10.0], N[(-1.0 * N[(-2.0 * x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := -1 \cdot \left(-27 \cdot \left(a \cdot b\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+80}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;-1 \cdot \left(-2 \cdot x\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -4.9999999999999996e80 or 10 < (*.f64 (*.f64 a #s(literal 27 binary64)) b)

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
      3. lower--.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
      5. lower-/.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      11. lower-*.f6482.2%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
    8. Applied rewrites82.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    9. Taylor expanded in a around inf

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

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

        \[\leadsto -1 \cdot \left(-27 \cdot \left(a \cdot b\right)\right) \]
    11. Applied rewrites35.4%

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

    if -4.9999999999999996e80 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 10

    1. Initial program 95.1%

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. lift--.f64N/A

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-+r-N/A

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      8. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      9. lower--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      10. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      11. *-commutativeN/A

        \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      12. count-2-revN/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      13. lower-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      17. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
      19. metadata-eval95.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      21. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      22. lower-*.f6495.1%

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
      24. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
      25. lower-*.f6495.1%

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
    3. Applied rewrites95.1%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
      7. associate-*l*N/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
      8. *-commutativeN/A

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

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
      11. associate-*r*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
      13. *-commutativeN/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
      15. associate-*l*N/A

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

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
      17. *-commutativeN/A

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
      18. lower-*.f6494.5%

        \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    5. Applied rewrites94.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
      3. lower--.f64N/A

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

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
      5. lower-/.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
      11. lower-*.f6482.2%

        \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
    8. Applied rewrites82.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
    9. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \left(-2 \cdot \color{blue}{x}\right) \]
    10. Step-by-step derivation
      1. lower-*.f6430.8%

        \[\leadsto -1 \cdot \left(-2 \cdot x\right) \]
    11. Applied rewrites30.8%

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

Alternative 10: 30.8% accurate, 3.4× speedup?

\[-1 \cdot \left(-2 \cdot x\right) \]
(FPCore (x y z t a b)
  :precision binary64
  (* -1.0 (* -2.0 x)))
double code(double x, double y, double z, double t, double a, double b) {
	return -1.0 * (-2.0 * x);
}
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)
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
    code = (-1.0d0) * ((-2.0d0) * x)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return -1.0 * (-2.0 * x);
}
def code(x, y, z, t, a, b):
	return -1.0 * (-2.0 * x)
function code(x, y, z, t, a, b)
	return Float64(-1.0 * Float64(-2.0 * x))
end
function tmp = code(x, y, z, t, a, b)
	tmp = -1.0 * (-2.0 * x);
end
code[x_, y_, z_, t_, a_, b_] := N[(-1.0 * N[(-2.0 * x), $MachinePrecision]), $MachinePrecision]
-1 \cdot \left(-2 \cdot x\right)
Derivation
  1. Initial program 95.1%

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

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

      \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    3. lift--.f64N/A

      \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    4. associate-+r-N/A

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

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

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

      \[\leadsto \left(x \cdot 2 + \color{blue}{\left(a \cdot 27\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    8. fp-cancel-sign-sub-invN/A

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    9. lower--.f64N/A

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right)} - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    10. lift-*.f64N/A

      \[\leadsto \left(\color{blue}{x \cdot 2} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    11. *-commutativeN/A

      \[\leadsto \left(\color{blue}{2 \cdot x} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    12. count-2-revN/A

      \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    13. lower-+.f64N/A

      \[\leadsto \left(\color{blue}{\left(x + x\right)} - \left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    14. lower-*.f64N/A

      \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\mathsf{neg}\left(a \cdot 27\right)\right) \cdot b}\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    15. lift-*.f64N/A

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

      \[\leadsto \left(\left(x + x\right) - \left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right)\right) \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    17. distribute-lft-neg-inN/A

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

      \[\leadsto \left(\left(x + x\right) - \color{blue}{\left(\left(\mathsf{neg}\left(27\right)\right) \cdot a\right)} \cdot b\right) - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t \]
    19. metadata-eval95.1%

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
    21. *-commutativeN/A

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
    22. lower-*.f6495.1%

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \]
    24. *-commutativeN/A

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \color{blue}{\left(z \cdot \left(y \cdot 9\right)\right)} \]
    25. lower-*.f6495.1%

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

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - t \cdot \left(z \cdot \color{blue}{\left(9 \cdot y\right)}\right) \]
  3. Applied rewrites95.1%

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

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

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

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

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

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot 9\right)} \cdot y\right) \cdot t \]
    7. associate-*l*N/A

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(z \cdot 9\right) \cdot \left(y \cdot t\right)} \]
    8. *-commutativeN/A

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

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(z \cdot 9\right) \cdot \color{blue}{\left(t \cdot y\right)} \]
    11. associate-*r*N/A

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot 9\right) \cdot t\right) \cdot y} \]
    13. *-commutativeN/A

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right) \cdot y \]
    15. associate-*l*N/A

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

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(t \cdot z\right) \cdot 9\right)} \cdot y \]
    17. *-commutativeN/A

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
    18. lower-*.f6494.5%

      \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \left(\color{blue}{\left(z \cdot t\right)} \cdot 9\right) \cdot y \]
  5. Applied rewrites94.5%

    \[\leadsto \left(\left(x + x\right) - \left(-27 \cdot a\right) \cdot b\right) - \color{blue}{\left(\left(z \cdot t\right) \cdot 9\right) \cdot y} \]
  6. Taylor expanded in b around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

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

      \[\leadsto -1 \cdot \left(b \cdot \color{blue}{\left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)}\right) \]
    3. lower--.f64N/A

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

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - \color{blue}{27} \cdot a\right)\right) \]
    5. lower-/.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    6. lower--.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    7. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    8. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    9. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    10. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right) \]
    11. lower-*.f6482.2%

      \[\leadsto -1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot \color{blue}{a}\right)\right) \]
  8. Applied rewrites82.2%

    \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)}{b} - 27 \cdot a\right)\right)} \]
  9. Taylor expanded in x around inf

    \[\leadsto -1 \cdot \left(-2 \cdot \color{blue}{x}\right) \]
  10. Step-by-step derivation
    1. lower-*.f6430.8%

      \[\leadsto -1 \cdot \left(-2 \cdot x\right) \]
  11. Applied rewrites30.8%

    \[\leadsto -1 \cdot \left(-2 \cdot \color{blue}{x}\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2025258 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64
  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))