Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A

Percentage Accurate: 90.1% → 91.0%
Time: 12.9s
Alternatives: 21
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}

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

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}

Alternative 1: 91.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(a + b \cdot c\right) \cdot c \leq 10^{+267}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* (+ a (* b c)) c) 1e+267)
   (* 2.0 (fma i (- (* (* (- b) c) c) (* c a)) (fma t z (* y x))))
   (* (* -2.0 (* (* c (+ (/ a b) c)) i)) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((a + (b * c)) * c) <= 1e+267) {
		tmp = 2.0 * fma(i, (((-b * c) * c) - (c * a)), fma(t, z, (y * x)));
	} else {
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(Float64(a + Float64(b * c)) * c) <= 1e+267)
		tmp = Float64(2.0 * fma(i, Float64(Float64(Float64(Float64(-b) * c) * c) - Float64(c * a)), fma(t, z, Float64(y * x))));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64(c * Float64(Float64(a / b) + c)) * i)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], 1e+267], N[(2.0 * N[(i * N[(N[(N[((-b) * c), $MachinePrecision] * c), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(c * N[(N[(a / b), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(a + b \cdot c\right) \cdot c \leq 10^{+267}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\


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

    1. Initial program 93.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites91.8%

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

    if 9.9999999999999997e266 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 75.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites66.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    4. Applied rewrites40.5%

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites87.0%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in b around inf

      \[\leadsto b \cdot \color{blue}{\left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
    10. Applied rewrites81.0%

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

Alternative 2: 90.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + b \cdot c\right) \cdot c\\ \mathbf{if}\;t\_1 \leq 10^{+267}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ a (* b c)) c)))
   (if (<= t_1 1e+267)
     (* 2.0 (- (+ (* x y) (* z t)) (* t_1 i)))
     (* (* -2.0 (* (* c (+ (/ a b) c)) i)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a + (b * c)) * c;
	double tmp;
	if (t_1 <= 1e+267) {
		tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * i));
	} else {
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * 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, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a + (b * c)) * c
    if (t_1 <= 1d+267) then
        tmp = 2.0d0 * (((x * y) + (z * t)) - (t_1 * i))
    else
        tmp = ((-2.0d0) * ((c * ((a / b) + c)) * i)) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a + (b * c)) * c;
	double tmp;
	if (t_1 <= 1e+267) {
		tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * i));
	} else {
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a + (b * c)) * c
	tmp = 0
	if t_1 <= 1e+267:
		tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * i))
	else:
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * b
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a + Float64(b * c)) * c)
	tmp = 0.0
	if (t_1 <= 1e+267)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_1 * i)));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64(c * Float64(Float64(a / b) + c)) * i)) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a + (b * c)) * c;
	tmp = 0.0;
	if (t_1 <= 1e+267)
		tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * i));
	else
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+267], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(c * N[(N[(a / b), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_1 \leq 10^{+267}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1 \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\


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

    1. Initial program 93.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]

    if 9.9999999999999997e266 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 75.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites66.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    4. Applied rewrites40.5%

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites87.0%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in b around inf

      \[\leadsto b \cdot \color{blue}{\left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
    10. Applied rewrites81.0%

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

Alternative 3: 88.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\ \;\;\;\;\left(-2 \cdot t\_1\right) \cdot c\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+243}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x - t\_1 \cdot c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (fma c b a) i)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+229)
     (* (* -2.0 t_1) c)
     (if (<= t_2 2e+243)
       (* 2.0 (- (fma x y (* z t)) (* (* a c) i)))
       (* 2.0 (- (* y x) (* t_1 c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = fma(c, b, a) * i;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+229) {
		tmp = (-2.0 * t_1) * c;
	} else if (t_2 <= 2e+243) {
		tmp = 2.0 * (fma(x, y, (z * t)) - ((a * c) * i));
	} else {
		tmp = 2.0 * ((y * x) - (t_1 * c));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(fma(c, b, a) * i)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+229)
		tmp = Float64(Float64(-2.0 * t_1) * c);
	elseif (t_2 <= 2e+243)
		tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a * c) * i)));
	else
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(t_1 * c)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+229], N[(N[(-2.0 * t$95$1), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$2, 2e+243], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(-2 \cdot t\_1\right) \cdot c\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+243}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1 \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6485.6

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e243

    1. Initial program 99.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites99.3%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    4. Applied rewrites91.4%

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

    if 2.0000000000000001e243 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 79.0%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6485.0

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
    4. Applied rewrites85.0%

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

Alternative 4: 88.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\ \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -5e+229)
     (* (* -2.0 (* (fma c b a) i)) c)
     (if (<= t_1 4e+303)
       (* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
       (* (* -2.0 (* (* c (+ (/ a b) c)) i)) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -5e+229) {
		tmp = (-2.0 * (fma(c, b, a) * i)) * c;
	} else if (t_1 <= 4e+303) {
		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
	} else {
		tmp = (-2.0 * ((c * ((a / b) + c)) * i)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -5e+229)
		tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c);
	elseif (t_1 <= 4e+303)
		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a)));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64(c * Float64(Float64(a / b) + c)) * i)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+229], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 4e+303], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(c * N[(N[(a / b), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left(\left(c \cdot \left(\frac{a}{b} + c\right)\right) \cdot i\right)\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6485.6

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(\left(t \cdot z + x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

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

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y + \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(c \cdot i\right)}\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y + \left(\mathsf{neg}\left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y + -1 \cdot \color{blue}{\left(a \cdot \left(c \cdot i\right)\right)}\right)\right) \]
      5. associate-+l+N/A

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

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

        \[\leadsto 2 \cdot \left(\left(t \cdot z + x \cdot y\right) + \color{blue}{-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)}\right) \]
      8. associate-+l+N/A

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

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y + \left(\mathsf{neg}\left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right) \]
      10. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y + \left(\mathsf{neg}\left(a\right)\right) \cdot \color{blue}{\left(c \cdot i\right)}\right)\right) \]
      11. cancel-sign-sub-invN/A

        \[\leadsto 2 \cdot \left(t \cdot z + \left(x \cdot y - \color{blue}{a \cdot \left(c \cdot i\right)}\right)\right) \]
      12. associate--l+N/A

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

        \[\leadsto 2 \cdot \left(\left(t \cdot z + x \cdot y\right) - \color{blue}{a \cdot \left(c \cdot i\right)}\right) \]
    4. Applied rewrites89.8%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites70.5%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    4. Applied rewrites45.4%

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites89.0%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in b around inf

      \[\leadsto b \cdot \color{blue}{\left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left({c}^{2} \cdot i\right) + -2 \cdot \frac{a \cdot \left(c \cdot i\right)}{b}\right) \cdot b \]
    10. Applied rewrites85.6%

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

