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

Percentage Accurate: 90.3% → 95.5%
Time: 4.5s
Alternatives: 18
Speedup: 0.7×

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

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

Initial Program: 90.3% 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: 95.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_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)\\ \mathbf{if}\;i \leq -1 \cdot 10^{-75}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2 \cdot 10^{+110}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\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 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i)))))
   (if (<= i -1e-75)
     t_1
     (if (<= i 2e+110)
       (* 2.0 (fma (- (* (- b) (* i c)) (* i a)) c (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 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
	double tmp;
	if (i <= -1e-75) {
		tmp = t_1;
	} else if (i <= 2e+110) {
		tmp = 2.0 * fma(((-b * (i * c)) - (i * a)), c, 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(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
	tmp = 0.0
	if (i <= -1e-75)
		tmp = t_1;
	elseif (i <= 2e+110)
		tmp = Float64(2.0 * fma(Float64(Float64(Float64(-b) * Float64(i * c)) - Float64(i * a)), c, 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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1e-75], t$95$1, If[LessEqual[i, 2e+110], N[(2.0 * N[(N[(N[((-b) * N[(i * c), $MachinePrecision]), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision] * c + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_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)\\
\mathbf{if}\;i \leq -1 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -9.9999999999999996e-76 or 2e110 < i

    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.9999999999999996e-76 < i < 2e110

    1. Initial program 87.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6497.5

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

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

Alternative 2: 94.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\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^{+299}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot 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.0000000000000001e299

    1. Initial program 75.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 x around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - 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(t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      2. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      9. lower-fma.f6487.5

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right) \cdot t\right) \]
    7. Applied rewrites87.1%

      \[\leadsto 2 \cdot \left(\left(\frac{\left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)}{t} + z\right) \cdot \color{blue}{t}\right) \]
    8. 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)} \]
    9. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      10. lift-*.f6488.9

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

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

    if -1.0000000000000001e299 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000015e244

    1. Initial program 98.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) \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 78.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 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. lower-*.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\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 3: 86.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 -1 \cdot 10^{+299}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+65}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;\left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\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 -1e+299)
     (* 2.0 (- (* y x) (* (* (fma c b a) i) c)))
     (if (<= t_1 -2e+65)
       (* 2.0 (- (* y x) (* (* (fma c b a) c) i)))
       (if (<= t_1 1e+143)
         (* (- (fma t z (* y x)) (* (* (* c c) b) i)) 2.0)
         (* 2.0 (- (* (* i c) (- (* c b) (- a))))))))))
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 <= -1e+299) {
		tmp = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
	} else if (t_1 <= -2e+65) {
		tmp = 2.0 * ((y * x) - ((fma(c, b, a) * c) * i));
	} else if (t_1 <= 1e+143) {
		tmp = (fma(t, z, (y * x)) - (((c * c) * b) * i)) * 2.0;
	} else {
		tmp = 2.0 * -((i * c) * ((c * b) - -a));
	}
	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 <= -1e+299)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c)));
	elseif (t_1 <= -2e+65)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * c) * i)));
	elseif (t_1 <= 1e+143)
		tmp = Float64(Float64(fma(t, z, Float64(y * x)) - Float64(Float64(Float64(c * c) * b) * i)) * 2.0);
	else
		tmp = Float64(2.0 * Float64(-Float64(Float64(i * c) * Float64(Float64(c * b) - Float64(-a)))));
	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, -1e+299], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+65], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * c), $MachinePrecision] * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * (-N[(N[(i * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] - (-a)), $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 -1 \cdot 10^{+299}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\

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

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

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


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

    1. Initial program 75.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 x around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - 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(t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      2. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      9. lower-fma.f6487.5

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right) \cdot t\right) \]
    7. Applied rewrites87.1%

      \[\leadsto 2 \cdot \left(\left(\frac{\left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)}{t} + z\right) \cdot \color{blue}{t}\right) \]
    8. 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)} \]
    9. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      10. lift-*.f6488.9

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

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

    if -1.0000000000000001e299 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e65

    1. Initial program 98.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6478.5

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot c\right) \cdot i\right) \]
      19. lift-fma.f6477.5

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

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

    if -2e65 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 a around 0

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \]
      4. lower-*.f6489.5

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

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

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

        \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2} \]
      3. lower-*.f6489.5

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

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

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

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

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

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

        \[\leadsto \left(\left(t \cdot z + \color{blue}{y \cdot x}\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2 \]
      10. lift-fma.f64N/A

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(t, z, y \cdot x\right)} - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2 \]
      11. lift-*.f6490.0

        \[\leadsto \left(\mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2 \]
    6. Applied rewrites90.0%

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

    if 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6480.3

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(\mathsf{neg}\left(a\right)\right)\right)\right) \]
      11. lower-neg.f6482.2

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

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