Alternative 5: 82.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-17}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* y x) (* (* (fma c b a) i) c))))
        (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -1e+74) t_1 (if (<= t_2 5e-17) (* 2.0 (fma t z (* y x))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -1e+74) {
		tmp = t_1;
	} else if (t_2 <= 5e-17) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c)))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -1e+74)
		tmp = t_1;
	elseif (t_2 <= 5e-17)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+74], t$95$1, If[LessEqual[t$95$2, 5e-17], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-17}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999952e73 or 4.9999999999999999e-17 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 84.3%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6478.0

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
    4. Applied rewrites78.0%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)} \]

    if -9.99999999999999952e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999999e-17

    1. Initial program 99.0%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6490.4

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites90.4%

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

Alternative 6: 81.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ t_3 := 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+74}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-17}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+289}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* -2.0 (* (fma c b a) i)) c))
        (t_2 (* (* (+ a (* b c)) c) i))
        (t_3 (* 2.0 (- (* y x) (* (* a c) i)))))
   (if (<= t_2 -5e+229)
     t_1
     (if (<= t_2 -1e+74)
       t_3
       (if (<= t_2 5e-17)
         (* 2.0 (fma t z (* y x)))
         (if (<= t_2 2e+289) t_3 t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (-2.0 * (fma(c, b, a) * i)) * c;
	double t_2 = ((a + (b * c)) * c) * i;
	double t_3 = 2.0 * ((y * x) - ((a * c) * i));
	double tmp;
	if (t_2 <= -5e+229) {
		tmp = t_1;
	} else if (t_2 <= -1e+74) {
		tmp = t_3;
	} else if (t_2 <= 5e-17) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else if (t_2 <= 2e+289) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	t_3 = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(a * c) * i)))
	tmp = 0.0
	if (t_2 <= -5e+229)
		tmp = t_1;
	elseif (t_2 <= -1e+74)
		tmp = t_3;
	elseif (t_2 <= 5e-17)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	elseif (t_2 <= 2e+289)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+229], t$95$1, If[LessEqual[t$95$2, -1e+74], t$95$3, If[LessEqual[t$95$2, 5e-17], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+289], t$95$3, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
t_3 := 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+74}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-17}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+289}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229 or 2.0000000000000001e289 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 77.0%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6486.6

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites86.6%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999952e73 or 4.9999999999999999e-17 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e289

    1. Initial program 99.2%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6461.0

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
    4. Applied rewrites61.0%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)} \]
    5. Taylor expanded in a around inf

      \[\leadsto 2 \cdot \left(y \cdot x - a \cdot \color{blue}{\left(c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto 2 \cdot \left(y \cdot x - 1 \cdot \left(a \cdot \color{blue}{\left(c \cdot i\right)}\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot \left(\color{blue}{c} \cdot i\right)\right)\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(a \cdot c\right) \cdot i\right)\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot c\right)\right) \cdot i\right)\right)\right) \]
      7. mul-1-negN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot c\right)\right) \cdot i\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot c\right)\right)\right) \cdot i\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot c\right)\right)\right) \cdot i\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(a \cdot c\right) \cdot -1\right)\right) \cdot i\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a \cdot c\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot i\right) \]
      12. metadata-evalN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a \cdot c\right) \cdot 1\right) \cdot i\right) \]
      13. *-rgt-identityN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right) \]
      14. lower-*.f6454.1

        \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right) \]
    7. Applied rewrites54.1%

      \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot \color{blue}{i}\right) \]

    if -9.99999999999999952e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999999e-17

    1. Initial program 99.0%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6490.4

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites90.4%

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

Alternative 7: 81.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\ \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+74}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+110}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(-i\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -5e+229)
     (* (* -2.0 (* (fma c b a) i)) c)
     (if (<= t_1 -1e+74)
       (* 2.0 (- (* y x) (* (* a c) i)))
       (if (<= t_1 5e+110)
         (* 2.0 (fma t z (* y x)))
         (* 2.0 (* (- i) (* (fma c b a) c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -5e+229) {
		tmp = (-2.0 * (fma(c, b, a) * i)) * c;
	} else if (t_1 <= -1e+74) {
		tmp = 2.0 * ((y * x) - ((a * c) * i));
	} else if (t_1 <= 5e+110) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = 2.0 * (-i * (fma(c, b, a) * c));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -5e+229)
		tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c);
	elseif (t_1 <= -1e+74)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(a * c) * i)));
	elseif (t_1 <= 5e+110)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(2.0 * Float64(Float64(-i) * Float64(fma(c, b, a) * c)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+229], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, -1e+74], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+110], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\

\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+110}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(-i\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6485.6

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999952e73

    1. Initial program 99.2%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6461.7

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
    4. Applied rewrites61.7%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)} \]
    5. Taylor expanded in a around inf

      \[\leadsto 2 \cdot \left(y \cdot x - a \cdot \color{blue}{\left(c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto 2 \cdot \left(y \cdot x - 1 \cdot \left(a \cdot \color{blue}{\left(c \cdot i\right)}\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot \left(\color{blue}{c} \cdot i\right)\right)\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot \left(c \cdot i\right)\right)\right)\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(a \cdot c\right) \cdot i\right)\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot c\right)\right) \cdot i\right)\right)\right) \]
      7. mul-1-negN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot c\right)\right) \cdot i\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot c\right)\right)\right) \cdot i\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(-1 \cdot \left(a \cdot c\right)\right)\right) \cdot i\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{neg}\left(\left(a \cdot c\right) \cdot -1\right)\right) \cdot i\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a \cdot c\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot i\right) \]
      12. metadata-evalN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a \cdot c\right) \cdot 1\right) \cdot i\right) \]
      13. *-rgt-identityN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right) \]
      14. lower-*.f6452.0

        \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot i\right) \]
    7. Applied rewrites52.0%

      \[\leadsto 2 \cdot \left(y \cdot x - \left(a \cdot c\right) \cdot \color{blue}{i}\right) \]

    if -9.99999999999999952e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999978e110

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6487.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites87.6%

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

    if 4.99999999999999978e110 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 83.0%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 2 \cdot \left(\mathsf{neg}\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right) \]
      2. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \color{blue}{\left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      3. mul-1-negN/A

        \[\leadsto 2 \cdot \left(\left(-1 \cdot c\right) \cdot \left(\color{blue}{i} \cdot \left(a + b \cdot c\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(-1 \cdot c\right) \cdot \left(\left(a + b \cdot c\right) \cdot \color{blue}{i}\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(\left(\left(-1 \cdot c\right) \cdot \left(a + b \cdot c\right)\right) \cdot \color{blue}{i}\right) \]
      6. associate-*r*N/A

        \[\leadsto 2 \cdot \left(\left(-1 \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right) \cdot i\right) \]
      7. mul-1-negN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(c \cdot \left(a + b \cdot c\right)\right)\right) \cdot i\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\left(a + b \cdot c\right) \cdot c\right)\right) \cdot i\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(\mathsf{neg}\left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\mathsf{neg}\left(i \cdot \left(\left(a + b \cdot c\right) \cdot c\right)\right)\right) \]
      11. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)}\right) \]
      12. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(i\right)\right) \cdot \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)}\right) \]
      13. lower-neg.f64N/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right)\right) \]
      14. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(a + b \cdot c\right) \cdot c\right)\right) \]
      15. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(a + b \cdot c\right) \cdot c\right)\right) \]
      16. lift-*.f6476.6

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

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(a + b \cdot c\right) \cdot c\right)\right) \]
      18. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(a + b \cdot c\right) \cdot c\right)\right) \]
      19. +-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(b \cdot c + a\right) \cdot c\right)\right) \]
      20. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\right) \]
      21. lower-fma.f6476.6

        \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)\right) \]
    4. Applied rewrites76.6%

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