Alternative 4: 85.5% 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 -1 \cdot 10^{+299}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq -20000000000:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\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 -1e+299)
     (* 2.0 (- (* y x) (* (* (fma c b a) i) c)))
     (if (<= t_1 -20000000000.0)
       (* 2.0 (- (* y x) (* (* (fma c b a) c) i)))
       (if (<= t_1 1e+143)
         (* 2.0 (fma t z (* y x)))
         (* 2.0 (- (* (* i c) (- (* c b) (- a))))))))))
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 <= -1e+299) {
		tmp = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
	} else if (t_1 <= -20000000000.0) {
		tmp = 2.0 * ((y * x) - ((fma(c, b, a) * c) * i));
	} else if (t_1 <= 1e+143) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = 2.0 * -((i * c) * ((c * b) - -a));
	}
	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 <= -1e+299)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c)));
	elseif (t_1 <= -20000000000.0)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * c) * i)));
	elseif (t_1 <= 1e+143)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(2.0 * Float64(-Float64(Float64(i * c) * Float64(Float64(c * b) - Float64(-a)))));
	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, -1e+299], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000.0], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * (-N[(N[(i * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] - (-a)), $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 -1 \cdot 10^{+299}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\

\mathbf{elif}\;t\_1 \leq -20000000000:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\

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

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


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

    1. Initial program 75.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 x around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - 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(t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      2. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      9. lower-fma.f6487.5

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right) \cdot t\right) \]
    7. Applied rewrites87.1%

      \[\leadsto 2 \cdot \left(\left(\frac{\left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)}{t} + z\right) \cdot \color{blue}{t}\right) \]
    8. 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)} \]
    9. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      10. lift-*.f6488.9

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

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

    if -1.0000000000000001e299 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e10

    1. Initial program 98.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6482.1

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot c\right) \cdot i\right) \]
      19. lift-fma.f6474.7

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

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

    if -2e10 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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-*.f6488.8

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

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

    if 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6480.3

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(\mathsf{neg}\left(a\right)\right)\right)\right) \]
      11. lower-neg.f6482.2

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

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

Alternative 5: 83.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-72}:\\ \;\;\;\;2 \cdot \left(\left(\frac{\left(-c\right) \cdot t\_1}{t} + z\right) \cdot t\right)\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-110}:\\ \;\;\;\;2 \cdot \left(y \cdot x - t\_1 \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (fma c b a) i)))
   (if (<= (* z t) -5e-72)
     (* 2.0 (* (+ (/ (* (- c) t_1) t) z) t))
     (if (<= (* z t) 5e-110)
       (* 2.0 (- (* y x) (* t_1 c)))
       (* (- (fma t z (* y x)) (* (* (* c c) b) i)) 2.0)))))
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 tmp;
	if ((z * t) <= -5e-72) {
		tmp = 2.0 * ((((-c * t_1) / t) + z) * t);
	} else if ((z * t) <= 5e-110) {
		tmp = 2.0 * ((y * x) - (t_1 * c));
	} else {
		tmp = (fma(t, z, (y * x)) - (((c * c) * b) * i)) * 2.0;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(fma(c, b, a) * i)
	tmp = 0.0
	if (Float64(z * t) <= -5e-72)
		tmp = Float64(2.0 * Float64(Float64(Float64(Float64(Float64(-c) * t_1) / t) + z) * t));
	elseif (Float64(z * t) <= 5e-110)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(t_1 * c)));
	else
		tmp = Float64(Float64(fma(t, z, Float64(y * x)) - Float64(Float64(Float64(c * c) * b) * i)) * 2.0);
	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]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e-72], N[(2.0 * N[(N[(N[(N[((-c) * t$95$1), $MachinePrecision] / t), $MachinePrecision] + z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e-110], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * c), $MachinePrecision] * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-110}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1 \cdot c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -4.9999999999999996e-72

    1. Initial program 89.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 x around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - 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(t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right) \cdot t\right) \]
    7. Applied rewrites74.9%

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

    if -4.9999999999999996e-72 < (*.f64 z t) < 5e-110

    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 x around 0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - 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(t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      2. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      9. lower-fma.f6459.1

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right) \cdot t\right) \]
    7. Applied rewrites51.3%

      \[\leadsto 2 \cdot \left(\left(\frac{\left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)}{t} + z\right) \cdot \color{blue}{t}\right) \]
    8. 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)} \]
    9. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right) \]
      10. lift-*.f6489.9

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

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

    if 5e-110 < (*.f64 z t)

    1. Initial program 89.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 a around 0

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \]
      4. lower-*.f6477.8

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

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

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

        \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2} \]
      3. lower-*.f6477.8

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

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

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

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

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

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

        \[\leadsto \left(\left(t \cdot z + \color{blue}{y \cdot x}\right) - \left(\left(c \cdot c\right) \cdot b\right) \cdot i\right) \cdot 2 \]
      10. lift-fma.f64N/A

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

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

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