Alternative 8: 79.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+205}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+74}:\\ \;\;\;\;2 \cdot \left(t \cdot z - \left(a \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-9}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* -2.0 (* (fma c b a) i)) c)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -1e+205)
     t_1
     (if (<= t_2 -1e+74)
       (* 2.0 (- (* t z) (* (* a c) i)))
       (if (<= t_2 5e-9) (* 2.0 (fma t z (* y x))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (-2.0 * (fma(c, b, a) * i)) * c;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -1e+205) {
		tmp = t_1;
	} else if (t_2 <= -1e+74) {
		tmp = 2.0 * ((t * z) - ((a * c) * i));
	} else if (t_2 <= 5e-9) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -1e+205)
		tmp = t_1;
	elseif (t_2 <= -1e+74)
		tmp = Float64(2.0 * Float64(Float64(t * z) - Float64(Float64(a * c) * i)));
	elseif (t_2 <= 5e-9)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+205], t$95$1, If[LessEqual[t$95$2, -1e+74], N[(2.0 * N[(N[(t * z), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-9], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \left(t \cdot z - \left(a \cdot c\right) \cdot i\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000002e205 or 5.0000000000000001e-9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.6%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6474.6

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites74.6%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -1.00000000000000002e205 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999952e73

    1. Initial program 99.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites99.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    4. Applied rewrites76.8%

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

      \[\leadsto 2 \cdot \left(t \cdot z - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]
    6. Step-by-step derivation
      1. lower-*.f6455.0

        \[\leadsto 2 \cdot \left(t \cdot z - \left(a \cdot \color{blue}{c}\right) \cdot i\right) \]
    7. Applied rewrites55.0%

      \[\leadsto 2 \cdot \left(t \cdot z - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]

    if -9.99999999999999952e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e-9

    1. Initial program 99.0%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6490.3

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites90.3%

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

Alternative 9: 79.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+179}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-9}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* -2.0 (* (fma c b a) i)) c)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+179) t_1 (if (<= t_2 5e-9) (* 2.0 (fma t z (* y x))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (-2.0 * (fma(c, b, a) * i)) * c;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+179) {
		tmp = t_1;
	} else if (t_2 <= 5e-9) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+179)
		tmp = t_1;
	elseif (t_2 <= 5e-9)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+179], t$95$1, If[LessEqual[t$95$2, 5e-9], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e179 or 5.0000000000000001e-9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.9%

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

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      3. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      4. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      5. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot c \]
      13. +-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \cdot c \]
      14. *-commutativeN/A

        \[\leadsto \left(-2 \cdot \left(\left(c \cdot b + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6474.2

        \[\leadsto \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c \]
    4. Applied rewrites74.2%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]

    if -5e179 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e-9

    1. Initial program 99.0%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6486.3

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites86.3%

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

Alternative 10: 74.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(\left(\left(\left(-i\right) \cdot b\right) \cdot c\right) \cdot c\right) \cdot 2\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto 2 \cdot \left(\left(-1 \cdot b\right) \cdot \color{blue}{\left({c}^{2} \cdot i\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\color{blue}{{c}^{2}} \cdot i\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(i \cdot \color{blue}{{c}^{2}}\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto 2 \cdot \left(\left(\left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot \color{blue}{{c}^{2}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot \color{blue}{{c}^{2}}\right) \]
      6. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(b \cdot i\right)\right) \cdot {\color{blue}{c}}^{2}\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(i \cdot b\right)\right) \cdot {c}^{2}\right) \]
      8. distribute-lft-neg-outN/A

        \[\leadsto 2 \cdot \left(\left(\left(\mathsf{neg}\left(i\right)\right) \cdot b\right) \cdot {\color{blue}{c}}^{2}\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\left(\mathsf{neg}\left(i\right)\right) \cdot b\right) \cdot {\color{blue}{c}}^{2}\right) \]
      10. lower-neg.f64N/A

        \[\leadsto 2 \cdot \left(\left(\left(-i\right) \cdot b\right) \cdot {c}^{2}\right) \]
      11. unpow2N/A

        \[\leadsto 2 \cdot \left(\left(\left(-i\right) \cdot b\right) \cdot \left(c \cdot \color{blue}{c}\right)\right) \]
      12. lower-*.f6464.9

        \[\leadsto 2 \cdot \left(\left(\left(-i\right) \cdot b\right) \cdot \left(c \cdot \color{blue}{c}\right)\right) \]
    4. Applied rewrites64.9%

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

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left(-i\right) \cdot b\right) \cdot \left(c \cdot c\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\left(-i\right) \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot 2} \]
      3. lower-*.f6464.9

        \[\leadsto \color{blue}{\left(\left(\left(-i\right) \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot 2} \]
    6. Applied rewrites66.4%

      \[\leadsto \color{blue}{\left(\left(\left(\left(-i\right) \cdot b\right) \cdot c\right) \cdot c\right) \cdot 2} \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

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

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \color{blue}{\left({c}^{2} \cdot i\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(i \cdot \color{blue}{{c}^{2}}\right) \]
      3. unpow2N/A

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

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(\left(i \cdot c\right) \cdot \color{blue}{c}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(\left(c \cdot i\right) \cdot c\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(\left(-2 \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{c} \]
      7. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(\left(\left(c \cdot i\right) \cdot b\right) \cdot -2\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot i\right) \cdot b\right) \cdot -2\right) \cdot c \]
      13. *-commutativeN/A

        \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
      14. lower-*.f6471.5

        \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
    4. Applied rewrites71.5%

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

Alternative 11: 74.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites69.7%

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in a around 0

      \[\leadsto \left(\left(i \cdot \left(b \cdot c\right)\right) \cdot -2\right) \cdot c \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
      2. lower-*.f6466.0

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
    10. Applied rewrites66.0%

      \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

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

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \color{blue}{\left({c}^{2} \cdot i\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(i \cdot \color{blue}{{c}^{2}}\right) \]
      3. unpow2N/A

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

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(\left(i \cdot c\right) \cdot \color{blue}{c}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(-2 \cdot b\right) \cdot \left(\left(c \cdot i\right) \cdot c\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(\left(-2 \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{c} \]
      7. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right) \cdot c \]
      11. *-commutativeN/A

        \[\leadsto \left(\left(\left(c \cdot i\right) \cdot b\right) \cdot -2\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot i\right) \cdot b\right) \cdot -2\right) \cdot c \]
      13. *-commutativeN/A

        \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
      14. lower-*.f6471.5

        \[\leadsto \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c \]
    4. Applied rewrites71.5%

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

Alternative 12: 74.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites69.7%

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in a around 0

      \[\leadsto \left(\left(i \cdot \left(b \cdot c\right)\right) \cdot -2\right) \cdot c \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
      2. lower-*.f6466.0

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
    10. Applied rewrites66.0%

      \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites70.5%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. Applied rewrites71.1%

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

Alternative 13: 73.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites69.7%

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot c\right) \cdot i\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot \color{blue}{c} \]
      5. distribute-rgt-inN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
      6. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      7. distribute-lft-outN/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
      8. lower-*.f64N/A

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot \color{blue}{c} \]
    7. Applied rewrites85.6%

      \[\leadsto \color{blue}{\left(\left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot -2\right) \cdot c} \]
    8. Taylor expanded in a around 0

      \[\leadsto \left(\left(i \cdot \left(b \cdot c\right)\right) \cdot -2\right) \cdot c \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
      2. lower-*.f6466.0

        \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]
    10. Applied rewrites66.0%

      \[\leadsto \left(\left(i \cdot \left(c \cdot b\right)\right) \cdot -2\right) \cdot c \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites70.5%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. Applied rewrites71.1%

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

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      4. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(\left(c \cdot c\right) \cdot i\right)\right) \cdot -2 \]
      5. pow2N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(i \cdot {c}^{2}\right)\right) \cdot -2 \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot i\right) \cdot {c}^{2}\right) \cdot -2 \]
      8. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot i\right) \cdot {c}^{2}\right) \cdot -2 \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot {c}^{2}\right) \cdot -2 \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot {c}^{2}\right) \cdot -2 \]
      11. pow2N/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
      12. lift-*.f6469.7

        \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
    6. Applied rewrites69.7%

      \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 73.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;\left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229

    1. Initial program 76.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites69.7%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. Applied rewrites67.2%

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

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      4. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(\left(c \cdot c\right) \cdot i\right)\right) \cdot -2 \]
      5. associate-*l*N/A

        \[\leadsto \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      8. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      9. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]
      11. lower-*.f6467.0

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]
    6. Applied rewrites67.0%

      \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

    if 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites70.5%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. Applied rewrites71.1%

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

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      4. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(\left(c \cdot c\right) \cdot i\right)\right) \cdot -2 \]
      5. pow2N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(i \cdot {c}^{2}\right)\right) \cdot -2 \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot i\right) \cdot {c}^{2}\right) \cdot -2 \]
      8. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot i\right) \cdot {c}^{2}\right) \cdot -2 \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot {c}^{2}\right) \cdot -2 \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot {c}^{2}\right) \cdot -2 \]
      11. pow2N/A

        \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
      12. lift-*.f6469.7

        \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
    6. Applied rewrites69.7%

      \[\leadsto \left(\left(i \cdot b\right) \cdot \left(c \cdot c\right)\right) \cdot -2 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 73.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (* c b) (* i c)) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+229)
     t_1
     (if (<= t_2 4e+303) (* 2.0 (fma t z (* y x))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((c * b) * (i * c)) * -2.0;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+229) {
		tmp = t_1;
	} else if (t_2 <= 4e+303) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(c * b) * Float64(i * c)) * -2.0)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+229)
		tmp = t_1;
	elseif (t_2 <= 4e+303)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+229], t$95$1, If[LessEqual[t$95$2, 4e+303], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000005e229 or 4e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Applied rewrites70.1%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(i, \left(\left(-b\right) \cdot c\right) \cdot c - c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    4. Applied rewrites69.1%

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

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      4. *-commutativeN/A

        \[\leadsto \left(b \cdot \left(\left(c \cdot c\right) \cdot i\right)\right) \cdot -2 \]
      5. associate-*l*N/A

        \[\leadsto \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      8. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      9. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]
      11. lower-*.f6468.6

        \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]
    6. Applied rewrites68.6%

      \[\leadsto \left(\left(c \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot -2 \]

    if -5.0000000000000005e229 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4e303

    1. Initial program 99.1%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6477.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites77.6%

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

Alternative 16: 62.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+158}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -2e+217)
     t_1
     (if (<= t_2 1e+158) (* 2.0 (fma t z (* y x))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((i * c) * a) * -2.0;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -2e+217) {
		tmp = t_1;
	} else if (t_2 <= 1e+158) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(i * c) * a) * -2.0)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -2e+217)
		tmp = t_1;
	elseif (t_2 <= 1e+158)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+217], t$95$1, If[LessEqual[t$95$2, 1e+158], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+217}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+158}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e217 or 9.99999999999999953e157 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 79.7%

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

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6440.3

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites40.3%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]

    if -1.99999999999999992e217 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999953e157

    1. Initial program 99.0%

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      3. lower-*.f6482.3

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites82.3%

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