Alternative 6: 83.4% 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 -20000000000:\\ \;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\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 -20000000000.0)
     (* 2.0 (- (* y x) (* (* (fma c b a) c) i)))
     (if (<= t_1 1e+143)
       (* 2.0 (fma t z (* y x)))
       (* 2.0 (- (* (* i c) (- (* c b) (- a)))))))))
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 <= -20000000000.0) {
		tmp = 2.0 * ((y * x) - ((fma(c, b, a) * c) * i));
	} else if (t_1 <= 1e+143) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = 2.0 * -((i * c) * ((c * b) - -a));
	}
	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 <= -20000000000.0)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * c) * i)));
	elseif (t_1 <= 1e+143)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(2.0 * Float64(-Float64(Float64(i * c) * Float64(Float64(c * b) - Float64(-a)))));
	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, -20000000000.0], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * (-N[(N[(i * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] - (-a)), $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 -20000000000:\\
\;\;\;\;2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\

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

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


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

    1. Initial program 84.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6483.2

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    5. 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)} \]
    6. 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. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot c\right) \cdot i\right) \]
      19. lift-fma.f6477.4

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

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

    if -2e10 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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-*.f6488.8

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

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

    if 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6480.3

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(\mathsf{neg}\left(a\right)\right)\right)\right) \]
      11. lower-neg.f6482.2

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

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