Alternative 17: 44.5% accurate, 0.7× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + z) * t
    if ((z * t) <= (-1d+87)) then
        tmp = t_1
    else if ((z * t) <= (-2d-74)) then
        tmp = ((i * c) * a) * (-2.0d0)
    else if ((z * t) <= 2d-51) then
        tmp = (x + x) * y
    else if ((z * t) <= 2d+27) then
        tmp = ((a * c) * i) * (-2.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (z + z) * t;
	double tmp;
	if ((z * t) <= -1e+87) {
		tmp = t_1;
	} else if ((z * t) <= -2e-74) {
		tmp = ((i * c) * a) * -2.0;
	} else if ((z * t) <= 2e-51) {
		tmp = (x + x) * y;
	} else if ((z * t) <= 2e+27) {
		tmp = ((a * c) * i) * -2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (z + z) * t
	tmp = 0
	if (z * t) <= -1e+87:
		tmp = t_1
	elif (z * t) <= -2e-74:
		tmp = ((i * c) * a) * -2.0
	elif (z * t) <= 2e-51:
		tmp = (x + x) * y
	elif (z * t) <= 2e+27:
		tmp = ((a * c) * i) * -2.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(z + z) * t)
	tmp = 0.0
	if (Float64(z * t) <= -1e+87)
		tmp = t_1;
	elseif (Float64(z * t) <= -2e-74)
		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
	elseif (Float64(z * t) <= 2e-51)
		tmp = Float64(Float64(x + x) * y);
	elseif (Float64(z * t) <= 2e+27)
		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (z + z) * t;
	tmp = 0.0;
	if ((z * t) <= -1e+87)
		tmp = t_1;
	elseif ((z * t) <= -2e-74)
		tmp = ((i * c) * a) * -2.0;
	elseif ((z * t) <= 2e-51)
		tmp = (x + x) * y;
	elseif ((z * t) <= 2e+27)
		tmp = ((a * c) * i) * -2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+87], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -2e-74], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-51], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+27], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z + z\right) \cdot t\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-74}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\left(x + x\right) \cdot y\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 z t) < -9.9999999999999996e86 or 2e27 < (*.f64 z t)

    1. Initial program 87.2%

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 2 \cdot \left(z \cdot \color{blue}{t}\right) \]
      2. associate-*l*N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      4. count-2-revN/A

        \[\leadsto \left(z + z\right) \cdot t \]
      5. lower-+.f6455.6

        \[\leadsto \left(z + z\right) \cdot t \]
    4. Applied rewrites55.6%

      \[\leadsto \color{blue}{\left(z + z\right) \cdot t} \]

    if -9.9999999999999996e86 < (*.f64 z t) < -1.99999999999999992e-74

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6427.0

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites27.0%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]

    if -1.99999999999999992e-74 < (*.f64 z t) < 2e-51

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6440.1

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites40.1%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]

    if 2e-51 < (*.f64 z t) < 2e27

    1. Initial program 91.5%

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

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6432.2

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites32.2%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]
    5. Applied rewrites29.1%

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