Alternative 7: 81.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\right)\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+143}:\\ \;\;\;\;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 (- (* (* i c) (- (* c b) (- a))))))
        (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -1e+108)
     t_1
     (if (<= t_2 1e+143) (* 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 * -((i * c) * ((c * b) - -a));
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -1e+108) {
		tmp = t_1;
	} else if (t_2 <= 1e+143) {
		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(Float64(i * c) * Float64(Float64(c * b) - Float64(-a)))))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -1e+108)
		tmp = t_1;
	elseif (t_2 <= 1e+143)
		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[(i * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] - (-a)), $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+108], t$95$1, If[LessEqual[t$95$2, 1e+143], 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(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+143}:\\
\;\;\;\;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) < -1e108 or 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6480.9

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(\mathsf{neg}\left(a\right)\right)\right)\right) \]
      11. lower-neg.f6480.8

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

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

    if -1e108 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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.0

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

      \[\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 8: 81.5% 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 -1 \cdot 10^{+108}:\\ \;\;\;\;2 \cdot \left(-\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+143}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\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 -1e+108)
     (* 2.0 (- (* (* (fma c b a) c) i)))
     (if (<= t_1 1e+143)
       (* 2.0 (fma t z (* y x)))
       (* -2.0 (* (* (fma c b a) i) 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 <= -1e+108) {
		tmp = 2.0 * -((fma(c, b, a) * c) * i);
	} else if (t_1 <= 1e+143) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = -2.0 * ((fma(c, b, a) * i) * 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 <= -1e+108)
		tmp = Float64(2.0 * Float64(-Float64(Float64(fma(c, b, a) * c) * i)));
	elseif (t_1 <= 1e+143)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * 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, -1e+108], N[(2.0 * (-N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 1e+143], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $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 -1 \cdot 10^{+108}:\\
\;\;\;\;2 \cdot \left(-\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \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) < -1e108

    1. Initial program 82.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6481.5

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(\mathsf{neg}\left(a\right)\right)\right)\right) \]
      11. lower-neg.f6479.6

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

      \[\leadsto 2 \cdot \left(-\left(i \cdot c\right) \cdot \left(c \cdot b - \left(-a\right)\right)\right) \]
    8. Taylor expanded in c around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(\left(c \cdot b + a\right) \cdot c\right) \cdot i\right) \]
      18. lift-fma.f6475.0

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

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

    if -1e108 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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.0

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

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

    if 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 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. lower-*.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\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 9: 81.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -2 \cdot \left(\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^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+143}:\\ \;\;\;\;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+108)
     t_1
     (if (<= t_2 1e+143) (* 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+108) {
		tmp = t_1;
	} else if (t_2 <= 1e+143) {
		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(fma(c, b, a) * i) * c))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -1e+108)
		tmp = t_1;
	elseif (t_2 <= 1e+143)
		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[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $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+108], t$95$1, If[LessEqual[t$95$2, 1e+143], 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(\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^{+108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+143}:\\
\;\;\;\;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) < -1e108 or 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

    if -1e108 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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.0

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

      \[\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.6% 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^{+290}:\\ \;\;\;\;\left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\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+290)
     (* (* (* c (* i c)) b) -2.0)
     (if (<= t_1 1e+307)
       (* 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+290) {
		tmp = ((c * (i * c)) * b) * -2.0;
	} else if (t_1 <= 1e+307) {
		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+290)
		tmp = Float64(Float64(Float64(c * Float64(i * c)) * b) * -2.0);
	elseif (t_1 <= 1e+307)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(Float64(Float64(c * c) * Float64(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+290], N[(N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * c), $MachinePrecision] * N[(i * b), $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^{+290}:\\
\;\;\;\;\left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\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) < -4.9999999999999998e290

    1. Initial program 75.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 b around inf

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

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

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

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

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

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

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

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

      \[\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. associate-*l*N/A

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

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

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      6. lift-*.f6471.9

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

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

    if -4.9999999999999998e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 98.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 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-*.f6476.9

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

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

    if 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.2% 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^{+290}:\\ \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\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+290)
     (* (* -2.0 c) (* (* c b) i))
     (if (<= t_1 1e+307)
       (* 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+290) {
		tmp = (-2.0 * c) * ((c * b) * i);
	} else if (t_1 <= 1e+307) {
		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+290)
		tmp = Float64(Float64(-2.0 * c) * Float64(Float64(c * b) * i));
	elseif (t_1 <= 1e+307)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(Float64(Float64(c * c) * Float64(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+290], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * c), $MachinePrecision] * N[(i * b), $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^{+290}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\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) < -4.9999999999999998e290

    1. Initial program 75.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6483.6

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\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. associate-*r*N/A

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

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

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

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

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

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

        \[\leadsto \left(-2 \cdot c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \]
      8. lift-*.f6488.6

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

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

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

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

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

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

    if -4.9999999999999998e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 98.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 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-*.f6476.9

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

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

    if 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 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^{+290}:\\ \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b \cdot \left(c \cdot c\right)\right) \cdot i\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+290)
     (* (* -2.0 c) (* (* c b) i))
     (if (<= t_1 1e+307)
       (* 2.0 (fma t z (* y x)))
       (* (* (* b (* c c)) i) -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+290) {
		tmp = (-2.0 * c) * ((c * b) * i);
	} else if (t_1 <= 1e+307) {
		tmp = 2.0 * fma(t, z, (y * x));
	} else {
		tmp = ((b * (c * c)) * i) * -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+290)
		tmp = Float64(Float64(-2.0 * c) * Float64(Float64(c * b) * i));
	elseif (t_1 <= 1e+307)
		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
	else
		tmp = Float64(Float64(Float64(b * Float64(c * c)) * i) * -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+290], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision] * i), $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^{+290}:\\
\;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot \left(c \cdot c\right)\right) \cdot i\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) < -4.9999999999999998e290

    1. Initial program 75.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 c around 0

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6483.6

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\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. associate-*r*N/A

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

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

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

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

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

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

        \[\leadsto \left(-2 \cdot c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \]
      8. lift-*.f6488.6

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

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

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

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

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

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

    if -4.9999999999999998e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 98.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 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-*.f6476.9

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

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

    if 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.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 b around inf

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

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

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

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

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

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

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

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

      \[\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. associate-*r*N/A

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

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

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

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

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

      \[\leadsto \left(\left(b \cdot \left(c \cdot c\right)\right) \cdot i\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(-2 \cdot c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+290}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+307}:\\ \;\;\;\;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 c) (* (* c b) i))) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+290)
     t_1
     (if (<= t_2 1e+307) (* 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 * c) * ((c * b) * i);
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+290) {
		tmp = t_1;
	} else if (t_2 <= 1e+307) {
		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 * c) * Float64(Float64(c * b) * i))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+290)
		tmp = t_1;
	elseif (t_2 <= 1e+307)
		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 * c), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+290], t$95$1, If[LessEqual[t$95$2, 1e+307], 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 c\right) \cdot \left(\left(c \cdot b\right) \cdot i\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;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) < -4.9999999999999998e290 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.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(c \cdot \left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i\right) + \left(t \cdot z + x \cdot y\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(-1 \cdot \left(b \cdot \left(c \cdot i\right)\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      4. associate-*r*N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      7. lower-neg.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(c \cdot i\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - a \cdot i, c, t \cdot z + x \cdot y\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      11. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, t \cdot z + x \cdot y\right) \]
      12. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \]
      14. lower-*.f6483.5

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-b\right) \cdot \left(i \cdot c\right) - i \cdot a, c, \mathsf{fma}\left(t, z, y \cdot x\right)\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. associate-*r*N/A

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

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

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

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

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

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

        \[\leadsto \left(-2 \cdot c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \]
      8. lift-*.f6488.8

        \[\leadsto \left(-2 \cdot c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{i}\right) \]
    7. Applied rewrites88.8%

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

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

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

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

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

    if -4.9999999999999998e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 98.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 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-*.f6476.9

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

      \[\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 14: 63.0% 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 -5 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+143}:\\ \;\;\;\;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 -5e+166)
     t_1
     (if (<= t_2 1e+143) (* 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 <= -5e+166) {
		tmp = t_1;
	} else if (t_2 <= 1e+143) {
		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 <= -5e+166)
		tmp = t_1;
	elseif (t_2 <= 1e+143)
		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, -5e+166], t$95$1, If[LessEqual[t$95$2, 1e+143], 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 -5 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+143}:\\