Alternative 18: 44.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + x\right) \cdot y\\ \mathbf{if}\;x \cdot y \leq -5000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-57}:\\ \;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 0.02:\\ \;\;\;\;\left(z + z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ x x) y)))
   (if (<= (* x y) -5000000.0)
     t_1
     (if (<= (* x y) -5e-57)
       (* (* (* i a) c) -2.0)
       (if (<= (* x y) 0.02) (* (+ z z) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + x) * y;
	double tmp;
	if ((x * y) <= -5000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -5e-57) {
		tmp = ((i * a) * c) * -2.0;
	} else if ((x * y) <= 0.02) {
		tmp = (z + z) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x + x) * y
    if ((x * y) <= (-5000000.0d0)) then
        tmp = t_1
    else if ((x * y) <= (-5d-57)) then
        tmp = ((i * a) * c) * (-2.0d0)
    else if ((x * y) <= 0.02d0) then
        tmp = (z + z) * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + x) * y;
	double tmp;
	if ((x * y) <= -5000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -5e-57) {
		tmp = ((i * a) * c) * -2.0;
	} else if ((x * y) <= 0.02) {
		tmp = (z + z) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + x) * y
	tmp = 0
	if (x * y) <= -5000000.0:
		tmp = t_1
	elif (x * y) <= -5e-57:
		tmp = ((i * a) * c) * -2.0
	elif (x * y) <= 0.02:
		tmp = (z + z) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + x) * y)
	tmp = 0.0
	if (Float64(x * y) <= -5000000.0)
		tmp = t_1;
	elseif (Float64(x * y) <= -5e-57)
		tmp = Float64(Float64(Float64(i * a) * c) * -2.0);
	elseif (Float64(x * y) <= 0.02)
		tmp = Float64(Float64(z + z) * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + x) * y;
	tmp = 0.0;
	if ((x * y) <= -5000000.0)
		tmp = t_1;
	elseif ((x * y) <= -5e-57)
		tmp = ((i * a) * c) * -2.0;
	elseif ((x * y) <= 0.02)
		tmp = (z + z) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-57], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.02], N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \cdot y \leq -5000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-57}:\\
\;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\

\mathbf{elif}\;x \cdot y \leq 0.02:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5e6 or 0.0200000000000000004 < (*.f64 x y)

    1. Initial program 88.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6450.7

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites50.7%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]

    if -5e6 < (*.f64 x y) < -5.0000000000000002e-57

    1. Initial program 93.5%

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

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6426.1

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites26.1%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]
    5. Applied rewrites24.5%

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

        \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot -2 \]
      4. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(i \cdot c\right)\right) \cdot -2 \]
      5. associate-*r*N/A

        \[\leadsto \left(\left(a \cdot i\right) \cdot c\right) \cdot -2 \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(a \cdot i\right) \cdot c\right) \cdot -2 \]
      7. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot a\right) \cdot c\right) \cdot -2 \]
      8. lower-*.f6423.2

        \[\leadsto \left(\left(i \cdot a\right) \cdot c\right) \cdot -2 \]
    7. Applied rewrites23.2%

      \[\leadsto \left(\left(i \cdot a\right) \cdot c\right) \cdot -2 \]

    if -5.0000000000000002e-57 < (*.f64 x y) < 0.0200000000000000004

    1. Initial program 91.8%

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 2 \cdot \left(z \cdot \color{blue}{t}\right) \]
      2. associate-*l*N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      4. count-2-revN/A

        \[\leadsto \left(z + z\right) \cdot t \]
      5. lower-+.f6438.0

        \[\leadsto \left(z + z\right) \cdot t \]
    4. Applied rewrites38.0%

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