\;\;\;\;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.0000000000000002e166 or 1e143 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 80.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 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-*.f6439.8

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

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

    if -5.0000000000000002e166 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e143

    1. Initial program 98.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 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-*.f6484.3

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
    4. Applied rewrites84.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 15: 44.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + x\right) \cdot y\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+128}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-314}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+98}:\\ \;\;\;\;\left(t + t\right) \cdot z\\ \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) -1e+128)
     t_1
     (if (<= (* x y) -5e-314)
       (* (* (* i c) a) -2.0)
       (if (<= (* x y) 2e+98) (* (+ t t) z) 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) <= -1e+128) {
		tmp = t_1;
	} else if ((x * y) <= -5e-314) {
		tmp = ((i * c) * a) * -2.0;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= (-1d+128)) then
        tmp = t_1
    else if ((x * y) <= (-5d-314)) then
        tmp = ((i * c) * a) * (-2.0d0)
    else if ((x * y) <= 2d+98) then
        tmp = (t + t) * z
    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) <= -1e+128) {
		tmp = t_1;
	} else if ((x * y) <= -5e-314) {
		tmp = ((i * c) * a) * -2.0;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= -1e+128:
		tmp = t_1
	elif (x * y) <= -5e-314:
		tmp = ((i * c) * a) * -2.0
	elif (x * y) <= 2e+98:
		tmp = (t + t) * z
	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) <= -1e+128)
		tmp = t_1;
	elseif (Float64(x * y) <= -5e-314)
		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
	elseif (Float64(x * y) <= 2e+98)
		tmp = Float64(Float64(t + t) * z);
	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) <= -1e+128)
		tmp = t_1;
	elseif ((x * y) <= -5e-314)
		tmp = ((i * c) * a) * -2.0;
	elseif ((x * y) <= 2e+98)
		tmp = (t + t) * z;
	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], -1e+128], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-314], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+98], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 85.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 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-+.f6461.0

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

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

    if -1.0000000000000001e128 < (*.f64 x y) < -4.99999999982e-314

    1. Initial program 92.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 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.2

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

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

    if -4.99999999982e-314 < (*.f64 x y) < 2e98

    1. Initial program 93.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. associate-*r*N/A

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

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

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

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

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