Alternative 19: 43.4% accurate, 0.9× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + z) * t
    if ((z * t) <= (-2d+128)) then
        tmp = t_1
    else if ((z * t) <= 2d-51) then
        tmp = (x + x) * y
    else if ((z * t) <= 2d+27) then
        tmp = ((a * c) * i) * (-2.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (z + z) * t;
	double tmp;
	if ((z * t) <= -2e+128) {
		tmp = t_1;
	} else if ((z * t) <= 2e-51) {
		tmp = (x + x) * y;
	} else if ((z * t) <= 2e+27) {
		tmp = ((a * c) * i) * -2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (z + z) * t
	tmp = 0
	if (z * t) <= -2e+128:
		tmp = t_1
	elif (z * t) <= 2e-51:
		tmp = (x + x) * y
	elif (z * t) <= 2e+27:
		tmp = ((a * c) * i) * -2.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(z + z) * t)
	tmp = 0.0
	if (Float64(z * t) <= -2e+128)
		tmp = t_1;
	elseif (Float64(z * t) <= 2e-51)
		tmp = Float64(Float64(x + x) * y);
	elseif (Float64(z * t) <= 2e+27)
		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (z + z) * t;
	tmp = 0.0;
	if ((z * t) <= -2e+128)
		tmp = t_1;
	elseif ((z * t) <= 2e-51)
		tmp = (x + x) * y;
	elseif ((z * t) <= 2e+27)
		tmp = ((a * c) * i) * -2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+128], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e-51], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+27], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z + z\right) \cdot t\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\left(x + x\right) \cdot y\\

\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -2.0000000000000002e128 or 2e27 < (*.f64 z t)

    1. Initial program 86.9%

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 2 \cdot \left(z \cdot \color{blue}{t}\right) \]
      2. associate-*l*N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      4. count-2-revN/A

        \[\leadsto \left(z + z\right) \cdot t \]
      5. lower-+.f6457.0

        \[\leadsto \left(z + z\right) \cdot t \]
    4. Applied rewrites57.0%

      \[\leadsto \color{blue}{\left(z + z\right) \cdot t} \]

    if -2.0000000000000002e128 < (*.f64 z t) < 2e-51

    1. Initial program 92.1%

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6437.4

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites37.4%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]

    if 2e-51 < (*.f64 z t) < 2e27

    1. Initial program 91.5%

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

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6432.2

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites32.2%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]
    5. Applied rewrites29.1%

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

Alternative 20: 40.4% accurate, 1.9× speedup?

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

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x + x) * y
    if (x <= (-2.1d+34)) then
        tmp = t_1
    else if (x <= 2.7d0) then
        tmp = (z + z) * t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + x) * y;
	double tmp;
	if (x <= -2.1e+34) {
		tmp = t_1;
	} else if (x <= 2.7) {
		tmp = (z + z) * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + x) * y
	tmp = 0
	if x <= -2.1e+34:
		tmp = t_1
	elif x <= 2.7:
		tmp = (z + z) * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + x) * y)
	tmp = 0.0
	if (x <= -2.1e+34)
		tmp = t_1;
	elseif (x <= 2.7)
		tmp = Float64(Float64(z + z) * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + x) * y;
	tmp = 0.0;
	if (x <= -2.1e+34)
		tmp = t_1;
	elseif (x <= 2.7)
		tmp = (z + z) * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, -2.1e+34], t$95$1, If[LessEqual[x, 2.7], N[(N[(z + z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + x\right) \cdot y\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.7:\\
\;\;\;\;\left(z + z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.10000000000000017e34 or 2.7000000000000002 < x

    1. Initial program 87.9%

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6445.8

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites45.8%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]

    if -2.10000000000000017e34 < x < 2.7000000000000002

    1. Initial program 92.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto 2 \cdot \left(z \cdot \color{blue}{t}\right) \]
      2. associate-*l*N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{t} \]
      4. count-2-revN/A

        \[\leadsto \left(z + z\right) \cdot t \]
      5. lower-+.f6435.7

        \[\leadsto \left(z + z\right) \cdot t \]
    4. Applied rewrites35.7%

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

Alternative 21: 29.0% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \left(x + x\right) \cdot y \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* (+ x x) y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (x + x) * y;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (x + x) * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (x + x) * y;
}
def code(x, y, z, t, a, b, c, i):
	return (x + x) * y
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(x + x) * y)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (x + x) * y;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}

\\
\left(x + x\right) \cdot y
\end{array}
Derivation
  1. Initial program 90.1%

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

    \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
  3. Step-by-step derivation
    1. associate-*r*N/A

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

      \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
    3. count-2-revN/A

      \[\leadsto \left(x + x\right) \cdot y \]
    4. lower-+.f6429.0

      \[\leadsto \left(x + x\right) \cdot y \]
  4. Applied rewrites29.0%

    \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025130 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64
  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))