Alternative 16: 42.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + x\right) \cdot y\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+128}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-314}:\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+98}:\\ \;\;\;\;\left(t + t\right) \cdot z\\ \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) -1e+128)
     t_1
     (if (<= (* x y) -5e-314)
       (* (* (* a c) i) -2.0)
       (if (<= (* x y) 2e+98) (* (+ t t) z) 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) <= -1e+128) {
		tmp = t_1;
	} else if ((x * y) <= -5e-314) {
		tmp = ((a * c) * i) * -2.0;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= (-1d+128)) then
        tmp = t_1
    else if ((x * y) <= (-5d-314)) then
        tmp = ((a * c) * i) * (-2.0d0)
    else if ((x * y) <= 2d+98) then
        tmp = (t + t) * z
    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) <= -1e+128) {
		tmp = t_1;
	} else if ((x * y) <= -5e-314) {
		tmp = ((a * c) * i) * -2.0;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= -1e+128:
		tmp = t_1
	elif (x * y) <= -5e-314:
		tmp = ((a * c) * i) * -2.0
	elif (x * y) <= 2e+98:
		tmp = (t + t) * z
	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) <= -1e+128)
		tmp = t_1;
	elseif (Float64(x * y) <= -5e-314)
		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
	elseif (Float64(x * y) <= 2e+98)
		tmp = Float64(Float64(t + t) * z);
	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) <= -1e+128)
		tmp = t_1;
	elseif ((x * y) <= -5e-314)
		tmp = ((a * c) * i) * -2.0;
	elseif ((x * y) <= 2e+98)
		tmp = (t + t) * z;
	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], -1e+128], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-314], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+98], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 85.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 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-+.f6461.0

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

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

    if -1.0000000000000001e128 < (*.f64 x y) < -4.99999999982e-314

    1. Initial program 92.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 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.2

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

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

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

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

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

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

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

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

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

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

    if -4.99999999982e-314 < (*.f64 x y) < 2e98

    1. Initial program 93.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. associate-*r*N/A

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

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

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

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

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

Alternative 17: 42.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + x\right) \cdot y\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+98}:\\ \;\;\;\;\left(t + t\right) \cdot z\\ \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) -5e+112) t_1 (if (<= (* x y) 2e+98) (* (+ t t) z) 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) <= -5e+112) {
		tmp = t_1;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= (-5d+112)) then
        tmp = t_1
    else if ((x * y) <= 2d+98) then
        tmp = (t + t) * z
    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) <= -5e+112) {
		tmp = t_1;
	} else if ((x * y) <= 2e+98) {
		tmp = (t + t) * z;
	} 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) <= -5e+112:
		tmp = t_1
	elif (x * y) <= 2e+98:
		tmp = (t + t) * z
	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) <= -5e+112)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e+98)
		tmp = Float64(Float64(t + t) * z);
	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) <= -5e+112)
		tmp = t_1;
	elseif ((x * y) <= 2e+98)
		tmp = (t + t) * z;
	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], -5e+112], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+98], N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 85.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 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-+.f6460.4

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

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

    if -5e112 < (*.f64 x y) < 2e98

    1. Initial program 92.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 z around inf

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

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

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

        \[\leadsto \left(t + t\right) \cdot z \]
      4. lower-+.f6436.3

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

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

Alternative 18: 29.2% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \left(t + t\right) \cdot z \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* (+ t t) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (t + t) * z;
}
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 = (t + t) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (t + t) * z;
}
def code(x, y, z, t, a, b, c, i):
	return (t + t) * z
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(t + t) * z)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (t + t) * z;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}

\\
\left(t + t\right) \cdot z
\end{array}
Derivation
  1. Initial program 90.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 inf

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

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

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

      \[\leadsto \left(t + t\right) \cdot z \]
    4. lower-+.f6429.2

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

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

Reproduce

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